knip-deadcode
БесплатноБез исполняемых скриптовНе проверенKnip dead code detection best practices for JavaScript and TypeScript projects. Use when configuring Knip, analyzing unused code, setting up CI integration…
от pproenca★ 231 звезда на GitHubОб этом скилле
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
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Configuration Foundations | CRITICAL | config- |
| 2 | Entry Point Strategy | CRITICAL | entry- |
| 3 | Workspace & Monorepo | HIGH | workspace- |
| 4 | Dependency Analysis | HIGH | deps- |
| 5 | Export Detection | MEDIUM-HIGH | exports- |
| 6 | CI Integration | MEDIUM | ci- |
| 7 | Auto-Fix Workflow | MEDIUM | fix- |
| 8 | Performance Optimization | LOW-MEDIUM | perf- |
Quick Reference
1. Configuration Foundations (CRITICAL)
config-avoid-broad-ignore- Avoid broad ignore patternsconfig-configure-path-aliases- Configure path aliases in Knipconfig-enable-plugins-explicitly- Enable framework plugins explicitlyconfig-run-without-config- Run without config first for baselineconfig-separate-entry-project- Separate entry files from project filesconfig-use-json-schema- Use JSON schema for configuration validationconfig-use-negation-patterns- Use negation patterns for exclusionsconfig-use-production-mode- Use production mode for shipping code analysis
2. Entry Point Strategy (CRITICAL)
entry-add-dynamic-imports- Add dynamic import targets as entry pointsentry-exclude-test-files- Exclude test files from production entriesentry-include-all-entry-points- Include all application entry pointsentry-include-bin-scripts- Include binary scripts as entry pointsentry-use-compilers- Use compilers for non-standard file typesentry-use-plugin-entries- Use plugin entry points for frameworksentry-verify-with-debug- Verify entry points with debug mode
3. Workspace & Monorepo (HIGH)
workspace-configure-root-workspace- Configure root workspace explicitlyworkspace-ignore-specific- Ignore specific workspaces when neededworkspace-isolate-for-strict- Isolate workspaces for strict dependency checkingworkspace-list-cross-deps- List cross-workspace dependencies explicitlyworkspace-per-workspace-plugins- Configure plugins per workspaceworkspace-use-workspace-globs- Use workspace globs for consistent configuration
4. Dependency Analysis (HIGH)
deps-add-unlisted-deps- Add unlisted dependencies to package.jsondeps-avoid-transitive-reliance- Avoid relying on transitive dependenciesdeps-configure-plugin-deps- Configure plugins for tool-specific dependenciesdeps-fix-files-first- Fix unused files before dependenciesdeps-ignore-conditional-deps- Ignore conditionally loaded dependenciesdeps-remove-obsolete-types- Remove obsolete type definition packages
5. Export Detection (MEDIUM-HIGH)
exports-check-class-members- Check class members for unused codeexports-enable-entry-exports- Enable entry export checking for private packagesexports-handle-reexports- Handle re-exports in barrel filesexports-ignore-same-file- Ignore exports used in same file- [
exports-tag-public-api](references/expo
Установить knip-deadcode в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл knip-deadcode?
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.
Как установить скилл knip-deadcode?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл knip-deadcode запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic