design-feature
Purpose
Technical design interview -> design document. Pipeline: plan-feature -> write-a-prd -> review-prd -> glossary -> (design-ux) -> design-feature -> review-plan.
Starting
Before asking anything:
- Look in
./plans/for: PRD (*-prd.md), scope doc (*-scope.md), glossary (*-glossary.md), UX spec (*-ux.md). Read all found. Use glossary canonical terms for data models, APIs, modules, variables. UX flows map to behavior specs; UX screens/components map to frontend architecture. - Explore the codebase thoroughly — tech stack, patterns, data models, auth, API conventions, testing patterns, deployment setup.
- Search for architecture docs, ADRs, domain glossaries, process docs, READMEs.
- If docs and code disagree, note the discrepancy to surface during interview.
If prior docs exist: "I've read the PRD, UX spec, and explored the codebase. Requirements call for [items]. UX defines [N flows] across [N screens]. Stack uses [tech]. First: [question about architecture/patterns]."
No PRD? Works — but note that defined requirements make for a better design. No UX spec? Interview will cover frontend concerns as needed. No glossary? Be consistent in naming and note decisions in the Decisions Log.
Interview Protocol
Walk down each branch of the design tree one decision at a time.
One question per turn
Use AskUserQuestion for every question. Never plain text. Each call: one question with question, header (max 12 chars), options (2-4, each with label + description), recommended option first with "(Recommended)" suffix. Set multiSelect: true when choices aren't exclusive. Use preview for code snippet/config comparisons. User can always pick "Other."
When the user can't decide
State your recommendation, record as assumption in Assumptions & Unknowns, move on.
Code-first
Explore the codebase before asking questions it could answer. Present as confirmation: "I found the project handles auth via [pattern] in [file]. I'll follow the same approach unless you say otherwise."
Completeness tracking
Track whether you've resolved decisions across these domains:
- Architecture & patterns — System design, service/module boundaries, API design. New components, fit with existing architecture, pattern deviations.
- Data & state — CRUD operations, models, schemas, migrations, state management locations (DB, cache, session, client).
- Core behavior (technical) — Implementation approach for each user story/FR. Step-by-step: what happens in the system when the user acts?
- Edge cases & failure modes — Race conditions, partial failures, concurrent access, error handling, data validation, boundary conditions.
- Integration & dependencies — External systems, third-party APIs, internal services. Integration contracts.
- Operational & rollout — Backward compatibility, feature flags, migrations, monitoring, performance budget, cost.
- Security & access — Permissions, trust boundaries, sensitive data, input validation, abuse prevention.
- Testing strategy — Unit/integration/e2e approach per component. Test data, mocking, acceptance verification.
- Code design & boundaries — Interfaces, abstractions, dependency direction, injection points. Existing patterns to follow. Coupling/cohesion tradeoffs.
- Phased build plan — Vertical slices delivering working functionality. Dependency ordering. Acceptance criteria per phase tied to interview decisions.
Exhaust every branch. Domains are not checkboxes — each is a branch of the decision tree. Explore depth-first: when an answer raises sub-questions, resolve them before moving to the next domain. Keep asking until every sub-question within every domain is fully resolved. If the codebase answers a question, mark it resolved and move on — only ask the user what the codebase can't answer. No limit on number of questions. Questions stay concise; depth comes from more turns, not longer ones.
Dependencies and conflicts
Resolve upstream decisions before downstream — earlier choices constrain later ones. When a new decision invalidates an earlier one, flag and propose an update.
When code, docs, and intent conflict, surface it. Classify as stale docs, incomplete implementation, intentional divergence, or unclear ownership.
Wrapping up
When every domain is fully resolved with no remaining sub-questions, proceed to wrap up.
If PRD exists, verify every FR and user story maps to at least one behavior spec or build phase. Surface any missing coverage before producing the document.
Save to ./plans/<feature-name>-design.md. After writing: "Review this and tell me what to change. When satisfied, run /review-plan."
Update directly on change requests. No re-interview for minor adjustments. Flag conflicts with earlier decisions.
Technical Design Template
Include relevant sections. Omit any that would say "N/A."
# Design: <Feature Name>
> Technical design for [<feature-name>-prd.md] (scope: [<feature-name>-scope.md], UX: [<feature-name>-ux.md])
> Generated from design-feature interview on <date>
## Decisions Log
1. **<Topic>**: <Decision>. *Rationale: <why>*
## Data Models
### <ModelName>
- **Fields**: name, type, constraints
- **Relationships**: foreign keys, associations
- **Migration notes**: changes to existing models
## Behavior Specs
### <Behavior Name>
- **Trigger**: <what initiates>
- **Steps**: <numbered>
- **Result**: <what user sees>
- **Variations**: <conditional paths>
## Edge Cases & Failure Modes
| Scenario | Expected Behavior | Severity |
|----------|-------------------|----------|
| | | critical / warning / graceful |
## Scope
**In scope (v1):**
- ...
**Out of scope:**
- <thing> — <why>
## Assumptions & Unknowns
- **Assumption**: <statement>. *Risk if incorrect: <impact>*
- **Unknown**: <question>. *Risk if incorrect: <impact>*
## Documentation Impact
- **Must update**: <docs that will become inaccurate>
- **New docs needed**: <new concepts requiring documentation>
## Source-of-Truth Conflicts
| Conflict | Sources | Classification | Resolution |
|----------|---------|---------------|------------|
| | | stale docs / incomplete impl / intentional / unclear | |
## Operational Considerations
- **Rollout strategy**:
- **Backward compatibility**:
- **Feature flags**:
- **Performance / cost**:
- **Monitoring**:
- **Failure recovery**:
## Security & Access
- **Permissions affected**:
- **Sensitive data**:
- **Trust boundaries**:
- **Abuse risks**:
## Code Design & Boundaries
- **Key interfaces/abstractions**:
- **Dependency direction**:
- **Patterns applied**:
- **Extension points**:
## Testing Strategy
- **Unit tests**:
- **Integration tests**:
- **End-to-end tests**:
- **Test data**:
- **Acceptance verification**:
## Phased Build Plan
### Phase 1: <Title>
**Depends on**: Nothing / Phase N
**Decisions**: #1, #2
**PRD coverage**: FR-1, FR-2, User Story: <name>
**What**: <vertical slice description>
**Acceptance criteria**:
- [ ] <criterion>
## Pipeline Status
| Step | Date | Verdict | Key Findings |
|------|------|---------|--------------|
| plan-feature | <date or "skipped"> | <verdict> | <summary> |
| write-a-prd | <date or "skipped"> | -- | <summary> |
| review-prd | <date or "skipped"> | <verdict> | <summary> |
| glossary | <date or "skipped"> | -- | <summary> |
| design-ux | <date or "skipped"> | -- | <summary> |
| design-feature | <date> | -- | <summary> |
More from michaelmerrill/skills
design
Design specification interview → standalone spec.md (flows, screens, states, components, responsive, a11y). Triggers: 'design this,' 'what screens,' 'how should users interact,' post-product. Not for: technical design (engineering), requirements (product). Skip for API-only, CLI, backend, or infra features.
8plan
Decompose technical design into agent-sized implementation issues → numbered markdown files + standalone plan.md. Triggers: 'plan this,' 'break into issues,' 'create tasks,' 'ready to implement,' post-engineering. Not for: designs without file paths/phases (run engineering first).
7design-ux
MUST USE when a user wants to design user flows, interaction patterns, or screen-level UX for a feature that has defined requirements. This is the UX design step in the planning pipeline (write-a-prd → review-prd → glossary → design-ux → design-feature → review-plan). Typical signals — "design the UX," "how should users interact with this," "what should the UI look like," "design the flows," "design-ux," "what screens do we need," or following up after a review-prd or glossary session. Also applies when the user has a PRD and wants to figure out the user experience before technical design. Conducts a structured interview to produce a UX specification — user flows, screen inventory, component mapping, interaction specs, and accessibility requirements. Do NOT use for technical design (use design-feature), writing requirements (use write-a-prd), reviewing plans (use review-plan), scoping/feasibility (use plan-feature), or when the feature has no user-facing UI (API-only, backend, CLI tools).
6plan-feature
Scoping interview for new features -> scope doc with go/no-go. Triggers: user wants to add/build/implement any new capability. First pipeline step. Not for: bugs, PRDs (write-a-prd), design (design-feature), executing existing specs.
6define
Product requirements → living doc Requirements section + quality gate + domain glossary. Stateful: detects existing sections and resumes where needed. Triggers: 'define this,' 'write a PRD,' 'define requirements,' 'spec this out,' post-explore. Not for: scoping (explore), UX (design), technical design (architect).
5explore
Scope and assess new feature ideas → living doc with go/no-go. Elaborates vague ideas into clear concepts. First pipeline step. Triggers: user wants to add/build/implement any new capability. Not for: bugs (triage-issue), requirements (define), design (design/architect).
5