doit-toolkit-cli 0.1.9__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.
Files changed (134) 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/status_command.py +117 -0
  11. doit_cli/cli/sync_prompts_command.py +248 -0
  12. doit_cli/cli/validate_command.py +196 -0
  13. doit_cli/cli/verify_command.py +204 -0
  14. doit_cli/cli/workflow_mixin.py +224 -0
  15. doit_cli/cli/xref_command.py +555 -0
  16. doit_cli/formatters/__init__.py +8 -0
  17. doit_cli/formatters/base.py +38 -0
  18. doit_cli/formatters/json_formatter.py +126 -0
  19. doit_cli/formatters/markdown_formatter.py +97 -0
  20. doit_cli/formatters/rich_formatter.py +257 -0
  21. doit_cli/main.py +49 -0
  22. doit_cli/models/__init__.py +139 -0
  23. doit_cli/models/agent.py +74 -0
  24. doit_cli/models/analytics_models.py +384 -0
  25. doit_cli/models/context_config.py +464 -0
  26. doit_cli/models/crossref_models.py +182 -0
  27. doit_cli/models/diagram_models.py +363 -0
  28. doit_cli/models/fixit_models.py +355 -0
  29. doit_cli/models/hook_config.py +125 -0
  30. doit_cli/models/project.py +91 -0
  31. doit_cli/models/results.py +121 -0
  32. doit_cli/models/search_models.py +228 -0
  33. doit_cli/models/status_models.py +195 -0
  34. doit_cli/models/sync_models.py +146 -0
  35. doit_cli/models/template.py +77 -0
  36. doit_cli/models/validation_models.py +175 -0
  37. doit_cli/models/workflow_models.py +319 -0
  38. doit_cli/prompts/__init__.py +5 -0
  39. doit_cli/prompts/fixit_prompts.py +344 -0
  40. doit_cli/prompts/interactive.py +390 -0
  41. doit_cli/rules/__init__.py +5 -0
  42. doit_cli/rules/builtin_rules.py +160 -0
  43. doit_cli/services/__init__.py +79 -0
  44. doit_cli/services/agent_detector.py +168 -0
  45. doit_cli/services/analytics_service.py +218 -0
  46. doit_cli/services/architecture_generator.py +290 -0
  47. doit_cli/services/backup_service.py +204 -0
  48. doit_cli/services/config_loader.py +113 -0
  49. doit_cli/services/context_loader.py +1121 -0
  50. doit_cli/services/coverage_calculator.py +142 -0
  51. doit_cli/services/crossref_service.py +237 -0
  52. doit_cli/services/cycle_time_calculator.py +134 -0
  53. doit_cli/services/date_inferrer.py +349 -0
  54. doit_cli/services/diagram_service.py +337 -0
  55. doit_cli/services/drift_detector.py +109 -0
  56. doit_cli/services/entity_parser.py +301 -0
  57. doit_cli/services/er_diagram_generator.py +197 -0
  58. doit_cli/services/fixit_service.py +699 -0
  59. doit_cli/services/github_service.py +192 -0
  60. doit_cli/services/hook_manager.py +258 -0
  61. doit_cli/services/hook_validator.py +528 -0
  62. doit_cli/services/input_validator.py +322 -0
  63. doit_cli/services/memory_search.py +527 -0
  64. doit_cli/services/mermaid_validator.py +334 -0
  65. doit_cli/services/prompt_transformer.py +91 -0
  66. doit_cli/services/prompt_writer.py +133 -0
  67. doit_cli/services/query_interpreter.py +428 -0
  68. doit_cli/services/report_exporter.py +219 -0
  69. doit_cli/services/report_generator.py +256 -0
  70. doit_cli/services/requirement_parser.py +112 -0
  71. doit_cli/services/roadmap_summarizer.py +209 -0
  72. doit_cli/services/rule_engine.py +443 -0
  73. doit_cli/services/scaffolder.py +215 -0
  74. doit_cli/services/score_calculator.py +172 -0
  75. doit_cli/services/section_parser.py +204 -0
  76. doit_cli/services/spec_scanner.py +327 -0
  77. doit_cli/services/state_manager.py +355 -0
  78. doit_cli/services/status_reporter.py +143 -0
  79. doit_cli/services/task_parser.py +347 -0
  80. doit_cli/services/template_manager.py +710 -0
  81. doit_cli/services/template_reader.py +158 -0
  82. doit_cli/services/user_journey_generator.py +214 -0
  83. doit_cli/services/user_story_parser.py +232 -0
  84. doit_cli/services/validation_service.py +188 -0
  85. doit_cli/services/validator.py +232 -0
  86. doit_cli/services/velocity_tracker.py +173 -0
  87. doit_cli/services/workflow_engine.py +405 -0
  88. doit_cli/templates/agent-file-template.md +28 -0
  89. doit_cli/templates/checklist-template.md +39 -0
  90. doit_cli/templates/commands/doit.checkin.md +363 -0
  91. doit_cli/templates/commands/doit.constitution.md +187 -0
  92. doit_cli/templates/commands/doit.documentit.md +485 -0
  93. doit_cli/templates/commands/doit.fixit.md +181 -0
  94. doit_cli/templates/commands/doit.implementit.md +265 -0
  95. doit_cli/templates/commands/doit.planit.md +262 -0
  96. doit_cli/templates/commands/doit.reviewit.md +355 -0
  97. doit_cli/templates/commands/doit.roadmapit.md +368 -0
  98. doit_cli/templates/commands/doit.scaffoldit.md +458 -0
  99. doit_cli/templates/commands/doit.specit.md +521 -0
  100. doit_cli/templates/commands/doit.taskit.md +304 -0
  101. doit_cli/templates/commands/doit.testit.md +277 -0
  102. doit_cli/templates/config/context.yaml +134 -0
  103. doit_cli/templates/config/hooks.yaml +93 -0
  104. doit_cli/templates/config/validation-rules.yaml +64 -0
  105. doit_cli/templates/github-issue-templates/epic.yml +78 -0
  106. doit_cli/templates/github-issue-templates/feature.yml +116 -0
  107. doit_cli/templates/github-issue-templates/task.yml +129 -0
  108. doit_cli/templates/hooks/.gitkeep +0 -0
  109. doit_cli/templates/hooks/post-commit.sh +25 -0
  110. doit_cli/templates/hooks/post-merge.sh +75 -0
  111. doit_cli/templates/hooks/pre-commit.sh +17 -0
  112. doit_cli/templates/hooks/pre-push.sh +18 -0
  113. doit_cli/templates/memory/completed_roadmap.md +50 -0
  114. doit_cli/templates/memory/constitution.md +125 -0
  115. doit_cli/templates/memory/roadmap.md +61 -0
  116. doit_cli/templates/plan-template.md +146 -0
  117. doit_cli/templates/scripts/bash/check-prerequisites.sh +166 -0
  118. doit_cli/templates/scripts/bash/common.sh +156 -0
  119. doit_cli/templates/scripts/bash/create-new-feature.sh +297 -0
  120. doit_cli/templates/scripts/bash/setup-plan.sh +61 -0
  121. doit_cli/templates/scripts/bash/update-agent-context.sh +675 -0
  122. doit_cli/templates/scripts/powershell/check-prerequisites.ps1 +148 -0
  123. doit_cli/templates/scripts/powershell/common.ps1 +137 -0
  124. doit_cli/templates/scripts/powershell/create-new-feature.ps1 +283 -0
  125. doit_cli/templates/scripts/powershell/setup-plan.ps1 +61 -0
  126. doit_cli/templates/scripts/powershell/update-agent-context.ps1 +406 -0
  127. doit_cli/templates/spec-template.md +159 -0
  128. doit_cli/templates/tasks-template.md +313 -0
  129. doit_cli/templates/vscode-settings.json +14 -0
  130. doit_toolkit_cli-0.1.9.dist-info/METADATA +324 -0
  131. doit_toolkit_cli-0.1.9.dist-info/RECORD +134 -0
  132. doit_toolkit_cli-0.1.9.dist-info/WHEEL +4 -0
  133. doit_toolkit_cli-0.1.9.dist-info/entry_points.txt +2 -0
  134. doit_toolkit_cli-0.1.9.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,355 @@
