Skip to main content
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

  1. Static structural analysis → C4 context + container sketch.
  2. Dependency and module mapping.
  3. Data-flow tracing; flag PII touchpoints.
  4. Dead-code candidate detection (with evidence; never auto-delete).
  5. History mining — recurring bug areas, revert patterns, "here be dragons" commits → gotchas.
  6. 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

ScenarioInputExpected outputPass criterion
Known small legacy repofixture repoknowledge pack with correct C4 + ≥90% of seeded gotchashuman review score
Dead-code detectionrepo with known dead modulemodule flagged as candidate, not assertedprecision on seeded cases