Reference — generated from the toolkit
Source of truth: toolkit/skills/code-archaeology/spec.md. Edit it there; this page is regenerated on build.
Skill: code-archaeology
- Owner: AI + Engineering
- Version: 0.1.0
- Lifecycle: draft
- Phase: cross-cutting (primarily STOP)
Trigger
Point it at a legacy repo to produce a current-state understanding fast — the flagship "AI accelerates STOP" capability. Weeks of manual spelunking per product collapsed to days.
Inputs → outputs
- Inputs: a legacy repository (read-only), its history, and any existing docs.
- Outputs: a draft legacy-system knowledge pack — C4 context/container sketch, module and dependency map, data flows, dead-code candidates, and gotchas mined from commit history and issue trackers.
Procedure
- Static structural analysis → C4 context + container sketch.
- Dependency and module mapping.
- Data-flow tracing; flag PII touchpoints.
- Dead-code candidate detection (with evidence; never auto-delete).
- History mining — recurring bug areas, revert patterns, "here be dragons" commits → gotchas.
- Emit the knowledge-pack draft for SME validation.
Guardrails & permissions
- Read-only on the target repo; no writes, no irreversible actions.
- Outputs are drafts for human/SME validation — dead-code candidates and buried rules are proposals, never conclusions.
Failure modes
- Over-confident dead-code calls (mitigated: evidence required, human confirms).
- Missing rules that live in data/config not code (mitigated: SME validation step).
Golden scenarios
| Scenario | Input | Expected output | Pass criterion |
|---|---|---|---|
| Known small legacy repo | fixture repo | knowledge pack with correct C4 + ≥90% of seeded gotchas | human review score |
| Dead-code detection | repo with known dead module | module flagged as candidate, not asserted | precision on seeded cases |