an agent skill · system design, contracts, NFR budgets & ADRs

/architecture

Point an agent at a PRD and it starts writing code — inventing boundaries, contracts, and data stores one file at a time. architecture makes it decide the shape first — service boundaries, interface contracts, NFR budgets as real numbers, a threat model, and the ADRs that record why — at the Shape stage between product and the build skills, precisely enough that frontend, backend, data, and ai build the right thing in parallel without re-deriving it.

# natural language — no flags, no fixed pipeline /architecture design a multi-tenant refund-automation agent — boundaries, contracts & SLOs

runs onClaude CodeCodexCursorAntigravityopencodeGrok BuildHermes

The router is the skill. There is no fixed pipeline to run start-to-finish — each job stands alone and enters where your question is. The animation traces one path; the sections below map the whole surface it routes across.

Own the decision, not the code

architecture owns the Shape stage — the consequential, hard-to-reverse decisions between product (what to build and why) and the build skills (the production code): service boundaries, public API shape, data-store and consistency choice, the auth model, SLO targets. It hands those decisions down as a contract, a budget, a threat model, and a durable record — and recommends the build skills by name rather than silently doing their work.

architecture owns

the decision, contract, budget & threat model

  • boundaries — bounded contexts, monolith-vs-micro, coupling
  • contracts — the API/event interfaces FE + BE build to in parallel
  • NFR budgets — perf/SLO/scale/cost as numbers, not "-ilities"
  • threat model — STRIDE register, auth & zero-trust posture
  • the decision record — ADRs + fitness-function governance
  • migration shape — strangler-fig, 7 Rs, cutover gate

hands off to

contribute to; own none

  • product — upstream: discovery, PRD, prioritization
  • frontend · backend — production code behind the contract
  • data · ai — pipelines, stores, model/agent implementation
  • design — UX, UI, interaction & states
  • quality — load-testing, independent vuln scanning
  • operate — runtime SLO monitoring, deploy pipelines

Own the shape, not the implementation behind it. When compatible upstream artifacts are supplied — a PRD, a product handoff, an existing ADR log — architecture uses them without silently overriding decisions already made.

The faceted router

SKILL.md is a router, not a script. Requirements are gated first; then every request selects the smallest sufficient route: one primary job — the eight below — combined with at most one surface overlay that reshapes boundaries, contracts, and budgets for the system type. Read the selected references completely; load two or three at most, never the whole pack. Eight jobs and five surfaces compose into 8 × 5 = 40 routes — from a single-ADR two-file read to a full architecture pass — without ever reading all fourteen references at once.

facetoptionsrule
① Primary job system design · decomposition · contracts · data · NFR budgets · security · migration · ADR & governance Exactly one. Pick the single job the request needs; the default entry is system design.
② Surface overlay web / SaaS · mobile · agentic · data-intensive · internal platform At most one. It reshapes boundaries, contracts, and budgets for the system type — agentic always added when a model acts.
Requirements before solution. A route never begins at a design on an unvalidated set of requirements. Functional requirements, NFRs, and constraints are captured — and any contradiction (e.g. "full network isolation" vs "real-time public ingestion") surfaced and resolved — before a single boundary is drawn.

The eight primary jobs

Each job is one reference, read fully only when its route is selected — grounded in named canon, producing a checkable artifact. This is the whole surface, not a headline slice.

I need to…ReadGrounded inProduces
Design / architect the system, or review a design for gaps system-design.md C4 model · arc42 · 4+1 views · back-of-envelope numbers Requirements gate, leveled C4/arc42 design, trade-offs, capacity math
Break this up · "should this be a microservice" · fix coupling decomposition.md DDD bounded contexts · Khononov coupling · monolith-first (Fowler) · Team Topologies Bounded contexts, monolith/modular/micro call with a named disintegrator
Design the API · define the contract · version / deprecate contracts.md OpenAPI · AsyncAPI · REST / gRPC / GraphQL trade-offs · versioning Contract skeleton, versioning + deprecation plan, review checklist
Design data flow · choose consistency · CQRS / ES · identifiers data-architecture.md CAP / PACELC · DDIA concept map · CQRS / ES · outbox · microservices.io Consistency decision per flow, CQRS/ES score, store selection
Set perf / SLO / scaling / cost targets · Well-Architected review nfr-budgets.md Well-Architected pillars · Google SRE error budget · numeric budgets Perf-budget table, SLO + error budget, scaling triggers, WA self-audit
Threat-model · decide the auth / authz model · tenant isolation security-architecture.md STRIDE · Threat Modeling Manifesto · zero-trust · OWASP STRIDE register, auth/authz decision, zero-trust posture, data-classification
Migrate / replatform · extract a service · deprecate an API migration.md Strangler Fig (Fowler) · AWS 7 Rs · extraction order · comparison-read cutover 7 Rs / Strangler pick, extraction order, cutover gate, deprecation timeline
Write an ADR · record / govern a decision · detect drift adr-and-governance.md Nygard / MADR ADR · Y-Statement · fitness functions (Ford / Parsons / Kua) ADR (right-weight), lifecycle/immutability rule, drift detection, fitness functions

