← ClaudeAtlas

legacy-spec-agentlisted

Reverse-engineer a specification from undocumented legacy code, and track drift between the code and that spec. Use this whenever the user wants to understand what an unfamiliar or undocumented codebase actually does, onboard onto legacy code, generate the missing spec/documentation from source, reconstruct business rules or architecture from code, or detect when code has diverged from its documented intent — even if they never say the word "spec" (e.g. "what does this repo actually do", "document this legacy system", "I inherited this codebase and there are no docs", "did anything break the original design").
HoonStyle/legacy-spec-agent · ★ 0 · AI & Automation · score 70
Install: claude install-skill HoonStyle/legacy-spec-agent
# Legacy Spec Agent Reconstruct a **grounded specification** from code that has no usable documentation, then keep that spec honest by detecting **drift** when the code changes. The premise is deliberate: in real legacy systems the spec is missing but **the code is always there.** So this skill never asks for a spec as input — it mines one out of the source, and every claim it emits must be backed by a `file:line` citation. Anything it cannot ground in code is quarantined as *unverified*, never presented as fact. > Guiding rule — **no ungrounded sentence ships.** A reconstructed rule without a code citation is a guess, and a guess in a spec is worse than a blank. This mirrors "Fact First": evidence gates every line. --- ## Two modes Decide which mode you are in before doing anything else. - **Mode A — Reverse-Spec** (default, first run on a repo): produce a grounded artifact profile from scratch. The default `standard` profile emits the complete documentation set; use `core` only when the user explicitly requests it. - **Mode B — Drift-Check** (a prior `SPEC.md` from this skill already exists): re-verify each existing claim's citation against the *current* code and emit `DRIFT_REPORT.md`, appending to `audit_log.jsonl`. If a `SPEC.md` produced by this skill exists in the target output location, default to Mode B and say so; otherwise Mode A. --- ## Workflow (Mode A) Run the phases in order. Each phase maps to a role documented in `references/agent-roles.md` — read