Skip to main content

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

SituationStart with
Legacy repo, no A2C yeta2c migrate --path . (inventory-first)
You already ran a2c bootstrapa2c migrate --entry-path bootstrap-first --path .
Pure docs repoa2c migrate --tier docs-only --path .
Software repo (default depth)a2c migrate --tier workflow-lite --path .
Start migration overa2c migrate --reset --path . (type reset)
Refresh readiness after new contexta2c 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 pointers
  • anchoring-readiness.md — verdict (Strong / Partial / Weak), coverage matrix, gaps, ways forward

Iterate: add inputs/a2c migrate --reassess → AI batch-migrate-00ra2c migrate to review warnings → proceed when you are satisfied.

Phase reports

After each batch, the AI writes planning/migration/phase-NN-report.md (0006) before you run --complete-batch. Open the folder to see where you are in the migration.

Workflow

  1. Starta2c migrate --path . (confirm on TTY).
  2. Optional: add legacy context under inputs/.
  3. 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.
  1. Record progressa2c migrate --complete-batch batch-migrate-00 --path . (confirms again).
  2. Batches 01–06 — one logical concern per commit; phase report each time.
  3. a2c doctor — migration phase and readiness verdict (informational).

Check status without prompts: a2c migrate --status --path .

Batches (summary)

BatchPurpose
batch-migrate-00Inventory, plans, anchoring-readiness.md, phase-00-report.md
batch-migrate-00rReassess readiness only (after --reassess)
batch-migrate-01a2c bootstrap / init
batch-migrate-02Anchoring ADRs
batch-migrate-03Governance merge
batch-migrate-04Tooling merge
batch-migrate-05Optional canonical inputs/ intake
batch-migrate-06Hygiene and completion

Full contract: legacy-adoption prompt.