Legacy repository adoption
Adopt A2C into an existing git repository — brownfield, not greenfield.
Most software that can benefit from A2C already exists. Use a2c migrate plus the legacy-adoption prompt for AI-guided, bounded batches (inventory → scaffold → anchoring ADRs → merge → verify).
Prompt asset: pathname:///a2c-assets/prompts/bootstrap/legacy-adoption.md. Decision record: ADR-0018.
Human in the loop
Tools never block migration. a2c migrate is deliberately cautious:
- Summarizes phase, next batch, and anchoring readiness on every call (except
--status) - Warns when readiness is Partial or Weak
- Asks “Are you sure you want to continue?” on a TTY (including
--complete-batch) - Non-interactive: warnings on stderr only
You always decide. Prefer annoying prompts over silent design drift.
When to use
| Situation | Start with |
|---|---|
| Legacy repo, no A2C yet | a2c migrate --path . (inventory-first) |
You already ran a2c bootstrap | a2c migrate --entry-path bootstrap-first --path . |
| Pure docs repo | a2c migrate --tier docs-only --path . |
| Software repo (default depth) | a2c migrate --tier workflow-lite --path . |
| Start migration over | a2c migrate --reset --path . (type reset) |
| Refresh readiness after new context | a2c migrate --reassess --path . |
a2c migrate works before A2C root markers exist. It writes .a2c/migration.yaml and seeds the prompt at planning/migration/legacy-adoption.md when method assets are discoverable.
Migration context: inputs/
Before anchoring ADRs, place legacy context in inputs/ (design notes, wiki exports, interview notes, old READMEs). This folder is migration-only:
- AI reads it during inventory and anchoring batches
- It is not part of the long-term repo contract
- It must not be committed — batch 06 adds
inputs/to.gitignore
If some inputs/ material should live in the repo permanently, use batch 05 with inputs-intake.md after anchoring.
Anchoring ADRs and readiness
Legacy code often encodes decisions that were never written down. Batch 02 creates anchoring ADRs — Accepted, retrospective records grounded in code, in-repo docs, and inputs/.
When inventory finds explicit architecture-significant requirements (or docs/asr/ already exists), plan or record ASRs under docs/asr/ (ADR-0019). a2c migrate reports asrs= in legacy signals; a2c list asrs and a2c doctor cover ASR status including Amended.
Batch 00 produces:
anchoring-plan.md— candidates and evidence pointersanchoring-readiness.md— verdict (Strong / Partial / Weak), coverage matrix, gaps, ways forward
Iterate: add inputs/ → a2c migrate --reassess → AI batch-migrate-00r → a2c migrate to review warnings → proceed when you are satisfied.
Phase reports
After each batch, the AI writes planning/migration/phase-NN-report.md (00 … 06) before you run --complete-batch. Open the folder to see where you are in the migration.
Workflow
- Start —
a2c migrate --path .(confirm on TTY). - Optional: add legacy context under
inputs/. - Batch 00 in Cursor — inventory, plans, anchoring-readiness (no commits):
@planning/migration/legacy-adoption.md
Start batch-migrate-00: inventory this repository and write anchoring-readiness.md.
- Record progress —
a2c migrate --complete-batch batch-migrate-00 --path .(confirms again). - Batches 01–06 — one logical concern per commit; phase report each time.
a2c doctor— migration phase and readiness verdict (informational).
Check status without prompts: a2c migrate --status --path .
Batches (summary)
| Batch | Purpose |
|---|---|
batch-migrate-00 | Inventory, plans, anchoring-readiness.md, phase-00-report.md |
batch-migrate-00r | Reassess readiness only (after --reassess) |
batch-migrate-01 | a2c bootstrap / init |
batch-migrate-02 | Anchoring ADRs |
batch-migrate-03 | Governance merge |
batch-migrate-04 | Tooling merge |
batch-migrate-05 | Optional canonical inputs/ intake |
batch-migrate-06 | Hygiene and completion |
Full contract: legacy-adoption prompt.
Related
- reuse.md — greenfield adoption checklist
- inputs-intake.md — canonicalizing drafts into the repo
- cli.md —
a2c migrateflags