.claude/skills/find-dead-code/SKILL.md
Detect unused files, exports, and dependencies with knip. Use when the user runs /find-dead-code or asks to find dead code, unused exports, or unused dependencies.
npx skillsauth add mark-lengyel-attrecto/movies-app-react find-dead-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
knip v5 scan results (auto-detects Next.js entry points — pages, layouts, API routes, middleware are not flagged):
!npx knip@5 --no-color 2>&1 || echo "(knip exited with errors — see output above)"
!node --version
knip@6+ requires Node ≥20.19. If the Node version above is older, the skill pins to knip@5 automatically.
Analyse the knip output above and produce a structured report with three sections. For each finding, say what it is, whether it looks like real dead code or a false positive, and what action to take.
Files that are never imported by any other module. These are the highest-priority findings.
Known false-positive patterns for this project — skip these:
src/app/ (Next.js entry points — pages, layouts, route handlers, middleware)src/proxy.ts / src/middleware.ts (Next.js middleware, auto-executed)*.test.ts, *.spec.ts)For each real unused file: name it, describe what it contains, and recommend deleting it or wiring it up.
Named exports that no other module imports. These are lower priority — the file itself is live, but the export is dead weight.
Known false-positive patterns for this project — skip these:
signIn / signOut re-exports from src/lib/auth.ts — used by Auth.js internally via the auth config object*Keys) — these are exported for cache invalidation and may not show up in static analysisredirect from src/i18n/navigation.ts — re-exported from next-intl, may be used conditionallyFor each real unused export: name it, show the file:line, and recommend either removing the export or deleting the function/type entirely if nothing else in the file is used.
Unlisted = used in code but not declared in package.json (transitive dep leak — fragile).
Unused = declared in package.json but never imported in the scanned source.
Known false-positive patterns for this project — skip these:
postcss unlisted — it's a peer dependency of @tailwindcss/postcss, not needed as a direct depFor each real finding: name the package, show where it is/isn't used, and recommend adding it explicitly or removing it.
End with a concise punch list:
development
Sync AI documentation (CLAUDE.md, AGENTS.md, memory files) with recent code changes. Use when the user runs /sync-ai-docs, has just finished writing code manually, has completed a notable feature or refactor, or asks to update/sync the project AI docs.
tools
Add a new page to the app following project conventions. Use when the user runs /new-page or asks to create a new route or page.
development
Validate that all translation keys used in source code exist in both en.json and hu.json. Use when the user runs /check-i18n or wants to audit translation completeness.
development
Audit the codebase for project-specific convention violations. Use when the user runs /check-conventions or asks to validate that the code follows project conventions.