Ensures ADR and C4 diagram behaviors during all workflows. Use when loading context, discussing architecture, creating designs, or when "ADR", "architecture decision", "C4", "coupling", "cohesion", or "boundary" are mentioned. Activates during /arch:init, /context:load, /context:refresh, /spec:init, /define, /design, /deliver, /discern, /handoff, /diagnose, and /discover.
From genienpx claudepluginhub elmmly/genie-team --plugin genieThis skill is limited to using the following tools:
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Architecture knowledge lives in two artifact types that complement specs:
SPEC (WHAT)
/ \
/ \
ADR (HOW+WHY) -- C4 (CONTEXT MAP)
All three are persistent, first-class artifacts. Backlog items are transient; these are not.
Architecture Decision Records capture significant technical decisions using the Michael Nygard pattern.
docs/decisions/
ADR-000-use-adrs-for-architecture-decisions.md # bootstrapping record
ADR-001-{slug}.md
ADR-002-{slug}.md
Flat directory. No subdirectories. The domain field in frontmatter provides domain association.
Schema:
schemas/adr.schema.mdv1.0
Required: adr_version, type: adr, id (ADR-NNN), title, status, created, deciders
Optional: domain, spec_refs, backlog_ref, superseded_by, supersedes, tags
/define (proposed) → /design (accepted) → [lives indefinitely]
→ /design (superseded by new ADR)
→ /design (deprecated if no longer relevant)
/define when a behavioral delta involves an architectural choice/design after evaluating alternatives/designsuperseded_by points to the replacementCreate an ADR ONLY when BOTH conditions are true:
Do NOT create ADRs for: trivial decisions, single-option choices, easily reversible choices, or implementation details within a single component.
Sequential 3-digit zero-padded: ADR-000, ADR-001, ADR-002, etc.
To determine the next number: scan docs/decisions/ADR-*.md and increment the highest found.
C4 Mermaid diagrams provide the contextual map — how everything relates structurally.
docs/architecture/
system-context.md # Level 1: System and external actors
containers.md # Level 2: High-level containers/services
components/ # Level 3: Per-domain component diagrams
{domain}.md # One per domain, parallels docs/specs/{domain}/
Schema:
schemas/architecture-diagram.schema.mdv1.0
Required: diagram_version, type: architecture-diagram, level (1-3), title, updated, updated_by
Optional: domain (L3 only), backlog_ref, adr_refs, tags
| Level | File | Scope |
|---|---|---|
| 1 — System Context | docs/architecture/system-context.md | System and external actors |
| 2 — Container | docs/architecture/containers.md | High-level containers/services |
| 3 — Component | docs/architecture/components/{domain}.md | Per-domain components |
Level 4 (Code) is NOT supported. Source code is the code-level diagram.
Each diagram file contains:
type: architecture-diagram## Coupling Notes section — runtime, build-time, and data dependencies## Cohesion Assessment section — rates domain cohesion (HIGH/MEDIUM/LOW) with justification (Level 3 only)See schemas/architecture-diagram.schema.md for full color palette and node format.
Node format:
["<b>Title</b><br/> <br/><span>Responsibility</span><br/><span>Technology</span>"]
Key colors:
#ff2e97 (hot pink) on #2a0f1e#00fff5 (cyan) on #0d2a2a#b967ff (purple) on #1f0d2e#9d4edd (violet) on #1a0d24Diagrams not updated within 90 days are flagged as potentially stale by /context:load and /diagnose.
This skill activates during:
/arch:init — Bootstrap ADR-000 and initial C4 diagrams for existing projects/context:load — Report ADR count by status and diagram staleness/context:refresh — Detect drift between diagrams and code structure/spec:init — Generate initial C4 diagrams (L1-L2) from discovered domains/define — Create proposed ADRs when behavioral delta involves an architectural choice/design — Create accepted ADRs; update C4 diagrams when boundaries change/deliver — Read ADRs for implementation context (WHY constraints exist)/discern — Verify ADR compliance; check for boundary violations/handoff — Inject ADR-specific transition guidance into handoff output/diagnose — Coupling violations, cohesion drift, ADR health, diagram staleness/discover — Surface existing ADRs as context for explorationAll commands that read ADRs follow this pattern:
adr_refs in the backlog item or design document frontmatteradr_refs is present: Read each referenced ADR file from docs/decisions/adr_refs is missing: Scan docs/decisions/ADR-*.md for ADRs matching the domain or tagsdocs/decisions/ does not exist: Warn and continue:
No ADRs directory found. Architecture decisions are not being tracked.
All commands that read C4 diagrams follow this pattern:
docs/architecture/ directoryNo architecture directory found. C4 diagrams are not being maintained.
Creates proposed ADRs when a behavioral delta involves an architectural choice:
docs/decisions/ADR-*.md
b. Create docs/decisions/ADR-{NNN}-{slug}.md with status: proposed
c. Fill in Context and Alternatives Considered sections (captured while the problem is fresh)
d. Leave Decision section with placeholder: "To be determined by /design"
e. Add adr_refs to the backlog item frontmatterReads: docs/decisions/ADR-*.md (for numbering and dedup)
Writes: docs/decisions/ADR-{NNN}-{slug}.md (proposed), backlog frontmatter adr_refs
Creates accepted ADRs and updates C4 diagrams:
ADR Behavior:
proposed ADRs from /define)proposed ADR exists for this decision: Complete the Decision section, update status: accepted
c. If no ADR exists: Create new docs/decisions/ADR-{NNN}-{slug}.md with status: accepted
d. If design supersedes an existing decision: Create new ADR, update old ADR with status: superseded and superseded_byadr_refs to the design document and backlog item frontmatterC4 Diagram Behavior:
-->) to reflect new dependencies
c. Update ## Coupling Notes section
d. Update frontmatter: updated date, updated_by: "/design", backlog_refReads: docs/decisions/ADR-*.md, docs/architecture/**/*.md
Writes: docs/decisions/ADR-{NNN}-{slug}.md, docs/architecture/**/*.md frontmatter and body
Reads ADRs for implementation context — does NOT create or modify them:
adr_refs or domain scan)adr_refs exist in backlog item frontmatter:
ADR compliance: This work references {N} architecture decision(s). Ensure the approach aligns with each accepted decision. Violations will be flagged during /discern review.
Reads: docs/decisions/ADR-*.md, docs/architecture/components/{domain}.md
Writes: Nothing (read-only for architecture artifacts)
Verifies ADR compliance and checks for boundary violations:
| ADR | Decision | Compliant? | Notes |
|-----|----------|------------|-------|
| ADR-001 | JWT refresh tokens | YES | Implemented as specified |
| ADR-003 | Auth service boundary | VIOLATION | Direct DB access bypasses service |
Reads: docs/decisions/ADR-*.md, docs/architecture/components/{domain}.md
Writes: Nothing (compliance output goes in the review document, not in ADRs)
Primary consumer of architecture artifacts for health analysis:
Coupling Analysis:
docs/architecture/containers.md) and component diagrams-->) from Mermaid diagrams to build declared dependency graphCohesion Analysis:
## Cohesion Assessment ratings — flag mismatchesADR Health:
docs/decisions//design activity, contradictory accepted ADRs, superseded ADRs still referenced by active codeDiagram Staleness:
updated field in each diagram's frontmatterReads: docs/decisions/ADR-*.md, docs/architecture/**/*.md, source code imports
Writes: Nothing (findings go in the diagnose report)
Generates initial C4 diagrams from discovered domains:
docs/architecture/system-context.md: System and discovered external actors
b. Level 2 — docs/architecture/containers.md: High-level containers inferred from project structure
c. Level 3 directory — mkdir docs/architecture/components/ (files created later by /design)updated_by: "/spec:init", current date## Coupling Notes with initial observations from project structure/design refines them as architecture evolvesReads: Project structure, discovered domains
Writes: docs/architecture/system-context.md, docs/architecture/containers.md, docs/architecture/components/ directory
Bootstraps architecture artifacts for existing projects:
docs/specs/{domain}/ for domain awarenessdocs/architecture/components/ directoryReads: CLAUDE.md, README.md, source directories, config files, docs/specs/{domain}/ (directory names only)
Writes: docs/decisions/ADR-000-*.md, docs/architecture/system-context.md, docs/architecture/containers.md, docs/architecture/components/ directory
Surfaces existing ADRs as context for exploration:
docs/decisions/ADR-*.md for ADRs related to the discovery topicReads: docs/decisions/ADR-*.md
Writes: Nothing (read-only)
Injects ADR-specific transition guidance into handoff output:
design → deliver handoff:
ADR context for Crafter: {N} architecture decision(s) constrain this work: {list ADR ids + 1-line summaries}. Implementation must align with these decisions. b. For
deliver → discernhandoff: ADR context for Critic: {If adr_refs exist: "Verify ADR compliance for: {list ADR ids}. Check for boundary violations."}
Reads: docs/decisions/ADR-*.md
Writes: Nothing (read-only — guidance injection only)
Reports architecture artifact status:
docs/decisions/ADR-*.md — count by status (proposed, accepted, deprecated, superseded)docs/architecture/**/*.md — check updated dates against 90-day thresholdReads: docs/decisions/ADR-*.md, docs/architecture/**/*.md
Writes: Nothing (read-only)
Detects drift between diagrams and code structure:
Reads: docs/architecture/**/*.md, project directory structure
Writes: Nothing (read-only — drift is reported, humans and /design fix it)
These rules apply to ALL commands that interact with architecture artifacts:
/spec:init and /arch:init create initial diagrams./define creates proposed, /design creates accepted or changes status/context:refresh and /diagnose report drift. Humans and /design update diagrams/diagnose detects coupling violations, reference the ADR that established that boundary