By krus210
Enforce microservice architecture rules by defining contracts in SERVICE_MAP.yaml, then auto-generating Mermaid diagrams, validating code conformance, and blocking changes that violate the spec.
Audit a monorepo of SERVICE_MAP.yaml files against each other and (optionally) a top-level architecture spec. Reports graph mismatches, orphan events, TODO leaks, write_path/events inconsistencies. Read-only.
Implement a change from an .archplan.md artifact — apply contract edits, sync docs, write a conformant coding plan, implement with TDD, then prove plan↔code conformance with validate/check-architecture. Commits, never pushes.
Bootstrap a service for archspec — auto-discover endpoints/dependencies/storage/topics from Go code, ask the user for SLA/idempotency/timeout fields, then create SERVICE_MAP.yaml, ARCHITECTURE.md, ADR dir, install pre-commit hook, append archspec block to CLAUDE.md.
Read SERVICE_MAP.yaml, draw a chat-only Mermaid for a proposed change, and propose YAML edits before writing code.
Regenerate Mermaid diagrams and ARCHITECTURE.md from docs/SERVICE_MAP.yaml.
Use when an .archplan.md artifact exists and the user wants the change built — "implement the plan", "build it", or /archspec:implement. Applies the archplan's contract edits, syncs generated docs, writes a coding plan that provably maps to the archplan, implements with TDD, then runs conformance passes + /archspec:validate + /archspec:check-architecture until no BLOCK remains.
Use before non-trivial feature or bugfix work — phrases like "let's add X", "investigate Y", "understand how Z works", or when the user runs /archspec:investigate. Read-only: consults SERVICE_MAP.yaml, asks clarifying questions about ambiguous requirements, then proposes a change plan + chat-only Mermaid.
Use when the user edits SERVICE_MAP.yaml, asks to "regenerate diagrams", "update mermaid", "service map drift", or runs /archspec:sync. Regenerates docs/diagrams/*.mmd and the managed region of docs/ARCHITECTURE.md.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Spec-driven architecture validation for microservices.
archspec captures a microservice's architecture as a versioned, machine-readable
contract (SERVICE_MAP.yaml), generates Mermaid diagrams and ARCHITECTURE.md
deterministically from it, and validates code changes against it on two layers:
/archspec:validate (idempotency, race conditions, eventual consistency) ┌─────────────────────────┐
│ docs/SERVICE_MAP.yaml │ ← single source of truth
└────────────┬────────────┘
│
┌────────────────────────┼────────────────────────┐
▼ ▼ ▼
/archspec:sync pre-commit hook /archspec:validate
(Mermaid + ARCH.md) (DET-001..015) (AI-001..010)
| Pain | archspec answer |
|---|---|
ARCHITECTURE.md rots — written by hand, updated by goodwill | Generated from YAML; CI fails on drift |
| C4 diagrams in Lucidchart aren't version-controlled | Mermaid in repo, deterministic |
| Invariants like "endpoint must be idempotent" live in tribal knowledge | Encoded in SERVICE_MAP.yaml; AI rules check the code |
| Reviewers can't mechanically check contracts | Pre-commit + /archspec:validate reports |
| New contributors need weeks to understand the bounded context | Read one YAML, get diagrams + invariants |
/plugin marketplace add krus210/archspec
/plugin install archspec@archspec
After installation, run /reload-plugins (or restart Claude Code) so commands and skills become available.
git clone https://github.com/krus210/archspec
ln -s "$PWD/archspec/skills/architecture-sync" ~/.claude/skills/
ln -s "$PWD/archspec/skills/architecture-investigate" ~/.claude/skills/
cd path/to/your-service
/archspec:init
This creates docs/SERVICE_MAP.yaml, generates initial diagrams + ARCHITECTURE.md,
installs the pre-commit hook, and appends the archspec block to CLAUDE.md.
archspec is intentionally small: each command/skill has a concrete artifact at the end, and those artifacts stay in the repo.
| Flow | Output |
|---|---|
/archspec:init / architecture-sync bootstrap | docs/SERVICE_MAP.yaml, docs/diagrams/{context,container,sequence}.mmd, generated docs/ARCHITECTURE.md, .servicemap/schema.json, docs/adr/, installed git hooks, and the archspec block in CLAUDE.md |
/archspec:sync / architecture-sync | Regenerated Mermaid diagrams and the managed region of docs/ARCHITECTURE.md |
/archspec:investigate / architecture-investigate | Read-only contract summary, clarification questions, an optional cross-check against a reference/golden spec, a chat-only sequence diagram for the proposed change, a YAML diff to apply before coding — including an edge_cases[] risk register that turns every finding into a DET-003-enforced test path — plus a persisted docs/plans/*.archplan.md artifact reviewed by an independent plan-review gate, and a definition-of-done + validation loop to run after implementation |
/archspec:implement / architecture-implement | Contract edits applied + re-synced docs, a coding plan with an archplan↔task conformance table, the implemented change, five conformance passes (wiring, event emission, end-to-end field threading, dedup atomicity, requirement evidence), green /archspec:validate + /archspec:check-architecture, and an independent diff review |
/archspec:validate | Markdown report grouped by BLOCK / WARN / INFO / SUPPRESSED, with file references and fix hints |
/archspec:check-architecture | Monorepo-wide architecture audit across all SERVICE_MAP.yaml files |
The generated diagrams are plain Mermaid, so a fresh /archspec:init produces
reviewable text artifacts rather than screenshots. Example output from a
task-service init is checked in under
examples/task-service-init-output/docs/diagrams.
Context diagram:
flowchart LR
subgraph this["task-service"]
svc[task-service]
end
upstream_api-gateway[api-gateway] --> svc
svc -.-> storage_task-store[("in-memory: task-store")]
svc ==>|publish| topic_task-created>task.created]
Container diagram:
npx claudepluginhub krus210/archspec --plugin archspecComprehensive C4 architecture documentation workflow with bottom-up code analysis, component synthesis, container mapping, and context diagram generation
Enterprise microservices architecture design and implementation expert for scalable distributed systems
C3 architecture design methodology with sealed architecture facts and change-unit workflows.
Editorial "Architecture & Design" bundle for Claude Code from Antigravity Awesome Skills.
AI-powered architecture documentation framework with ADRs, reviews, and pragmatic mode
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns