knip
Knip Code Cleanup
Run knip to find and remove unused files, dependencies, and exports from this codebase.
Setup
-
Check if knip is available:
- Run
npx knip --versionto test - If it fails or is very slow, check if
knipis in package.json devDependencies - If not installed locally, install with
npm install -D knip(or pnpm/yarn/bun equivalent based on lockfile present)
- Run
-
Knip does NOT remove unused imports/variables inside files — that's a linter's job. Knip finds unused files, dependencies, and exports across the project.
Workflow
Always follow this configuration-first workflow. Even for simple "run knip" or "clean up codebase" prompts, configure knip properly before acting on reported issues.
Step 1: Understand the project
More from brianlovin/claude-config
simplify
Simplify and refine recently modified code for clarity and consistency. Use after writing code to improve readability without changing functionality.
9.4Kdeslop
Remove AI-generated code slop from the current branch. Use after writing code to clean up unnecessary comments, defensive checks, and inconsistent style.
965rams
Run accessibility and visual design review on components. Use when reviewing UI code for WCAG compliance and design issues.
306find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
221agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
175favicon
Generate a complete set of favicons from a source image and update HTML. Use when setting up favicons for a web project.
148