mcpField
K
knip-deadcode

knip-deadcode

github.com/pproencaDevelopment218383 installsUpdated 11w ago
Repository

About knip-deadcode

A reference skill for applying Knip to detect and remove dead code in JavaScript and TypeScript projects. It organizes guidance for configuration, monorepos, CI, cleanup, and performance by priority.

Key features

  1. 0143 rules across eight categories
  2. 02Knip configuration and entry-point guidance
  3. 03Monorepo and dependency analysis
  4. 04CI, auto-fix, and performance practices

Use cases

  1. 01Set up Knip for a project or monorepo
  2. 02Investigate false positives and negatives
  3. 03Add dead-code checks to CI
  4. 04Plan an auto-fix cleanup workflow

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill knip-deadcode

After installing, type/knip-deadcodein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

metadata.json
assets/templates/
_template.md
references/
_sections.md
ci-add-to-pipeline.md
ci-separate-production-check.md
ci-use-cache.md
ci-use-max-issues.md
ci-use-reporters.md
ci-watch-mode-local.md
config-avoid-broad-ignore.md
config-configure-path-aliases.md
config-enable-plugins-explicitly.md
config-run-without-config.md
config-separate-entry-project.md
config-use-json-schema.md
config-use-negation-patterns.md
config-use-production-mode.md
deps-add-unlisted-deps.md
deps-avoid-transitive-reliance.md
deps-configure-plugin-deps.md
deps-fix-files-first.md
deps-ignore-conditional-deps.md
deps-remove-obsolete-types.md
entry-add-dynamic-imports.md
entry-exclude-test-files.md
entry-include-all-entry-points.md
entry-include-bin-scripts.md
entry-use-compilers.md
entry-use-plugin-entries.md
entry-verify-with-debug.md

Details

From the project README

Community Knip Dead Code Detection Best Practices

Comprehensive guide for detecting and removing dead code in JavaScript and TypeScript projects using Knip. Contains 43 rules across 8 categories, prioritized by impact to guide configuration, CI integration, and cleanup workflows.

When to Apply

Reference these guidelines when:

  • Configuring Knip for a new project or monorepo
  • Investigating false positives or false negatives
  • Setting up CI pipelines to prevent dead code regressions
  • Using auto-fix to clean up unused code
  • Optimizing Knip performance for large codebases

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Configuration FoundationsCRITICALconfig-
2Entry Point StrategyCRITICALentry-
3Workspace & MonorepoHIGHworkspace-
4Dependency AnalysisHIGHdeps-
5Export DetectionMEDIUM-HIGHexports-
6CI IntegrationMEDIUMci-
7Auto-Fix WorkflowMEDIUMfix-
8Performance OptimizationLOW-MEDIUMperf-

Quick Reference

1. Configuration Foundations (CRITICAL)
2. Entry Point Strategy (CRITICAL)
3. Workspace & Monorepo (HIGH)
4. Dependency Analysis (HIGH)
5. Export Detection (MEDIUM-HIGH)
6. CI Integration (MEDIUM)
7. Auto-Fix Workflow (MEDIUM)
8. Performance Optimization (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported