Skip to content

Commit bd83253

Browse files
committed
refactor(prompts): reorganize generate-spec workflow steps
- Add dedicated Step 1 for spec directory creation - Renumber all subsequent steps (1→2, 2→3, etc.) - Add Questions File Workflow for iterative Q&A process - Update all step references throughout document - Fix typo: 'pre-existing'
1 parent b8875bf commit bd83253

File tree

1 file changed

+68
-36
lines changed

1 file changed

+68
-36
lines changed

prompts/generate-spec.md

Lines changed: 68 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,52 @@ If the user did not include an initial input or reference for the spec, ask the
5555

5656
Follow this exact sequence:
5757

58-
1. **Initial Scope Assessment** - Evaluate if the feature is appropriately sized for this workflow
59-
2. **Clarifying Questions** - Gather detailed requirements through structured inquiry
60-
3. **Context Assessment** - Review existing codebase for relevant patterns and constraints (optional)
61-
4. **Spec Generation** - Create the detailed specification document
62-
5. **Review and Refine** - Validate completeness and clarity with the user
58+
1. **Create Spec Directory** - Create `./docs/specs/[NN]-spec-[feature-name]/` directory structure
59+
2. **Context Assessment** - Review existing codebase for relevant patterns and constraints (optional)
60+
3. **Initial Scope Assessment** - Evaluate if the feature is appropriately sized for this workflow
61+
4. **Clarifying Questions** - Gather detailed requirements through structured inquiry
62+
5. **Spec Generation** - Create the detailed specification document
63+
6. **Review and Refine** - Validate completeness and clarity with the user
6364

64-
## Step 1: Initial Scope Assessment
65+
## Step 1: Create Spec Directory
6566

66-
Before asking questions, evaluate whether this feature request is appropriately sized for this spec-driven workflow.
67+
Create the spec directory structure before proceeding with any other steps. This ensures all files (questions, spec, tasks, proofs) have a consistent location.
68+
69+
**Directory Structure:**
70+
71+
- **Path**: `./docs/specs/[NN]-spec-[feature-name]/` where `[NN]` is a zero-padded 2-digit sequence number (e.g., `01`, `02`, `03`)
72+
- **Naming Convention**: Use lowercase with hyphens for the feature name
73+
- **Examples**: `01-spec-user-authentication/`, `02-spec-payment-integration/`, etc.
74+
75+
**Verification**: Confirm the directory exists before proceeding to Step 2.
76+
77+
## Step 2: Context Assessment
78+
79+
If working in a pre-existing project, begin by briefly reviewing the codebase and existing docs to understand:
80+
81+
- Current architecture patterns and conventions
82+
- Relevant existing components or features
83+
- Integration constraints or dependencies
84+
- Files that might need modification or extension
85+
- **Repository Standards and Patterns**: Identify existing coding standards, architectural patterns, and development practices from:
86+
- Project documentation (README.md, CONTRIBUTING.md, docs/)
87+
- AI specific documentation (AGENTS.md, CLAUDE.md)
88+
- Configuration files (package.json, Cargo.toml, pyproject.toml, etc.)
89+
- Existing code structure and naming conventions
90+
- Testing patterns and quality assurance practices
91+
- Commit message conventions and development workflows
92+
93+
**Use this context to inform scope validation and requirements, not to drive technical decisions.** Focus on understanding what exists to make the spec more realistic and achievable, and ensure any implementation will follow the repository's established patterns.
94+
95+
## Step 3: Initial Scope Assessment
96+
97+
Evaluate whether this feature request is appropriately sized for this spec-driven workflow.
6798

6899
**Chain-of-thought reasoning:**
69100

70101
- Consider the complexity and scope of the requested feature
71102
- Compare against the following examples
103+
- Use context from Step 2 to inform the assessment
72104
- If scope is too large, suggest breaking into smaller specs
73105
- If scope is too small, suggest direct implementation without formal spec
74106

@@ -104,11 +136,11 @@ Before asking questions, evaluate whether this feature request is appropriately
104136

