From archspec
Implements changes from an .archplan.md artifact: applies contract edits, syncs docs, produces a coding plan with conformance table, then builds and validates until no BLOCK remains.
How this skill is triggered — by the user, by Claude, or both
Slash command
/archspec:architecture-implementThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Write-side counterpart of `architecture-investigate`. The archplan artifact is the
Write-side counterpart of architecture-investigate. The archplan artifact is the
binding contract: every phase below either derives from it or checks against it.
This skill exists because a green build is not conformance — task_3 shipped a
nil-wired gateway, a declared event with no emit site, a field that never reached the
public edge, and dedup marked before its side effects, all with green unit tests.
Builds on superpowers: superpowers:writing-plans for the coding plan,
superpowers:subagent-driven-development or superpowers:executing-plans for
execution, superpowers:test-driven-development per task.
docs/plans/*.archplan.md./archspec:investigate first. Do not
improvise an architectural plan here: an unreviewed plan is how the task_3 topology
silently flipped from outbox events to sync RPC.edge_cases[] register, the state-ownership map, the fan-out trace, and the open
questions. Unresolved open questions that block coding → ask the user now.Apply the archplan's YAML patch to every touched docs/SERVICE_MAP.yaml (one per
service in a monorepo — cd into each service directory).
Validate each edited contract:
ARCHSPEC_ROOT="${CLAUDE_PLUGIN_ROOT:-$CLAUDE_PROJECT_DIR}"
$ARCHSPEC_ROOT/bin/archspec-python \
$ARCHSPEC_ROOT/skills/architecture-sync/scripts/validate_servicemap.py docs/SERVICE_MAP.yaml
Run /archspec:sync in each touched service directory so docs/diagrams/*.mmd and
the managed region of docs/ARCHITECTURE.md are regenerated before code is
written — the diagrams must describe the target state, not trail it.
Commit the contract change separately: docs(archspec): contract edits for <slug>.
Write the coding plan with superpowers:writing-plans, saved next to the archplan as
docs/plans/<date>-<slug>.codingplan.md. Two extra obligations beyond that skill:
Conformance table — a table with one row per archplan element: every event,
endpoint, field, batch call, dedup key, and edge_cases[] entry, mapped to the
coding task that realises it and the test that proves it. An archplan element with
no row is a missing task; a coding task with no archplan element is scope creep —
resolve both before coding.
Method-existence gate — for every downstream call the plan makes, verify the method exists in the callee's contract/proto now, by grep, not by plausibility:
grep -rn "GetWorkersBatch" proto/ */docs/SERVICE_MAP.yaml
A method that does not exist in the callee is forbidden — SearchBySkills in task_3
was invented at this exact point. Either use the method the contract declares, or go
back to investigate and change the contract explicitly.
Execute the coding plan task-by-task (superpowers:subagent-driven-development when
subagents are available, else superpowers:executing-plans), with
superpowers:test-driven-development per task. Frequent commits. Every edge_cases[]
entry gets the test its test: path names — exercising the behaviour, not just
creating the file.
Run each pass over the full diff. Each one targets a bug class that shipped in task_3 with green tests. Record the evidence inline; a pass with no evidence is not done.
main.go / DI container). Every constructor argument for a
declared dependency is a real client, never nil / a placeholder. Then verify every
new client's default address/port against the target service's actual listen
port (its main.go / deploy config) — a geo client defaulting to another
service's port compiles, passes unit tests, and dials the wrong service in every
real environment. Unit tests stub these, so only this pass catches both.events.published[] entry in every touched contract, grep the service code for the
topic string and confirm a publish/outbox append on every path the archplan
shows it on (initial and retry/reassignment paths — task_3 published match.found
only on the initial path)./decline-offer declared
but only /decline routed is a documented endpoint that 404s); prove it with a
handler test that hits the documented path.file:line that implements it →
test that proves it. A requirement you cannot point into the diff is unimplemented,
however much surrounding code exists (task_3: "rating is the primary sort" had no
file:line — it was simply not there)./archspec:validate from the repo root (monorepo-aware: it discovers every
*/docs/SERVICE_MAP.yaml and lints each service)./archspec:check-architecture for any cross-service change.exceptions[] entry with a reason. Findings are never waved off as stale.Dispatch a reviewer subagent with a fresh context (no chat history). Give it: the
archplan path, the coding plan path, and the branch diff (git diff <base>...HEAD).
It re-runs Phase E's five passes against the diff plus the archplan's rubric (topology,
batch usage, snapshot reuse, terminal branches) and returns CRITICAL/MAJOR/MINOR
findings with file:line. Fix every CRITICAL and MAJOR, then re-dispatch a fresh
reviewer. Loop until zero CRITICAL findings. Emit the literal line
Implement-review: CLEAN after <N> round(s), <summary>.
Solo degradation is not CLEAN. If you cannot dispatch subagents, re-reading your
own diff is not an independent review — walk the passes anyway, but emit
Implement-review: SELF-ONLY after <N> pass(es), <summary> so the degradation stays
visible to the human and to any later review stage.
Commit the remaining work in logical commits. Do not push and do not open a PR unless the user explicitly asks. Close with the Definition of done from the archplan, each box checked with its evidence:
edge_cases[] entry has a test that actually exercises it;/archspec:validate green (or explicit exceptions[]);/archspec:check-architecture green for cross-service changes;Implement-review: CLEAN emitted..archplan.md artifact — run /archspec:investigate first.nil (or a stub) as a declared dependency in a composition root "to wire it
later". Later never comes; the first real event panics.go build / go test as done — only Phase F/G gates close the work.npx claudepluginhub krus210/archspec --plugin archspecReads SERVICE_MAP.yaml, asks clarifying questions, and produces a change plan with a Mermaid sequence diagram, YAML patch, and risk register before non-trivial feature or bugfix work.
Generates executable implementation plans from approved architecture specs, including task dependency graphs, skill routing, and acceptance criteria.
Produces an implementation architecture from a PRD or user spec: file tree, component breakdown, data model, and phased build plan with end conditions.