1
+ ---
2
+ description: Review implemented code for quality and completeness against specifications
3
+ handoffs:
4
+ - label: Run Tests
5
+ agent: doit.test
6
+ prompt: Execute automated tests and generate test report
7
+ send: true
8
+ - label: Check In
9
+ agent: doit.checkin
10
+ prompt: Finalize feature and create pull request
11
+ send: true
12
+ ---
13
+
14
+ ## User Input
15
+
16
+ ```text
17
+ $ARGUMENTS
18
+ ```
19
+
20
+ You **MUST** consider the user input before proceeding (if not empty).
21
+
22
+ ## Load Project Context
23
+
24
+ Before proceeding, load the project context to inform your responses:
25
+
26
+ ```bash
27
+ doit context show
28
+ ```
29
+
30
+ **If the command fails or doit is not installed**: Continue without context, but note that alignment with project principles cannot be verified.
31
+
32
+ **Use loaded context to**:
33
+
34
+ - Reference constitution principles when making decisions
35
+ - Consider roadmap priorities
36
+ - Identify connections to related specifications
37
+
38
+ ## Outline
39
+
40
+ 1. **Setup**: Run `.doit/scripts/bash/check-prerequisites.sh --json --require-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
41
+
42
+ 2. **Load review context**:
43
+ - **REQUIRED**: Read spec.md for requirements and acceptance criteria
44
+ - **REQUIRED**: Read plan.md for technical decisions and architecture
45
+ - **REQUIRED**: Read tasks.md for implementation details and file paths
46
+ - **IF EXISTS**: Read data-model.md for entity definitions
47
+ - **IF EXISTS**: Read contracts/ for API specifications
48
+
49
+ 3. **Detect implemented files** from tasks.md:
50
+ - Parse completed tasks (marked with [X])
51
+ - Extract file paths from task descriptions
52
+ - Build list of files to review
53
+ - Group files by category: models, services, endpoints, tests, config
54
+
55
+ 4. **Execute code review** against requirements:
56
+ - For each implemented file:
57
+ - Read file contents
58
+ - Compare against relevant spec requirements
59
+ - Check adherence to plan.md architecture decisions
60
+ - Verify data model compliance (if data-model.md exists)
61
+ - Verify API contract compliance (if contracts/ exists)
62
+ - Generate findings with severity levels:
63
+ - **CRITICAL**: Requirement not implemented, security issue, data loss risk
64
+ - **MAJOR**: Partial implementation, performance concern, missing validation
65
+ - **MINOR**: Code style, documentation gap, minor deviation from plan
66
+ - **INFO**: Suggestion, optimization opportunity, best practice note
67
+
68
+ 5. **Format findings report**:
69
+
70
+ ```text
71
+ ## Code Review Findings
72
+
73
+ ### Critical (X findings)
74
+ | File | Issue | Requirement |
75
+ |------|-------|-------------|
76
+ | path/to/file.py | Description | FR-XXX |
77
+
78
+ ### Major (X findings)
79
+ ...
80
+
81
+ ### Minor (X findings)
82
+ ...
83
+
84
+ ### Info (X findings)
85
+ ...
86
+
87
+ ### Summary
88
+ - Total files reviewed: X
89
+ - Critical issues: X
90
+ - Major issues: X
91
+ - Minor issues: X
92
+ - Recommendations: [list]
93
+ ```
94
+
95
+ 6. **Extract manual test items** from spec.md:
96
+ - Parse acceptance criteria/scenarios from spec
97
+ - Extract testable items that require manual verification
98
+ - Items typically marked as "Given/When/Then" or acceptance criteria
99
+ - Create sequential test list with:
100
+ - Test ID (MT-001, MT-002, etc.)
101
+ - Description
102
+ - Expected outcome
103
+ - Prerequisites (if any)
104
+
105
+ 7. **Present manual tests sequentially**:
106
+ - For each manual test:
107
+
108
+ ```text
109
+ ## Manual Test MT-XXX
110
+
111
+ **Description**: [test description]
112
+ **Prerequisites**: [any setup needed]
113
+ **Steps**:
114
+ 1. [step 1]
115
+ 2. [step 2]
116
+ ...
117
+
118
+ **Expected Result**: [what should happen]
119
+
120
+ ---
121
+ Please execute this test and respond with:
122
+ - PASS: Test passed as expected
123
+ - FAIL: Test failed (describe what happened)
124
+ - SKIP: Cannot test right now (provide reason)
125
+ - BLOCK: Blocked by issue (describe blocker)
126
+ ```
127
+
128
+ - Wait for user response before proceeding to next test
129
+ - Track results in memory
130
+
131
+ 8. **Track test progress**:
132
+ - Maintain running tally:
133
+
134
+ ```text
135
+ Progress: X/Y tests completed
136
+ - Passed: X
137
+ - Failed: X
138
+ - Skipped: X
139
+ - Blocked: X
140
+ ```
141
+
142
+ - Display after each test completion
143
+
144
+ 9. **Collect sign-off**:
145
+ - After all manual tests complete, present summary:
146
+
147
+ ```text
148
+ ## Manual Testing Complete
149
+
150
+ | Test ID | Description | Result |
151
+ |---------|-------------|--------|
152
+ | MT-001 | ... | PASS |
153
+ | MT-002 | ... | FAIL |
154
+ ...
155
+
156
+ **Overall Status**: [PASS if no failures, FAIL otherwise]
157
+
158
+ Do you approve these results and sign off on manual testing? (yes/no)
159
+ ```
160
+
161
+ - Record sign-off response and timestamp
162
+
163
+ 10. **Generate review-report.md** in FEATURE_DIR:
164
+
165
+ ```markdown
166
+ # Review Report: [Feature Name]
167
+
168
+ **Date**: [timestamp]
169
+ **Reviewer**: [Claude]
170
+ **Branch**: [current branch]
171
+
172
+ ## Code Review Summary
173
+
174
+ | Severity | Count |
175
+ |----------|-------|
176
+ | Critical | X |
177
+ | Major | X |
178
+ | Minor | X |
179
+ | Info | X |
180
+
181
+ ### Critical Findings
182
+ [detailed list]
183
+
184
+ ### Major Findings
185
+ [detailed list]
186
+
187
+ ## Manual Testing Summary
188
+
189
+ | Metric | Count |
190
+ |--------|-------|
191
+ | Total Tests | X |
192
+ | Passed | X |
193
+ | Failed | X |
194
+ | Skipped | X |
195
+ | Blocked | X |
196
+
197
+ ### Test Results
198
+ [detailed table]
199
+
200
+ ## Sign-Off
201
+
202
+ - Manual Testing: [Approved/Not Approved] at [timestamp]
203
+ - Notes: [any notes from sign-off]
204
+
205
+ ## Recommendations
206
+
207
+ 1. [recommendation 1]
208
+ 2. [recommendation 2]
209
+ ...
210
+
211
+ ## Next Steps
212
+
213
+ - Run `/doit.testit` for automated test execution
214
+ - Address any CRITICAL or MAJOR findings before merge
215
+ ```
216
+
217
+ 11. **Generate Mermaid Visualizations** (FR-011, FR-012):
218
+
219
+ After collecting all review data, generate visual quality dashboards:
220
+
221
+ a. **Finding Distribution Pie Chart**:
222
+ - Count findings by severity (Critical, Major, Minor, Info)
223
+ - Generate pie chart showing distribution
224
+ - Add to review-report.md in Quality Overview section
225
+
226
+ ```mermaid
227
+ pie title Finding Distribution
228
+ "Critical" : 0
229
+ "Major" : 2
230
+ "Minor" : 5
231
+ "Info" : 3
232
+ ```
233
+
234
+ Insert using auto-generated markers:
235
+
236
+ ~~~markdown
237
+ ## Quality Overview
238
+
239
+ <!-- BEGIN:AUTO-GENERATED section="finding-distribution" -->
240
+ ```mermaid
241
+ pie title Finding Distribution
242
+ "Critical" : [count]
243
+ "Major" : [count]
244
+ "Minor" : [count]
245
+ "Info" : [count]
246
+ ```
247
+ <!-- END:AUTO-GENERATED -->
248
+ ~~~
249
+
250
+ b. **Test Results Visualization**:
251
+ - Count test results by status (Passed, Failed, Skipped, Blocked)
252
+ - Generate pie chart showing test outcomes
253
+ - Add to review-report.md in Manual Testing Summary section
254
+
255
+ ```mermaid
256
+ pie title Test Results
257
+ "Passed" : 8
258
+ "Failed" : 1
259
+ "Skipped" : 2
260
+ "Blocked" : 0
261
+ ```
262
+
263
+ Insert using auto-generated markers:
264
+
265
+ ~~~markdown
266
+ ## Test Results Overview
267
+
268
+ <!-- BEGIN:AUTO-GENERATED section="test-results" -->
269
+ ```mermaid
270
+ pie title Test Results
271
+ "Passed" : [count]
272
+ "Failed" : [count]
273
+ "Skipped" : [count]
274
+ "Blocked" : [count]
275
+ ```
276
+ <!-- END:AUTO-GENERATED -->
277
+ ~~~
278
+
279
+ c. **Conditional Generation**:
280
+ - If no findings: Show "No Issues Found" message instead of empty pie chart
281
+ - If no manual tests: Omit Test Results visualization entirely
282
+ - If all tests pass: Use green-themed success message
283
+
284
+ d. **Diagram Validation**:
285
+ - Verify mermaid syntax is valid
286
+ - Ensure all counts are non-negative integers
287
+ - Check that pie chart values sum to total count
288
+
289
+ 12. **Report**: Output path to review-report.md and summary of findings
290
+
291
+ ## Key Rules
292
+
293
+ - Use absolute paths for all file operations
294
+ - STOP on any CRITICAL finding that blocks further review
295
+ - Present manual tests one at a time, wait for response
296
+ - Generate review-report.md even if some tests are skipped
297
+ - Include timestamps for audit trail
298
+
299
+ ---
300
+
301
+ ## Next Steps
302
+
303
+ After completing this command, display a recommendation section based on the outcome:
304
+
305
+ ### On Success (review approved, no critical issues)
306
+
307
+ Display the following at the end of your output:
308
+
309
+ ```markdown
310
+ ---
311
+
312
+ ## Next Steps
313
+
314
+ ┌───────────────────────────────────────────────────────────────────────────────────┐
315
+ │ Workflow Progress │
316
+ │ ● specit → ● planit → ● taskit → ● implementit → ● testit → ● reviewit → ○ checkin │
317
+ └───────────────────────────────────────────────────────────────────────────────────┘
318
+
319
+ **Recommended**: Run `/doit.checkin` to finalize and merge your changes.
320
+ ```
321
+
322
+ ### On Issues Found (changes requested)
323
+
324
+ If the review found issues that need to be addressed:
325
+
326
+ ```markdown
327
+ ---
328
+
329
+ ## Next Steps
330
+
331
+ ┌───────────────────────────────────────────────────────────────────────────────────┐
332
+ │ Workflow Progress │
333
+ │ ● specit → ● planit → ● taskit → ● implementit → ● testit → ◐ reviewit → ○ checkin │
334
+ └───────────────────────────────────────────────────────────────────────────────────┘
335
+
336
+ **Status**: [N] critical, [M] major issues found.
337
+
338
+ **Recommended**: Run `/doit.implementit` to address the review feedback.
339
+
340
+ After fixing issues, run `/doit.reviewit` again to verify.
341
+ ```
342
+
343
+ ### On Error (missing prerequisites)
344
+
345
+ If required files are missing:
346
+
347
+ ```markdown
348
+ ---
349
+
350
+ ## Next Steps
351
+
352
+ **Issue**: Required files for review are missing.
353
+
354
+ **Recommended**: Run `/doit.implementit` to complete the implementation first.
355
+ ```
@@ -0,0 +1,368 @@
1
+ ---
2
+ description: Create or update the project roadmap with prioritized requirements, deferred functionality, and AI-suggested enhancements.
3
+ handoffs:
4
+ - label: Create Specification
5
+ agent: doit.specit
6
+ prompt: Create a feature specification for the top roadmap item...
7
+ - label: Update Constitution
8
+ agent: doit.constitution
9
+ prompt: Update the project constitution based on roadmap priorities...
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
+ ## Outline
37
+
38
+ This command creates or updates the project roadmap at `.doit/memory/roadmap.md`. The roadmap captures high-level requirements prioritized by business value, deferred items, and project vision.
39
+
40
+ ### 1. Parse Command Arguments
41
+
42
+ Extract the operation and details from `$ARGUMENTS`:
43
+
44
+ | Pattern | Operation | Example |
45
+ |---------|-----------|---------|
46
+ | `create [vision]` | Create new roadmap | `/doit.roadmapit create a task management app` |
47
+ | `add [item]` | Add item to roadmap | `/doit.roadmapit add user authentication` |
48
+ | `defer [item]` | Move item to deferred | `/doit.roadmapit defer social login` |
49
+ | `reprioritize` | Review and change priorities | `/doit.roadmapit reprioritize` |
50
+ | (empty or `update`) | Interactive update | `/doit.roadmapit` |
51
+
52
+ If no arguments provided or unrecognized pattern, proceed to step 2 for detection.
53
+
54
+ ### 2. Check for Existing Roadmap
55
+
56
+ Check if `.doit/memory/roadmap.md` exists:
57
+
58
+ - **If NOT exists**: Proceed to Step 3 (Create Workflow)
59
+ - **If exists**: Proceed to Step 4 (Update Workflow)
60
+
61
+ ### 3. Create Workflow (New Roadmap)
62
+
63
+ #### 3.1 Ensure Directory Exists
64
+
65
+ ```bash
66
+ mkdir -p .doit/memory
67
+ ```
68
+
69
+ #### 3.2 Gather Project Context
70
+
71
+ Read these files if they exist to understand project context:
72
+
73
+ - `.doit/memory/constitution.md` - Project principles and tech stack
74
+ - `README.md` - Project description
75
+ - `package.json` or `pyproject.toml` - Project metadata
76
+
77
+ #### 3.3 Ask Clarifying Questions
78
+
79
+ Present questions to establish roadmap foundation. Use the user's input (if provided) as context:
80
+
81
+ **Question 1: Project Vision**
82
+ > What is the primary goal or vision for this project?
83
+ >
84
+ > Based on your input "[USER_INPUT]", I understand the project is about [INTERPRETATION].
85
+ >
86
+ > Please confirm or provide a more detailed vision statement.
87
+
88
+ **Question 2: Initial Priority Items**
89
+ > What are the most critical features or requirements for your MVP?
90
+ >
91
+ > Suggested based on your description:
92
+ > - [SUGGESTION_1]
93
+ > - [SUGGESTION_2]
94
+ >
95
+ > Which of these are correct? What would you add or change?
96
+
97
+ **Question 3: Known Constraints**
98
+ > Are there any constraints or limitations to consider?
99
+ >
100
+ > Options:
101
+ > A. Timeline constraints (specific deadline)
102
+ > B. Technical constraints (must use specific tech)
103
+ > C. Resource constraints (limited team/budget)
104
+ > D. No significant constraints
105
+ > E. Custom (please specify)
106
+
107
+ #### 3.4 Build Roadmap Structure
108
+
109
+ Using the gathered information, create the roadmap:
110
+
111
+ 1. Load template from `.doit/templates/roadmap-template.md`
112
+ 2. Replace `[PROJECT_NAME]` with project name from constitution or package metadata
113
+ 3. Replace `[DATE]` with current date
114
+ 4. Replace `[PROJECT_VISION]` with the confirmed vision statement
115
+ 5. Populate priority sections based on user's answers:
116
+ - Add confirmed critical items to P1
117
+ - Add important but not blocking items to P2
118
+ - Add nice-to-have items to P3/P4
119
+ 6. Leave Deferred Items empty for new roadmaps
120
+
121
+ #### 3.5 Write Roadmap
122
+
123
+ Write the populated roadmap to `.doit/memory/roadmap.md`
124
+
125
+ #### 3.6 Offer Enhancement Suggestions
126
+
127
+ After creating the roadmap, proceed to Step 6 (AI Suggestions).
128
+
129
+ ---
130
+
131
+ ### 4. Update Workflow (Existing Roadmap)
132
+
133
+ #### 4.1 Load Current Roadmap
134
+
135
+ Read `.doit/memory/roadmap.md` and parse:
136
+
137
+ - Current vision statement
138
+ - All items in P1, P2, P3, P4 sections with their status
139
+ - All deferred items
140
+ - Last updated date
141
+
142
+ #### 4.2 Display Current State
143
+
144
+ Show the user the current roadmap state:
145
+
146
+ ```markdown
147
+ ## Current Roadmap State
148
+
149
+ **Vision**: [Current vision statement]
150
+ **Last Updated**: [Date]
151
+
152
+ ### Active Items
153
+ | Priority | Item | Feature Branch | Status |
154
+ |----------|------|----------------|--------|
155
+ | P1 | [item] | [branch-ref] | [ ] |
156
+ | P2 | [item] | [branch-ref] | [ ] |
157
+ ...
158
+
159
+ ### Deferred Items
160
+ | Item | Original Priority | Reason |
161
+ |------|-------------------|--------|
162
+ ...
163
+ ```
164
+
165
+ #### 4.3 Handle Specific Operations
166
+
167
+ Based on the parsed operation from Step 1:
168
+
169
+ **Add Operation (`add [item]`)**:
170
+ 1. Ask: "What priority should this item have? (P1/P2/P3/P4)"
171
+ 2. Ask: "What's the business rationale for this priority?"
172
+ 3. Ask: "Is there a feature branch reference? (e.g., `[###-feature-name]`)"
173
+ 4. Add the item to the appropriate section
174
+
175
+ **Defer Operation (`defer [item]`)**:
176
+ 1. Search for the item in active sections
177
+ 2. If not found: List available items and ask user to select
178
+ 3. If found: Ask "What's the reason for deferring?"
179
+ 4. Move item to Deferred section with original priority and reason
180
+
181
+ **Reprioritize Operation (`reprioritize`)**:
182
+ 1. List all active items with current priorities
183
+ 2. Ask: "Which items need priority changes?"
184
+ 3. For each item to change:
185
+ - Show current priority
186
+ - Ask for new priority (P1/P2/P3/P4)
187
+ - Ask for rationale for the change
188
+ 4. Update items in their new sections
189
+
190
+ **Interactive Update (no specific operation)**:
191
+ 1. Ask: "What would you like to do?"
192
+ - A. Add a new item
193
+ - B. Defer an item
194
+ - C. Reprioritize items
195
+ - D. Update the vision statement
196
+ - E. Mark an item as complete (moves to completed_roadmap.md)
197
+ 2. Execute the selected operation
198
+
199
+ #### 4.4 Preserve Unmodified Content
200
+
201
+ When updating the roadmap:
202
+
203
+ - Keep all items not explicitly changed
204
+ - Maintain existing rationales unless updated
205
+ - Preserve feature branch references
206
+ - Update only the `Last Updated` date
207
+
208
+ #### 4.5 Write Updated Roadmap
209
+
210
+ Write the modified roadmap back to `.doit/memory/roadmap.md`
211
+
212
+ #### 4.6 Offer Enhancement Suggestions
213
+
214
+ After updating, proceed to Step 6 (AI Suggestions).
215
+
216
+ ---
217
+
218
+ ### 5. Handle Edge Cases
219
+
220
+ #### 5.1 Malformed Roadmap
221
+
222
+ If existing roadmap cannot be parsed:
223
+
224
+ 1. Create backup: `mv .doit/memory/roadmap.md .doit/memory/roadmap.md.bak`
225
+ 2. Notify user: "The existing roadmap appears to be malformed. A backup has been created."
226
+ 3. Try to extract any readable content
227
+ 4. Offer to create fresh roadmap incorporating salvaged content
228
+
229
+ #### 5.2 Item Not Found (for defer/update)
230
+
231
+ If specified item cannot be found:
232
+
233
+ 1. List all current items in a table
234
+ 2. Ask user to select from the list or provide exact item text
235
+ 3. Use fuzzy matching to suggest closest matches
236
+
237
+ #### 5.3 Conflicting Priorities
238
+
239
+ If user assigns multiple P1 items:
240
+
241
+ 1. Show warning: "You have [N] P1 items. P1 should be reserved for truly critical items."
242
+ 2. Ask: "Would you like to compare these items to determine which is most critical?"
243
+ 3. If yes, present pairwise comparison for each P1 item
244
+
245
+ ---
246
+
247
+ ### 6. AI Enhancement Suggestions
248
+
249
+ After any create or update operation, analyze the roadmap and project context to suggest enhancements.
250
+
251
+ #### 6.1 Gather Context
252
+
253
+ Read additional context if available:
254
+
255
+ - `.doit/memory/constitution.md` - Project principles
256
+ - `.doit/memory/completed_roadmap.md` - Past completed items
257
+ - Current roadmap items and gaps
258
+
259
+ #### 6.2 Generate Suggestions
260
+
261
+ Based on context, generate 2-5 complementary feature suggestions:
262
+
263
+ ```markdown
264
+ ## Enhancement Suggestions
265
+
266
+ Based on your roadmap and project context, here are some features you might consider:
267
+
268
+ ### Suggestion 1: [Feature Name]
269
+ **Rationale**: [Why this complements existing items]
270
+ **Suggested Priority**: P[N]
271
+ **Aligns with**: [Related existing item or principle]
272
+
273
+ ### Suggestion 2: [Feature Name]
274
+ ...
275
+
276
+ ---
277
+
278
+ **Actions**:
279
+ - Type the suggestion number to add it (e.g., "1" or "1, 3")
280
+ - Type "skip" to finish without adding suggestions
281
+ - Type "modify [N]" to customize a suggestion before adding
282
+ ```
283
+
284
+ #### 6.3 Handle Suggestion Response
285
+
286
+ - If user selects suggestions: Add them to the appropriate priority sections
287
+ - If user modifies: Apply customizations then add
288
+ - If user skips: Complete without changes
289
+
290
+ ---
291
+
292
+ ### 7. Completion Report
293
+
294
+ Output a summary of changes:
295
+
296
+ ```markdown
297
+ ## Roadmap Update Complete
298
+
299
+ **File**: `.doit/memory/roadmap.md`
300
+ **Operation**: [Create/Add/Defer/Reprioritize]
301
+ **Date**: [Current date]
302
+
303
+ ### Changes Made
304
+ - [List of specific changes]
305
+
306
+ ### Current Statistics
307
+ | Priority | Count |
308
+ |----------|-------|
309
+ | P1 | [N] |
310
+ | P2 | [N] |
311
+ | P3 | [N] |
312
+ | P4 | [N] |
313
+ | Deferred | [N] |
314
+
315
+ ### Next Steps
316
+ - Run `/doit.specit` to create specs for top priority items
317
+ - Run `/doit.roadmapit` again to continue updating
318
+ - Review completed items in `.doit/memory/completed_roadmap.md`
319
+ ```
320
+
321
+ ---
322
+
323
+ ## Key Rules
324
+
325
+ - Always preserve existing content when updating
326
+ - Ask clarifying questions before making changes
327
+ - Provide AI suggestions after every operation
328
+ - Use feature branch references `[###-feature-name]` for traceability
329
+ - Maintain maximum 3-5 P1 items (truly critical only)
330
+ - Back up malformed roadmaps before recreating
331
+
332
+ ---
333
+
334
+ ## Next Steps
335
+
336
+ After completing this command, display a recommendation section based on the outcome:
337
+
338
+ ### On Success (roadmap created or updated)
339
+
340
+ Display the following at the end of your output:
341
+
342
+ ```markdown
343
+ ---
344
+
345
+ ## Next Steps
346
+
347
+ **Roadmap updated!**
348
+
349
+ **Recommended**: Run `/doit.specit [top priority item]` to create a specification for your highest priority feature.
350
+
351
+ **Alternative**: Run `/doit.roadmapit add [item]` to add more items to the roadmap.
352
+ ```
353
+
354
+ ### On Item Added
355
+
356
+ If a new item was added to the roadmap:
357
+
358
+ ```markdown
359
+ ---
360
+
361
+ ## Next Steps
362
+
363
+ **Item added to roadmap!**
364
+
365
+ **Recommended**: Run `/doit.specit [item description]` to create a specification for this item.
366
+
367
+ **Alternative**: Run `/doit.roadmapit reprioritize` to review and adjust priorities.
368
+ ```