By krus210
Declare and validate architecture contracts using SERVICE_MAP.yaml specs. Bootstrap service docs, audit microservice contracts for consistency, generate Mermaid diagrams from YAML, then implement changes via TDD against 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 AGENTS.md (canonical cross-tool file) and 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 wants to bootstrap or initialize archspec for a service (create the SERVICE_MAP.yaml contract, diagrams and ARCHITECTURE.md), "set up archspec", "init archspec", edits SERVICE_MAP.yaml, asks to "regenerate diagrams", "update mermaid", "service map drift", or runs /archspec:init or /archspec:sync. Bootstraps a new service when docs/SERVICE_MAP.yaml is absent, otherwise 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 claimnpx claudepluginhub krus210/archspec --plugin archspecBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Executables (bin/) — files in this plugin's bin/directory are added to the Bash tool's PATH while the plugin is enabled.
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 |
archspec's three skills (architecture-sync, architecture-investigate,
architecture-implement) are portable across Claude Code, Codex, and opencode. Pick
the option that matches your setup.
/plugin marketplace add krus210/archspec
/plugin install archspec@archspec
After installation, run /reload-plugins (or restart Claude Code) so commands and skills become available.
npx skills# installs the 3 archspec skills into every detected agent
npx skills add krus210/archspec
# or scope it: -a claude-code (repeatable), -g (global), -y (no prompts),
# --skill architecture-sync --skill architecture-investigate --skill architecture-implement
install / i / a are aliases of add. This installs skills only — the
/archspec:* slash commands and git hooks come with Option A (or a manual clone).
npx skills is the vercel-labs/skills CLI.
git clone https://github.com/krus210/archspec
mkdir -p .agents/skills # or ~/.agents/skills for a global install
cp -r archspec/skills/architecture-sync .agents/skills/
cp -r archspec/skills/architecture-investigate .agents/skills/
cp -r archspec/skills/architecture-implement .agents/skills/
Older Codex builds scan ~/.codex/skills/ instead. Invoke a skill by typing
$architecture-sync (or the skill name) or picking it from /skills.
git clone https://github.com/krus210/archspec
mkdir -p .opencode/skills # or ~/.config/opencode/skills for a global install
cp -r archspec/skills/architecture-sync .opencode/skills/
cp -r archspec/skills/architecture-investigate .opencode/skills/
cp -r archspec/skills/architecture-implement .opencode/skills/
Append the archspec block (skills/architecture-sync/templates/CLAUDE.archspec-block.md)
to AGENTS.md — the canonical cross-tool instructions file opencode reads (CLAUDE.md
is only a fallback when no AGENTS.md exists). Optional command files go in
.opencode/command/archspec/. Requires opencode ≥ v1.0.190 for native skills support.
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 AGENTS.md (the
canonical cross-tool instructions file) and CLAUDE.md (Claude Code's native file).
It runs the same way once the skill is loaded on any host: Claude Code /archspec:init;
Codex $architecture-sync and ask it to bootstrap; opencode load the skill and ask it
to bootstrap.
archspec is intentionally small: each command/skill has a concrete artifact at the end, and those artifacts stay in the repo.
Comprehensive C4 architecture documentation workflow with bottom-up code analysis, component synthesis, container mapping, and context diagram generation
Editorial "Architecture & Design" bundle for Claude Code from Antigravity Awesome Skills.
Enterprise microservices architecture design and implementation expert for scalable distributed systems
AI-powered architecture documentation framework with ADRs, reviews, and pragmatic mode
Generate architecture diagrams and technical design documents
Technical architecture skills for system design, API design, database design, event-driven systems, and migration planning.