Run the full Archgate governance loop end to end in minutes — install the CLI, initialize a project, run a check, add an editor plugin, and have your AI agent review code against your ADRs.
This walkthrough takes you through the full governance loop end to end: install the CLI, scaffold a project, run a check, add an editor plugin, and have your AI agent review code against your ADRs. It should take under 10 minutes.
-
Install the CLI
Section titled “Install the CLI”If you have not installed Archgate yet, use the one-line installer (no Node.js required):
Terminal window curl -fsSL https://cli.archgate.dev/install-unix | shTerminal window irm https://cli.archgate.dev/install-windows | iexSee Installation for proto, npm, and all other options.
-
Initialize your project
Section titled “Initialize your project”From your project root, scaffold governance:
Terminal window cd my-projectarchgate initThis creates an
.archgate/directory containing a sample ADR, its companion.rules.tsrules file, and the Archgate configuration. The generated files are a working example you can build on. The full layout and the ADR frontmatter format are documented in the CLI Quick Start. -
Run your first check
Section titled “Run your first check”Run the deterministic compliance checker against your codebase:
Terminal window archgate checkArchgate loads every ADR marked with
rules: true, executes its companion rules file, and reports any violations with file paths and line numbers. The exit code tells you the outcome —0means everything complies,1means one or more violations were found,2means an internal error.This is the detection stage of the loop, and it is the hard gate you wire into CI and pre-commit. To check only staged files:
Terminal window archgate check --staged -
Add an editor plugin
Section titled “Add an editor plugin”The CLI works standalone, but the editor plugin is what closes the loop — it gives your AI agent a governance workflow so it reads your ADRs before coding and validates after. The plugin is currently in beta, so first authenticate:
Terminal window archgate loginThis starts a GitHub device flow: the CLI shows a one-time code and URL, you authorize in the browser, and credentials are stored securely. Once logged in, install the plugin for your editor:
Terminal window archgate plugin installArchgate supports six editors — Claude Code, Cursor, VS Code, Copilot CLI, Claude Desktop, and OpenCode. To see what each plugin adds and the exact per-editor setup, see the Plugins overview.
-
Run the reviewer
Section titled “Run the reviewer”Now exercise the AI layer. After your agent (or you) makes a code change, invoke the
@reviewerskill in your editor:@reviewerThe reviewer gathers all ADRs applicable to your changes via
archgate review-context, runs the automated checks, and delegates each affected domain to a focused sub-agent that verifies compliance — catching the judgment calls a linter cannot make. This is the AI-review half of the detection stage.When the reviewer or a real incident surfaces a pattern worth codifying, run the
@lessons-learnedskill to capture it into a new or updated ADR. That new rule flows back into prevention — the next time your agent writes code, it reads that decision before it starts. The loop is now closed.
What you just did
Section titled “What you just did”You ran every stage of the governance loop:
- Prevention —
archgate initscaffolded ADRs; the plugin feeds them to your AI agent as context. - Detection —
archgate checkvalidated deterministically;@revieweradded AI judgment. - Learning —
@lessons-learnedturns findings into new rules that strengthen prevention.