Knip
Skill LFTPadilla/agent-dev-kit/plugins/dev-skills/skills/knip
Find dead code, unused files, unused exports, and unused dependencies in a JavaScript/TypeScript project using knip. Use before a refactor, before a PR, or when the user asks to clean up bloat, remove unused deps, or shrink the codebase.From its SKILL.md
npx -y skills add LFTPadilla/agent-dev-kit --skill knipAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 4 commands, including `npx knip` and 3 more.
SKILL.md
1.8 KB, 386 tokens by cl100k_base, as published. Nobody here has run it
knip — dead code & unused dependency finder
Knip traces the whole project (not one file at a time) to find what nothing references: unused files, exports, types, and dependencies. This is the mechanical version of "delete code you don't need."
Run
npx knip # report unused files, exports, deps, types
npx knip --production # only production code paths (ignore tests/dev)
npx knip --dependencies # just unused/unlisted dependencies
npx knip --fix # auto-remove unused exports/files (review the diff!)
Zero-config for most setups — knip reads package.json + tsconfig.json and
has built-in plugins for Vite, Vitest, Next, ESLint, etc. Add a knip.json
only if entry points are non-standard.
How to use the output
- Run
npx knip. Group findings: unused files / exports / deps / types. - Verify before deleting — knip can flag things reached only by dynamic import, config strings, or framework conventions. Confirm each is truly dead.
- Remove in small commits (files, then exports, then deps). Re-run knip after.
--fixis safe for clearly-unused exports/files, but read the diff — never blind-apply on auth, migration, or public-API code.
Gotchas
- Monorepo: run per-workspace or configure
workspacesinknip.json. - Entry points it can't infer (CLI bins, serverless handlers) → list them in
knip.jsonso it doesn't report them as unused. - Pairs well as a pre-commit gate (warn, don't block) and before any refactor.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.