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

code-dissolver

/code-dissolver

Usuwa martwy kod i stare flagi funkcji, łącząc analizę wywołań z telemetrią z produkcji.

Repozytorium
code-dissolver ↗
Licencja
MIT
Ostatnia zmiana repozytorium
03.11.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
4
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

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

Usuwa martwy kod i stare flagi funkcji, łącząc analizę wywołań z telemetrią z produkcji.

Oryginalny opis (EN)

[WHAT IT DOES]: Eliminates dead code, abandoned feature flags, and orphaned database models by combining static AST call-graph reachability with empirical production execution telemetry (eBPF, APM logs). [WHEN TO USE]: Use when safely refactoring massive legacy codebases, pruning zombie functions, removing stale feature flags, shrinking bloated dependencies, or eliminating the fear of breaking changes when cleaning technical debt. [WHEN NOT TO USE]: Do NOT use on brand-new codebases with no production traffic or for dynamic runtime monkey-patching.

Jak działa

  1. 1. When to Activate
  2. 2. Dissolution Runbook
  3. 3. Reference Files
Sekcje z nagłówków SKILL.md, w oryginale · 78 linii, 415 słów
Podgląd SKILL.md
---
name: code-dissolver
description: >-
  [WHAT IT DOES]: Eliminates dead code, abandoned feature flags, and orphaned database models
  by combining static AST call-graph reachability with empirical production execution telemetry (eBPF, APM logs).
  [WHEN TO USE]: Use when safely refactoring massive legacy codebases, pruning zombie functions, removing stale feature flags,
  shrinking bloated dependencies, or eliminating the fear of breaking changes when cleaning technical debt.
  [WHEN NOT TO USE]: Do NOT use on brand-new codebases with no production traffic or for dynamic runtime monkey-patching.
---

# Code Dissolver: Telemetry-Proven Codebase Trimmer

```
  +---------------------------------------------------------------------------------+
  |                                 CODE DISSOLVER                                  |
  |        AST Static Reachability + Empirical Production Telemetry Correlator      |
  +---------------------------------------------------------------------------------+

       [Source Code Repository]                 [Production Observability]
       - Complete Abstract Syntax Tree (AST)     - 90-Day eBPF / APM Invocation Logs
       - Static Caller-Callee Graph              - Zero-Sample Traces
                  |                                           |
                  +---------------------+---------------------+
                                        |
                                        v
                       [Reachability & Telemetry Matrix]
                       - Active In-Use Functions
                       - Statically Unreachable Code
                       - Ghost Paths (Reachable in code, but 0 real-world calls)
                                        |
                                        v
                        +---------------+---------------+
                        |                               |
                  [Zero Drift]                  [Ambiguous Dynamic Call]
                        |                               |
                        v                               v
             [Automated Clean Cut]           [Flag for Human Review]
             - Dissolve Dead Functions
             - Inline 100% Feature Flags
             - Re-Run Test Suite (0 Errors)
```

---

## 1. When to Activate

Trigger `code-dissolver` when:
- **Massive Codebase Bloat:** Repositories with >100,000 LOC where engineers spend hours navigating dead files or obsolete functions.
- **Stale Feature Flag Cleanup:** Flags that have been 100% enabled (or 0% enabled) in production for months and clutter the codebase with conditional branching.
- **Microservice Decomposition:** Carving out domain boundaries and identifying dead endpoints before splitting a monolith.
- **Bundle Size Optimization:** Stripping unreferenced exports from backend and frontend services with mathematical safety confidence.

---

## 2. Dissolution Runbook

### Step 1: Parse the Static AST Call Graph
Run the AST analyzer to identify all function declarations, imports, and caller-to-callee dependencies:
```bash
python scripts/prune_telemetry_analyzer.py --demo
```
The parser builds a directed graph:
* Nodes = Functions, Methods, Classes.
* Edges = Function calls (`visit_Call`).

### Step 2: Correlate with Real-World Production Traces
Map each node against live production telemetry (eBPF traces, OpenTelemetry spans, or Datadog/NewRelic logs) over a 90-day window:
* **Active Nodes:** Executed $> 0$ times in production.
* **Ghost Nodes:** Reachable in theory, but executed **0 times** across millions of requests.
* **Unreachable Nodes:** Isolated from all application entry points.

### Step 3: Formal Pruning Safety Proof
1. Compute the transitive dependency closure: ensure no active node calls the candidate node.
2. Confirm the candidate is not referenced in reflection, dynamic `eval()`, or external public API contracts.
3. Verify all automated unit and integration tests remain green after mock removal.

### Step 4: Atomic Refactor & Pull Request
1. Safely delete the dead code blocks and orphaned imports.
2. Inline stale feature flags (removing the `if/else` wrapper and preserving only the true branch).
3. Export an audit report using [dissolver_report_template.md](./templates/dissolver_report_template.md).

---

## 3. Reference Files
- [prune_telemetry_analyzer.py](./scripts/prune_telemetry_analyzer.py): Python AST and telemetry correlation engine.
- [dissolver_report_template.md](./templates/dissolver_report_template.md): Formal pruning and safety audit report template.
Pliki w paczce (4)
  • .gitignore 1 KB
  • LICENSE 1 KB
  • README.md 4 KB
  • SKILL.md 4 KB

Wersje

W bazie nie ma innych skilli o nazwie code-dissolver.

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

  • 90dead-code-removal
    Usuwa bezpiecznie martwy kod, nieużywane zależności i przestarzałe flagi, w małych krokach i z możliwością cofnięcia.
  • 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.
  • 95cleaning-up-stale-feature-flags
    Wyszukuje przestarzałe flagi funkcji w PostHog i porządkuje kod, który je sprawdza, przez lokalne zmiany i szkice PR.
  • 95cleaning-up-stale-feature-flags
    Wyszukuje i usuwa nieaktualne flagi funkcji w PostHog: nieużywane, w pełni wdrożone i porzucone, po sprawdzeniu zależności.
  • 100cleaning-up-stale-feature-flags
    Wskazuje nieaktualne feature flags w projekcie PostHog i czyści kod, który je sprawdza, otwierając osobny draft pull request dla każdej flagi.
  • 90dead-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.

Uwagi i zgłoszenia

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