Przejdź do treści
Biblioteka skilli
Programowanie · Automatyzacja

configure-dead-code

/configure-dead-code

Konfiguruje wykrywanie martwego kodu (Knip, Vulture, cargo-machete, deadcode): skanowanie nieużywanego kodu, migrację narzędzi i kontrole martwego kodu w CI.

Repozytorium
claude-plugins ↗
Licencja
MIT
Ostatnia zmiana repozytorium
24.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
3
Przestarzałość

Brak sygnałów. Repozytorium zmienione 24.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Konfiguruje wykrywanie martwego kodu (Knip, Vulture, cargo-machete, deadcode): skanowanie nieużywanego kodu, migrację narzędzi i kontrole martwego kodu w CI.

Argumenty

/configure-dead-code [--check-only] [--fix] [--tool <knip|vulture|deadcode|machete>]
Oryginalny opis (EN)

Dead-code detection: Knip, Vulture, cargo-machete, deadcode. Use when setting up unused-code scanning, migrating tools, or adding dead-code CI checks.

Jak działa

  1. When to Use This Skill
  2. Context
  3. Parameters
  4. Execution
  5. Agentic Optimizations
  6. Flags
  7. Examples
  8. Error Handling
  9. See Also
Sekcje z nagłówków SKILL.md, w oryginale · 189 linii, 854 słów
Podgląd SKILL.md
---
created: 2025-12-16
modified: 2026-04-19
reviewed: 2025-12-16
description: "Dead-code detection: Knip, Vulture, cargo-machete, deadcode. Use when setting up unused-code scanning, migrating tools, or adding dead-code CI checks."
allowed-tools: Glob, Grep, Read, Write, Edit, Bash, AskUserQuestion, TodoWrite, WebSearch, WebFetch
args: "[--check-only] [--fix] [--tool <knip|vulture|deadcode|machete>]"
argument-hint: "[--check-only] [--fix] [--tool <knip|vulture|deadcode|machete>]"
name: configure-dead-code
---

# /configure:dead-code

Check and configure dead code detection tools.

## When to Use This Skill

| Use this skill when... | Use another approach when... |
|------------------------|------------------------------|
| Setting up dead code detection for a new project | Running an existing dead code scan (`knip`, `vulture`) |
| Auditing whether Knip, Vulture, or cargo-machete is configured correctly | Manually removing specific unused exports or imports |
| Migrating between dead code detection tools | Debugging why a specific file is flagged as unused |
| Adding dead code checks to CI/CD pipelines | Reviewing dead code findings one by one |
| Standardizing dead code detection across a monorepo | Configuring linting rules (`/configure:linting` instead) |

## Context

- Project root: !`pwd`
- Package files: !`find . -maxdepth 1 \( -name 'package.json' -o -name 'pyproject.toml' -o -name 'Cargo.toml' \)`
- Knip config: !`find . -maxdepth 1 \( -name 'knip.json' -o -name 'knip.config.*' \)`
- Vulture config: !`find . -maxdepth 1 \( -name '.vulture' -o -name 'vulture.ini' \)`
- Pre-commit: !`find . -maxdepth 1 -name '.pre-commit-config.yaml'`
- Project standards: !`find . -maxdepth 1 -name '.project-standards.yaml'`

## Parameters

Parse from command arguments:

- `--check-only`: Report compliance status without modifications (CI/CD mode)
- `--fix`: Apply fixes automatically without prompting
- `--tool <knip|vulture|deadcode|machete>`: Override tool detection

**Dead code detection tools:**
- **JavaScript/TypeScript**: Knip (finds unused files, exports, dependencies)
- **Python**: Vulture or deadcode (finds unused code)
- **Rust**: cargo-machete (finds unused dependencies)

## Execution

Execute this dead code detection compliance check:

### Step 1: Detect project language and existing tools

Check for language and tool indicators:

| Indicator | Language | Tool |
|-----------|----------|------|
| `knip.json` or `knip.config.*` | JavaScript/TypeScript | Knip |
| `package.json` with knip | JavaScript/TypeScript | Knip |
| `pyproject.toml` [tool.vulture] | Python | Vulture |
| `.vulture` or `vulture.ini` | Python | Vulture |
| `Cargo.toml` | Rust | cargo-machete |

Use WebSearch or WebFetch to verify latest versions before configuring.

### Step 2: Analyze current configuration

For the detected tool, check configuration completeness:

**Knip:**
- [ ] Config file exists (`knip.json` or `knip.config.*`)
- [ ] Entry points configured
- [ ] Ignore patterns set
- [ ] Plugin configurations
- [ ] Workspace support (monorepo)
- [ ] CI integration

**Vulture:**
- [ ] Configuration file exists
- [ ] Minimum confidence set
- [ ] Paths configured
- [ ] Ignore patterns
- [ ] Allowlist file (if needed)

**cargo-machete:**
- [ ] Installed as cargo subcommand
- [ ] Workspace configuration
- [ ] CI integration

### Step 3: Generate compliance report

Print a formatted compliance report:

