doit-toolkit-cli 0.1.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of doit-toolkit-cli might be problematic. Click here for more details.

Files changed (135) hide show
  1. doit_cli/__init__.py +1356 -0
  2. doit_cli/cli/__init__.py +26 -0
  3. doit_cli/cli/analytics_command.py +616 -0
  4. doit_cli/cli/context_command.py +213 -0
  5. doit_cli/cli/diagram_command.py +304 -0
  6. doit_cli/cli/fixit_command.py +641 -0
  7. doit_cli/cli/hooks_command.py +211 -0
  8. doit_cli/cli/init_command.py +613 -0
  9. doit_cli/cli/memory_command.py +293 -0
  10. doit_cli/cli/roadmapit_command.py +10 -0
  11. doit_cli/cli/status_command.py +117 -0
  12. doit_cli/cli/sync_prompts_command.py +248 -0
  13. doit_cli/cli/validate_command.py +196 -0
  14. doit_cli/cli/verify_command.py +204 -0
  15. doit_cli/cli/workflow_mixin.py +224 -0
  16. doit_cli/cli/xref_command.py +555 -0
  17. doit_cli/formatters/__init__.py +8 -0
  18. doit_cli/formatters/base.py +38 -0
  19. doit_cli/formatters/json_formatter.py +126 -0
  20. doit_cli/formatters/markdown_formatter.py +97 -0
  21. doit_cli/formatters/rich_formatter.py +257 -0
  22. doit_cli/main.py +51 -0
  23. doit_cli/models/__init__.py +139 -0
  24. doit_cli/models/agent.py +74 -0
  25. doit_cli/models/analytics_models.py +384 -0
  26. doit_cli/models/context_config.py +464 -0
  27. doit_cli/models/crossref_models.py +182 -0
  28. doit_cli/models/diagram_models.py +363 -0
  29. doit_cli/models/fixit_models.py +355 -0
  30. doit_cli/models/hook_config.py +125 -0
  31. doit_cli/models/project.py +91 -0
  32. doit_cli/models/results.py +121 -0
  33. doit_cli/models/search_models.py +228 -0
  34. doit_cli/models/status_models.py +195 -0
  35. doit_cli/models/sync_models.py +146 -0
  36. doit_cli/models/template.py +77 -0
  37. doit_cli/models/validation_models.py +175 -0
  38. doit_cli/models/workflow_models.py +319 -0
  39. doit_cli/prompts/__init__.py +5 -0
  40. doit_cli/prompts/fixit_prompts.py +344 -0
  41. doit_cli/prompts/interactive.py +390 -0
  42. doit_cli/rules/__init__.py +5 -0
  43. doit_cli/rules/builtin_rules.py +160 -0
  44. doit_cli/services/__init__.py +79 -0
  45. doit_cli/services/agent_detector.py +168 -0
  46. doit_cli/services/analytics_service.py +218 -0
  47. doit_cli/services/architecture_generator.py +290 -0
  48. doit_cli/services/backup_service.py +204 -0
  49. doit_cli/services/config_loader.py +113 -0
  50. doit_cli/services/context_loader.py +1123 -0
  51. doit_cli/services/coverage_calculator.py +142 -0
  52. doit_cli/services/crossref_service.py +237 -0
  53. doit_cli/services/cycle_time_calculator.py +134 -0
  54. doit_cli/services/date_inferrer.py +349 -0
  55. doit_cli/services/diagram_service.py +337 -0
  56. doit_cli/services/drift_detector.py +109 -0
  57. doit_cli/services/entity_parser.py +301 -0
  58. doit_cli/services/er_diagram_generator.py +197 -0
  59. doit_cli/services/fixit_service.py +699 -0
  60. doit_cli/services/github_service.py +192 -0
  61. doit_cli/services/hook_manager.py +258 -0
  62. doit_cli/services/hook_validator.py +528 -0
  63. doit_cli/services/input_validator.py +322 -0
  64. doit_cli/services/memory_search.py +527 -0
  65. doit_cli/services/mermaid_validator.py +334 -0
  66. doit_cli/services/prompt_transformer.py +91 -0
  67. doit_cli/services/prompt_writer.py +133 -0
  68. doit_cli/services/query_interpreter.py +428 -0
  69. doit_cli/services/report_exporter.py +219 -0
  70. doit_cli/services/report_generator.py +256 -0
  71. doit_cli/services/requirement_parser.py +112 -0
  72. doit_cli/services/roadmap_summarizer.py +209 -0
  73. doit_cli/services/rule_engine.py +443 -0
  74. doit_cli/services/scaffolder.py +215 -0
  75. doit_cli/services/score_calculator.py +172 -0
  76. doit_cli/services/section_parser.py +204 -0
  77. doit_cli/services/spec_scanner.py +327 -0
  78. doit_cli/services/state_manager.py +355 -0
  79. doit_cli/services/status_reporter.py +143 -0
  80. doit_cli/services/task_parser.py +347 -0
  81. doit_cli/services/template_manager.py +710 -0
  82. doit_cli/services/template_reader.py +158 -0
  83. doit_cli/services/user_journey_generator.py +214 -0
  84. doit_cli/services/user_story_parser.py +232 -0
  85. doit_cli/services/validation_service.py +188 -0
  86. doit_cli/services/validator.py +232 -0
  87. doit_cli/services/velocity_tracker.py +173 -0
  88. doit_cli/services/workflow_engine.py +405 -0
  89. doit_cli/templates/agent-file-template.md +28 -0
  90. doit_cli/templates/checklist-template.md +39 -0
  91. doit_cli/templates/commands/doit.checkin.md +363 -0
  92. doit_cli/templates/commands/doit.constitution.md +187 -0
  93. doit_cli/templates/commands/doit.documentit.md +485 -0
  94. doit_cli/templates/commands/doit.fixit.md +181 -0
  95. doit_cli/templates/commands/doit.implementit.md +265 -0
  96. doit_cli/templates/commands/doit.planit.md +262 -0
  97. doit_cli/templates/commands/doit.reviewit.md +355 -0
  98. doit_cli/templates/commands/doit.roadmapit.md +389 -0
  99. doit_cli/templates/commands/doit.scaffoldit.md +458 -0
  100. doit_cli/templates/commands/doit.specit.md +521 -0
  101. doit_cli/templates/commands/doit.taskit.md +304 -0
  102. doit_cli/templates/commands/doit.testit.md +277 -0
  103. doit_cli/templates/config/context.yaml +134 -0
  104. doit_cli/templates/config/hooks.yaml +93 -0
  105. doit_cli/templates/config/validation-rules.yaml +64 -0
  106. doit_cli/templates/github-issue-templates/epic.yml +78 -0
  107. doit_cli/templates/github-issue-templates/feature.yml +116 -0
  108. doit_cli/templates/github-issue-templates/task.yml +129 -0
  109. doit_cli/templates/hooks/.gitkeep +0 -0
  110. doit_cli/templates/hooks/post-commit.sh +25 -0
  111. doit_cli/templates/hooks/post-merge.sh +75 -0
  112. doit_cli/templates/hooks/pre-commit.sh +17 -0
  113. doit_cli/templates/hooks/pre-push.sh +18 -0
  114. doit_cli/templates/memory/completed_roadmap.md +50 -0
  115. doit_cli/templates/memory/constitution.md +125 -0
  116. doit_cli/templates/memory/roadmap.md +61 -0
  117. doit_cli/templates/plan-template.md +146 -0
  118. doit_cli/templates/scripts/bash/check-prerequisites.sh +166 -0
  119. doit_cli/templates/scripts/bash/common.sh +156 -0
  120. doit_cli/templates/scripts/bash/create-new-feature.sh +297 -0
  121. doit_cli/templates/scripts/bash/setup-plan.sh +61 -0
  122. doit_cli/templates/scripts/bash/update-agent-context.sh +675 -0
  123. doit_cli/templates/scripts/powershell/check-prerequisites.ps1 +148 -0
  124. doit_cli/templates/scripts/powershell/common.ps1 +137 -0
  125. doit_cli/templates/scripts/powershell/create-new-feature.ps1 +283 -0
  126. doit_cli/templates/scripts/powershell/setup-plan.ps1 +61 -0
  127. doit_cli/templates/scripts/powershell/update-agent-context.ps1 +406 -0
  128. doit_cli/templates/spec-template.md +159 -0
  129. doit_cli/templates/tasks-template.md +313 -0
  130. doit_cli/templates/vscode-settings.json +14 -0
  131. doit_toolkit_cli-0.1.10.dist-info/METADATA +324 -0
  132. doit_toolkit_cli-0.1.10.dist-info/RECORD +135 -0
  133. doit_toolkit_cli-0.1.10.dist-info/WHEEL +4 -0
  134. doit_toolkit_cli-0.1.10.dist-info/entry_points.txt +2 -0
  135. doit_toolkit_cli-0.1.10.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,521 @@
