Index of every page on this site: llms.txt
All skills
webpro avatar

/configure-knip

@30e66c9
by Lars Kappertwebpro/skills18 stars
Run it yourself

Set up and optimize Knip configuration to find unused files, dependencies, and exports. Use when configuring knip.json or cleaning up a JavaScript or TypeScript codebase.

Use this Skill: https://skilld.dev/gh/webpro/skills/configure-knip

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

SKILL.md

≈47 tokens for metadata: the name and description. ≈474 when used: this file.

Description uses 2.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈187 characters, or 2.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Configure Knip

Set up and iteratively optimize Knip configuration to find unused files, dependencies, exports, and types.

Setup

Ensure the @knip/mcp MCP server is registered in your AI coding agent:

npx -y @knip/mcp

This provides three MCP capabilities:

  • knip-configure prompt — guided workflow for setup and optimization
  • knip-run tool — runs analysis, returns configuration hints and issues
  • knip-docs tool — fetches Knip documentation by topic

Task Instructions

  1. If the MCP server is not available, register it with your agent
  2. Use the knip-configure MCP prompt — it contains the full workflow:
    • Reads essential docs via knip-docs
    • Runs analysis via knip-run
    • Iterates on knip.json until hints are resolved and false positives minimized

Core Principles

  • Configure Knip properly before jumping to conclusions about false positives
  • Run Knip to get configuration hints and issues
  • Address the hints by adjusting Knip configuration (knip.json)
  • Repeat until hints are gone and false positives are minimized

Configuration Review Hints

  • Never use "ignore" patterns (hides real issues!), always prefer specific solutions; other ignore* options are allowed
  • Remove ignore patterns that don't match any files
  • Remove redundant ignore patterns — Knip respects .gitignore (node_modules, dist, build, .git)
  • Remove entry patterns covered by config defaults and auto-detected plugins
  • Config files (e.g. vite.config.ts) showing as unused → try enable or disable the plugin explicitly ({ vite: true })
  • Unresolved imports from path aliases: add paths to Knip config (tsconfig.json semantics)
  • Dependencies matching Node.js builtins: add to ignoreDependencies (e.g. buffer, process)
  • Many unused exported types → consider ignoreExportsUsedInFile: { interface: true, type: true }

Source: SKILL.md on GitHub

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 alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides a workflow for configuring the Knip tool using its official MCP server. It involves standard package installation and codebase analysis, which are appropriate for its stated purpose.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

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

Last checked against GitHub 2 weeks ago.

Activeupdated 6 months ago

README badge

README badge for webpro/skills/configure-knip