Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

dead-code-eliminator

/dead-code-eliminator

Dowodzi zbieżnymi dowodami, że kod jest nieosiągalny, po czym usuwa go razem z testami, fixture'ami i flagami w odwracalnych kawałkach, bez psucia dynamicznych wywołań.

Repozytorium
skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
13.10.2026

Ocena i bezpieczeństwo

90/ 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ść25 / 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
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 13.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

Dowodzi zbieżnymi dowodami, że kod jest nieosiągalny, po czym usuwa go razem z testami, fixture'ami i flagami w odwracalnych kawałkach, bez psucia dynamicznych wywołań.

Oryginalny opis (EN)

Proves code is unreachable with converging evidence, then removes it and its tests, fixtures, and flags in reversible slices without breaking dynamic callers. Use when deleting suspected dead code, cleaning up after a migration or feature retirement, trimming a bloated module, or before estimating work on unfamiliar code. Do NOT use when you want to survey and rank an area's debt without committing to deletion - use find-tech-debt instead.

Jak działa

  1. Workflow
  2. Deliverable
  3. Quality bar
  4. Do NOT
Sekcje z nagłówków SKILL.md, w oryginale · 35 linii, 577 słów
Podgląd SKILL.md
---
name: dead-code-eliminator
description: Proves code is unreachable with converging evidence, then removes it and its tests, fixtures, and flags in reversible slices without breaking dynamic callers. Use when deleting suspected dead code, cleaning up after a migration or feature retirement, trimming a bloated module, or before estimating work on unfamiliar code. Do NOT use when you want to survey and rank an area's debt without committing to deletion - use find-tech-debt instead.
metadata:
  title: "Dead Code Eliminator"
---
# Dead Code Eliminator

Delete code only after converging evidence proves it dead, then remove it in reversible slices that include its tests, fixtures, config, and flags.

## Workflow

1. **Scope one cluster.** Pick a single symbol, file, or feature to prove dead. Do not batch unrelated removals - a regression must point to one change.
2. **Gather static evidence.** Run the language's dead-code detector (ts-prune or knip for TS/JS, vulture for Python, `deadcode` for Go) and a dependency grapher (madge) or IDE "find usages". Record what each reports unreachable.
3. **Gather runtime evidence.** Check production coverage or profiling data over a representative window - at least 30 days for user-facing paths, 90+ days for code tied to monthly or quarterly jobs - and telemetry: was this endpoint, job, or branch hit this quarter? A symbol is a deletion candidate only when static analysis AND runtime evidence agree. One signal alone produces false positives that take down prod.
4. **Hunt the dynamic callers static tools miss.** Grep the symbol name as a *string* (reflection, string-keyed dispatch, serialization). Check DI containers, registries, ORM hooks, cron/queue workers, and feature-flag config. Search infra repos and other services. Public API surface and library exports are reachable by definition unless you control every consumer.
5. **Classify the kind of dead, because each is removed differently.** Unreachable (no path calls it) → delete. Unused (callable, never called) → delete. Redundant (duplicates a live path) → repoint callers first. Dormant-behind-a-flag (flag off for a cycle) → retire the flag first, then delete its branch.
6. **Soft-delete risky removals first.** Replace the suspect path with log-and-throw, or gate it behind a kill flag while keeping the code, for one full business cycle - 30 days minimum, 90 for anything touching monthly or quarterly processes. If nothing fires the log, proceed. For low-risk leaf code, skip to step 7.
7. **Delete in a focused PR.** Remove the code AND its tests, fixtures, config, flags, and now-orphaned imports. Keep the diff under roughly 400 changed lines so it is reviewable in one sitting; a bigger cluster gets split into multiple PRs. Let CI and the type-checker catch references the search missed. No formatting or refactors in the same diff.

## Deliverable

Produce a deletion PR (one per cluster) containing the removed code plus its entire footprint - tests, fixtures, config, flags, orphaned imports - and a PR description that cites the two converging evidence signals, names which of the four kinds of dead the code is, and, for soft-deleted paths, records the observation window with zero hits.

## Quality bar

- Every deletion cites at least two independent converging signals (static + runtime).
- The PR removes the dead symbol's entire footprint, leaving no orphaned test, fixture, or flag.
- The removal names which of the four kinds of dead it is.
- Reverting the PR cleanly restores the prior behavior.

## Do NOT

- Treat "I can't find a caller" as proof of death - absence of a static caller is not absence of a dynamic one.
- Delete code you only suspect is dead, public API without consumer proof, or code added in the last few weeks (it may be ahead of its caller).
- Skip the string-grep and DI/flag/registry check for anything invoked indirectly.
- Fold formatting or refactors into a deletion PR.
- Batch many clusters into one PR.

When evidence is ambiguous, mark the symbol deprecated and instrument it rather than guessing.

Wersje

RepozytoriumWynikLicencja
Ta strona · SkillMedev/skills90MIT
ArabelaTso/Skills-4-SE95Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki 7f661abf0894 (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

  • 90routine-dead-code-removal
    Automatycznie usuwa kod nieosiągalny z jednego pakietu monorepo, po weryfikacji dynamicznych odwołań, i wysyła każde usunięcie przez /ship.
  • 100tech-debt
    Wyszukuje code smells, audytuje TODO, usuwa martwy kod i nieużywane importy oraz ocenia jakość kodu, z pełnym dostępem do modyfikacji plików i uruchamiania testów.
  • 100code-dissolver
    Usuwa martwy kod i stare flagi funkcji, łącząc analizę wywołań z telemetrią z produkcji.
  • 100tech-debt-prioritizer
    Inwentaryzuje dług techniczny i szereguje go ekonomicznie: ocena 1-3 koszt zwłoki i dźwignia, indeks priorytetu i propozycja dla zarządu oparta na wpływie biznesowym.
  • 90zero-tech-debt
    Usuwa z kodu balast po wdrożonych zmianach: martwe gałęzie, stare flagi i zbędne ścieżki, zamiast łatać je kolejnymi poprawkami.
  • 100techdebt
    Przegląda kod pod kątem duplikatów, martwych eksportów, nieużywanych zależności i starych TODO na koniec sesji.

Uwagi i zgłoszenia

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