You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(prompts): improve spec generation workflow and task list formatting (#30)
* 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'
* docs(prompts): improve task list format with hierarchical structure
Update generate-task-list-from-spec prompt to use hierarchical markdown structure for better readability.
- Change from flat bullet lists to hierarchical headers (### and ####)
- Convert Demo Criteria and Proof Artifacts to bulleted lists
- Add TBD placeholder for Tasks section in Phase 2 output format
* docs(prompts): remove redundant instruction from iterative process
Remove bullet point about handling clarification requests in the current
questions file, as this is already covered by the workflow steps above.
* docs(prompts): add validation report output location
Add 'Saving The Output' section specifying where validation reports should be saved, aligning with other workflow output file locations in the spec directory structure.
* docs(prompts): add example format for clarifying questions
Add a generic example template showing the expected format for clarifying
questions with numbered questions, lettered options, and checkboxes. Remove
redundant instruction about providing multiple choice answers.
* refactor(prompts): consolidate functional requirements into demoable units
Move functional requirements from separate section into each Demoable Unit
to make specs more self-contained and easier to read. Each unit now contains
all requirements needed for implementation, reducing cross-referencing and
making the spec structure more actionable.
* refactor(prompts): remove demo criteria, consolidate into proof artifacts
Remove separate 'Demo Criteria' sections and consolidate verification into
self-documenting proof artifacts. Each proof artifact now describes what
it demonstrates (e.g., 'Screenshot: `--help` output demonstrates new
command exists').
Changes:
- Remove Demo Criteria from spec and task list templates
- Update proof artifacts format to include descriptive language
- Update all workflow references from demo criteria to proof artifacts
- Rename 'Evidence & Output' to 'Verification Result' in validation table
- Update all verification checklists to focus on proof artifacts
This simplifies the workflow by making proof artifacts the single source
of truth for what needs to be demonstrated.
* refactor(prompts): align validation to focus on proof artifacts
Refactor validation process to consistently focus on proof artifact
verification rather than code implementation analysis. This improves
cohesion and clarity throughout the validation prompt.
Changes:
- Update Evaluation Rubric (R1, R5) to focus on proof artifacts
- Refactor Step 4 verification to test proof artifacts instead of
searching code files
- Rename 'Requirement Implementation' to 'Requirement Coverage'
- Update Coverage Matrix examples to use proof artifact results
- Restructure Validation Issues section with clearer format and
table examples
- Remove code analysis directives (line numbers, file content checks)
- Add commit log analysis to repository compliance checks
This aligns validation with its stated goal: verifying proof artifacts
demonstrate spec requirements, not analyzing code implementation.
* fix(prompts): enforce wait for user answers in spec generation
Add explicit STOP AND WAIT instructions to prevent AI from jumping
straight from creating clarifying questions to generating the spec
without waiting for user responses. Reorganize workflow section for
better clarity and add critical enforcement points.
* refactor(prompts): improve clarity and enforceability in spec generation
- Rename sections for better clarity (Process Overview → Spec Generation Overview)
- Add explicit requirement to report scope assessment results
- Make context assessment required instead of optional
- Standardize question format with uppercase option letters
- Remove redundant Final Instructions section
- Improve formatting consistency throughout
* fix: add missing space
2.**Context Assessment** - Review existing codebase for relevant patterns and constraints
58
+
3.**Initial Scope Assessment** - Evaluate if the feature is appropriately sized for this workflow
59
+
4.**Clarifying Questions** - Gather detailed requirements through structured inquiry
60
+
5.**Spec Generation** - Create the detailed specification document
61
+
6.**Review and Refine** - Validate completeness and clarity with the user
57
62
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
63
+
## Step 1: Create Spec Directory
63
64
64
-
## Step 1: Initial Scope Assessment
65
+
Create the spec directory structure before proceeding with any other steps. This ensures all files (questions, spec, tasks, proofs) have a consistent location.
65
66
66
-
Before asking questions, evaluate whether this feature request is appropriately sized for this spec-driven workflow.
67
+
**Directory Structure:**
68
+
69
+
-**Path**: `./docs/specs/[NN]-spec-[feature-name]/` where `[NN]` is a zero-padded 2-digit sequence number (e.g., `01`, `02`, `03`)
70
+
-**Naming Convention**: Use lowercase with hyphens for the feature name
71
+
-**Examples**: `01-spec-user-authentication/`, `02-spec-payment-integration/`, etc.
72
+
73
+
**Verification**: Confirm the directory exists before proceeding to Step 2.
74
+
75
+
## Step 2: Context Assessment
76
+
77
+
If working in a pre-existing project, begin by briefly reviewing the codebase and existing docs to understand:
78
+
79
+
- Current architecture patterns and conventions
80
+
- Relevant existing components or features
81
+
- Integration constraints or dependencies
82
+
- Files that might need modification or extension
83
+
-**Repository Standards and Patterns**: Identify existing coding standards, architectural patterns, and development practices from:
- Testing patterns and quality assurance practices
89
+
- Commit message conventions and development workflows
90
+
91
+
**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.
92
+
93
+
## Step 3: Initial Scope Assessment
94
+
95
+
Evaluate whether this feature request is appropriately sized for this spec-driven workflow.
67
96
68
97
**Chain-of-thought reasoning:**
69
98
70
99
- Consider the complexity and scope of the requested feature
71
100
- Compare against the following examples
101
+
- Use context from Step 2 to inform the assessment
72
102
- If scope is too large, suggest breaking into smaller specs
73
103
- If scope is too small, suggest direct implementation without formal spec
74
104
@@ -102,13 +132,16 @@ Before asking questions, evaluate whether this feature request is appropriately
102
132
- Creating a single database migration with rollback capability
103
133
- Implementing one user story with complete end-to-end flow
104
134
105
-
If the scope appears inappropriate, inform the user and suggest alternatives before proceeding.
135
+
### Report Scope Assessment To User
106
136
107
-
## Step 2: Clarifying Questions
137
+
-**ALWAYS** inform the user of the result of the scope assessment.
138
+
- If the scope appears inappropriate, **ALWAYS** pause the conversation to suggest alternatives and get input from the user.
108
139
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."
140
+
## Step 4: Clarifying Questions
110
141
111
-
Adapt your questions based on the user's input. Use the following common areas to guide your questions:
142
+
Ask clarifying questions to gather sufficient detail. Focus on understanding the "what" and "why" rather than the "how."
143
+
144
+
Use the following common areas to guide your questions:
112
145
113
146
**Core Understanding:**
114
147
@@ -126,31 +159,61 @@ Adapt your questions based on the user's input. Use the following common areas t
126
159
- Any existing design mockups or UI guidelines to follow?
127
160
- Are there any technical constraints or integration requirements?
128
161
129
-
**Demo & Proof:**
162
+
**Proof Artifacts:**
130
163
131
-
-How will we demonstrate this feature works?
132
-
- What proof artifacts will we need (URLs, CLI output, screenshots)?
164
+
-What proof artifacts will demonstrate this feature works (URLs, CLI output, screenshots)?
165
+
- What will each artifact demonstrate about the feature?
133
166
134
167
**Progressive Disclosure:** Start with Core Understanding, then expand based on feature complexity and user responses.
135
168
136
-
##Step 3: Context Assessment (Optional)
169
+
### Questions File Format
137
170
138
-
If the feature involves existing systems, briefly review the codebase and existing docs to understand:
171
+
Follow this format exactly when you create the questions file.
139
172
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:
- Testing patterns and quality assurance practices
149
-
- Commit message conventions and development workflows
173
+
```markdown
174
+
# [NN] Questions Round 1 - [Feature Name]
150
175
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.
176
+
Please answer each question below (select one or more options, or add your own notes). Feel free to add additional context under any question.
152
177
153
-
## Step 4: Spec Generation
178
+
## 1. [Question Category/Topic]
179
+
180
+
[What specific aspect of the feature needs clarification?]
181
+
182
+
- [ ] (A) [Option description explaining what this choice means]
183
+
- [ ] (B) [Option description explaining what this choice means]
184
+
- [ ] (C) [Option description explaining what this choice means]
185
+
- [ ] (D) [Option description explaining what this choice means]
186
+
- [ ] (E) Other (describe)
187
+
188
+
## 2. [Another Question Category/Topic]
189
+
190
+
[What specific aspect of the feature needs clarification?]
191
+
192
+
- [ ] (A) [Option description explaining what this choice means]
193
+
- [ ] (B) [Option description explaining what this choice means]
194
+
- [ ] (C) [Option description explaining what this choice means]
195
+
- [ ] (D) [Option description explaining what this choice means]
196
+
- [ ] (E) Other (describe)
197
+
```
198
+
199
+
### Questions File Process
200
+
201
+
1.**Create Questions File**: Save questions to a file named `[NN]-questions-[N]-[feature-name].md` where `[N]` is the round number (starting at 1, incrementing for each new round).
202
+
2.**Point User to File**: Direct the user to the questions file and instruct them to answer the questions directly in the file.
203
+
3.**STOP AND WAIT**: Do not proceed to Step 5. Wait for the user to indicate they have saved their answers.
204
+
4.**Read Answers**: After the user indicates they have saved their answers, read the file and continue the conversation.
205
+
5.**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 (return to step 3).
206
+
207
+
**Iterative Process:**
208
+
209
+
- If a user's answer reveals new questions or areas needing clarification, ask follow-up questions in a new questions file.
210
+
- Build on previous answers - use context from earlier responses to inform subsequent questions.
211
+
-**CRITICAL**: After creating any questions file, you MUST STOP and wait for the user to provide answers before proceeding.
212
+
- Only proceed to Step 5 after:
213
+
- You have received and reviewed all user answers to clarifying questions
214
+
- You have enough detail to populate all spec sections (User Stories, Demoable Units with functional requirements, etc.).
215
+
216
+
## Step 5: Spec Generation
154
217
155
218
Generate a comprehensive specification using this exact structure:
156
219
@@ -174,22 +237,31 @@ Generate a comprehensive specification using this exact structure:
174
237
[Focus on tangible progress and WHAT will be demonstrated. Define 2-4 small, end-to-end vertical slices using the format below.]
175
238
176
239
### [Unit 1]: [Title]
240
+
177
241
**Purpose:** [What this slice accomplishes and who it serves]
178
-
**Demo Criteria:** [What will be shown to verify working value]
- Example: `Order PDF: PDF downloaded from https://example.com/order-submitted shows completed flow demonstrates end-to-end functionality`
193
265
194
266
## Non-Goals (Out of Scope)
195
267
@@ -206,12 +278,13 @@ Generate a comprehensive specification using this exact structure:
206
278
## Repository Standards
207
279
208
280
[Identify existing patterns and practices that implementation should follow. Examples include:
281
+
209
282
- Coding standards and style guides from the repository
210
283
- Architectural patterns and file organization
211
284
- Testing conventions and quality assurance practices
212
285
- Documentation patterns and commit conventions
213
286
- Build and deployment workflows
214
-
If no specific standards are identified, state "Follow established repository patterns and conventions."]
287
+
If no specific standards are identified, state "Follow established repository patterns and conventions."]
215
288
216
289
## Technical Considerations
217
290
@@ -233,7 +306,7 @@ If no specific standards are identified, state "Follow established repository pa
233
306
2. [Question 2]
234
307
```
235
308
236
-
## Step 5: Review and Refinement
309
+
## Step 6: Review and Refinement
237
310
238
311
After generating the spec, present it to the user and ask:
239
312
@@ -247,11 +320,10 @@ Iterate based on feedback until the user is satisfied.
247
320
## Output Requirements
248
321
249
322
**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.
**Example:** For feature "user authentication", create directory `01-spec-user-authentication/`and save file as `01-spec-user-authentication.md` inside it
324
+
**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
253
325
254
-
## Critical Constraints (Negative Instructions)
326
+
## Critical Constraints
255
327
256
328
**NEVER:**
257
329
@@ -265,31 +337,12 @@ Iterate based on feedback until the user is satisfied.
265
337
**ALWAYS:**
266
338
267
339
- Ask clarifying questions before generating the spec
268
-
- Provide numbered/lettered options for easy selection
269
340
- Validate scope appropriateness before proceeding
270
341
- Use the exact spec structure provided above
271
342
- Ensure the spec is understandable by a junior developer
272
-
- Include proof artifacts and demo criteria for each work unit
343
+
- Include proof artifacts for each work unit that demonstrate what will be shown
273
344
- Follow identified repository standards and patterns in all requirements
274
345
275
346
## What Comes Next
276
347
277
348
Once this spec is complete and approved, instruct the user to run `/generate-task-list-from-spec`. This will start the next step in the workflow, which is to break down the specification into actionable tasks.
278
-
279
-
## Final Instructions
280
-
281
-
Follow this exact sequence:
282
-
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
287
-
-**Ensure each section has a distinct purpose** - avoid restating content from previous sections
288
-
-**User Stories** focus on motivation and WHY
289
-
-**Demoable Units** focus on tangible progress and WHAT will be shown
290
-
-**Functional Requirements** focus on system behavior and WHAT the system must do
291
-
-**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
0 commit comments