Skip to main content

Living Architecture Control Plane for the AI-Dev Era

Project description

ArchSteer

ArchSteer conformance PyPI License: MIT

Living Architecture Control Plane for the AI-Dev Era.

AI agents now write code faster than any architect can review, document, or govern it. Docs rot instantly, the real architecture is invisible, structural decisions get made silently, and intended architecture drifts with every edit. ArchSteer is the always-current architecture system of record + governance plane: it derives the real architecture from code, keeps living docs and ADRs auto-built, surfaces every major decision for the architect to ratify, enforces declared intent as code-level fitness functions, and steers AI agents to conform instead of replicating local slop.

Everything is a projection of one code-derived model — .archsteer/model.json.

                    .archsteer/model.json  (single source of truth)
                                 │
   MAP ──── DOCUMENT ──── GOVERN ──── STEER ──── EVOLVE
  model    living docs   fitness     agent     report.html
  from     + auto ADRs   functions   guardrails  (drift/
  source   + diagrams    + ratchet   + MCP       decisions)

Install

pip install archsteer                 # regex engine + the local MCP server, zero native deps
pip install "archsteer[treesitter]"   # optional native acceleration

(Since 0.4.1 the MCP server ships in the base install; pip install "archsteer[mcp]" still works as a no-op alias.)

Languages: JavaScript / TypeScript, Python, Java (Spring-aware), and Salesforce Apex (SOQL/DML + trigger/handler/selector conventions). Layer detection uses in-source signals first — Spring stereotype annotations, Apex class-name conventions — then directory names.

Quickstart

archsteer init      # scaffold .archsteer/ + a starter rule pack auto-matched to your stack
archsteer map       # build model.json from source
archsteer docs      # regenerate .archsteer/architecture.md (deterministic, Mermaid)
archsteer govern    # conformance + drift score by rule
archsteer adr       # draft ADRs: new structural decisions + widespread rule violations
archsteer baseline  # accept current debt — the ratchet
archsteer steer -f src/controllers/payment.js -t "add refund endpoint"
archsteer check     # CI/pre-commit: fail on NET-NEW violations only
archsteer report    # self-contained .archsteer/report.html

init auto-detects your stack and seeds a matching baseline rule pack — edit .archsteer/architecture.yaml to fit your conventions, or pick one explicitly:

Pack Detected by Baseline rules
java-spring pom.xml / build.gradle persistence only in repositories; controllers never touch repositories
salesforce sfdx-project.json / force-app SOQL only in selectors; logic-less triggers; no DML in controllers
python-service pyproject.toml / requirements.txt persistence behind repositories; thin API handlers
express-to-next package.json repository pattern; Express → Next.js migration
archsteer init --pack salesforce   # override the auto-detection

The three design guarantees

  1. Ratchet, not freeze. archsteer check blocks only net-new violations against a baseline — teams keep shipping features while debt can only shrink.
  2. Conservative, architect-in-the-loop ADRs. Two narrow sources, both opt-in review — never auto-committed. Across time: external-boundary changes (new dependency, new datastore, new layer) — never internal reshuffles. Within a snapshot: a rule violated in 3+ components — a genuine pattern worth ratifying or relaxing, not a one-off left to check/govern. Drafts are idempotent; re-running never duplicates one already on disk.
  3. Sharp agent steering. Guardrails injected into CLAUDE.md, AGENTS.md, and .cursor/rules/archsteer.mdc (an always-on Cursor rule) are scoped to the files in play and point at the governing ADR — they don't dump the whole model into the context window.

Declaring intent — .archsteer/architecture.yaml

target: "Migrate Express + raw SQL to Next.js route handlers + the repository pattern"
layers: [route, controller, service, repository, model]
rules:
  - id: no-raw-sql-outside-repository
    type: required_layer_for_data_access
    allowed_layers: [repository]
    operations: [RAW]
    severity: error
    adr: .archsteer/adr/0001-repository-pattern.md
    steer: "Wrap all queries in a repository under src/repositories/. No raw SQL elsewhere."

Rule types: required_layer_for_data_access, forbidden_import, forbidden_data_access, forbidden_layer_edge.

Using with AI agents (MCP)

archsteer mcp runs a local MCP server over stdio — spawned by your own editor/agent, never hosted by us. It reads only what init/map/govern already wrote to .archsteer/ on disk, so there's no network call and nothing leaves your machine. It exposes three tools:

  • current_architecture — component/layer counts, conformance/drift, the declared target.
  • get_target_pattern — the invariants that apply to a file, before you write to it.
  • check_file — whether a file you just edited conforms, without waiting for CI.

Add it to Claude Code:

claude mcp add archsteer -- archsteer mcp

Add it to Cursor with one click: Install in Cursor →

Or to any MCP-compatible client's config:

{ "mcpServers": { "archsteer": { "command": "archsteer", "args": ["mcp"] } } }

Also published to the official MCP registry as io.github.einvoice-dev1/archsteer (runnable via uvx archsteer mcp).

CI / pre-commit

  • GitHub Action: .github/workflows/archsteer.yml (maps, drafts ADRs, runs the net-new gate, uploads report.html).
  • Git hook: cp hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit.

Conformance badge

If your repo pushes snapshots to the situation room (archsteer push), its latest conformance score is a live badge — the one at the top of this README is this repo governing itself:

[![ArchSteer conformance](https://img.shields.io/endpoint?url=https%3A%2F%2Fwww.archsteer.com%2Fapi%2Fbadge%2FYOUR-REPO)](https://www.archsteer.com)

Replace YOUR-REPO with the repo name archsteer push reports. Green at ≥90%, grey while you're still x-ray-only (no architecture.yaml declared yet).

Try the demo

cd examples/demo-repo
archsteer init && archsteer map && archsteer report   # open .archsteer/report.html

Roadmap

  • Shipped — cloud control plane (Next.js + Supabase): multi-repo situation room with drift/decision time-series. archsteer mcp: a local MCP server so agents query the live model + intent mid-edit. An org-wide, hosted MCP server (Team tier) so agents can ask cross-repo questions against the situation room — "what's our drift index," "which repos have pending ADRs" — the same data as the dashboard, over MCP.
  • Later — auth, org/repo model, billing.

Development

python3.11 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -q

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

archsteer-0.6.0.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

archsteer-0.6.0-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

File details

Details for the file archsteer-0.6.0.tar.gz.

File metadata

  • Download URL: archsteer-0.6.0.tar.gz
  • Upload date:
  • Size: 48.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for archsteer-0.6.0.tar.gz
Algorithm Hash digest
SHA256 57ddcf504c19e709306235440c062f05c48afa6e75d6d53a9faac0db07bfa93b
MD5 891c639ca960fb6aba0b4e37734fa99d
BLAKE2b-256 2f37e98ef320c8700be626eb6f44cef878185235bd13b9490b528daa0e9ad7c9

See more details on using hashes here.

File details

Details for the file archsteer-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: archsteer-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 51.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for archsteer-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aedf3c8eb15c1e707a9a9f83a0dbd61add1de9de20a026ba7ccf6523ae89dbd4
MD5 d19ea04a8d7e3201409d9a13359d3e31
BLAKE2b-256 64ef10635526914df629149de1d99e11450bd4457317788021ca3e0ffe3abf84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page