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/agent-config
simplify
Simplify and refine recently modified code for clarity and consistency. Use after writing code to improve readability without changing functionality.
399deslop
Remove AI-generated code slop from the current branch. Use after writing code to clean up unnecessary comments, defensive checks, and inconsistent style.
383rams
Run accessibility and visual design review on components. Use when reviewing UI code for WCAG compliance and design issues.
17agent-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.
15tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
14skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
12