Skip to content

Cursor Plugin

Install and configure the Archgate plugin for Cursor. Add an always-apply governance rule plus skills and sub-agents so Cursor's AI reads your ADRs before coding and validates compliance after.

Archgate integrates with Cursor to give its AI agent the same structured governance workflow available in Claude Code: read the applicable ADRs before writing code, validate after, and capture new patterns for the team. The integration combines an always-apply Cursor rule with the Archgate skills and agents.

The plugin (archgate, version 0.7.0) registers a Cursor marketplace entry and installs an agent, five skills, and a governance rule. Cursor’s plugin system handles namespacing, so skills and agents use their direct names without an archgate: prefix.

NameModePurpose
developerEditsGeneral development agent. Reads ADRs before coding, validates after, orchestrates the skills.
plannerRead-onlyDesigns ADR-compliant implementation approaches without writing or modifying any files.
NameWhen it is used
reviewerAfter a code change — validates changes against project ADRs using focused per-domain sub-agents.
lessons-learnedAfter coding and validation — captures recurring patterns and codifies them into ADRs.
adr-authorWhen creating or editing an ADR — follows the project’s established structure and conventions.
onboardOnce per project — runs archgate init, explores the codebase, interviews you, writes ADRs.
cli-referenceInternal: loads the authoritative CLI command, rules-authoring, and ADR-format references.

These are the same agent and skills shipped in the Claude Code plugin, adapted for Cursor’s plugin system.

FilePurpose
.cursor/rules/archgate-governance.mdcAn always-apply rule that instructs the agent to consult ADRs and run checks.

The rule uses alwaysApply: true, so Cursor’s agent always has governance context available without manual activation. It tells the agent to run archgate review-context before coding and archgate check --staged after, and reinforces the key principle: architectural decisions are enforced, not suggested — if archgate check reports violations, they must be fixed.

  1. Log in with GitHub.

    Terminal window
    archgate login

    This obtains your plugin token and stores credentials in your OS credential manager.

  2. Initialize the project for Cursor.

    Run archgate init with the --editor cursor flag:

    Terminal window
    archgate init --editor cursor

    If you are logged in, this also installs the Archgate plugin. To request the plugin explicitly:

    Terminal window
    archgate init --editor cursor --install-plugin

The plugin is delivered through two channels, both handled by the CLI:

  • Cursor team marketplace — a git-based marketplace repository served from plugins.archgate.dev. After installation, Cursor discovers the plugin from the marketplace URL the CLI prints. (Under the hood, the plugin archive is served as a tar.gz.)
  • VS Code extension (VSIX) — a .vsix is installed into Cursor via cursor --install-extension when the cursor CLI is available.

The archgate plugin install --editor cursor command installs the VSIX via the cursor CLI if present and prints the team marketplace URL; otherwise it prints manual instructions.

Terminal window
archgate plugin install --editor cursor

To retrieve the authenticated marketplace URL for manual setup:

Terminal window
archgate plugin url --editor cursor

After installing the plugin, run the onboard skill once per project. It:

  1. Explores your codebase structure — directories, key files, package configuration.
  2. Interviews you about your team’s conventions, constraints, and architectural decisions.
  3. Creates an initial set of ADRs from your answers.
  4. Sets up the .archgate/ directory with your first rules.

After onboarding, the other skills handle day-to-day development. See Writing ADRs for the format it follows.

The developer agent follows a structured workflow for every coding task:

  1. Read applicable ADRs — runs archgate review-context to see which ADRs apply to the changed files. It does not write code until it has read them.
  2. Write code following ADR constraints — implements changes against the Do’s and Don’ts from the applicable ADRs.
  3. Run compliance checks — runs archgate check --staged to execute automated rules; fixes any violations before proceeding.
  4. Reviewer pass — invokes the reviewer skill, which launches a focused sub-agent per affected domain to verify structural compliance against the full ADR set.
  5. Capture learnings — invokes the lessons-learned skill to identify patterns worth codifying as new ADRs or updates to existing ones.

For planning-only work, switch to the planner agent: it reads the relevant ADRs, analyzes the codebase, and produces an ADR-compliant plan without modifying any files.

When a task would require violating an ADR, the agent refuses, names the ADR, and suggests a compliant alternative — consistently, regardless of phrasing. ADRs are mandatory constraints. For example, asked to add a disallowed dependency in a project governed by a dependency-policy ADR, the agent declines, cites the ADR and the approved list, and proposes the sanctioned alternative.

The archgate session-context cursor command reads Cursor agent session transcripts from disk, letting skills recover context that may have been compacted or truncated. It accepts two optional flags:

  • --max-entries <n> — maximum number of (most recent) entries to return; default 200.
  • --session-id <uuid> — a specific session UUID; if omitted, the most recent session is used.

For exact command flags and output formats, see the authoritative reference at cli.archgate.dev.

ScenarioUse
Setting up Archgate on a new projectonboard
Planning an approach before codingplanner
Day-to-day coding tasksdeveloper
Reviewing changes for ADR compliancereviewer
Capturing a recurring pattern as an ADRlessons-learned
Creating or editing an ADR by handadr-author

Most of the time you interact only with the developer agent — it orchestrates reviewer and lessons-learned automatically.