Index of every page on this site: llms.txt
All skills
Run it yourself

This skill should be used when the user asks to "clean up code", "remove dead code", "simplify this function", "this code is too complex", "reduce complexity", "find unused imports", "code quality sweep", or "/simplifier". Focuses on dead code, complexity reduction, and duplication removal.

  • 6 files
  • 17.5 KB
  • Updated 2 days ago
  • GitHub
Use this Skill: https://skilld.dev/gh/utkudarilmaz/claude-code-setup/simplifier

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesjs-ts-patterns.md

≈774 tokens on demand. Your agent reads this file only when SKILL.md points to it.

JavaScript/TypeScript Simplification Patterns

Dead Code

// DEAD: Unused import
import { unusedHelper } from './utils'

// DEAD: Unused variable
const config = loadConfig() // Never referenced

// DEAD: Unreachable code
function process() {
  return early
  console.log('never runs')
}

// DEAD: Unused exports
export const LEGACY_FLAG = true // Check if imported anywhere

// DEAD: Unused type/interface
interface OldResponse { // No references in codebase
  data: string
}

Complexity

// COMPLEX: Deep nesting
function process(data: Data | null) {
  if (data) {
    if (data.valid) {
      if (data.items) {
        // logic buried here
      }
    }
  }
}

// SIMPLIFIED: Early returns with optional chaining
function process(data: Data | null) {
  if (!data?.valid || !data.items?.length) return
  // logic at top level
}
// COMPLEX: Long boolean expression
if (user && user.active && !user.banned && user.role === 'admin' && user.verified) {}

// SIMPLIFIED: Extract to descriptive variable
const isActiveAdmin = user?.active && !user.banned &&
                      user.role === 'admin' && user.verified
if (isActiveAdmin) {}
// COMPLEX: Callback hell
getData(id, (data) => {
  processData(data, (result) => {
    saveResult(result, (saved) => {
      notify(saved, () => {})
    })
  })
})

// SIMPLIFIED: async/await
const data = await getData(id)
const result = await processData(data)
const saved = await saveResult(result)
await notify(saved)
// COMPLEX: Nested ternaries
const label = isAdmin ? 'Admin' : isMod ? 'Moderator' : isUser ? 'User' : 'Guest'

// SIMPLIFIED: Map lookup or function
const roleLabels: Record<string, string> = { admin: 'Admin', mod: 'Moderator', user: 'User' }
const label = roleLabels[role] ?? 'Guest'

JS/TS-Specific Checks

Pattern Issue Fix
any type Type safety bypass Use proper types or unknown
Async function without await Likely missing await or unnecessary async Add await or remove async
Unused React hook dependencies Stale closures, subtle bugs Add missing deps or restructure
Promise without .catch() or try/catch Unhandled rejection Add error handling
== null vs === null inconsistency Inconsistent nullish checks Use == null (covers undefined) or strict consistently
Mixed async patterns Callbacks + promises + async/await Standardize on async/await
useEffect without cleanup Memory leak with subscriptions/timers Return cleanup function
Re-renders from inline objects/functions Performance issue Use useMemo/useCallback or extract
JSON.parse() without try/catch Runtime crash on invalid input Wrap in try/catch
Barrel exports re-exporting everything Tree-shaking issues, slow builds Export only what's needed
Optional chaining opportunities Verbose null checks Replace a && a.b && a.b.c with a?.b?.c
Object.keys().forEach Verbose iteration Use Object.entries() or for...of

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 7ee2637. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 days ago

README badge

README badge for utkudarilmaz/claude-code-setup/simplifier