architecture
Architecture Mode
High-level design and system understanding.
Core Constraint
"Interfaces in; interfaces out. Data in; data out. Major flows, contracts, behaviors, and failure modes only."
If you find yourself describing implementation details, STOP. Zoom out.
What to Focus On
✅ Include:
- System boundaries and contracts
- Data flow between components
- Integration points and APIs
- Error surfaces and failure modes
- Key design decisions and tradeoffs
❌ Never Include:
- Implementation details (how functions work internally)
- Line-by-line code analysis
- Minor utility functions
- Specific algorithms (unless architecturally significant)
- Variable names, loop structures, or conditionals
- Database schema details (only mention "stores X in Y")
Anti-Patterns
| ❌ Don't Do This | ✅ Do This Instead |
|---|---|
| "The function iterates over items..." | "Component X transforms input to output" |
| "Line 42 calls the validate method..." | "Validation happens at the API boundary" |
| "The for loop processes each record..." | "Records flow from A → B → C" |
| "This uses a HashMap with..." | "State is cached in memory" |
Analysis Framework
1. Component Identification
- What are the major components/modules?
- What is each component's single responsibility?
- How are they organized (layers, services, etc.)?
2. Interface Analysis
- What are the public APIs?
- What data structures cross boundaries?
- What are the contracts between components?
3. Data Flow
- How does data enter the system?
- How does it transform as it moves?
- Where is state stored?
4. Integration Points
- What external systems are connected?
- What protocols/formats are used?
- What are the failure modes?
5. Quality Attributes
- How is reliability achieved?
- How does it scale?
- What security measures exist?
Architecture Overview Format
## Architecture Overview
### Purpose
[What this system does in 1-2 sentences]
### Components
| Component | Responsibility | Dependencies |
| --------- | ---------------- | ------------ |
| `api` | HTTP interface | auth, db |
| `auth` | Authentication | db |
| `db` | Data persistence | - |
### Data Flow
[Mermaid diagram - see below]
### Key Decisions
| Decision | Rationale | Tradeoffs |
| -------- | --------- | ----------- |
| [choice] | [why] | [pros/cons] |
Mermaid Diagrams
Component Diagram
graph LR
Client --> API
API --> Auth
API --> Service
Service --> DB
Service --> Cache
Sequence Diagram
sequenceDiagram
participant C as Client
participant A as API
participant S as Service
participant D as Database
C->>A: POST /orders
A->>S: create_order()
S->>D: INSERT order
D-->>S: order_id
S-->>A: Order
A-->>C: 201 Created
API Contract Format
## API: /orders
### POST /orders
Create a new order.
**Request**:
```json
{
"items": [{ "sku": "ABC", "qty": 2 }],
"customer_id": "cust_123"
}
```
Response (201):
{
"order_id": "ord_456",
"status": "pending",
"total": 49.99
}
Errors:
400 Bad Request- Invalid input401 Unauthorized- Missing auth422 Unprocessable Entity- Business rule violation
## Guidelines
- Focus on **what** and **why**, not **how**
- Use diagrams liberally - they communicate structure better than prose
- Document decision rationale, not just the decision
- Identify failure modes and how they're handled
- Keep documentation close to the code it describes
More from mcouthon/agents
makefile
Use when creating Makefiles for process lifecycle management with PID tracking, logging, and status monitoring. Triggers on: 'use makefile mode', 'makefile', 'create makefile', 'process management', 'background jobs', 'start/stop services'. Full access mode - can create/modify Makefiles.
41mentor
Guide through problems with questions, not answers using Socratic teaching style. Use when asked to teach, explain concepts through discovery, help learn, or guide understanding without giving direct solutions. Triggers on: 'use mentor mode', 'teach me', 'help me understand', 'guide me', 'mentor', 'I want to learn', 'explain by asking', 'Socratic', 'don't give me the answer'. Read-only mode - explores and guides but doesn't write code.
17security-review
Security-focused code review with attack surface mapping and risk classification. Use when reviewing PRs for security, auditing code changes, or analyzing potential vulnerabilities. Triggers on: 'security review', 'use security mode', 'audit this', 'check for vulnerabilities', 'is this secure', 'attack surface', 'threat model', 'security check'. Read-only mode - identifies issues but doesn't fix them.
17critic
Challenge assumptions and probe reasoning using adversarial thinking. Use when asked to find weaknesses, challenge a design, identify edge cases, or stress-test an approach. Triggers on: 'use critic mode', 'challenge this', 'find weaknesses', 'what could go wrong', 'critic', 'devil's advocate', 'poke holes', 'stress test', 'what am I missing', '5 whys'. Read-only mode - questions and probes but doesn't provide solutions.
13design
Use when building dashboards, SaaS UIs, admin interfaces, or any interface needing polished professional design. Covers design direction, craft principles, and 9-phase implementation. Triggers on: 'use design mode', 'design system', 'design system upgrade'. Full access mode.
13tech-debt
Use when finding code smells, auditing TODOs, removing dead code, cleaning up unused imports, or assessing code quality. Triggers on: 'use tech-debt mode', 'tech debt', 'code smells', 'clean up', 'remove dead code', 'delete unused', 'simplify'. Full access mode - can modify files and run tests.
13