engineering
Technical design interview → ./plans/<feature>/tdd.md → adversarial review. Pipeline: scope → product → design → engineering → plan.
Phase: Engineering. User is technical. Architecture, data models, APIs, behavior, security, observability, build phasing.
Starting
Before asking anything:
- Read the feature folder (
./plans/*/). If multiple feature folders found in./plans/, list them viaAskUserQuestionand ask which feature to work on. Checkpipeline.mdfor## Rollback Notes— if content, skip steps 2-3, resume only affected domains, clear after resolving. - Look for
scope.md,prd.md,spec.md.spec.mdis REQUIRED — if missing, stop: "Run/designfirst." Iftdd.mdalready populated → skip interview, go to Adversarial Review. - Check
prd.mdfor## Glossary. If missing AND requirements introduce 3+ domain nouns not in codebase → generate glossary silently inprd.md, then use canonical terms throughout. - Explore codebase — tech stack, patterns, data models, auth, API conventions, testing, deployment.
- Search for architecture docs, ADRs, domain glossaries. If docs and code disagree, note discrepancy to surface during interview.
If prior docs exist: "I've read the PRD, design spec, and explored the codebase. PRD calls for [items]. Spec defines [N flows] across [N screens]. Stack uses [tech]. First: [question]."
Interview Protocol
Use AskUserQuestion for every question — header (<=12 chars), 2-4 options, one marked "(Recommended)". When user can't decide: push — reframe, explain tradeoffs, give stronger recommendation. Record as assumption only when user genuinely can't resolve. Revisit assumptions when later answers provide resolution.
Code-first: explore 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." When codebase has competing patterns, surface the conflict and ask user which to follow. After user answers, verify against codebase — surface contradictions before proceeding.
Completeness tracking
Resolve decisions across these domains depth-first — exhaust sub-questions before moving on. Only ask what the codebase can't answer. After resolving each domain, append <!-- progress: domain-N resolved --> to the target section in tdd.md. On resume, detect markers and skip resolved domains. Remove markers when writing the final doc.
- System context — where feature sits in overall system, boundaries, C4 context diagram (mermaid)
- Architecture decisions — inline ADRs: status, context, decision, alternatives considered, consequences accepted
- Data models — fields, relationships, indexes, migration strategy, ER diagrams (mermaid)
- API design — full contracts: endpoints, auth, request/response, ALL error responses, rate limits, idempotency
- Core behavior — behavior specs linked to FRs (
Maps to: FR-N, Story: X). What happens in the system when user acts? - Edge cases — severity classification (critical/warning/graceful) + mitigation approach
- Security — auth/permissions, trust boundaries, data protection, abuse prevention
- Observability — logging events with structured fields, metrics with alert thresholds, health checks
- Testing — strategy per layer: unit/integration/e2e tables with components, what to test, approach
- Operational — rollout, feature flags, backward compat, rollback plan, perf targets (P50/P95/P99), scalability, cost
- Code design — key interfaces (actual code signatures), dependency direction, patterns, extension points
- Phased build — vertical slices with ADR + FR traceability per phase
Dependencies, conflicts, rollback
Resolve upstream decisions before downstream. When code/docs/intent conflict, surface and classify: stale docs, incomplete implementation, intentional divergence, or unclear ownership.
When a design decision invalidates upstream docs, append ## Rollback Notes to pipeline.md (trigger, affected domains, decisions to preserve). Data model breaks UX → /design. Architectural constraint breaks product assumption → /product or /scope. Roll back only as far as necessary.
Producing the doc
When every domain is fully resolved: audit all recorded assumptions — resolve any that later context now answers. If an answer in a later domain invalidates an earlier one, reopen that domain. Write tdd.md using the template in assets/tdd-template.md. If prd.md exists, verify every FR and user story maps to a behavior spec or build phase — surface gaps. Then proceed to Adversarial Review.
Adversarial Review
Work silently — user sees only the verdict.
- Understand: Read
tdd.md. Note anything underspecified, inconsistent, or surprising. - Verify against reality: Check claims against code/docs. Cross-check against
prd.mdFRs — all stories addressed? Unjustified scope creep? Cross-check againstspec.mdflows — design mismatches? Ifscope.mdexists: tackles out-of-scope items? Misses v1 items? - Pressure-test: Apply adversarial lenses from
references/review-lenses.md. Additional lens: ADR quality — alternatives explored? consequences documented? Skip empty lenses, order findings by severity. Enumerate remaining assumptions — flag any now resolvable.
Verdict
Scale response to severity — solid design gets short review.
Format: ### Verdict: Ready / Revise / Rethink followed by Strengths (2-4 bullets), Issues (severity-ordered: category, description, why it matters, what to do), Risks, Recommended next step (one sentence).
Ready: "Design is ready. Run /plan to decompose into implementation issues."
Revise: "Let's work through these issues." Group by subsection. Each turn: restate issues, propose resolution, accept/modify/skip. Skipped items become open items. After all resolved, update tdd.md in single write, re-run review. No re-exploration, no scope expansion, no re-interview. Batch aggressively if user accepts unchanged.
Rethink: Recommend re-interview from affected domains. If findings invalidate product assumptions (not just tech), append ## Rollback Notes to pipeline.md and direct to /product or /scope.
Update ## Decisions Log and ## Status in pipeline.md.
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