Architecture (v2.2.1)
High-performance systems designer and guardian of evolutionary simplicity. "Architecture is what remains when you take all the code away."
🔒 Prerequisites (Mandatory)
This skill operates WITHIN the SDD framework. Before starting any technical execution:
0. Mode Check: Verify the current operational mode (.hub-mode) and apply the guidelines of the token-distiller skill.
- Context Check: Rehydrate the context by reading
.specs/project/STATE.md,.specs/project/MEMORY.md, and.specs/project/LEARNINGS.md. - Knowledge Check: Follow the Knowledge Verification Chain (Codebase Docs -> Project Docs -> Existing Code -> Web Search).
- Spec Check: Does the
spec.mdfile exist with clear requirements and Acceptance Criteria (ACs)? (BDD mandatory for Medium+). - Plan Check: Does the
plan.mdfile define the architecture, schemas, and include Mermaid diagrams? - Contract Check: Was the
contract.mdfile established with validation sensors? - Task Check: Is the task list in
tasks.mddetailed and atomized?
Goal
Empower the agent to design high-quality and complex software architectures, spanning distributed systems (CQRS, Event-Driven) and modular monoliths. The skill ensures that every decision is justified by trade-offs, prioritizes simplicity, and is protected by Fitness Functions and visually documented via Mermaid.
Workflow (4 Phases)
Phase 1: DISCOVERY — Requirements & Constraints
- Map Terrain: Identify technical, financial, and team constraints.
- Identify Load Patterns: Differentiate read vs. write volumes (indicative of CQRS).
- Need for Decoupling: Evaluate if synchronous communication is a bottleneck (indicative of Event-Driven).
- Memory Capture: Review previous ADRs in
.specs/architecture/to ensure continuity.
Phase 2: SPECIFY — Trade-offs & Design
- Explore Alternatives: Compare approaches (Simple vs. Scalable) in a Trade-off Matrix.
- Consistency Analysis: Evaluate if the business requires Strong Consistency or tolerates Eventual Consistency.
- Visual Modeling: Create Mermaid diagrams (System Map, Sequence) to validate the flow.
- ADR Creation: Document the technical choice by creating a new ADR file in
.specs/architecture/following the official template.
Phase 3: IMPLEMENT — Pattern Selection & Logic
- Command/Query Modeling: If using CQRS, clearly define Read and Write models.
- Event Design: Define message schemas, idempotency strategies, and DLQs.
- Design Components: Apply SOLID, DRY, and YAGNI. Ensure components are focused and decoupled.
- Fitness Functions: Define automated tests/scripts to protect architectural integrity.
Phase 4: REVIEW — Documentation & Governance
- Verdict via Sensors: Audit the delivery against the original
spec.mdandplan.mdusing evidence from code and tests. - Finalize ADR: Ensure the ADR reflects the final implementation and documented impacts.
- Update Knowledge Map: Update the visual architecture in the Central Knowledge Map (Global Mandates).
- Persistence: Capture new architectural patterns in
.specs/project/LEARNINGS.md.
Output Structure
The execution of this skill results in the following mandatory artifacts in .specs/architecture/:
| Artifact | Format | Description |
|---|---|---|
| ADR-NNN | .md |
Architecture Decision Record with justification and impact. |
| System Map | Mermaid | Renderable diagram of components and flows. Mandatory. |
| Fitness Specs | .py / .sh |
Definition of automated tests for architecture governance. |
| Trade-off Matrix | Table | Comparison between the analyzed alternatives. |
Quality Rules
- Simplicity First: Do not use CQRS or Events if a simple relational database solves the problem.
- Mandatory Idempotency: Every event-oriented design must provide for repeated processing without side effects.
- Fitness-Driven: Every important architectural constraint must have a way to be automatically validated.
- Visual-First: Every complex component or flow must be documented with Mermaid in the
System Map. - Justified Decisions: Structural changes require a documented "Why" (ADR).
Prohibited
- NEVER propose distributed systems without an operational cost and latency analysis.
- NEVER use events for communication that requires an immediate (synchronous) response.
- NEVER ignore the complexity of managing eventual consistency on the front-end.
- NEVER start design without understanding throughput and availability requirements.
- NEVER create local memory files (
STATE.md, etc.); use.specs/project/. - NEVER rely on CLI tools for governance; the Markdown artifacts are the single source of truth.
References
references/architectural-principles.md— SOLID, KISS, YAGNI.references/cqrs-and-events.md— Command and event design.references/evolutionary-architecture.md— Fitness Functions and evolution.references/adr-template.md— Official ADR template.
version: "2.3.0"
feature_id: "HUB-ALIGNMENT"
phase: "VERIFY"
status: "COMPLETED"
last_update: "2026-05-06T13:16:19.372120Z"
evidence_checksum: "8e52f6a"