1
+ ---
2
+ description: Create or update the feature specification from a natural language feature description, with integrated ambiguity resolution and GitHub issue creation.
3
+ handoffs:
4
+ - label: Build Technical Plan
5
+ agent: doit.plan
6
+ prompt: Create a plan for the spec. I am building with...
7
+ - label: Scaffold Project Structure
8
+ agent: doit.scaffold
9
+ prompt: Generate project structure based on constitution tech stack
10
+ ---
11
+
12
+ ## User Input
13
+
14
+ ```text
15
+ $ARGUMENTS
16
+ ```
17
+
18
+ You **MUST** consider the user input before proceeding (if not empty).
19
+
20
+ ## Load Project Context
21
+
22
+ Before proceeding, load the project context to inform your responses:
23
+
24
+ ```bash
25
+ doit context show
26
+ ```
27
+
28
+ **If the command fails or doit is not installed**: Continue without context, but note that alignment with project principles cannot be verified.
29
+
30
+ **Use loaded context to**:
31
+
32
+ - Reference constitution principles when making decisions
33
+ - Consider roadmap priorities
34
+ - Identify connections to related specifications
35
+
36
+ **For this command specifically**:
37
+
38
+ - Reference constitution principles when defining requirements
39
+ - Align new features with roadmap priorities
40
+ - Check for overlap with existing specifications
41
+
42
+ ## Outline
43
+
44
+ The text the user typed after `/doit.doit` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `$ARGUMENTS` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
45
+
46
+ Given that feature description, do this:
47
+
48
+ 1. **Generate a concise short name** (2-4 words) for the branch:
49
+ - Analyze the feature description and extract the most meaningful keywords
50
+ - Create a 2-4 word short name that captures the essence of the feature
51
+ - Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
52
+ - Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)
53
+ - Keep it concise but descriptive enough to understand the feature at a glance
54
+ - Examples:
55
+ - "I want to add user authentication" → "user-auth"
56
+ - "Implement OAuth2 integration for the API" → "oauth2-api-integration"
57
+ - "Create a dashboard for analytics" → "analytics-dashboard"
58
+ - "Fix payment processing timeout bug" → "fix-payment-timeout"
59
+
60
+ 2. **Check for existing branches before creating new one**:
61
+
62
+ a. First, fetch all remote branches to ensure we have the latest information:
63
+
64
+ ```bash
65
+ git fetch --all --prune
66
+ ```
67
+
68
+ b. Find the highest feature number across all sources for the short-name:
69
+ - Remote branches: `git ls-remote --heads origin | grep -E 'refs/heads/[0-9]+-<short-name>$'`
70
+ - Local branches: `git branch | grep -E '^[* ]*[0-9]+-<short-name>$'`
71
+ - Specs directories: Check for directories matching `specs/[0-9]+-<short-name>`
72
+
73
+ c. Determine the next available number:
74
+ - Extract all numbers from all three sources
75
+ - Find the highest number N
76
+ - Use N+1 for the new branch number
77
+
78
+ d. Run the script `.doit/scripts/bash/create-new-feature.sh --json "$ARGUMENTS"` with the calculated number and short-name:
79
+ - Pass `--number N+1` and `--short-name "your-short-name"` along with the feature description
80
+ - Bash example: `.doit/scripts/bash/create-new-feature.sh --json "$ARGUMENTS" --json --number 5 --short-name "user-auth" "Add user authentication"`
81
+ - PowerShell example: `.doit/scripts/bash/create-new-feature.sh --json "$ARGUMENTS" -Json -Number 5 -ShortName "user-auth" "Add user authentication"`
82
+
83
+ **IMPORTANT**:
84
+ - Check all three sources (remote branches, local branches, specs directories) to find the highest number
85
+ - Only match branches/directories with the exact short-name pattern
86
+ - If no existing branches/directories found with this short-name, start with number 1
87
+ - You must only ever run this script once per feature
88
+ - The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for
89
+ - The JSON output will contain BRANCH_NAME and SPEC_FILE paths
90
+ - For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot")
91
+
92
+ 3. Load `.doit/templates/spec-template.md` to understand required sections.
93
+
94
+ 4. Follow this execution flow:
95
+
96
+ 1. Parse user description from Input
97
+ If empty: ERROR "No feature description provided"
98
+ 2. Extract key concepts from description
99
+ Identify: actors, actions, data, constraints
100
+ 3. For unclear aspects:
101
+ - Make informed guesses based on context and industry standards
102
+ - Only mark with [NEEDS CLARIFICATION: specific question] if:
103
+ - The choice significantly impacts feature scope or user experience
104
+ - Multiple reasonable interpretations exist with different implications
105
+ - No reasonable default exists
106
+ - **LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total**
107
+ - Prioritize clarifications by impact: scope > security/privacy > user experience > technical details
108
+ 4. Fill User Scenarios & Testing section
109
+ If no clear user flow: ERROR "Cannot determine user scenarios"
110
+ 5. Generate Functional Requirements
111
+ Each requirement must be testable
112
+ Use reasonable defaults for unspecified details (document assumptions in Assumptions section)
113
+ 6. Define Success Criteria
114
+ Create measurable, technology-agnostic outcomes
115
+ Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)
116
+ Each criterion must be verifiable without implementation details
117
+ 7. Identify Key Entities (if data involved)
118
+ 8. Return: SUCCESS (spec ready for planning)
119
+
120
+ 5. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
121
+
122
+ 6. **Generate Mermaid Visualizations** (FR-001, FR-002, FR-003):
123
+
124
+ After writing the spec content, generate visual diagrams to enhance understanding:
125
+
126
+ a. **User Journey Visualization**:
127
+ - Parse all user stories from the spec (### User Story N - [Title])
128
+ - For each user story, extract the key action flow from acceptance scenarios
129
+ - Generate a flowchart with one subgraph per user story
130
+ - Use format: `US{N}_S[Start] --> US{N}_A[Action] --> US{N}_E[End]`
131
+ - Replace the placeholder in `<!-- BEGIN:AUTO-GENERATED section="user-journey" -->` markers
132
+
133
+ ```mermaid
134
+ flowchart LR
135
+ subgraph "User Story 1 - [Actual Title]"
136
+ US1_S[User Starts] --> US1_A[Key Action] --> US1_E[Expected Outcome]
137
+ end
138
+ subgraph "User Story 2 - [Actual Title]"
139
+ US2_S[User Starts] --> US2_A[Key Action] --> US2_E[Expected Outcome]
140
+ end
141
+ ```
142
+
143
+ b. **Entity Relationships** (FR-002, FR-003):
144
+ - Check if Key Entities section exists and has content
145
+ - **IF Key Entities defined**:
146
+ - Parse entity names and relationships from the Key Entities section
147
+ - Generate an ER diagram showing entities and their relationships
148
+ - Replace content in `<!-- BEGIN:AUTO-GENERATED section="entity-relationships" -->` markers
149
+ - **IF NO Key Entities defined**:
150
+ - **REMOVE the entire Entity Relationships section** (from `## Entity Relationships` to before `## Requirements`)
151
+ - Do NOT leave an empty placeholder section
152
+
153
+ ```mermaid
154
+ erDiagram
155
+ ENTITY1 ||--o{ ENTITY2 : "relationship description"
156
+
157
+ ENTITY1 {
158
+ string id PK
159
+ string key_attribute
160
+ }
161
+ ```
162
+
163
+ c. **Diagram Validation**:
164
+ - Verify mermaid syntax is valid (proper diagram type, matching brackets)
165
+ - Check node count does not exceed 20 per diagram (split into subgraphs if needed)
166
+ - Ensure all entity names from Key Entities are represented
167
+
168
+ 7. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
169
+
170
+ a. **Create Spec Quality Checklist**: Generate a checklist file at `FEATURE_DIR/checklists/requirements.md` using the checklist template structure with these validation items:
171
+
172
+ ```markdown
173
+ # Specification Quality Checklist: [FEATURE NAME]
174
+
175
+ **Purpose**: Validate specification completeness and quality before proceeding to planning
176
+ **Created**: [DATE]
177
+ **Feature**: [Link to spec.md]
178
+
179
+ ## Content Quality
180
+
181
+ - [ ] No implementation details (languages, frameworks, APIs)
182
+ - [ ] Focused on user value and business needs
183
+ - [ ] Written for non-technical stakeholders
184
+ - [ ] All mandatory sections completed
185
+
186
+ ## Requirement Completeness
187
+
188
+ - [ ] No [NEEDS CLARIFICATION] markers remain
189
+ - [ ] Requirements are testable and unambiguous
190
+ - [ ] Success criteria are measurable
191
+ - [ ] Success criteria are technology-agnostic (no implementation details)
192
+ - [ ] All acceptance scenarios are defined
193
+ - [ ] Edge cases are identified
194
+ - [ ] Scope is clearly bounded
195
+ - [ ] Dependencies and assumptions identified
196
+
197
+ ## Feature Readiness
198
+
199
+ - [ ] All functional requirements have clear acceptance criteria
200
+ - [ ] User scenarios cover primary flows
201
+ - [ ] Feature meets measurable outcomes defined in Success Criteria
202
+ - [ ] No implementation details leak into specification
203
+
204
+ ## Notes
205
+
206
+ - Items marked incomplete require spec updates before `/doit.planit`
207
+ ```
208
+
209
+ b. **Run Validation Check**: Review the spec against each checklist item:
210
+ - For each item, determine if it passes or fails
211
+ - Document specific issues found (quote relevant spec sections)
212
+
213
+ c. **Handle Validation Results**:
214
+
215
+ - **If all items pass**: Mark checklist complete and proceed to step 6
216
+
217
+ - **If items fail (excluding [NEEDS CLARIFICATION])**:
218
+ 1. List the failing items and specific issues
219
+ 2. Update the spec to address each issue
220
+ 3. Re-run validation until all items pass (max 3 iterations)
221
+ 4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user
222
+
223
+ - **If [NEEDS CLARIFICATION] markers remain**:
224
+ 1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec
225
+ 2. **LIMIT CHECK**: If more than 3 markers exist, keep only the 3 most critical (by scope/security/UX impact) and make informed guesses for the rest
226
+ 3. For each clarification needed (max 3), present options to user in this format:
227
+
228
+ ```markdown
229
+ ## Question [N]: [Topic]
230
+
231
+ **Context**: [Quote relevant spec section]
232
+
233
+ **What we need to know**: [Specific question from NEEDS CLARIFICATION marker]
234
+
235
+ **Suggested Answers**:
236
+
237
+ | Option | Answer | Implications |
238
+ |--------|--------|--------------|
239
+ | A | [First suggested answer] | [What this means for the feature] |
240
+ | B | [Second suggested answer] | [What this means for the feature] |
241
+ | C | [Third suggested answer] | [What this means for the feature] |
242
+ | Custom | Provide your own answer | [Explain how to provide custom input] |
243
+
244
+ **Your choice**: _[Wait for user response]_
245
+ ```
246
+
247
+ 4. **CRITICAL - Table Formatting**: Ensure markdown tables are properly formatted:
248
+ - Use consistent spacing with pipes aligned
249
+ - Each cell should have spaces around content: `| Content |` not `|Content|`
250
+ - Header separator must have at least 3 dashes: `|--------|`
251
+ - Test that the table renders correctly in markdown preview
252
+ 5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)
253
+ 6. Present all questions together before waiting for responses
254
+ 7. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")
255
+ 8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer
256
+ 9. Re-run validation after all clarifications are resolved
257
+
258
+ d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status
259
+
260
+ 8. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (`/doit.planit`).
261
+
262
+ **NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.
263
+
264
+ ## General Guidelines
265
+
266
+ ## Quick Guidelines
267
+
268
+ - Focus on **WHAT** users need and **WHY**.
269
+ - Avoid HOW to implement (no tech stack, APIs, code structure).
270
+ - Written for business stakeholders, not developers.
271
+ - DO NOT create any checklists that are embedded in the spec. That will be a separate command.
272
+
273
+ ### Section Requirements
274
+
275
+ - **Mandatory sections**: Must be completed for every feature
276
+ - **Optional sections**: Include only when relevant to the feature
277
+ - When a section doesn't apply, remove it entirely (don't leave as "N/A")
278
+
279
+ ### For AI Generation
280
+
281
+ When creating this spec from a user prompt:
282
+
283
+ 1. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps
284
+ 2. **Document assumptions**: Record reasonable defaults in the Assumptions section
285
+ 3. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
286
+ - Significantly impact feature scope or user experience
287
+ - Have multiple reasonable interpretations with different implications
288
+ - Lack any reasonable default
289
+ 4. **Prioritize clarifications**: scope > security/privacy > user experience > technical details
290
+ 5. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item
291
+ 6. **Common areas needing clarification** (only if no reasonable default exists):
292
+ - Feature scope and boundaries (include/exclude specific use cases)
293
+ - User types and permissions (if multiple conflicting interpretations possible)
294
+ - Security/compliance requirements (when legally/financially significant)
295
+
296
+ **Examples of reasonable defaults** (don't ask about these):
297
+
298
+ - Data retention: Industry-standard practices for the domain
299
+ - Performance targets: Standard web/mobile app expectations unless specified
300
+ - Error handling: User-friendly messages with appropriate fallbacks
301
+ - Authentication method: Standard session-based or OAuth2 for web apps
302
+ - Integration patterns: RESTful APIs unless specified otherwise
303
+
304
+ ### Success Criteria Guidelines
305
+
306
+ Success criteria must be:
307
+
308
+ 1. **Measurable**: Include specific metrics (time, percentage, count, rate)
309
+ 2. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools
310
+ 3. **User-focused**: Describe outcomes from user/business perspective, not system internals
311
+ 4. **Verifiable**: Can be tested/validated without knowing implementation details
312
+
313
+ **Good examples**:
314
+
315
+ - "Users can complete checkout in under 3 minutes"
316
+ - "System supports 10,000 concurrent users"
317
+ - "95% of searches return results in under 1 second"
318
+ - "Task completion rate improves by 40%"
319
+
320
+ **Bad examples** (implementation-focused):
321
+
322
+ - "API response time is under 200ms" (too technical, use "Users see results instantly")
323
+ - "Database can handle 1000 TPS" (implementation detail, use user-facing metric)
324
+ - "React components render efficiently" (framework-specific)
325
+ - "Redis cache hit rate above 80%" (technology-specific)
326
+
327
+ ---
328
+
329
+ ## Integrated Ambiguity Scan
330
+
331
+ After creating the initial spec, perform a structured ambiguity scan using this 8-category taxonomy. For each category, assess status: Clear / Partial / Missing.
332
+
333
+ ### Category Taxonomy
334
+
335
+ 1. **Functional Scope & Behavior**
336
+ - Core user goals & success criteria
337
+ - Explicit out-of-scope declarations
338
+ - User roles / personas differentiation
339
+
340
+ 2. **Domain & Data Model**
341
+ - Entities, attributes, relationships
342
+ - Identity & uniqueness rules
343
+ - Lifecycle/state transitions
344
+
345
+ 3. **Interaction & UX Flow**
346
+ - Critical user journeys / sequences
347
+ - Error/empty/loading states
348
+ - Accessibility or localization notes
349
+
350
+ 4. **Non-Functional Quality Attributes**
351
+ - Performance (latency, throughput targets)
352
+ - Scalability assumptions
353
+ - Security & privacy requirements
354
+
355
+ 5. **Integration & External Dependencies**
356
+ - External services/APIs
357
+ - Data import/export formats
358
+
359
+ 6. **Edge Cases & Failure Handling**
360
+ - Negative scenarios
361
+ - Conflict resolution
362
+
363
+ 7. **Constraints & Tradeoffs**
364
+ - Technical constraints
365
+ - Explicit tradeoffs
366
+
367
+ 8. **Terminology & Consistency**
368
+ - Canonical glossary terms
369
+ - Avoided synonyms
370
+
371
+ ### Clarification Process
372
+
373
+ If Partial or Missing categories exist that require user input:
374
+
375
+ 1. Generate up to **5 clarification questions** maximum
376
+ 2. Each question must be answerable with:
377
+ - Multiple-choice (2-5 options), OR
378
+ - Short answer (≤5 words)
379
+ 3. Present questions sequentially, one at a time
380
+ 4. After each answer, integrate into the appropriate spec section
381
+ 5. Ensure **no [NEEDS CLARIFICATION] markers remain** in final output
382
+
383
+ ---
384
+
385
+ ## GitHub Issue Integration (FR-048, FR-049)
386
+
387
+ After the spec is complete and validated, create GitHub issues if a remote is available.
388
+
389
+ ### Issue Creation Process
390
+
391
+ 1. **Detect GitHub Remote**:
392
+
393
+ ```bash
394
+ git remote get-url origin 2>/dev/null
395
+ ```
396
+
397
+ If no remote or not a GitHub URL, skip issue creation gracefully.
398
+
399
+ 2. **Create Epic Issue**:
400
+ - Title: `[Epic]: {Feature Name from spec}`
401
+ - Labels: `epic`
402
+ - Body: Summary section from spec + link to spec file
403
+ - Store Epic issue number for linking
404
+
405
+ 3. **Create Feature Issues for Each User Story**:
406
+ - Title: `[Feature]: {User Story Title}`
407
+ - Labels: `feature`, `priority:{P1|P2|P3}`
408
+ - Body: User story content + acceptance scenarios
409
+ - Add `Part of Epic #XXX` reference
410
+
411
+ 4. **Skip Flag Option**:
412
+ - If `--skip-issues` provided in arguments, skip GitHub issue creation
413
+ - Example: `/doit.doit "my feature" --skip-issues`
414
+
415
+ 5. **Graceful Fallback**:
416
+ - If `gh` CLI not available: warn and continue without issues
417
+ - If GitHub API fails: log error, continue with spec creation
418
+ - Never fail the entire command due to GitHub issues
419
+
420
+ ### Issue Creation Commands
421
+
422
+ ```bash
423
+ # Create Epic
424
+ gh issue create --title "[Epic]: {FEATURE_NAME}" \
425
+ --label "epic" \
426
+ --body "$(cat <<'EOF'
427
+ ## Summary
428
+ {SPEC_SUMMARY}
429
+
430
+ ## Success Criteria
431
+ {SUCCESS_CRITERIA}
432
+
433
+ ---
434
+ Spec file: `{SPEC_FILE_PATH}`
435
+ EOF
436
+ )"
437
+
438
+ # Create Feature for each user story
439
+ gh issue create --title "[Feature]: {USER_STORY_TITLE}" \
440
+ --label "feature,priority:{PRIORITY}" \
441
+ --body "$(cat <<'EOF'
442
+ ## Description
443
+ {USER_STORY_CONTENT}
444
+
445
+ ## Acceptance Scenarios
446
+ {ACCEPTANCE_SCENARIOS}
447
+
448
+ ---
449
+ Part of Epic #{EPIC_NUMBER}
450
+ EOF
451
+ )"
452
+ ```
453
+
454
+ ### Output
455
+
456
+ Report created issues at the end:
457
+
458
+ ```markdown
459
+ ## GitHub Issues Created
460
+
461
+ - Epic: #{EPIC_NUMBER} - {EPIC_TITLE}
462
+ - Features:
463
+ - #{FEATURE_1_NUMBER} - {FEATURE_1_TITLE} (P1)
464
+ - #{FEATURE_2_NUMBER} - {FEATURE_2_TITLE} (P2)
465
+ ```
466
+
467
+ If issues were skipped or failed, note the reason.
468
+
469
+ ---
470
+
471
+ ## Next Steps
472
+
473
+ After completing this command, display a recommendation section based on the outcome:
474
+
475
+ ### On Success (spec created)
476
+
477
+ Display the following at the end of your output:
478
+
479
+ ```markdown
480
+ ---
481
+
482
+ ## Next Steps
483
+
484
+ ┌─────────────────────────────────────────────────────────────┐
485
+ │ Workflow Progress │
486
+ │ ● specit → ○ planit → ○ taskit → ○ implementit → ○ checkin │
487
+ └─────────────────────────────────────────────────────────────┘
488
+
489
+ **Recommended**: Run `/doit.planit` to create an implementation plan for this feature.
490
+ ```
491
+
492
+ ### On Success with Clarifications Needed
493
+
494
+ If the spec contains [NEEDS CLARIFICATION] markers:
495
+
496
+ ```markdown
497
+ ---
498
+
499
+ ## Next Steps
500
+
501
+ ┌─────────────────────────────────────────────────────────────┐
502
+ │ Workflow Progress │
503
+ │ ● specit → ○ planit → ○ taskit → ○ implementit → ○ checkin │
504
+ └─────────────────────────────────────────────────────────────┘
505
+
506
+ **Recommended**: Resolve N open questions in the spec before proceeding to planning.
507
+ ```
508
+
509
+ ### On Error
510
+
511
+ If the command fails (e.g., branch creation failed):
512
+
513
+ ```markdown
514
+ ---
515
+
516
+ ## Next Steps
517
+
518
+ **Issue**: [Brief description of what went wrong]
519
+
520
+ **Recommended**: [Specific recovery action based on the error]
521
+ ```