Bring an existing codebase under Archgate governance. Run archgate init, use the onboard skill to author your first ADRs, and wire compliance into your workflow.
Adopting Archgate in an existing project does not mean rewriting it. Governance is additive: you commit a .archgate/ directory of Architecture Decision Records (ADRs), and from then on every check, CI run, and AI session reads those ADRs as the source of truth. This guide walks the adoption path from a clean repo to enforced governance.
The CLI syntax referenced here is documented authoritatively at cli.archgate.dev — this page focuses on the adoption journey and where each tool fits.
The adoption path
Section titled “The adoption path”-
Initialize the governance skeleton with
archgate init. -
Author your first ADRs — codify the conventions your codebase already follows. The
onboardskill automates this by exploring the repo for you. -
Verify the ADRs and rules pass against your current code with
archgate check. -
Enforce continuously — wire checks into CI and pre-commit hooks.
-
Evolve — extend governance over time with the
lessons-learnedandadr-authorskills.
Step 1 — Initialize
Section titled “Step 1 — Initialize”Run archgate init in the repository root. It creates the .archgate/ directory containing adrs/ (your ADRs and companion .rules.ts rule files) and lint/, and detects your editors so it can offer to wire up the matching plugin.
archgate initThe init flow seeds a placeholder example ADR (GEN-001-example.md) so you can see the format. You will replace it with real ADRs in the next step. See the CLI getting-started guide for every init flag and the exact directory layout.
Step 2 — Author your first ADRs
Section titled “Step 2 — Author your first ADRs”You have two paths to your initial ADR set. Most teams adopting Archgate into a mature codebase use the guided onboard skill, which discovers conventions automatically rather than asking you to write everything by hand.
The onboard skill is the recommended path for an existing repo. Available inside Archgate’s editor plugins (Claude Code, Cursor, VS Code, and others), it onboards a project into governance end to end:
-
Pre-flight — verifies the Archgate CLI is installed.
-
Initialize — runs
archgate initif.archgate/adrs/does not exist yet, and removes the placeholder example ADR. -
Assess maturity — classifies the repo as greenfield, early-stage, or mature from manifest files, source file counts, and recent git history.
-
Discover — for mature and early-stage repos, parallel explore sub-agents read your toolchain config, source patterns (error handling, imports, naming), and docs to extract the conventions you already follow — without you describing them.
-
Interview — asks at most three targeted questions to fill gaps exploration could not (priority governance domains, any legacy areas or external specs).
-
Propose a backlog — presents a prioritized list of 6–8 ADRs across the relevant domains (architecture, backend, frontend, data, general) for your approval before anything is written.
-
Author — writes every approved ADR (and companion rule files where a decision is objectively checkable), then fixes cross-references between them.
-
Report — prints a governance summary: ADRs created, domains covered, remaining gaps, and next steps.
Run it once, when setting up Archgate for the first time. After the initial set exists, re-running it extends or audits your governance.
If you prefer to write ADRs yourself, or want to capture one specific decision, use the adr-author skill (or the CLI’s ADR commands directly). It follows the same ADR structure the onboard skill produces — Context, Decision, Do’s and Don’ts, Consequences, Compliance, and References — and can create a companion .rules.ts for decisions that are verifiable in code.
This path suits greenfield projects with few existing conventions, or incremental adoption where you document one architectural area at a time.
Step 3 — Verify against current code
Section titled “Step 3 — Verify against current code”Once your ADRs exist, confirm their automated rules pass against the repository as it stands today:
archgate checkA clean run means your ADRs accurately describe your codebase. If a rule fails on existing code, you have a decision to make: fix the code, relax the rule, or scope the ADR to apply only to new files. The full flag set (--verbose, --json, --adr, --base, --staged) is documented in the CLI reference.
Step 4 — Enforce continuously
Section titled “Step 4 — Enforce continuously”Governance only holds if it is enforced. Layer enforcement so violations are caught as early as possible:
For AI-assisted work, the editor plugins close the loop earlier still: the developer agent reads relevant ADRs before writing code and validates compliance before you commit, so the CI gate rarely fires.
Step 5 — Evolve governance over time
Section titled “Step 5 — Evolve governance over time”Adoption is the start, not the end. As your architecture changes:
- Use the lessons-learned skill after a development session to capture new learnings and codify them into ADRs or project memory — the final step in the development workflow.
- Use the adr-author skill to document a new decision the onboarding pass did not cover.
- Re-run the onboard skill to extend governance to a new domain (for example, adding data-layer ADRs after introducing a database).
You can also bootstrap with proven conventions from the Archgate ADR registry instead of starting from a blank page — import a curated pack and remap its IDs into your project.