Full router table & invariants: SKILL.md.

system design

C4 modelarc42 (12 sections)4+1 viewsback-of-envelope math

decomposition

DDD bounded contextscontext-map patternsKhononov Balancing CouplingMonolithFirst (Fowler)Team Topologies

contracts

OpenAPI · AsyncAPIREST / gRPC / GraphQLversioning & deprecationzalando / MS API rulebooks

data

CAP · PACELCDDIA concept mapCQRS / Event SourcingOutbox · SagaData Mesh

NFR budgets

Well-Architected pillarsSRE SLO / error budgetCircuit Breaker · Bulkhead12-factor

security

STRIDEThreat Modeling Manifestozero-trustOWASP

migration & governance

Strangler FigAWS 7 RsADR (Nygard · MADR)Y-Statementfitness functions

Five surface overlays

One overlay, at most, reshapes the job for the system type — the same contract job is bounded differently for a multi-tenant SaaS than for a data platform. Agentic is the first-class differentiator, expanded below.

Web / SaaS surface-web-saas.md

Multi-tenant web app (the default): tenant isolation (silo / pool / bridge), 3-tier + per-client BFF, OIDC tenant resolution as first-class structure.

reshapestenancy model · BFF · isolation tier

Mobile surface-mobile.md

Native client: the client pattern (MVVM / TCA / Clean / RIBs), offline / sync with a stated conflict rule, single source of truth & unidirectional data flow.

reshapesclient arch · offline-sync · SSOT/UDF

Agentic / LLM flagship

A model acts under non-determinism. Harness design, workflow-vs-agent, multi-agent economics, RAG topology, memory tiers, eval-as-gate, and agent security — it changes topology, not just a component.

reshapestopology · eval gate · agent security

Data-intensive surface-data-intensive.md

Analytics / ML platform: the operational ↔ analytical boundary, batch-vs-stream, and mesh-vs-centralized ownership as the load-bearing decisions.

reshapesop/analytical split · batch/stream · mesh

Internal platform surface-internal-platform.md

Internal tool / developer platform (IDP): Team Topologies bridge, platform-as-product threshold, and the explicit "don't build a platform yet" gate.

reshapesplatform threshold · self-service · Conway

The agentic flagship

Generic system design is well-covered; agentic-system architecture is the open frontier. When a model acts under uncertainty, the architecture questions change: reliability is empirical, the topology is a decision, context is a finite budget, and the eval set is what gates release. The reference carries the 2026 primary material — thin-model / thick-harness, multi-agent economics, agent memory tiers, agent security — that the textbooks don't yet.

The harness carries the reliability — and the eval set is the acceptance gate.

An architecture decision, not a prompt tweak

# the model is thin; the harness is where the reliability lives
topology:   workflow       # workflow | single-agent | multi-agent
context:    finite budget  # compaction + JIT retrieval, not a dump
memory:     [episodic, semantic, procedural]
retrieval:  RAG + reranker # topology is an architecture choice
eval_gate:  40-case set   # blocks release on regression
hitl:       approve on irreversible action
security:   [prompt-injection, tool-scope, exfil]

Escalate topology only when it pays

  • Workflowpredefined steps — the default; cheapest, most reliable
  • Single agentdynamic tool loop — when the path can't be pre-drawn
  • Multi-agentonly when parallelizable & value clears the 4×/15× token cost

Non-determinism is a design constraint

  • eval-in-loopre-run every time the model or prompt changes
  • memory tiersepisodic / semantic / procedural, chosen per job
  • agent securitytool scope & blast radius before autonomy
The sharp distinction: the eval set is an acceptance gate — pre-release, pass/fail, blocking on regression — not a QA afterthought and not a runtime dashboard (that belongs to operate). Multi-agent isn't the "modern" default; below roughly a 45% single-agent error rate it rarely earns its 4–15× token cost. Agent-specific failure modes are first-class architecture concerns, each mapped to an eval case or a threat-model row:
prompt injectiontool-scope over-grantcontext poisoningdata exfiltrationrunaway cost / loops

