Create or update the shared architecture document at {ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md.
This is a shared project document — not tied to any specific change. It defines HOW the system is built and serves as context for all future changes.
Output: {ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md
Template: Use assets/architecture.md as the document structure.
Prerequisites: {ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/prd.md should exist. If not, ask user for a prd or suggest to "Create the PRD"
[!IMPORTANT]
This skill is designed to be used with the sdd-team:sdd-architect.agent agent.
Switch to it in the agent selector before invoking this skill for the full interactive experience.
If you are already using sdd-team:sdd-architect.agent, proceed with the workflow below.
Entry point
Check if architecture doc already exists
Read {ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md or any file provided by the user. If it exists:
- Summarize current content to the user.
- Ask: "Do you want to revise the existing architecture or start fresh? Skip this question if you detect from existing document or user input.
- If revise → follow Edit Architecture Workflow below.
- If fresh → follow Architecture Workflow below.
Context gathering (always)
- Read
{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/prd.md if it exists — primary requirements baseline.
- Read
{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/ux.md if it exists — UX implications.
- Read any additional files provided by the user (e.g.,
project-context.md, AGENTS.md) for technical preferences or constraints.
- Read project-level docs (README, package.json,
AGENTS.md, etc.).
- Ask the user for additional context if needed.
Architecture Workflow
Collaborative, step-by-step creation of architecture decisions that ensure consistent implementation.
Step 1 — Context gathering
- If no docs were found, ask: "Any PRD, UX specs, research docs, or project context files to load?"
- Read all provided files fully.
- If no PRD is available: gather requirements directly from the user via chat. Ask about: project goals, target users, core features, technical constraints, NFRs (performance, security, scale), and existing tech preferences. Use the answers as the requirements baseline.
- Look for existing technical preferences in
project-context.md, AGENTS.md, etc.
- Confirm gathered context with user before proceeding.
Output: ✅ Context loaded — ready to architect.
Step 2 — Project context analysis
Analyze loaded documents for architectural implications:
- Requirements analysis: Extract FRs, NFRs (performance, security, compliance), technical constraints.
- Scale assessment: Real-time needs, multi-tenancy, regulatory, integration complexity, data volume.
- UX implications (if UX spec provided): component complexity, animations, real-time updates, offline needs, accessibility level.
Present analysis back to user for validation — core functionality summary, critical NFRs, scale indicators, cross-cutting concerns. Ask: "Does this match your understanding?"
Step 3 — Starter template evaluation
- Check project context for existing tech preferences (languages, frameworks, databases, platforms).
- Ask about remaining preferences: team experience, deployment targets, integrations.
- Research current starter / scaffolding options for the project type.
- For each viable option, analyze: tech decisions it makes, patterns it establishes, dev experience features.
- Present options with trade-offs (adapt depth to user skill level). Get user's choice.
- Document: chosen starter, inherited tech decisions, CLI commands to scaffold.
Step 4 — Core architectural decisions
Facilitate decisions across these categories (skip what's already decided by starter/preferences):
- Data architecture: database, modeling approach, validation, migrations, caching
- Auth & security: authentication method, authorization patterns, encryption, API security
- API & communication: design patterns (REST/GraphQL), error handling standards, rate limiting
- Frontend (if applicable): state management, component architecture, routing, performance
- Infrastructure: hosting, CI/CD, environment config, monitoring, scaling
For each decision: present options with trade-offs, get user input, verify current versions, record choice with rationale.
Decision record format (for each item in architecture.md):
| Decision | Choice | Rationale |
|---|---|---|
| Database | PostgreSQL (Supabase) | Team familiarity, built-in auth, real-time subscriptions |
| Auth | Supabase Auth (JWT) | Free tier, social providers, row-level security |
| API style | REST + tRPC | Type-safe client, auto-generated TS types |
Step 5 — Implementation patterns & consistency rules
Define patterns to prevent implementation conflicts:
- Naming: database tables/columns, API endpoints, files, components, variables
- Structure: test locations, component organization, utilities, config files
- Formats: API response wrappers, error structures, date formats, JSON field casing
- Communication: event naming, state update patterns, logging formats
- Processes: error handling, loading states, retry logic, validation timing
For each area: present options, get user decision, document the chosen convention.
Step 6 — Project structure & boundaries
- Map requirements/epics to architectural components.
- Generate complete project directory tree (real files and folders — no generic placeholders).
- Define integration boundaries: API boundaries, component boundaries, data access patterns.
- Present structure, get user confirmation.
Step 7 — Validation
Run coherence checks on the complete architecture:
- Decision compatibility: all tech choices work together, versions compatible, no contradictions.
- Requirements coverage: every FR/NFR has architectural support.
- Implementation readiness: decisions complete enough for agents to implement consistently.
- Gap analysis: identify critical / important / nice-to-have gaps.
Present findings. Resolve critical issues with user before completing.
Step 8 — Completion
- Save final
architecture.md to {ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md using the template structure.
- Present a completion recap in chat: decisions made, patterns defined, structure finalized, gaps found.
Edit Architecture Workflow
Structured improvement of an existing architecture document.
Step 1 — Discovery
- Load
{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md completely.
- Ask: "What would you like to change?" Examples:
- Update technology choices (new framework version, different database, etc.)
- Add missing architectural decisions or patterns
- Refine project structure or boundaries
- Incorporate new requirements from updated PRD/UX specs
- Fix inconsistencies or gaps identified during implementation
- If user provides updated spec files (PRD, UX, epics), load them fully to understand the delta.
Step 2 — Impact analysis & change plan
- Read the entire architecture document thoroughly.
- Analyze requested changes for ripple effects:
- Decision compatibility: does the change conflict with existing decisions?
- Pattern impact: do naming conventions, error handling, or other patterns need updating?
- Structure impact: does the project directory tree need changes?
- Downstream effects: will this break existing implementations or require migration?
- Build change plan: section-by-section list of what needs updating, priority (Critical/High/Medium/Low), estimated ripple effects.
- Present change plan to user. Get approval before proceeding.
Step 3 — Apply edits
- Follow approved change plan systematically, section by section.
- For each change: load current section → apply modification → verify consistency with rest of document.
- Verify current technology versions for any tech stack changes — never trust hardcoded versions.
- Ensure cross-references remain valid (if a pattern changes, update all sections that reference it).
- Show progress after each major section update.
- Final coherence check: re-run Step 7 of the Architecture Workflow on the updated document.
Step 4 — Completion
- Apply all edits directly to
{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md.
- Present a completion recap: sections modified, decisions changed, new patterns/conventions, consistency check results.
Tracker Update
After saving architecture.md, follow the sdd-tracker skill — update shared.architecture and changelog (only if architecture was revised, not for new documents).
Guardrails
{SKILL_ASSETS_NOTICE}
- Adopt Architect's persona — from:
agents/architect.agent.md
- Never modify PRD or UX docs — output goes into
{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md only.
- Always validate with user before recording architectural decisions.
- Verify technology versions — never trust hardcoded versions.
- No time estimates.
1---2name: sdd-arch3description: Create or update the shared architecture document — select tech stack, define API patterns, establish naming conventions, map project structure, and record architectural decisions with rationale. Use when designing system architecture, making technical decisions, or updating the architecture doc. Do not use for implementing features, writing PRDs, or designing UX.4---56Create or update the shared architecture document at `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md`.7This is a **shared project document** — not tied to any specific change. It defines HOW the system is built and serves as context for all future changes.89**Output**: `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md`1011**Template**: Use `assets/architecture.md` as the document structure.1213**Prerequisites**: `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/prd.md` should exist. If not, ask user for a prd or suggest to "Create the PRD"141516> [!IMPORTANT]17> This skill is designed to be used with the **sdd-team:sdd-architect.agent** agent.18> Switch to it in the agent selector before invoking this skill for the full interactive experience.19> If you are already using **sdd-team:sdd-architect.agent**, proceed with the workflow below.2021---2223## Entry point24251. **Check if architecture doc already exists**2627 Read `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md` or any file provided by the user. If it exists:28 - Summarize current content to the user.29 - Ask: "Do you want to **revise** the existing architecture or **start fresh**? Skip this question if you detect from existing document or user input.30 - If revise → follow **Edit Architecture Workflow** below.31 - If fresh → follow **Architecture Workflow** below.32332. **Context gathering** (always)34 - Read `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/prd.md` if it exists — primary requirements baseline.35 - Read `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/ux.md` if it exists — UX implications.36 - Read any additional files provided by the user (e.g., `project-context.md`, `AGENTS.md`) for technical preferences or constraints.37 - Read project-level docs (README, package.json, `AGENTS.md`, etc.).38 - Ask the user for additional context if needed.3940---4142## Architecture Workflow4344Collaborative, step-by-step creation of architecture decisions that ensure consistent implementation.4546### Step 1 — Context gathering47481. If no docs were found, ask: _"Any PRD, UX specs, research docs, or project context files to load?"_492. Read all provided files fully.503. **If no PRD is available:** gather requirements directly from the user via chat. Ask about: project goals, target users, core features, technical constraints, NFRs (performance, security, scale), and existing tech preferences. Use the answers as the requirements baseline.514. Look for existing technical preferences in `project-context.md`, `AGENTS.md`, etc.525. Confirm gathered context with user before proceeding.5354Output: `✅ Context loaded — ready to architect.`5556### Step 2 — Project context analysis5758Analyze loaded documents for architectural implications:59601. **Requirements analysis:** Extract FRs, NFRs (performance, security, compliance), technical constraints.612. **Scale assessment:** Real-time needs, multi-tenancy, regulatory, integration complexity, data volume.623. **UX implications** (if UX spec provided): component complexity, animations, real-time updates, offline needs, accessibility level.6364Present analysis back to user for validation — core functionality summary, critical NFRs, scale indicators, cross-cutting concerns. Ask: _"Does this match your understanding?"_6566### Step 3 — Starter template evaluation67681. Check project context for existing tech preferences (languages, frameworks, databases, platforms).692. Ask about remaining preferences: team experience, deployment targets, integrations.703. Research current starter / scaffolding options for the project type.714. For each viable option, analyze: tech decisions it makes, patterns it establishes, dev experience features.725. Present options with trade-offs (adapt depth to user skill level). Get user's choice.736. Document: chosen starter, inherited tech decisions, CLI commands to scaffold.7475### Step 4 — Core architectural decisions7677Facilitate decisions across these categories (skip what's already decided by starter/preferences):7879- **Data architecture:** database, modeling approach, validation, migrations, caching80- **Auth & security:** authentication method, authorization patterns, encryption, API security81- **API & communication:** design patterns (REST/GraphQL), error handling standards, rate limiting82- **Frontend** (if applicable): state management, component architecture, routing, performance83- **Infrastructure:** hosting, CI/CD, environment config, monitoring, scaling8485For each decision: present options with trade-offs, get user input, verify current versions, record choice with rationale.8687> **Decision record format** (for each item in `architecture.md`):88> ```89> | Decision | Choice | Rationale |90> |---|---|---|91> | Database | PostgreSQL (Supabase) | Team familiarity, built-in auth, real-time subscriptions |92> | Auth | Supabase Auth (JWT) | Free tier, social providers, row-level security |93> | API style | REST + tRPC | Type-safe client, auto-generated TS types |94> ```9596### Step 5 — Implementation patterns & consistency rules9798Define patterns to prevent implementation conflicts:99100- **Naming:** database tables/columns, API endpoints, files, components, variables101- **Structure:** test locations, component organization, utilities, config files102- **Formats:** API response wrappers, error structures, date formats, JSON field casing103- **Communication:** event naming, state update patterns, logging formats104- **Processes:** error handling, loading states, retry logic, validation timing105106For each area: present options, get user decision, document the chosen convention.107108### Step 6 — Project structure & boundaries1091101. Map requirements/epics to architectural components.1112. Generate complete project directory tree (real files and folders — no generic placeholders).1123. Define integration boundaries: API boundaries, component boundaries, data access patterns.1134. Present structure, get user confirmation.114115### Step 7 — Validation116117Run coherence checks on the complete architecture:118119- **Decision compatibility:** all tech choices work together, versions compatible, no contradictions.120- **Requirements coverage:** every FR/NFR has architectural support.121- **Implementation readiness:** decisions complete enough for agents to implement consistently.122- **Gap analysis:** identify critical / important / nice-to-have gaps.123124Present findings. Resolve critical issues with user before completing.125126### Step 8 — Completion1271281. Save final `architecture.md` to `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md` using the template structure.1292. Present a **completion recap in chat**: decisions made, patterns defined, structure finalized, gaps found.130131---132133## Edit Architecture Workflow134135Structured improvement of an existing architecture document.136137### Step 1 — Discovery1381391. Load `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md` completely.1402. Ask: _"What would you like to change?"_ Examples:141 - Update technology choices (new framework version, different database, etc.)142 - Add missing architectural decisions or patterns143 - Refine project structure or boundaries144 - Incorporate new requirements from updated PRD/UX specs145 - Fix inconsistencies or gaps identified during implementation1463. If user provides updated spec files (PRD, UX, epics), load them fully to understand the delta.147148### Step 2 — Impact analysis & change plan1491501. Read the entire architecture document thoroughly.1512. Analyze requested changes for ripple effects:152 - **Decision compatibility:** does the change conflict with existing decisions?153 - **Pattern impact:** do naming conventions, error handling, or other patterns need updating?154 - **Structure impact:** does the project directory tree need changes?155 - **Downstream effects:** will this break existing implementations or require migration?1563. Build change plan: section-by-section list of what needs updating, priority (Critical/High/Medium/Low), estimated ripple effects.1574. Present change plan to user. Get approval before proceeding.158159### Step 3 — Apply edits1601611. Follow approved change plan systematically, section by section.1622. For each change: load current section → apply modification → verify consistency with rest of document.1633. **Verify current technology versions** for any tech stack changes — never trust hardcoded versions.1644. Ensure cross-references remain valid (if a pattern changes, update all sections that reference it).1655. Show progress after each major section update.1666. Final coherence check: re-run Step 7 of the Architecture Workflow on the updated document.167168### Step 4 — Completion1691701. Apply all edits directly to `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md`.1712. Present a **completion recap**: sections modified, decisions changed, new patterns/conventions, consistency check results.172173---174175## Tracker Update176177After saving `architecture.md`, follow the **`sdd-tracker` skill** — update `shared.architecture` and changelog (only if architecture was revised, not for new documents).178179---180181## Guardrails182183{SKILL_ASSETS_NOTICE}184- **Adopt Architect's persona** — from: `agents/architect.agent.md`185- **Never modify PRD or UX docs** — output goes into `{ARTIFACT_MAIN_FOLDER}/{SHARED_SUBFOLDER}/architecture.md` only.186- **Always validate with user** before recording architectural decisions.187- **Verify technology versions** — never trust hardcoded versions.188- **No time estimates.**