105137
If the scope appears inappropriate, inform the user and suggest alternatives before proceeding.
106138

107-
## Step 2: Clarifying Questions
139+
## Step 4: Clarifying Questions
108140

109-
Ask clarifying questions to gather sufficient detail. **Always provide numbered or lettered options** to allow the user to make selections easily by responding with *"1A, 2B, 3C"*, etc. Focus on understanding the "what" and "why" rather than the "how."
141+
Ask clarifying questions to gather sufficient detail. **Always provide multiple choice answers** with numbered or lettered options to allow the user to make selections easily. Focus on understanding the "what" and "why" rather than the "how."
110142

111-
Adapt your questions based on the user's input. Use the following common areas to guide your questions:
143+
Use the following common areas to guide your questions:
112144

113145
**Core Understanding:**
114146

@@ -133,24 +165,21 @@ Adapt your questions based on the user's input. Use the following common areas t
133165

134166
**Progressive Disclosure:** Start with Core Understanding, then expand based on feature complexity and user responses.
135167

136-
## Step 3: Context Assessment (Optional)
168+
**Questions File Workflow:**
137169

138-
If the feature involves existing systems, briefly review the codebase and existing docs to understand:
170+
1. **Create Questions File**: Save questions to `[NN]-questions-[N]-[feature-name].md` where `[N]` is the round number (starting at 1, incrementing for each new round).
171+
2. **Point User to File**: Direct the user to the questions file and instruct them to answer the questions directly in the file.
172+
3. **Wait for Confirmation**: After the user indicates they have saved their answers, read the file and continue the conversation.
173+
4. **Follow-Up Rounds**: If answers reveal new questions, create a new questions file with incremented round number (`[NN]-questions-[N+1]-[feature-name].md`) and repeat the process.
139174

140-
- Current architecture patterns and conventions
141-
- Relevant existing components or features
142-
- Integration constraints or dependencies
143-
- Files that might need modification or extension
144-
- **Repository Standards and Patterns**: Identify existing coding standards, architectural patterns, and development practices from:
145-
- Project documentation (README.md, CONTRIBUTING.md, docs/)
146-
- Configuration files (package.json, Cargo.toml, pyproject.toml, etc.)
147-
- Existing code structure and naming conventions
148-
- Testing patterns and quality assurance practices
149-
- Commit message conventions and development workflows
175+
**Iterative Process:**
150176

151-
**Use this context to inform scope validation and requirements, not to drive technical decisions.** Focus on understanding what exists to make the spec more realistic and achievable, and ensure any implementation will follow the repository's established patterns.
177+
- If a user's answer reveals new questions or areas needing clarification, ask follow-up questions in a new questions file.
178+
- If the user requests clarification or rephrasing of a question, provide it in the current questions file and continue the conversation.
179+
- Build on previous answers - use context from earlier responses to inform subsequent questions.
180+
- Continue until you have enough detail to populate all spec sections (User Stories, Functional Requirements, Demoable Units, etc.), then proceed to Step 5.
152181

153-
## Step 4: Spec Generation
182+
## Step 5: Spec Generation
154183

155184
Generate a comprehensive specification using this exact structure:
156185

@@ -174,11 +203,13 @@ Generate a comprehensive specification using this exact structure:
174203
[Focus on tangible progress and WHAT will be demonstrated. Define 2-4 small, end-to-end vertical slices using the format below.]
175204

176205
### [Unit 1]: [Title]
206+
177207
**Purpose:** [What this slice accomplishes and who it serves]
178208
**Demo Criteria:** [What will be shown to verify working value]
179209
**Proof Artifacts:** [Tangible evidence - URLs, CLI commands, test names, screenshots]
180210

181211
### [Unit 2]: [Title]
212+
182213
**Purpose:** [What this slice accomplishes and who it serves]
183214
**Demo Criteria:** [What will be shown to verify working value]
184215
**Proof Artifacts:** [Tangible evidence - URLs, CLI commands, test names, screenshots]
@@ -206,12 +237,13 @@ Generate a comprehensive specification using this exact structure:
206237
## Repository Standards
207238

