Use when designing, updating, or exploring system architecture with the C3 methodology - iteratively scope through hypothesis, exploration, and discovery across Context/Container/Component layers
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Transform requirements into structured C3 (Context-Container-Component) architecture documentation through iterative scoping. Also supports exploration-only mode for reading and navigating existing docs.
Core principle: Form hypothesis, explore to validate, discover impacts, iterate until stable. Uncertainty is expected and healthy.
Announce at start: "I'm using the c3-design skill to guide you through architecture design."
Determine the user's intent to choose the right mode:
| User Intent | Mode | Phases |
|---|---|---|
| "What's the architecture?" / "Give me an overview" | Exploration | Read TOC, present overview, navigate on demand |
| "How does X work?" / "Where is Y handled?" | Exploration | Read TOC, find matching docs, present focused view |
| "I need to add/change/fix..." | Design | Full design workflow (Phases 1-4) |
| "Why did we choose X?" | Exploration | Present ADR list, load specific decisions |
When user wants to understand (not change) the architecture:
Load TOC for inventory
cat .c3/TOC.md
Parse TOC for quick reference:
Present based on intent:
General orientation:
## {System Title} Architecture
**Purpose:** {from Context overview}
### System at a Glance
- **Containers:** {count} deployable units
- **Components:** {count} internal parts
- **Decisions:** {count} ADRs
### Container Overview
| ID | Container | Purpose |
|----|-----------|---------|
| `c3-1` | {title} | {summary from TOC} |
What would you like to explore?
Focused exploration: Load relevant docs based on user's area of interest.
Decision inquiry: Present ADR list and load specific decisions.
Navigate on demand:
Key principle: Don't load everything upfront. Load on demand based on user's next question.
When user wants to make changes, use the full design workflow below.
IMMEDIATELY after announcing, create TodoWrite items:
Phase 1: Surface Understanding - Read TOC, form hypothesis
Phase 2: Iterative Scoping - HYPOTHESIZE → EXPLORE → DISCOVER until stable
Phase 3: ADR Creation - Create ADR file in .c3/adr/ (MANDATORY)
Phase 4: Handoff - Execute settings.yaml handoff steps
Rules:
in_progress when startingcompleted only when gate criteria metSkipping phases = skill failure. No exceptions.
| Phase | Key Activities | Output | Gate |
|---|---|---|---|
| 1. Surface Understanding | Read TOC, parse request, form hypothesis | Initial hypothesis | TodoWrite: phases tracked |
| 2. Iterative Scoping | HYPOTHESIZE → EXPLORE → DISCOVER loop | Stable scope | Scope stable, all IDs named |
| 3. ADR + Plan Creation | Document journey, changes, verification, AND implementation plan | ADR with Plan in .c3/adr/ | ADR file exists with Implementation Plan section |
| 4. Handoff | Execute settings.yaml handoff steps | Tasks/notifications created | Handoff complete |
MANDATORY: You MUST create TodoWrite items for each phase. No phase can be skipped.
Every design change produces both an ADR and an Implementation Plan. They are two sides of the same coin:
ADR (medium abstraction) Plan (low abstraction)
├── Changes Across Layers ───────────→ Code Changes
├── Verification ────────────────────→ Acceptance Criteria
└────────────────── Mutual Reference ─────────────────────┘
ADR Lifecycle:
proposed → accepted → implemented
↓ ↓
superseded/deprecated
Note: Only
implementedADRs appear in the Table of Contents. Usec3-auditto verify implementation and transition status.
Rules:
Required: .c3/ directory with TOC.md must exist.
Pre-flight sanity checks (especially when auditing examples):
examples/.c3/TOC.md in this repo) instead of hopping between files.If .c3/ doesn't exist:
c3-adopt skill to initialize C3 documentation for this project"c3-adopt skill will discover the project structure and create initial documentsLoad project settings (if exists):
cat .c3/settings.yaml 2>/dev/null
If .c3/settings.yaml exists, apply preferences throughout the session:
diagrams - Use specified tool and patterns when creating diagramscontext/container/component - Follow layer-specific guidance when writing docsguard - Respect guardrails as constraints during designhandoff - Follow post-ADR steps after decision is acceptedSettings are optional - if missing, use sensible defaults.
Goal: Form initial hypothesis about what's affected.
Actions:
Read TOC for current state
cat .c3/TOC.md
Parse user request
Form initial hypothesis (THINKING, not asking)
<extended_thinking> <goal>Form initial hypothesis about which C3 layer and element is affected</goal>
<layer_detection> Parse user request for layer signals:
CONTEXT signals (system-wide):
CONTAINER signals (service-level):
COMPONENT signals (implementation-level):
<hypothesis_formation> Based on signals:
<confidence_assessment> HIGH if: Clear layer signal, maps directly to TOC ID MEDIUM if: Some ambiguity, multiple possible elements LOW if: Vague request, could be multiple layers
If LOW confidence: Explore more before committing to hypothesis </confidence_assessment> </extended_thinking>
Output: Abstract, high-level hypothesis to explore.
Goal: Validate and refine hypothesis until scope is stable.
┌────────────────────────────────────────────────────────┐
│ │
│ HYPOTHESIZE (abstract, from TOC + understanding) │
│ ↓ │
│ EXPLORE (investigate with lookup patterns + sub-skills)│
│ │ │
│ ├── Socratic questions as needed │
│ │ (confirm understanding along the way) │
│ ↓ │
│ DISCOVER (what did exploration reveal?) │
│ │ │
│ ├── Need to revise? → Update hypothesis, loop │
│ │ │
│ └── Stable? → Exit to Phase 3 │
│ │
└────────────────────────────────────────────────────────┘
Form or update hypothesis based on current understanding:
<thinking> Update hypothesis based on what I've learned: - Current hypothesis: [X] because [reasoning] - Alternative: Could be [Y] if [condition] - Document IDs involved: [list from TOC] - Confidence level: High/Medium/Low - What would change my mind? </thinking>This is internal reasoning, not questions to user.
Investigate hypothesis in 4 directions:
| Direction | Question | How |
|---|---|---|
| Isolated | What changes directly at this element? | Read document by ID (see lookup-patterns.md) |
| Upstream | What feeds into this? Dependencies? | Read related docs |
| Adjacent | What's at same level? Siblings? | Read same-layer docs |
| Downstream | What does this affect? Consumers? | Read dependent docs |
Use sub-skills for layer-specific exploration:
c3-context-design - Explore Context-level impactc3-container-design - Explore Container-level impactc3-component-design - Explore Component-level impactID-based lookup patterns (from lookup-patterns.md):
# Context: cat .c3/README.md
# Container: cat .c3/c3-{N}-*/README.md
# Component: cat .c3/c3-{N}-*/c3-{N}{NN}-*.md
# ADR: cat .c3/adr/adr-YYYYMMDD-slug.md
Socratic questions during exploration to confirm understanding:
Assess what exploration revealed:
<extended_thinking> <goal>Evaluate exploration results and decide whether to iterate or exit</goal>
<impact_classification> Classify each finding by direction:
UPSTREAM (higher level) findings:
ADJACENT (same level) findings:
DOWNSTREAM (lower level) findings:
NO NEW findings:
<scope_stability_check> Questions to determine stability:
ELIF adjacent_impacts_expanding THEN
ELIF only_downstream_or_none THEN
<iteration_counter> Track iterations to prevent infinite loops:
| Discovery | Signal | Action |
|---|---|---|
| Impact at higher abstraction | Bigger than thought | Form new hypothesis at higher level, loop |
| Impact at same level widely | Scope expansion | Expand hypothesis, continue exploring |
| Impact only downstream | Contained | Scope is stable, proceed |
| No new impacts | Complete | Exit to Phase 3 |
Key principle:
EXIT GATE - ALL must be true:
| Criterion | Check | If No |
|---|---|---|
| Complete ID list | Can name ALL affected documents by ID | Continue exploring |
| Impact clarity | Know WHY each document is affected | Ask clarifying questions |
| No upstream surprises | Last round revealed no new upstream impacts | Revise hypothesis |
| Socratic confirmation | Questions validated understanding | Ask more questions |
<thinking> Internal verification: - Documents affected: [list IDs] - Why each affected: [brief reason per ID] - New upstream impacts this round: [yes/no, list if yes] - Socratic confirmation status: [confirmed/pending] </thinking>Gate passed? Exit to Phase 3 (ADR Creation) Gate failed? Another iteration needed
MANDATORY: Phase 3 (ADR Creation) cannot be skipped.
You CANNOT:
Until you have created an ADR file in .c3/adr/.
Goal: Document the decision AND the implementation plan as an inseparable pair.
This phase is NOT optional. You must create an ADR with Implementation Plan before any document updates.
Determine ADR filename:
today=$(date +%Y%m%d)
# Use: .c3/adr/adr-YYYYMMDD-{slug}.md
Create ADR using template: See adr-template.md for full template.
ADR Structure Overview:
---
id: adr-YYYYMMDD-{slug}
title: [Decision Title]
status: proposed
date: YYYY-MM-DD
---
# [Decision Title]
## Status
## Problem/Requirement # What triggered this
## Exploration Journey # hypothesis -> explore -> discover
## Solution # Approach formed through exploration
## Changes Across Layers # Specific changes per C3 document
## Verification # Checklist from scoping
## Implementation Plan # MANDATORY
### Code Changes # Maps from Changes Across Layers
### Dependencies # Order of operations
### Acceptance Criteria # Maps from Verification
## Related
Key principle: Changes Across Layers -> Code Changes (1:1), Verification -> Acceptance Criteria (1:1)
<extended_thinking> <goal>Verify ADR and Plan are coherent before marking Phase 3 complete</goal>
<coherence_check> For each item in "Changes Across Layers":
For each item in "Verification":
Mapping must be complete:
<mutual_reference_verification> ADR references Plan:
Plan references ADR:
If mapping is incomplete → DO NOT proceed to Phase 4 </mutual_reference_verification> </extended_thinking>
Phase 3 Gate - Verify ADR + Plan coherence:
# Verify ADR was created
ls .c3/adr/adr-*.md | tail -1
# Verify Implementation Plan section exists
grep -q "## Implementation Plan" .c3/adr/adr-*.md && echo "Plan section: OK"
# Verify Code Changes table exists
grep -q "### Code Changes" .c3/adr/adr-*.md && echo "Code Changes: OK"
# Verify Acceptance Criteria table exists
grep -q "### Acceptance Criteria" .c3/adr/adr-*.md && echo "Acceptance Criteria: OK"
Gate criteria (ALL must pass):
If any gate fails, STOP. Complete the ADR+Plan before proceeding.
After ADR+Plan verified:
build-toc.sh scriptGoal: Execute post-ADR steps configured in settings.yaml.
Step 1: Load handoff configuration
# Check for settings.yaml
cat .c3/settings.yaml 2>/dev/null | grep -A 20 "^handoff:" || echo "NO_HANDOFF_CONFIG"
Step 2: Determine handoff actions
<thinking> Determine handoff approach: - Does settings.yaml exist? [yes/no] - Does it have a `handoff:` section? [yes/no] - If yes: What steps are configured? - If no: Use default handoff (summarize, list docs, offer tasks)Handoff steps to execute:
| If settings.yaml has... | Then do... |
|---|---|
handoff: section exists | Execute each step listed |
No handoff: section | Use defaults below |
| No settings.yaml | Use defaults below |
Default handoff steps (when no config):
Step 3: Execute handoff
For each step in handoff config (or defaults):
Step 4: Verify handoff complete
Confirm with user:
.c3/adr/adr-YYYYMMDD-slug.md"Phase 4 Gate: User acknowledges handoff is complete.
Use the Skill tool to invoke during exploration:
| Skill | When to Use |
|---|---|
c3-adopt | Initialize C3 documentation (if .c3/ doesn't exist) |
c3-context-design | Explore Context-level impact |
c3-container-design | Explore Container-level impact |
c3-component-design | Explore Component-level impact |
c3-config | Configure project settings |
c3-audit | Verify docs match code after implementation |
References (for lookup patterns):
TOC Rebuild: Use plugin's build-toc.sh script (ask Claude to "rebuild the TOC")
Goal: sanity check examples/.c3 before sharing with others.
examples/.c3/TOC.md, scan backend components, check frontend client; confirm legacy CON/COM prefixes caused collisions (e.g., before: COM-004 reused by logger and API client, REST routes sharing numbers).C3-<C>/C3-<C><NN> (e.g., C3-106-rest-routes for REST routes, C3-201-api-client for frontend API client), drop legacy duplicates, and refresh index links.| Principle | Application |
|---|---|
| Hypothesis first | Form from TOC, don't ask directly for location |
| Explore to validate | Investigate before confirming |
| Socratic during exploration | Questions confirm understanding, not discover location |
| ID-based navigation | Use document/heading IDs, not keyword search |
| Higher = bigger impact | Upstream/higher-level discoveries trigger revisit |
| ADR as stream | Capture journey, not just final answer |
| Iterate freely | Loop until stable, don't force forward |
src/handlers/auth.ts:validateToken().| Rationalization | Counter |
|---|---|
| "No time to refresh the TOC, I'll just skim files" | Stop and build/read the TOC first; C3 navigation depends on it. |
| "Examples can keep duplicate IDs, they're just sample data" | IDs must be unique or locate/anchor references break—fix collisions before scoping. |
| "I'll ask the user where to change docs instead of hypothesizing" | Hypothesis bounds exploration and prevents confirmation bias; form it before asking questions. |
| "The scope is clear, I can skip the ADR" | NO. ADR is mandatory. It documents the journey and enables review. |
| "I'll just update the docs and mention what I did" | NO. ADR first, then doc updates. This is non-negotiable. |
| "I'll add the Implementation Plan later" | NO. ADR and Plan are created together. Plan is part of Phase 3 gate. |
| "The code changes are obvious, no need to list them" | NO. Explicit mapping enables audit verification. List them. |
| "Handoff is just cleanup, I can skip it" | NO. Handoff ensures tasks are created and team is informed. Execute it. |
| "No settings.yaml means no handoff needed" | NO. Use default handoff steps. Always confirm completion with user. |
Red flags that mean you should pause:
.c3/TOC.md missing or obviously stale.Surface → Hypothesis at Container level → Explore up to Context, down to Components → ADR with cross-layer changes
Surface → Hypothesis at Component level → Explore if isolated or upstream cause → ADR focused on Component, verify no upstream issues
Surface → Hypothesis at Context level → Explore all downstream Containers/Components → Large ADR with many changes
Surface → Hypothesis at Component level → Explore adjacent components → ADR focused on Component layer