Knip Deadcode: Install, Source and Security | FunnelSlayer

Knip Deadcode

Published by wordbricks in onequery

No known issues1 installs

What this skill does

Knip dead code detection best practices for JavaScript and TypeScript projects. Use when configuring Knip, analyzing unused code, setting up CI integration, or cleaning up codebases. Triggers on knip.json, dead code, unused exports, unused dependencies, bundle optimization.

Add Knip Deadcode to your agent

Review the source and files first. When you are ready, copy the prompt instruction or use the CLI command supported by your environment.

Install with a prompt

Paste this into a compatible coding agent:

add this skill "knip-deadcode" from https://github.com/wordbricks/onequery

Install with the CLI

Run this command in a controlled environment after reviewing the repository:

npx skills add https://github.com/wordbricks/onequery --skill knip-deadcode

Skill instructions

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

Files included

  • assets/templates/_template.md
  • references/_sections.md
  • references/ci-add-to-pipeline.md
  • references/ci-separate-production-check.md
  • references/ci-use-cache.md
  • references/ci-use-max-issues.md
  • references/ci-use-reporters.md
  • references/ci-watch-mode-local.md
  • references/config-avoid-broad-ignore.md
  • references/config-configure-path-aliases.md
  • references/config-enable-plugins-explicitly.md
  • references/config-run-without-config.md
  • references/config-separate-entry-project.md
  • references/config-use-json-schema.md
  • references/config-use-negation-patterns.md
  • references/config-use-production-mode.md
  • references/deps-add-unlisted-deps.md
  • references/deps-avoid-transitive-reliance.md
  • references/deps-configure-plugin-deps.md
  • references/deps-fix-files-first.md
  • references/deps-ignore-conditional-deps.md
  • references/deps-remove-obsolete-types.md
  • references/entry-add-dynamic-imports.md
  • references/entry-exclude-test-files.md
  • references/entry-include-all-entry-points.md
  • references/entry-include-bin-scripts.md
  • references/entry-use-compilers.md
  • references/entry-use-plugin-entries.md
  • references/entry-verify-with-debug.md
  • references/exports-check-class-members.md
  • references/exports-enable-entry-exports.md
  • references/exports-handle-reexports.md
  • references/exports-ignore-same-file.md
  • references/exports-tag-public-api.md
  • references/exports-trace-usage.md
  • references/exports-use-include-libs.md
  • references/fix-allow-remove-files.md
  • references/fix-format-after-fix.md
  • references/fix-review-before-commit.md
  • references/fix-update-deps-after.md
  • references/fix-use-fix-type.md
  • references/perf-filter-issue-types.md
  • references/perf-limit-output.md
  • references/perf-profile-performance.md
  • references/perf-use-bun-runtime.md
  • references/perf-use-cache-flag.md
  • references/perf-use-workspace-filter.md
  • references/workspace-configure-root-workspace.md
  • references/workspace-ignore-specific.md
  • references/workspace-isolate-for-strict.md
  • references/workspace-list-cross-deps.md
  • references/workspace-per-workspace-plugins.md
  • references/workspace-use-workspace-globs.md
  • SKILL.md

More skills