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,458 @@
1
+ ---
2
+ description: Generate project folder structure and starter files based on tech stack from constitution or user input.
3
+ handoffs:
4
+ - label: Create Specification
5
+ agent: doit.specit
6
+ prompt: Create a feature specification for this scaffolded project. I want to build...
7
+ - label: Update Constitution
8
+ agent: doit.constitution
9
+ prompt: Update the project constitution with additional details...
10
+ - label: Organize Documentation
11
+ agent: doit.documentit
12
+ prompt: Organize and index the project documentation...
13
+ ---
14
+
15
+ ## User Input
16
+
17
+ ```text
18
+ $ARGUMENTS
19
+ ```
20
+
21
+ You **MUST** consider the user input before proceeding (if not empty).
22
+
23
+ ## Load Project Context
24
+
25
+ Before proceeding, load the project context to inform your responses:
26
+
27
+ ```bash
28
+ doit context show
29
+ ```
30
+
31
+ **If the command fails or doit is not installed**: Continue without context, but note that alignment with project principles cannot be verified.
32
+
33
+ **Use loaded context to**:
34
+
35
+ - Reference constitution principles when making decisions
36
+ - Consider roadmap priorities
37
+ - Identify connections to related specifications
38
+
39
+ ## Outline
40
+
41
+ You are generating a project folder structure based on the tech stack defined in the constitution or provided by the user. This command creates directories, config files, and starter templates appropriate for the chosen technology.
42
+
43
+ Follow this execution flow:
44
+
45
+ ### 1. Load Constitution
46
+
47
+ Read `.doit/memory/constitution.md` and extract:
48
+
49
+ - **Tech Stack**: Languages, Frameworks, Libraries
50
+ - **Infrastructure**: Hosting platform, Cloud provider, Database
51
+ - **Deployment**: CI/CD pipeline, Strategy, Environments
52
+
53
+ If constitution doesn't exist or has incomplete tech stack info, proceed to step 2.
54
+
55
+ ### 2. Tech Stack Clarification
56
+
57
+ If tech stack is not fully defined, prompt the user:
58
+
59
+ - "What is your primary programming language?" (e.g., Python, TypeScript, Go, Java, C#)
60
+ - "What framework are you using?" (e.g., React, FastAPI, .NET, Spring Boot)
61
+ - "Is this a frontend, backend, or full-stack project?"
62
+ - "Do you need containerization (Docker)?"
63
+
64
+ ### 3. Structure Generation
65
+
66
+ Based on detected/provided tech stack, generate the appropriate folder structure:
67
+
68
+ #### React/TypeScript Frontend
69
+
70
+ ```text
71
+ src/
72
+ ├── components/
73
+ │ └── .gitkeep
74
+ ├── hooks/
75
+ │ └── .gitkeep
76
+ ├── pages/
77
+ │ └── .gitkeep
78
+ ├── services/
79
+ │ └── .gitkeep
80
+ ├── styles/
81
+ │ └── .gitkeep
82
+ ├── types/
83
+ │ └── .gitkeep
84
+ ├── utils/
85
+ │ └── .gitkeep
86
+ └── App.tsx
87
+ public/
88
+ └── index.html
89
+ tests/
90
+ └── .gitkeep
91
+ ```
92
+
93
+ #### .NET/C# Backend
94
+
95
+ ```text
96
+ src/
97
+ ├── Controllers/
98
+ │ └── .gitkeep
99
+ ├── Models/
100
+ │ └── .gitkeep
101
+ ├── Services/
102
+ │ └── .gitkeep
103
+ ├── Data/
104
+ │ └── .gitkeep
105
+ ├── DTOs/
106
+ │ └── .gitkeep
107
+ └── Program.cs
108
+ tests/
109
+ ├── Unit/
110
+ │ └── .gitkeep
111
+ └── Integration/
112
+ └── .gitkeep
113
+ ```
114
+
115
+ #### Node.js/Express Backend
116
+
117
+ ```text
118
+ src/
119
+ ├── controllers/
120
+ │ └── .gitkeep
121
+ ├── models/
122
+ │ └── .gitkeep
123
+ ├── services/
124
+ │ └── .gitkeep
125
+ ├── routes/
126
+ │ └── .gitkeep
127
+ ├── middleware/
128
+ │ └── .gitkeep
129
+ ├── utils/
130
+ │ └── .gitkeep
131
+ └── app.js
132
+ tests/
133
+ └── .gitkeep
134
+ ```
135
+
136
+ #### Python/FastAPI Backend
137
+
138
+ ```text
139
+ src/
140
+ ├── api/
141
+ │ ├── routes/
142
+ │ │ └── .gitkeep
143
+ │ └── deps.py
144
+ ├── models/
145
+ │ └── .gitkeep
146
+ ├── schemas/
147
+ │ └── .gitkeep
148
+ ├── services/
149
+ │ └── .gitkeep
150
+ ├── core/
151
+ │ ├── config.py
152
+ │ └── security.py
153
+ └── main.py
154
+ tests/
155
+ ├── unit/
156
+ │ └── .gitkeep
157
+ └── integration/
158
+ └── .gitkeep
159
+ ```
160
+
161
+ #### Go Backend
162
+
163
+ ```text
164
+ cmd/
165
+ └── main.go
166
+ internal/
167
+ ├── handlers/
168
+ │ └── .gitkeep
169
+ ├── models/
170
+ │ └── .gitkeep
171
+ ├── services/
172
+ │ └── .gitkeep
173
+ ├── repository/
174
+ │ └── .gitkeep
175
+ └── middleware/
176
+ └── .gitkeep
177
+ pkg/
178
+ └── .gitkeep
179
+ tests/
180
+ └── .gitkeep
181
+ ```
182
+
183
+ #### Vue.js Frontend
184
+
185
+ ```text
186
+ src/
187
+ ├── components/
188
+ │ └── .gitkeep
189
+ ├── views/
190
+ │ └── .gitkeep
191
+ ├── composables/
192
+ │ └── .gitkeep
193
+ ├── stores/
194
+ │ └── .gitkeep
195
+ ├── services/
196
+ │ └── .gitkeep
197
+ ├── assets/
198
+ │ └── .gitkeep
199
+ ├── App.vue
200
+ └── main.ts
201
+ public/
202
+ └── index.html
203
+ tests/
204
+ └── .gitkeep
205
+ ```
206
+
207
+ #### Angular Frontend
208
+
209
+ ```text
210
+ src/
211
+ ├── app/
212
+ │ ├── components/
213
+ │ │ └── .gitkeep
214
+ │ ├── services/
215
+ │ │ └── .gitkeep
216
+ │ ├── models/
217
+ │ │ └── .gitkeep
218
+ │ ├── guards/
219
+ │ │ └── .gitkeep
220
+ │ └── app.module.ts
221
+ ├── assets/
222
+ │ └── .gitkeep
223
+ └── environments/
224
+ └── .gitkeep
225
+ tests/
226
+ └── .gitkeep
227
+ ```
228
+
229
+ #### Java/Spring Boot Backend
230
+
231
+ ```text
232
+ src/
233
+ ├── main/
234
+ │ ├── java/
235
+ │ │ └── com/
236
+ │ │ └── [package]/
237
+ │ │ ├── controller/
238
+ │ │ │ └── .gitkeep
239
+ │ │ ├── service/
240
+ │ │ │ └── .gitkeep
241
+ │ │ ├── repository/
242
+ │ │ │ └── .gitkeep
243
+ │ │ ├── model/
244
+ │ │ │ └── .gitkeep
245
+ │ │ └── Application.java
246
+ │ └── resources/
247
+ │ └── application.yml
248
+ └── test/
249
+ └── java/
250
+ └── .gitkeep
251
+ ```
252
+
253
+ ### 4. Config File Generation
254
+
255
+ Generate appropriate config files based on tech stack:
256
+
257
+ | Tech Stack | Config Files |
258
+ |------------|--------------|
259
+ | React/TypeScript | `tsconfig.json`, `package.json`, `vite.config.ts` |
260
+ | .NET | `*.csproj`, `appsettings.json`, `appsettings.Development.json` |
261
+ | Node.js | `package.json`, `tsconfig.json` (if TS), `.eslintrc.js` |
262
+ | Python | `pyproject.toml`, `requirements.txt`, `.python-version` |
263
+ | Go | `go.mod`, `go.sum` |
264
+ | Vue | `package.json`, `vite.config.ts`, `tsconfig.json` |
265
+ | Angular | `angular.json`, `package.json`, `tsconfig.json` |
266
+ | Java | `pom.xml` or `build.gradle`, `application.yml` |
267
+
268
+ ### 5. Starter Files Generation
269
+
270
+ Create minimal starter files:
271
+
272
+ - `README.md` with project name, description, and setup instructions
273
+ - `.editorconfig` for consistent coding styles
274
+ - Appropriate `.gitkeep` files in empty directories
275
+
276
+ ### 6. Docker Support
277
+
278
+ If containerization is required (from constitution or user input):
279
+
280
+ - Create `Dockerfile` appropriate for the tech stack
281
+ - Create `docker-compose.yml` for local development
282
+ - Create `.dockerignore`
283
+
284
+ ### 7. .gitignore Generation
285
+
286
+ Generate comprehensive `.gitignore` based on tech stack:
287
+
288
+ - Language-specific ignores (node_modules, __pycache__, bin/obj, etc.)
289
+ - IDE ignores (.idea, .vscode settings, etc.)
290
+ - Environment files (.env, .env.local)
291
+ - Build artifacts (dist, build, target)
292
+
293
+ ### 8. Doit Commands Generation
294
+
295
+ Generate the doit command suite for the new project:
296
+
297
+ 1. Create `.claude/commands/` directory in the target project
298
+ 2. Copy all 11 doit command templates from `.doit/templates/commands/`:
299
+ - `doit.checkin.md` - Feature completion and PR creation
300
+ - `doit.constitution.md` - Project constitution management
301
+ - `doit.documentit.md` - Documentation organization and indexing
302
+ - `doit.implementit.md` - Task implementation execution
303
+ - `doit.planit.md` - Implementation planning
304
+ - `doit.reviewit.md` - Code review workflow
305
+ - `doit.roadmapit.md` - Project roadmap management
306
+ - `doit.scaffoldit.md` - Project scaffolding
307
+ - `doit.specit.md` - Feature specification
308
+ - `doit.taskit.md` - Task generation
309
+ - `doit.testit.md` - Test execution
310
+
311
+ This enables new projects to immediately use the full doit workflow without manual setup.
312
+
313
+ ### 9. Multi-Stack Support
314
+
315
+ For full-stack projects (frontend + backend), create:
316
+
317
+ ```text
318
+ frontend/
319
+ └── [frontend structure]
320
+ backend/
321
+ └── [backend structure]
322
+ shared/
323
+ └── types/ # Shared type definitions
324
+ docker-compose.yml # Combined services
325
+ ```
326
+
327
+ ### 10. Existing Project Analysis (FR-064, FR-065)
328
+
329
+ If the project already has files:
330
+
331
+ 1. Scan existing directory structure
332
+ 2. Identify current tech stack from config files
333
+ 3. Generate analysis report showing:
334
+ - Detected technologies
335
+ - Current structure vs. recommended structure
336
+ - Missing recommended directories
337
+ - Suggested improvements
338
+
339
+ ### 11. Tech Stack Documentation (FR-015 to FR-018)
340
+
341
+ After tech stack is determined (from constitution or user input), generate `.doit/memory/tech-stack.md`:
342
+
343
+ 1. Read `.doit/templates/tech-stack-template.md` for structure
344
+ 2. Populate with captured tech stack information:
345
+ - **Languages**: Primary language and version
346
+ - **Frameworks**: Main framework(s) with versions
347
+ - **Key Libraries**: Important dependencies with rationale
348
+ - **Infrastructure**: Hosting, cloud provider, database choices
349
+ - **Architecture Decisions**: Key decisions made during scaffolding
350
+
351
+ 3. If `tech-stack.md` already exists:
352
+ - Preserve content in "Custom Notes" section
353
+ - Update auto-generated sections between markers
354
+
355
+ 4. If `constitution.md` exists with tech info:
356
+ - Include relevant details from constitution
357
+ - Cross-reference but don't duplicate
358
+
359
+ Example output structure:
360
+
361
+ ```markdown
362
+ # Tech Stack
363
+
364
+ **Generated**: 2026-01-10
365
+ **Last Updated**: 2026-01-10
366
+
367
+ ## Languages
368
+
369
+ | Language | Version | Purpose |
370
+ | -------- | ------- | ------- |
371
+ | TypeScript | 5.0+ | Primary |
372
+
373
+ ## Frameworks
374
+
375
+ | Framework | Version | Purpose |
376
+ | --------- | ------- | ------- |
377
+ | React | 18.x | Frontend UI |
378
+ | FastAPI | 0.100+ | Backend API |
379
+
380
+ ## Key Libraries
381
+
382
+ | Library | Version | Purpose | Why Chosen |
383
+ | ------- | ------- | ------- | ---------- |
384
+ | Tailwind | 3.x | Styling | Rapid prototyping |
385
+
386
+ <!-- BEGIN:AUTO-GENERATED section="scaffold-captured" -->
387
+ Captured during scaffold on 2026-01-10
388
+ <!-- END:AUTO-GENERATED -->
389
+
390
+ ## Custom Notes
391
+
392
+ [User additions preserved here]
393
+ ```
394
+
395
+ ### 12. Output Summary
396
+
397
+ After scaffolding, provide:
398
+
399
+ - List of created directories and files
400
+ - Confirmation that doit commands were generated (11 files in `.claude/commands/`)
401
+ - Confirmation that tech-stack.md was created in `.doit/memory/`
402
+ - Next steps for the user
403
+ - Suggested commands to run (e.g., `npm install`, `pip install -r requirements.txt`)
404
+ - Reminder to run `/doit.specit` to create feature specifications
405
+ - Reminder to run `/doit.documentit` to organize documentation
406
+
407
+ ## Validation
408
+
409
+ Before creating files:
410
+
411
+ - Confirm tech stack selection with user
412
+ - Check for existing files that would be overwritten
413
+ - Prompt for confirmation before creating structure
414
+
415
+ ## Notes
416
+
417
+ - Always create `.gitkeep` files in empty directories
418
+ - Use appropriate naming conventions for the tech stack (camelCase, snake_case, PascalCase)
419
+ - Include comments in generated config files explaining key settings
420
+ - Respect existing project structure when adding new directories
421
+
422
+ ---
423
+
424
+ ## Next Steps
425
+
426
+ After completing this command, display a recommendation section based on the outcome:
427
+
428
+ ### On Success (project scaffolded)
429
+
430
+ Display the following at the end of your output:
431
+
432
+ ```markdown
433
+ ---
434
+
435
+ ## Next Steps
436
+
437
+ **Project structure created!**
438
+
439
+ **Recommended**: Run `/doit.specit [feature description]` to create your first feature specification.
440
+
441
+ **Alternative**: Run `/doit.documentit organize` to organize any existing documentation.
442
+ ```
443
+
444
+ ### On Existing Project (structure already exists)
445
+
446
+ If the project already has a structure:
447
+
448
+ ```markdown
449
+ ---
450
+
451
+ ## Next Steps
452
+
453
+ **Project structure analyzed!**
454
+
455
+ **Recommended**: Run `/doit.specit [feature description]` to start developing a new feature.
456
+
457
+ **Alternative**: Run `/doit.documentit audit` to check documentation health.
458
+ ```