The universal invariants

Six rules govern every route, whichever references it loads — the behavioral spine, condensed.

What a pass produces

Architecture's deliverables are decisions made durable. A full pass emits up to five downstream artifacts — plus the DDD canvases and arc42 skeleton where the job calls for them. Each records the decision and options, the trade-off accepted, facts/decisions/assumptions distinguished, and the reversibility lens on any hard-to-reverse call. Fillable templates ship in the pack.

Solution architecture doc

assets/solution-architecture-doc.md

arc42-shaped: documents decisions and contracts, not implementation — survives a framework change.

API / event contracts

OpenAPI · AsyncAPI skeleton

The interfaces frontend and backend build to in parallel — versioned, with a deprecation plan.

NFR budget worksheet

assets/nfr-budget-worksheet.md

Perf, scale, reliability, and cost as numbers — SLO targets, error budgets, scaling triggers.

ADRs

assets/adr-template.md

The durable decision log — cite, don't re-litigate. MADR / Nygard / Y-Statement variants.

Threat-model register

assets/threat-model-register.md

A STRIDE table with a self-audit count — backend implements, quality independently verifies.

DDD canvases & arc42

bounded-context · aggregate-design · arc42-skeleton

Boundary and aggregate canvases (ddd-crew) and the arc42 skeleton, where the job calls for them.

The handoff seam

When downstream build work is expected, architecture emits a compact handoff.yaml beside the human artifacts — a routing index into the solution doc, contracts, budgets, ADRs, and threat model, never a copy of them. Standalone by default; the companion appears only in pipeline mode, when a consumer will actually read it.

architecture decides

skill: architecture
status: complete
objective: ""   # only required field
artifacts_created: [contracts,
  nfr-budgets, adrs, threat-model]
decisions: · assumptions: · constraints:
risks: [R-01, R-04]  # pointers, by id
validation: performed / remaining
recommended_next: frontend · backend
  · data · ai · quality

frontend · backend

The API/event contracts, NFR budgets that gate technical choices, and the ADRs — enough to build behind the interface in parallel, without re-deriving the shape.

data · ai · quality

Store & consistency decisions, the threat-model register to implement and independently verify, and the eval thresholds an agentic system must clear.

Seam discipline. The human artifacts are the real deliverables; if a consumer needs more than the index gives, the artifact itself is incomplete — the yaml never grows to compensate. Every downstream skill tolerates every field but objective being absent.

Start here

Install once. It's a plain SKILL.md router — no flags, no config, no scripts — so it activates on natural-language phrasing ("design the system", "should this be a microservice", "write an ADR", "threat-model this") rather than a fixed command.

# skills.sh ecosystem (installs globally to supported clients) npx skills add gabros20/architecture-skill -g -y # clone + installer (per-host targets) git clone https://github.com/gabros20/architecture-skill && cd architecture-skill ./install.sh codex # or: claude | cursor | antigravity | opencode | grok | hermes | agents | all # use — natural language, any host /architecture design the API contract for our billing service, versioned /architecture architect our support agent — topology, eval gate & agent security # → agentic overlay /architecture set SLO + perf budgets and run a Well-Architected self-audit

The same install runs on any Agent Skills host. Codex installs to ${CODEX_HOME:-$HOME/.codex}/skills and triggers with $architecture; agents remains a separate cross-agent installation target.

install targets by host
hostinstall targetcommand
Claude Code~/.claude/skills./install.sh claude
Codex${CODEX_HOME:-$HOME/.codex}/skills./install.sh codex
Cross-agent path~/.agents/skills./install.sh agents
Cursor CLI~/.cursor/skills./install.sh cursor
Antigravity (IDE + agy)~/.gemini/…/skills./install.sh antigravity
opencode~/.config/opencode/skills./install.sh opencode
Grok Build~/.grok/skills./install.sh grok
Hermes~/.hermes/skills./install.sh hermes

Prefer npx skills add gabros20/architecture-skill -g -y when you have Node — it maps supported clients itself.

what's in the repo
skills/architecture/ the skill: SKILL.md (router) + 14 references/ + assets/ docs/ installation · usage · recipes site/ this guide — deploys to architecture-skill.vercel.app install.sh installer (claude | codex | cursor | antigravity | opencode | grok | hermes | agents | all) README.md · CHANGELOG.md · LICENSE

More docs: docs/installation.md · docs/usage.md · docs/recipes.md.