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

dead-code-removal

/dead-code-removal

Znajduje kod, który nigdy się nie wykona, i usuwa go bez zepsucia przeoczonego wywołującego, przy czyszczeniu nieużywanych funkcji, gałęzi, flag funkcji i plików.

Repozytorium
AI-SKILLS ↗
Licencja
MIT
Ostatnia zmiana repozytorium
05.09.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 05.09.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

Znajduje kod, który nigdy się nie wykona, i usuwa go bez zepsucia przeoczonego wywołującego, przy czyszczeniu nieużywanych funkcji, gałęzi, flag funkcji i plików.

Oryginalny opis (EN)

Find code that can never run and delete it without breaking a caller you missed. Use when pruning unused functions, branches, feature flags, or files.

Jak działa

  1. Method
  2. Signals
  3. Boundaries
Sekcje z nagłówków SKILL.md, w oryginale · 50 linii, 432 słów
Podgląd SKILL.md
---
name: dead-code-removal
description: Find code that can never run and delete it without breaking a caller you missed. Use when pruning unused functions, branches, feature flags, or files.
---

# Dead code removal

Unused code is not free: it is read during every search, dragged along in every
refactor, and trusted during every audit, all for logic that never executes.
The risk is deleting something that only looks dead, so removal is a
verification job before it is a deletion job.

## Method

1. **Confirm no reference before touching a symbol.** Grep the whole tree, not
   just the current package: `grep -rn "functionName" .`. Include tests,
   config, string-based lookups, and reflection or dependency-injection names
   that a symbol search misses. Zero hits across all of these is the bar.
2. **Read a coverage report to find never-run lines.** Run the suite under
   coverage (`coverage.py`, `c8`, `go test -cover`) and look for functions and
   branches sitting at 0 percent. Coverage flags candidates; it does not prove
   death, since untested is not the same as unreachable. Pair it with grep.
3. **Check exported and dynamic surfaces harder.** A public export, a route
   handler, a serialized class name, or a plugin entry can be called by code you
   do not own. For these, search callers outside the repo, or deprecate for one
   release and watch the logs before deleting.
4. **Clear feature-flag residue once a flag is settled.** When a flag has been
   fully on or off for good, delete the dead branch, inline the live one, then
   remove the flag definition and its config keys. Leaving `if (flags.newFlow)`
   after the rollout finished breeds paths no one tests.
5. **Delete, do not comment out.** Version control holds the history; a
   commented-out block just becomes code that searches still match and no test
   covers. Remove it cleanly and let `git log` be the archive.
6. **Delete in small, reversible commits and let CI referee.** One symbol or one
   flag per commit, with the full test and build run each time. If something
   only looked dead, a red build or a `git bisect` points straight at the change
   that removed it.

## Signals

- Does `grep -rn` across the entire repo, tests and config included, return zero
  uses of the symbol?
- Is the line at 0 percent coverage because it cannot run, or only because no
  test exercises it yet?
- After removing a flag, does any config file, dashboard, or deploy script still
  name it?

## Boundaries

Public library APIs are not dead just because this repo does not call them:
consumers you cannot see may, so follow a deprecation cycle instead of deleting
outright. Reflection-heavy or plugin-based code, where usage is invisible to
static search, defers to a human who knows the runtime wiring.

Wersje

RepozytoriumWynikLicencja
Ta strona · Amey-Thakur/AI-SKILLS90MIT
yeaight7/agent-powerups100Apache-2.0

Migawka bazy z 28.10.2026 · wersja paczki ba87056b49c1 (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

  • 100fai-dead-code-removal
    Znajduje i usuwa martwy kod w Pythonie i TypeScripcie: nieużywane eksporty, nieosiągalne gałęzie i osierocone pliki, z weryfikacją narzędziami.
  • 84analyze-dead-code
    Znajduje w repozytorium nieużywane eksporty, nieosiągalne moduły i martwe pliki, a następnie usuwa je z kodu.
  • 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.
  • 88feature-flag-removal
    Pomaga usunąć flagę funkcji base::Feature wraz ze związanym z nią kodem.
  • 100dead-code-audit
    Wykrywa nieużywany kod: niewywoływane funkcje, zbędne importy, osierocone pliki i nieosiągalne gałęzie, przed sprzątaniem lub wydaniem.
  • 90prune
    Audytuje kod pod kątem martwego kodu, duplikacji, nieużywanych zależności i śmieci, a potem bezpiecznie usuwa to, co nie zasługuje na miejsce.

Uwagi i zgłoszenia

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