Problem
Legacy projects have behavior spread across code, tests, docs, and team memory. AI changes are risky because there is no clear contract.Outcome
You get a baseline spec that reflects current behavior, then tighten it over time.High-level walkthrough
- Pick one critical area first, not the whole repo.
- Write a spec that describes current behavior and known constraints.
- Link that spec to existing tests and docs in verification.
- Run spec check to surface missing coverage and weak spots.
- Fix one drift item at a time and keep iterating.
Codex example prompt
Any coding agent prompt
Verify
- Confirm the spec matches current shipped behavior.
- Confirm each key requirement has at least one verification reference.
- Track unresolved gaps as explicit follow-up work.