/spec-driven-dev:interview-specfrom spec-driven-dev
Interviews the user through deep, iterative questions to produce a comprehensive specification document detailed enough for an AI implementation agent.
Ships in spec-driven-dev. Installing the plugin adds it to Claude Code.
You are tasked with creating comprehensive specification documents through a deep, iterative interview process. Your role is to ask non-obvious questions, conduct proactive research, and produce a spec detailed enough for an AI implementation agent with zero prior context to execute.
Interview the user in detail using the AskUserQuestionTool about literally anything: technical implementation, UI & UX, concerns, tradeoffs, etc. but make sure the questions are not obvious. Be very in-depth and continue interviewing the user continually until you have complete understanding, then write the spec to the file.
When this command is invoked:
Check if an initial description was provided:
If no description provided, respond with:
I'll help you create a comprehensive specification document. To get started, please describe:
1. What are you building? (the problem and who it's for)
2. What's the core functionality?
Then wait for the user's input.
This is an iterative conversation that flows through these stages:
After receiving the initial description:
Assess whether research would be valuable before starting the interview. Not every project needs upfront research:
When research is wanted ALWAYS spawn subagents to gather context (in parallel if multiple areas need research). The agents you are available to use are:
spec-driven-dev:spec-doc-researcher - for external packages/APIs mentionedspec-driven-dev:spec-codebase-explorer - for existing codebase being modifiedIf research was done, synthesize findings and ask informed questions. If not, proceed directly to questioning.
Ask questions that are non-obvious. You can ask questions on anything from technical implementation, UI & UX, concerns, tradeoffs, etc. but make sure the questions are not obvious.
The focus on the spec is to be a comprehensive description of the project that is executable by an AI agent with zero context based on everything you have learned from the interview with the user. If the interview is mostly around business requirements, the spec should reflect that.
Write to: ./.claude/specs/{project-name}-{YYYY-MM-DD}.md
./.claude/specs/plugin-marketplace-2025-01-04.mdThe spec must be self-contained - an AI agent with no context from this conversation should be able to implement it.
# {Project Name} Specification
> {One-line description of what this builds}
## Executive Summary
{2-4 paragraphs covering:}
- What we're building and for whom
- The core problem being solved
- High-level approach
- Key constraints or requirements
### Core Features
1. **{Feature 1}** - {Brief description}
2. **{Feature 2}** - {Brief description}
3. **{Feature 3}** - {Brief description}
---
## Key Design Decisions
| Decision | Choice | Rationale |
|----------|--------|-----------|
| {Decision area} | {What we chose} | {Why, and what alternatives were considered} |
| {Decision area} | {What we chose} | {Why, and what alternatives were considered} |
---
## All Design Decisions
{Every decision made during the interview, synthesized into clean format}
### {Category 1}
**Decision**: {What was decided}
**Rationale**: {Why this choice, what alternatives were considered}
**Decision**: {What was decided}
**Rationale**: {Why this choice, what alternatives were considered}
### {Category 2}
{Continue for all decisions...}
---
## Architecture
### System Overview
{High-level description of how the system fits together}
### UI Components
{Only include for user-facing features}
#### {Component/View Name}
**Layout**:
```
┌─────────────────────────────────────────────────────────┐
│ {Header area} │
├─────────────────────────────────────────────────────────┤
│ {Main content area} │
│ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ {Element} │ │ {Element} │ │
│ └─────────────┘ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────┘
```
**Interactions**:
- {User action} → {System response}
- {User action} → {System response}
**States** (scale detail to complexity):
- Default: {Description}
- Loading: {Description}
- Error: {Description}
- Empty: {Description}
### Data Flow
```
{ASCII diagram showing how data moves through the system}
```
### Component Architecture
```
{File tree showing the structure}
project/
├── {directory}/
│ ├── {file} # {What this file does}
│ └── {file} # {What this file does}
└── {directory}/
└── {file} # {What this file does}
```
---
## Existing Implementation (optional)
{Only include if modifying existing code}
### Current State
{Description of what exists now}
### Key Code Excerpts
**{Component/File being modified}** (`{path}`)
```{language}
{Relevant code snippet that will be modified or extended}
```
**Modification approach**: {How we're changing/extending this}
---
## External Dependencies (optional)
### {Package/API Name} (v{version})
{Only include for external packages/APIs being used}
**Purpose**: {Why we're using this}
**Key APIs**:
```{language}
// {Function/class we'll use}
{API signature from documentation}
```
**Important Patterns**:
- {Pattern or constraint from docs}
- {Version-specific consideration}
### External Data Structures
{If consuming external APIs, show the data structures}
**{API/Source Name}** response structure:
```json
{
"field": "type - description",
"nested": {
"field": "type - description"
}
}
```
---
## Database Schema (optional)
{Only include if creating/modifying database}
```sql
-- {Table description}
CREATE TABLE {table_name} (
{column} {type} {constraints},
{column} {type} {constraints}
);
-- Indexes
CREATE INDEX {index_name} ON {table}({columns});
```
---
## Storage Structure (optional)
{Only include if using file/object storage}
```
{bucket/directory}/
├── {path}/
│ └── {file pattern} # {What these files contain}
└── {path}/
└── {file pattern} # {What these files contain}
```
---
## API Design (optional)
{TypeScript/language skeletons - minimal, not full implementations}
### {Endpoint/Function Group}
```typescript
// {Description of what this does}
async function {functionName}(
{param}: {Type},
{param}: {Type}
): Promise<{ReturnType}> {
// TODO: Implement
// 1. {Step 1}
// 2. {Step 2}
// 3. {Step 3}
}
```
**Parameters**:
- `{param}` ({Type}): {Description}
**Returns**: {Description of return value}
---
## Implementation Strategy
Plan the work as end-to-end vertical slices, not sequential horizontal phases. The first slice should prove the highest-risk assumption through the smallest real happy-path user journey. It may use a basic UI, but it must connect the actual layers needed to verify the behavior.
### Slice 1: {Risk-First Happy Path}
**User outcome**: {What the user can accomplish at the end of this slice}
**Proves**: {Highest-risk assumption, integration, or behavior this validates}
**End-to-end cut**:
- UI: {Smallest usable interface}
- API or server: {Real request/response path}
- Data or persistence: {Minimum schema/state needed}
- Agent or integration: {Tool, model, or third-party behavior involved}
**Live verification**:
- [ ] {Direct API request or curl probe and expected response}
- [ ] {Rendered browser journey and observable outcome}
- [ ] {Persistence or state verified through the application}
- [ ] {Representative LLM prompts and expected behavior, when applicable}
**Exit criteria**: {Observable evidence that the risky path works end to end}
---
### Slice 2: {Capability Expansion}
**User outcome**: {Additional behavior the user gains}
**Builds on**: {Previously proven slice}
**End-to-end cut**: {UI, API, data, agent, and integration changes}
**Live verification**:
- [ ] {How this behavior is exercised in the running product}
- [ ] {How the original happy path is rechecked}
**Exit criteria**: {Observable completion evidence}
---
{Continue with additional slices for breadth, failure handling, and polish...}
## Verification Strategy
### Static and Deterministic Checks
- [ ] {Existing typecheck, build, lint, or test command}
- [ ] {Focused automated regression coverage when deterministic logic warrants it}
### API and Integration Probes
- [ ] {Representative direct requests, payloads, and expected response content}
- [ ] {Persistence, external integration, or state changes verified through the real path}
### LLM and Agent Behavior (when applicable)
- [ ] {Representative prompt or request matrix}
- [ ] {Expected semantic behavior, tool calls, and state changes}
- [ ] {Important behavior to avoid}
- [ ] {Cases to repeat because nondeterminism could hide a failure}
### Browser Journey (when applicable)
- [ ] {Happy path to complete in the rendered application}
- [ ] {Important loading, success, persistence, and failure states to observe}
---
## Security Considerations
- {Security consideration and how it's addressed}
- {Security consideration and how it's addressed}
---
## Future Considerations
{Only items explicitly deferred by the user during the interview}
- {Deferred item} - {Why it's deferred}
- {Deferred item} - {Why it's deferred}
---
## Unresolved Questions
{Any questions that remain open - ideally empty}
- {Question} - {Context on why it's unresolved}
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
4 commands in this plugin
/brainstormExplore product and technical directions through research, explanations, and concrete options/implement-specImplement SpecImplement an approved spec through a risk-first subagent workflow with live end-to-end verification/restore-changesRestore ChangesRestore uncommitted changes using git, with option to restore all or specific filesnpx claudepluginhub daanferdinandusse/ai-agent-plugins --plugin spec-driven-devOther plugins' commands for the same job