208239
[Identify existing patterns and practices that implementation should follow. Examples include:
240+
209241
- Coding standards and style guides from the repository
210242
- Architectural patterns and file organization
211243
- Testing conventions and quality assurance practices
212244
- Documentation patterns and commit conventions
213245
- Build and deployment workflows
214-
If no specific standards are identified, state "Follow established repository patterns and conventions."]
246+
If no specific standards are identified, state "Follow established repository patterns and conventions."]
215247

216248
## Technical Considerations
217249

@@ -233,7 +265,7 @@ If no specific standards are identified, state "Follow established repository pa
233265
2. [Question 2]
234266
```
235267

236-
## Step 5: Review and Refinement
268+
## Step 6: Review and Refinement
237269

238270
After generating the spec, present it to the user and ask:
239271

@@ -247,9 +279,8 @@ Iterate based on feedback until the user is satisfied.
247279
## Output Requirements
248280

249281
**Format:** Markdown (`.md`)
250-
**Directory:** Create `./docs/specs/[NN]-spec-[feature-name]/` where `[NN]` is a zero-padded 2-digit sequence number starting from 01 (e.g., `01`, `02`, `03`). For example, `01-spec-user-authentication/`, `02-spec-payment-integration/`, etc.
251282
**Full Path:** `./docs/specs/[NN]-spec-[feature-name]/[NN]-spec-[feature-name].md`
252-
**Example:** For feature "user authentication", create directory `01-spec-user-authentication/` and save file as `01-spec-user-authentication.md` inside it
283+
**Example:** For feature "user authentication", the spec directory would be `01-spec-user-authentication/` with a spec file as `01-spec-user-authentication.md` inside it
253284

254285
## Critical Constraints (Negative Instructions)
255286

@@ -280,16 +311,17 @@ Once this spec is complete and approved, instruct the user to run `/generate-tas
280311

281312
Follow this exact sequence:
282313

283-
1. **Initial Scope Assessment**: Use the provided examples to evaluate if the feature is appropriately sized
284-
2. **Clarifying Questions**: Ask structured questions with numbered/lettered options for easy selection
285-
3. **Context Assessment**: Review existing codebase for relevant patterns and constraints (optional)
286-
4. **Spec Generation**: Create the spec using the exact structure provided
314+
1. **Create Spec Directory**: Create `./docs/specs/[NN]-spec-[feature-name]/` directory structure
315+
2. **Context Assessment**: Review existing codebase for relevant patterns and constraints (optional)
316+
3. **Initial Scope Assessment**: Use the provided examples to evaluate if the feature is appropriately sized
317+
4. **Clarifying Questions**: Ask structured questions with numbered/lettered options for easy selection
318+
5. **Spec Generation**: Create the spec using the exact structure provided
287319
- **Ensure each section has a distinct purpose** - avoid restating content from previous sections
288320
- **User Stories** focus on motivation and WHY
289321
- **Demoable Units** focus on tangible progress and WHAT will be shown
290322
- **Functional Requirements** focus on system behavior and WHAT the system must do
291323
- **Technical Considerations** focus on implementation constraints and HOW it will be built
292-
5. **Save**: Create directory `./docs/specs/[NN]-spec-[feature-name]/` and save file as `[NN]-spec-[feature-name].md` inside it
293-
6. **Review and Refine**: Validate completeness and clarity with the user
294-
7. **Guide User**: Direct user to the next workflow step (`/generate-task-list-from-spec`)
295-
8. **Stop**: Stop working once user confirms spec is complete
324+
6. **Save**: Save file as `[NN]-spec-[feature-name].md` inside the spec directory created in Step 1
325+
7. **Review and Refine**: Validate completeness and clarity with the user
326+
8. **Guide User**: Direct user to the next workflow step (`/generate-task-list-from-spec`)
327+
9. **Stop**: Stop working once user confirms spec is complete

0 commit comments

Comments
 (0)