|
1 | 1 | --- |
2 | 2 | description: Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec. |
3 | | -handoffs: |
| 3 | +handoffs: |
4 | 4 | - label: Build Technical Plan |
5 | 5 | agent: speckit.plan |
6 | 6 | prompt: Create a plan for the spec. I am building with... |
@@ -86,69 +86,69 @@ Execution steps: |
86 | 86 | - Information is better deferred to planning phase (note internally) |
87 | 87 |
|
88 | 88 | 3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints: |
89 | | - - Maximum of 10 total questions across the whole session. |
90 | | - - Each question must be answerable with EITHER: |
91 | | - - A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR |
92 | | - - A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words"). |
93 | | - - Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation. |
94 | | - - Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved. |
95 | | - - Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness). |
96 | | - - Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests. |
97 | | - - If more than 5 categories remain unresolved, select the top 5 by (Impact * Uncertainty) heuristic. |
| 89 | + - Maximum of 10 total questions across the whole session. |
| 90 | + - Each question must be answerable with EITHER: |
| 91 | + - A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR |
| 92 | + - A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words"). |
| 93 | + - Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation. |
| 94 | + - Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved. |
| 95 | + - Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness). |
| 96 | + - Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests. |
| 97 | + - If more than 5 categories remain unresolved, select the top 5 by (Impact \* Uncertainty) heuristic. |
98 | 98 |
|
99 | 99 | 4. Sequential questioning loop (interactive): |
100 | | - - Present EXACTLY ONE question at a time. |
101 | | - - For multiple‑choice questions: |
102 | | - - **Analyze all options** and determine the **most suitable option** based on: |
103 | | - - Best practices for the project type |
104 | | - - Common patterns in similar implementations |
105 | | - - Risk reduction (security, performance, maintainability) |
106 | | - - Alignment with any explicit project goals or constraints visible in the spec |
107 | | - - Present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice). |
108 | | - - Format as: `**Recommended:** Option [X] - <reasoning>` |
109 | | - - Then render all options as a Markdown table: |
110 | | - |
111 | | - | Option | Description | |
112 | | - |--------|-------------| |
113 | | - | A | <Option A description> | |
114 | | - | B | <Option B description> | |
115 | | - | C | <Option C description> (add D/E as needed up to 5) | |
116 | | - | Short | Provide a different short answer (<=5 words) (Include only if free-form alternative is appropriate) | |
117 | | - |
118 | | - - After the table, add: `You can reply with the option letter (e.g., "A"), accept the recommendation by saying "yes" or "recommended", or provide your own short answer.` |
119 | | - - For short‑answer style (no meaningful discrete options): |
120 | | - - Provide your **suggested answer** based on best practices and context. |
121 | | - - Format as: `**Suggested:** <your proposed answer> - <brief reasoning>` |
122 | | - - Then output: `Format: Short answer (<=5 words). You can accept the suggestion by saying "yes" or "suggested", or provide your own answer.` |
123 | | - - After the user answers: |
124 | | - - If the user replies with "yes", "recommended", or "suggested", use your previously stated recommendation/suggestion as the answer. |
125 | | - - Otherwise, validate the answer maps to one option or fits the <=5 word constraint. |
126 | | - - If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance). |
127 | | - - Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question. |
128 | | - - Stop asking further questions when: |
129 | | - - All critical ambiguities resolved early (remaining queued items become unnecessary), OR |
130 | | - - User signals completion ("done", "good", "no more"), OR |
131 | | - - You reach 5 asked questions. |
132 | | - - Never reveal future queued questions in advance. |
133 | | - - If no valid questions exist at start, immediately report no critical ambiguities. |
| 100 | + - Present EXACTLY ONE question at a time. |
| 101 | + - For multiple‑choice questions: |
| 102 | + - **Analyze all options** and determine the **most suitable option** based on: |
| 103 | + - Best practices for the project type |
| 104 | + - Common patterns in similar implementations |
| 105 | + - Risk reduction (security, performance, maintainability) |
| 106 | + - Alignment with any explicit project goals or constraints visible in the spec |
| 107 | + - Present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice). |
| 108 | + - Format as: `**Recommended:** Option [X] - <reasoning>` |
| 109 | + - Then render all options as a Markdown table: |
| 110 | + |
| 111 | + | Option | Description | |
| 112 | + | ------ | --------------------------------------------------------------------------------------------------- | |
| 113 | + | A | <Option A description> | |
| 114 | + | B | <Option B description> | |
| 115 | + | C | <Option C description> (add D/E as needed up to 5) | |
| 116 | + | Short | Provide a different short answer (<=5 words) (Include only if free-form alternative is appropriate) | |
| 117 | + - After the table, add: `You can reply with the option letter (e.g., "A"), accept the recommendation by saying "yes" or "recommended", or provide your own short answer.` |
| 118 | + |
| 119 | + - For short‑answer style (no meaningful discrete options): |
| 120 | + - Provide your **suggested answer** based on best practices and context. |
| 121 | + - Format as: `**Suggested:** <your proposed answer> - <brief reasoning>` |
| 122 | + - Then output: `Format: Short answer (<=5 words). You can accept the suggestion by saying "yes" or "suggested", or provide your own answer.` |
| 123 | + - After the user answers: |
| 124 | + - If the user replies with "yes", "recommended", or "suggested", use your previously stated recommendation/suggestion as the answer. |
| 125 | + - Otherwise, validate the answer maps to one option or fits the <=5 word constraint. |
| 126 | + - If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance). |
| 127 | + - Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question. |
| 128 | + - Stop asking further questions when: |
| 129 | + - All critical ambiguities resolved early (remaining queued items become unnecessary), OR |
| 130 | + - User signals completion ("done", "good", "no more"), OR |
| 131 | + - You reach 5 asked questions. |
| 132 | + - Never reveal future queued questions in advance. |
| 133 | + - If no valid questions exist at start, immediately report no critical ambiguities. |
134 | 134 |
|
135 | 135 | 5. Integration after EACH accepted answer (incremental update approach): |
136 | | - - Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents. |
137 | | - - For the first integrated answer in this session: |
138 | | - - Ensure a `## Clarifications` section exists (create it just after the highest-level contextual/overview section per the spec template if missing). |
139 | | - - Under it, create (if not present) a `### Session YYYY-MM-DD` subheading for today. |
140 | | - - Append a bullet line immediately after acceptance: `- Q: <question> → A: <final answer>`. |
141 | | - - Then immediately apply the clarification to the most appropriate section(s): |
142 | | - - Functional ambiguity → Update or add a bullet in Functional Requirements. |
143 | | - - User interaction / actor distinction → Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario. |
144 | | - - Data shape / entities → Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly. |
145 | | - - Non-functional constraint → Add/modify measurable criteria in Non-Functional / Quality Attributes section (convert vague adjective to metric or explicit target). |
146 | | - - Edge case / negative flow → Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it). |
147 | | - - Terminology conflict → Normalize term across spec; retain original only if necessary by adding `(formerly referred to as "X")` once. |
148 | | - - If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text. |
149 | | - - Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite). |
150 | | - - Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact. |
151 | | - - Keep each inserted clarification minimal and testable (avoid narrative drift). |
| 136 | + - Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents. |
| 137 | + - For the first integrated answer in this session: |
| 138 | + - Ensure a `## Clarifications` section exists (create it just after the highest-level contextual/overview section per the spec template if missing). |
| 139 | + - Under it, create (if not present) a `### Session YYYY-MM-DD` subheading for today. |
| 140 | + - Append a bullet line immediately after acceptance: `- Q: <question> → A: <final answer>`. |
| 141 | + - Then immediately apply the clarification to the most appropriate section(s): |
| 142 | + - Functional ambiguity → Update or add a bullet in Functional Requirements. |
| 143 | + - User interaction / actor distinction → Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario. |
| 144 | + - Data shape / entities → Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly. |
| 145 | + - Non-functional constraint → Add/modify measurable criteria in Non-Functional / Quality Attributes section (convert vague adjective to metric or explicit target). |
| 146 | + - Edge case / negative flow → Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it). |
| 147 | + - Terminology conflict → Normalize term across spec; retain original only if necessary by adding `(formerly referred to as "X")` once. |
| 148 | + - If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text. |
| 149 | + - Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite). |
| 150 | + - Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact. |
| 151 | + - Keep each inserted clarification minimal and testable (avoid narrative drift). |
152 | 152 |
|
153 | 153 | 6. Validation (performed after EACH write plus final pass): |
154 | 154 | - Clarifications session contains exactly one bullet per accepted answer (no duplicates). |
|
0 commit comments