```
Dead Code Detection Compliance Report
======================================
Project: [name]
Language: [TypeScript | Python | Rust]
Tool: [Knip 5.x | Vulture 2.x | cargo-machete 0.6.x]

Configuration:
  Config file             knip.json                  [EXISTS | MISSING]
  Entry points            configured                 [CONFIGURED | AUTO-DETECTED]
  Ignore patterns         node_modules, dist         [CONFIGURED | INCOMPLETE]
  Plugin support          enabled                    [ENABLED | N/A]

Detection Scope:
  Unused files            enabled                    [ENABLED | DISABLED]
  Unused exports          enabled                    [ENABLED | DISABLED]
  Unused dependencies     enabled                    [ENABLED | DISABLED]
  Unused types            enabled                    [ENABLED | DISABLED]

Scripts:
  dead-code command       package.json scripts       [CONFIGURED | MISSING]

Integration:
  Pre-commit hook         .pre-commit-config.yaml    [OPTIONAL | MISSING]
  CI/CD check             .github/workflows/         [CONFIGURED | MISSING]

Overall: [X issues found]
```

If `--check-only`, stop here.

### Step 4: Configure dead code detection (if --fix or user confirms)

Apply configuration based on detected language. Use templates from [REFERENCE.md](REFERENCE.md):

1. **Install tool** (e.g., `bun add --dev knip`, `uv add --group dev vulture`)
2. **Create config file** with entry points, exclusions, and plugins
3. **Add scripts** to package.json or create run commands
4. **Add CI workflow step** (warning mode, not blocking)

### Step 5: Update standards tracking

Update `.project-standards.yaml`:

```yaml
standards_version: "2025.1"
last_configured: "[timestamp]"
components:
  dead_code: "2025.1"
  dead_code_tool: "[knip|vulture|deadcode|machete]"
  dead_code_ci: true
```

### Step 6: Print final report

Print a summary of changes applied, run an initial scan if possible, and provide next steps for reviewing findings.

For detailed configuration templates and usage examples, see [REFERENCE.md](REFERENCE.md).

## Agentic Optimizations

| Context | Command |
|---------|---------|
| Quick compliance check | `/configure:dead-code --check-only` |
| Auto-fix all issues | `/configure:dead-code --fix` |
| Run Knip scan (JS/TS) | `npx knip --reporter compact` |
| Run Vulture scan (Python) | `vulture . --min-confidence 80` |
| Run cargo-machete (Rust) | `cargo machete` |
| CI mode (JSON output) | `npx knip --reporter json` |

## Flags

| Flag | Description |
|------|-------------|
| `--check-only` | Report status without offering fixes |
| `--fix` | Apply all fixes automatically without prompting |
| `--tool <tool>` | Override tool detection (knip, vulture, deadcode, machete) |

## Examples

```bash
# Check compliance and offer fixes
/configure:dead-code

# Check only, no modifications
/configure:dead-code --check-only

# Auto-fix with Knip
/configure:dead-code --fix --tool knip
```

## Error Handling

- **No language detected**: Cannot determine appropriate tool, error
- **Tool installation fails**: Report error, suggest manual installation
- **Configuration conflicts**: Warn about multiple tools, suggest consolidation
- **High number of findings**: Suggest starting with allowlist

## See Also

- `/configure:linting` - Configure linting tools
- `/configure:all` - Run all compliance checks
- **Knip documentation**: https://knip.dev
- **Vulture documentation**: https://github.com/jendrikseipp/vulture
- **cargo-machete documentation**: https://github.com/bnjbvr/cargo-machete
Pliki w paczce (2)
  • REFERENCE.md 5 KB
  • SKILL.md 7 KB

Wersje

W bazie nie ma innych skilli o nazwie configure-dead-code.

Migawka bazy z 13.11.2026 · wersja paczki 28d219f8d67b (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100knip-deadcode
    Podaje dobre praktyki wykrywania martwego kodu narzędziem Knip w projektach JavaScript i TypeScript: konfiguracja, analiza nieużywanego kodu, integracja z CI i porządkowanie.
  • 95vulture-dead-code
    Wykrywa nieużywany kod w Pythonie (funkcje, klasy, importy) narzędziami Vulture i deadcode przy porządkowaniu bazy kodu.
  • 84audit-dead-code
    Wyszukuje martwy kod w trybie tylko do odczytu, używając Knip, vulture, gopls i grep, i ocenia każdego kandydata jako martwego, niepewnego lub używanego.
  • 100cargo-machete
    Wykrywa nieużywane zależności Rust przez cargo-machete, aby audytować Cargo.toml, skracać czas budowania i oczyszczać nadmiar zależności.
  • 100dead-code-cleanup-edho-ferdian
    Usuwa martwy kod etapami: wykrywa go narzędziami stosu (knip, vulture, cargo-udeps), ocenia ryzyko i kasuje zależności, eksporty, pliki oraz duplikaty, uruchamiając testy między krokami.
  • 100knip
    Uruchamia Knip, by znaleźć nieużywane pliki, zależności, eksporty i typy w projektach TypeScript i JavaScript, oraz konfiguruje knip.json lub knip.ts.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.