@hustle-together/api-dev-tools 3.12.16 → 4.5.3

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 (180) hide show
  1. package/.claude/adr-requests/.gitkeep +10 -0
  2. package/.claude/agents/adr-researcher.md +109 -0
  3. package/.claude/agents/visual-analyzer.md +183 -0
  4. package/.claude/api-dev-state.json +10 -0
  5. package/.claude/documentation-audit.json +114 -0
  6. package/.claude/registry.json +289 -0
  7. package/.claude/settings.json +45 -1
  8. package/.claude/settings.local.json +1 -7
  9. package/.claude/workflow-logs/None.json +49 -0
  10. package/.claude/workflow-logs/session-20251230-143727.json +106 -0
  11. package/.skills/adr-deep-research/SKILL.md +351 -0
  12. package/.skills/api-create/SKILL.md +34 -20
  13. package/.skills/api-research/SKILL.md +130 -0
  14. package/.skills/docs-update/SKILL.md +205 -0
  15. package/.skills/hustle-brand/SKILL.md +368 -0
  16. package/.skills/hustle-build/SKILL.md +365 -38
  17. package/.skills/parallel-spawn/SKILL.md +212 -0
  18. package/.skills/ralph-continue/SKILL.md +151 -0
  19. package/.skills/ralph-loop/SKILL.md +341 -0
  20. package/.skills/ralph-status/SKILL.md +87 -0
  21. package/.skills/refactor/SKILL.md +59 -0
  22. package/.skills/shadcn/SKILL.md +522 -0
  23. package/.skills/test-all/SKILL.md +210 -0
  24. package/.skills/test-builds/SKILL.md +208 -0
  25. package/.skills/test-debug/SKILL.md +212 -0
  26. package/.skills/test-e2e/SKILL.md +168 -0
  27. package/.skills/test-review/SKILL.md +707 -0
  28. package/.skills/test-unit/SKILL.md +143 -0
  29. package/.skills/test-visual/SKILL.md +301 -0
  30. package/.skills/token-report/SKILL.md +132 -0
  31. package/CHANGELOG.md +488 -0
  32. package/README.md +346 -53
  33. package/bin/cli.js +359 -123
  34. package/hooks/__pycache__/api-workflow-check.cpython-314.pyc +0 -0
  35. package/hooks/__pycache__/auto-answer.cpython-314.pyc +0 -0
  36. package/hooks/__pycache__/cache-research.cpython-314.pyc +0 -0
  37. package/hooks/__pycache__/check-api-routes.cpython-314.pyc +0 -0
  38. package/hooks/__pycache__/check-playwright-setup.cpython-314.pyc +0 -0
  39. package/hooks/__pycache__/check-storybook-setup.cpython-314.pyc +0 -0
  40. package/hooks/__pycache__/check-update.cpython-314.pyc +0 -0
  41. package/hooks/__pycache__/completion-promise-detector.cpython-314.pyc +0 -0
  42. package/hooks/__pycache__/context-capacity-warning.cpython-314.pyc +0 -0
  43. package/hooks/__pycache__/detect-interruption.cpython-314.pyc +0 -0
  44. package/hooks/__pycache__/docs-update-check.cpython-314.pyc +0 -0
  45. package/hooks/__pycache__/enforce-a11y-audit.cpython-314.pyc +0 -0
  46. package/hooks/__pycache__/enforce-brand-guide.cpython-314.pyc +0 -0
  47. package/hooks/__pycache__/enforce-component-type-confirm.cpython-314.pyc +0 -0
  48. package/hooks/__pycache__/enforce-deep-research.cpython-314.pyc +0 -0
  49. package/hooks/__pycache__/enforce-disambiguation.cpython-314.pyc +0 -0
  50. package/hooks/__pycache__/enforce-documentation.cpython-314.pyc +0 -0
  51. package/hooks/__pycache__/enforce-dry-run.cpython-314.pyc +0 -0
  52. package/hooks/__pycache__/enforce-environment.cpython-314.pyc +0 -0
  53. package/hooks/__pycache__/enforce-external-research.cpython-314.pyc +0 -0
  54. package/hooks/__pycache__/enforce-freshness.cpython-314.pyc +0 -0
  55. package/hooks/__pycache__/enforce-interview.cpython-314.pyc +0 -0
  56. package/hooks/__pycache__/enforce-page-components.cpython-314.pyc +0 -0
  57. package/hooks/__pycache__/enforce-page-data-schema.cpython-314.pyc +0 -0
  58. package/hooks/__pycache__/enforce-questions-sourced.cpython-314.pyc +0 -0
  59. package/hooks/__pycache__/enforce-refactor.cpython-314.pyc +0 -0
  60. package/hooks/__pycache__/enforce-research.cpython-314.pyc +0 -0
  61. package/hooks/__pycache__/enforce-schema-from-interview.cpython-314.pyc +0 -0
  62. package/hooks/__pycache__/enforce-schema.cpython-314.pyc +0 -0
  63. package/hooks/__pycache__/enforce-scope.cpython-314.pyc +0 -0
  64. package/hooks/__pycache__/enforce-tdd-red.cpython-314.pyc +0 -0
  65. package/hooks/__pycache__/enforce-ui-disambiguation.cpython-314.pyc +0 -0
  66. package/hooks/__pycache__/enforce-ui-interview.cpython-314.pyc +0 -0
  67. package/hooks/__pycache__/enforce-verify.cpython-314.pyc +0 -0
  68. package/hooks/__pycache__/generate-adr-options.cpython-314.pyc +0 -0
  69. package/hooks/__pycache__/generate-manifest-entry.cpython-314.pyc +0 -0
  70. package/hooks/__pycache__/hook_utils.cpython-314.pyc +0 -0
  71. package/hooks/__pycache__/notify-input-needed.cpython-314.pyc +0 -0
  72. package/hooks/__pycache__/notify-phase-complete.cpython-314.pyc +0 -0
  73. package/hooks/__pycache__/ntfy-on-question.cpython-314.pyc +0 -0
  74. package/hooks/__pycache__/orchestrator-completion.cpython-314.pyc +0 -0
  75. package/hooks/__pycache__/orchestrator-handoff.cpython-314.pyc +0 -0
  76. package/hooks/__pycache__/orchestrator-session-startup.cpython-314.pyc +0 -0
  77. package/hooks/__pycache__/parallel-orchestrator.cpython-314.pyc +0 -0
  78. package/hooks/__pycache__/periodic-reground.cpython-314.pyc +0 -0
  79. package/hooks/__pycache__/project-document-prompt.cpython-314.pyc +0 -0
  80. package/hooks/__pycache__/remote-question-proxy.cpython-314.pyc +0 -0
  81. package/hooks/__pycache__/remote-question-server.cpython-314.pyc +0 -0
  82. package/hooks/__pycache__/run-code-review.cpython-314.pyc +0 -0
  83. package/hooks/__pycache__/run-visual-qa.cpython-314.pyc +0 -0
  84. package/hooks/__pycache__/session-logger.cpython-314.pyc +0 -0
  85. package/hooks/__pycache__/session-startup.cpython-314.pyc +0 -0
  86. package/hooks/__pycache__/track-scope-coverage.cpython-314.pyc +0 -0
  87. package/hooks/__pycache__/track-token-usage.cpython-314.pyc +0 -0
  88. package/hooks/__pycache__/track-tool-use.cpython-314.pyc +0 -0
  89. package/hooks/__pycache__/update-adr-decision.cpython-314.pyc +0 -0
  90. package/hooks/__pycache__/update-api-showcase.cpython-314.pyc +0 -0
  91. package/hooks/__pycache__/update-registry.cpython-314.pyc +0 -0
  92. package/hooks/__pycache__/update-ui-showcase.cpython-314.pyc +0 -0
  93. package/hooks/__pycache__/verify-after-green.cpython-314.pyc +0 -0
  94. package/hooks/__pycache__/verify-implementation.cpython-314.pyc +0 -0
  95. package/hooks/api-workflow-check.py +34 -0
  96. package/hooks/auto-answer.py +97 -20
  97. package/{.claude/hooks → hooks}/completion-promise-detector.py +0 -0
  98. package/{.claude/hooks → hooks}/context-capacity-warning.py +0 -0
  99. package/{.claude/hooks → hooks}/docs-update-check.py +0 -0
  100. package/{.claude/hooks → hooks}/enforce-dry-run.py +0 -0
  101. package/hooks/enforce-external-research.py +25 -0
  102. package/hooks/enforce-interview.py +20 -0
  103. package/{.claude/hooks → hooks}/generate-adr-options.py +0 -0
  104. package/{.claude/hooks → hooks}/hook_utils.py +0 -0
  105. package/hooks/ntfy-on-question.py +15 -2
  106. package/hooks/orchestrator-handoff.py +81 -3
  107. package/{.claude/hooks → hooks}/parallel-orchestrator.py +0 -0
  108. package/hooks/periodic-reground.py +40 -0
  109. package/{.claude/hooks → hooks}/remote-question-server.py +0 -0
  110. package/hooks/run-code-review.py +176 -29
  111. package/{.claude/hooks → hooks}/run-visual-qa.py +0 -0
  112. package/hooks/session-logger.py +27 -1
  113. package/hooks/session-startup.py +113 -0
  114. package/{.claude/hooks → hooks}/update-adr-decision.py +0 -0
  115. package/package.json +1 -1
  116. package/templates/.skills/hustle-interview/SKILL.md +174 -0
  117. package/templates/adr-viewer/_components/ADRViewer.tsx +326 -0
  118. package/templates/api-dev-state.json +33 -1
  119. package/templates/brand-page/page.tsx +645 -0
  120. package/templates/component/Component.visual.spec.ts +30 -24
  121. package/templates/eslint-plugin-zod-schema/index.js +446 -0
  122. package/templates/eslint-plugin-zod-schema/package.json +26 -0
  123. package/templates/github-workflows/security.yml +274 -0
  124. package/templates/hustle-build-defaults.json +53 -1
  125. package/templates/page/page.e2e.test.ts +30 -26
  126. package/templates/performance-budgets.json +63 -5
  127. package/templates/registry.json +279 -3
  128. package/templates/review-dashboard/page.tsx +510 -0
  129. package/templates/settings.json +74 -7
  130. package/templates/ui-showcase/_components/UIShowcase.tsx +47 -0
  131. package/templates/ui-showcase/_components/VisualTestingDashboard.tsx +579 -0
  132. package/.claude/commands/hustle-combine.md +0 -1089
  133. package/.claude/commands/hustle-ui-create-page.md +0 -1078
  134. package/.claude/commands/hustle-ui-create.md +0 -1058
  135. package/.claude/hooks/auto-answer.py +0 -305
  136. package/.claude/hooks/cache-research.py +0 -337
  137. package/.claude/hooks/check-api-routes.py +0 -168
  138. package/.claude/hooks/check-playwright-setup.py +0 -103
  139. package/.claude/hooks/check-storybook-setup.py +0 -81
  140. package/.claude/hooks/check-update.py +0 -132
  141. package/.claude/hooks/detect-interruption.py +0 -165
  142. package/.claude/hooks/enforce-a11y-audit.py +0 -202
  143. package/.claude/hooks/enforce-brand-guide.py +0 -241
  144. package/.claude/hooks/enforce-component-type-confirm.py +0 -97
  145. package/.claude/hooks/enforce-freshness.py +0 -184
  146. package/.claude/hooks/enforce-page-components.py +0 -186
  147. package/.claude/hooks/enforce-page-data-schema.py +0 -155
  148. package/.claude/hooks/enforce-questions-sourced.py +0 -146
  149. package/.claude/hooks/enforce-schema-from-interview.py +0 -248
  150. package/.claude/hooks/enforce-ui-disambiguation.py +0 -108
  151. package/.claude/hooks/enforce-ui-interview.py +0 -130
  152. package/.claude/hooks/generate-manifest-entry.py +0 -1161
  153. package/.claude/hooks/lib/__init__.py +0 -1
  154. package/.claude/hooks/lib/greptile.py +0 -355
  155. package/.claude/hooks/lib/ntfy.py +0 -209
  156. package/.claude/hooks/notify-input-needed.py +0 -73
  157. package/.claude/hooks/notify-phase-complete.py +0 -90
  158. package/.claude/hooks/ntfy-on-question.py +0 -240
  159. package/.claude/hooks/orchestrator-completion.py +0 -313
  160. package/.claude/hooks/orchestrator-handoff.py +0 -267
  161. package/.claude/hooks/orchestrator-session-startup.py +0 -146
  162. package/.claude/hooks/run-code-review.py +0 -393
  163. package/.claude/hooks/session-logger.py +0 -323
  164. package/.claude/hooks/test-orchestrator-reground.py +0 -248
  165. package/.claude/hooks/track-scope-coverage.py +0 -220
  166. package/.claude/hooks/track-token-usage.py +0 -121
  167. package/.claude/hooks/update-api-showcase.py +0 -161
  168. package/.claude/hooks/update-registry.py +0 -352
  169. package/.claude/hooks/update-ui-showcase.py +0 -224
  170. package/.claude/test-auto-answer-bot.py +0 -183
  171. package/.claude/test-completion-detector.py +0 -263
  172. package/.claude/test-orchestrator-state.json +0 -20
  173. package/.claude/test-orchestrator.sh +0 -271
  174. /package/{.claude/commands → commands}/hustle-build.md +0 -0
  175. /package/{.claude/hooks → hooks}/lib/__pycache__/__init__.cpython-314.pyc +0 -0
  176. /package/{.claude/hooks → hooks}/lib/__pycache__/greptile.cpython-314.pyc +0 -0
  177. /package/{.claude/hooks → hooks}/lib/__pycache__/ntfy.cpython-314.pyc +0 -0
  178. /package/{.claude/hooks → hooks}/project-document-prompt.py +0 -0
  179. /package/{.claude/hooks → hooks}/remote-question-proxy.py +0 -0
  180. /package/{.claude/hooks → hooks}/update-testing-checklist.py +0 -0
@@ -4,7 +4,7 @@ description: Build complete features from natural language. Orchestrates API, co
4
4
  license: MIT
5
5
  compatibility: Requires Claude Code with hooks and MCP servers configured
6
6
  metadata:
7
- version: "4.0.0"
7
+ version: "4.6.0"
8
8
  category: "orchestration"
9
9
  tags: ["build", "workflow", "orchestrator", "autonomous"]
10
10
  author: "Hustle Together"
@@ -20,23 +20,257 @@ Build complete features from natural language descriptions. This skill orchestra
20
20
  ```
21
21
  /hustle-build [description]
22
22
  /hustle-build --auto [description]
23
+ /hustle-build --parallel [description]
23
24
  /hustle-build --resume [build-id]
24
25
  /hustle-build --dry-run [description]
26
+ /hustle-build --max-iterations [N] [description]
25
27
  ```
26
28
 
27
29
  ## Arguments
28
30
 
29
31
  - `$ARGUMENTS` - Natural language description of what to build
30
32
  - `--auto` - Fully autonomous mode, auto-answers questions
33
+ - `--parallel` - Run up to 5 Opus agents in parallel (requires worktrees)
31
34
  - `--resume [id]` - Resume an interrupted build
32
35
  - `--dry-run` - Show what would be created without executing
36
+ - `--max-iterations [N]` - Max retry iterations per phase (default: 5)
37
+ - `--skip-document` - Skip the project document prompt
38
+ - `--from-document [path]` - Use specified file as project document (PRD, spec)
39
+
40
+ ## Parallel Execution (Recommended for Large Builds)
41
+
42
+ When `--parallel` is used, the orchestrator:
43
+
44
+ 1. **Creates git worktrees** for each independent workflow
45
+ 2. **Spawns up to 5 Opus agents** simultaneously
46
+ 3. **Injects shared decisions** into each agent
47
+ 4. **Merges results** when all complete
48
+
49
+ ```
50
+ ┌─────────────────────────────────────────────────────────────────┐
51
+ │ PARALLEL ORCHESTRATOR │
52
+ ├─────────────────────────────────────────────────────────────────┤
53
+ │ │
54
+ │ Shared Context (from Interview) │
55
+ │ ┌───────────────────────────────────────────────────────┐ │
56
+ │ │ Auth: JWT | Errors: partial-success | Brand: yes │ │
57
+ │ └───────────────────────────────────────────────────────┘ │
58
+ │ │ │
59
+ │ ┌───────────────┼───────────────┐ │
60
+ │ ▼ ▼ ▼ │
61
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
62
+ │ │ Agent #1 │ │ Agent #2 │ │ Agent #3 │ │
63
+ │ │ /api-create │ │ /api-create │ │ /hustle-ui │ │
64
+ │ │ user-stats │ │ chart-data │ │ StatCard │ │
65
+ │ └──────────────┘ └──────────────┘ └──────────────┘ │
66
+ │ │ │ │ │
67
+ │ └───────────────┼───────────────┘ │
68
+ │ ▼ │
69
+ │ ┌───────────────────────────────────────────────────────┐ │
70
+ │ │ MERGE COORDINATOR │ │
71
+ │ │ • Combines registry entries │ │
72
+ │ │ • Resolves conflicts │ │
73
+ │ │ • Creates unified PR │ │
74
+ │ └───────────────────────────────────────────────────────┘ │
75
+ │ │
76
+ └─────────────────────────────────────────────────────────────────┘
77
+ ```
78
+
79
+ See [PARALLEL_AUTONOMOUS_WORKFLOW.md](../../docs/PARALLEL_AUTONOMOUS_WORKFLOW.md) for details.
80
+
81
+ ## Max Iterations
82
+
83
+ Each phase has a maximum iteration count to prevent infinite loops:
84
+
85
+ ```json
86
+ {
87
+ "max_iterations": {
88
+ "default": 5,
89
+ "phases": {
90
+ "disambiguation": 2,
91
+ "research": 3,
92
+ "interview": 1,
93
+ "schema": 3,
94
+ "tdd_red": 5,
95
+ "tdd_green": 10,
96
+ "verify": 3,
97
+ "code_review": 3,
98
+ "refactor": 5
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ Override with `--max-iterations`:
105
+ ```bash
106
+ # Allow more retries for complex builds
107
+ /hustle-build --max-iterations 10 --auto complex e-commerce system
108
+ ```
109
+
110
+ When max iterations reached:
111
+ 1. Log issue to `session_archives.interrupted`
112
+ 2. Create partial PR with work completed
113
+ 3. Notify via NTFY
114
+ 4. Continue with other workflows
33
115
 
34
116
  ---
35
117
 
36
- ## Phase 1: Parse Request
118
+ ## Phase 1: Document Intake & Parsing (Optional)
119
+
120
+ At the start of `/hustle-build`, the `project-document-prompt.py` hook asks if you have a comprehensive project document.
121
+
122
+ **Supported Document Types:**
123
+ - PRD (Product Requirements Document)
124
+ - Technical specifications
125
+ - Deep research outputs (from `/plan` or `/spike`)
126
+ - API definitions (OpenAPI, JSON specs)
127
+
128
+ **How to provide:**
129
+ ```
130
+ # When prompted, you can:
131
+ 1. Provide a file path: ./docs/my-prd.md
132
+ 2. Paste content directly
133
+ 3. Provide a URL to fetch
134
+ 4. Say "no document" to skip
135
+
136
+ # Or skip the prompt entirely:
137
+ /hustle-build --skip-document [description]
138
+
139
+ # Or provide a document directly:
140
+ /hustle-build --from-document ./docs/spec.md [description]
141
+ ```
142
+
143
+ The document is stored in `state.project_spec.raw_content` for parsing.
144
+
145
+ ### Document Parsing (When project_spec exists)
146
+
147
+ If a project document was provided, analyze it to extract structured elements.
148
+
149
+ **Extraction Targets:**
150
+
151
+ | Element Type | Keywords to Find | What to Extract |
152
+ |-------------|------------------|-----------------|
153
+ | Pages | "page", "screen", "route", "/path", "view" | name, route, description, features |
154
+ | Components | "component", "widget", "card", "form", "button" | name, type (display/input/composite), props, variants |
155
+ | APIs | "API", "endpoint", "/api/", "fetch", "GET", "POST" | name, method, path, request/response schemas |
156
+ | Data Models | "model", "schema", "type", "interface", "entity" | name, fields, relationships |
157
+ | Integrations | service names (Stripe, Supabase, Auth0) | service, features used, env vars |
158
+
159
+ **Dependency Graph Construction:**
160
+ - APIs = Tier 1 (no dependencies)
161
+ - Components = Tier 2 (depend on APIs for types)
162
+ - Pages = Tier 3 (depend on components)
163
+
164
+ **Store extracted data in state:**
165
+
166
+ ```json
167
+ {
168
+ "project_spec": {
169
+ "source": "file|paste|url",
170
+ "file_path": "./docs/my-prd.md",
171
+ "raw_content": "[original document]",
172
+ "format": "markdown|json|text",
173
+ "parsed_at": "[timestamp]",
174
+ "word_count": 2500,
175
+ "extracted": {
176
+ "summary": "E-commerce dashboard with user stats and order tracking",
177
+ "pages": [
178
+ {
179
+ "name": "Dashboard",
180
+ "route": "/dashboard",
181
+ "description": "Main user dashboard",
182
+ "features": ["stats display", "order list", "notifications"],
183
+ "uses_components": ["StatCard", "OrderTable"],
184
+ "uses_apis": ["user-stats", "orders"]
185
+ }
186
+ ],
187
+ "components": [
188
+ {
189
+ "name": "StatCard",
190
+ "type": "display",
191
+ "description": "Display individual statistic with trend",
192
+ "props": ["title", "value", "trend", "icon"],
193
+ "variants": ["primary", "secondary", "success", "warning"]
194
+ }
195
+ ],
196
+ "apis": [
197
+ {
198
+ "name": "user-stats",
199
+ "method": "GET",
200
+ "path": "/api/v2/user-stats",
201
+ "description": "User statistics endpoint",
202
+ "response_fields": ["totalOrders", "revenue", "growth"]
203
+ }
204
+ ],
205
+ "data_models": [
206
+ {
207
+ "name": "UserStats",
208
+ "fields": ["totalOrders: number", "revenue: number", "growth: number"]
209
+ }
210
+ ],
211
+ "integrations": [
212
+ {
213
+ "service": "supabase",
214
+ "features": ["auth", "database"],
215
+ "env_vars": ["SUPABASE_URL", "SUPABASE_ANON_KEY"]
216
+ }
217
+ ]
218
+ },
219
+ "user_modifications": {
220
+ "added": [],
221
+ "removed": [],
222
+ "modified": []
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ **Present decomposition for approval:**
229
+
230
+ Use AskUserQuestion:
231
+
232
+ ```
233
+ Based on your project document, I've identified:
234
+
235
+ **Pages (2):**
236
+ - Dashboard (/dashboard) - Main user dashboard
237
+ - Orders (/orders) - Order management
238
+
239
+ **Components (4):**
240
+ - StatCard (display) - Display statistic with trend
241
+ - OrderTable (composite) - Order listing
242
+ - OrderRow (display) - Single order row
243
+ - StatusBadge (display) - Order status indicator
244
+
245
+ **APIs (3):**
246
+ - user-stats (GET /api/v2/user-stats)
247
+ - orders (GET /api/v2/orders)
248
+ - order-detail (GET /api/v2/orders/[id])
249
+
250
+ **Data Models (2):**
251
+ - UserStats, Order
252
+
253
+ **Integrations (1):**
254
+ - Supabase (auth, database)
255
+
256
+ Is this decomposition correct?
257
+ ```
258
+
259
+ Options:
260
+ - "Yes, proceed with this plan (Recommended)"
261
+ - "Add missing elements"
262
+ - "Remove elements"
263
+ - "Re-parse document"
264
+ - "Skip document, use description instead"
265
+
266
+ ---
267
+
268
+ ## Phase 2: Parse Request
37
269
 
38
270
  Parse the user's natural language request to identify required elements.
39
271
 
272
+ **Note:** If `project_spec.extracted` exists from Phase 1, use it as the primary decomposition source and skip manual parsing.
273
+
40
274
  **Input:** $ARGUMENTS
41
275
 
42
276
  **Look for:**
@@ -49,7 +283,7 @@ Parse the user's natural language request to identify required elements.
49
283
 
50
284
  ---
51
285
 
52
- ## Phase 2: Decompose Into Workflows
286
+ ## Phase 3: Decompose Into Workflows
53
287
 
54
288
  For each identified element, determine:
55
289
 
@@ -90,14 +324,14 @@ Does this look correct?
90
324
  ```
91
325
 
92
326
  Use AskUserQuestion with options:
93
- - "Yes, proceed with this plan"
327
+ - "Yes, proceed with this plan (Recommended)"
94
328
  - "Add more elements"
95
329
  - "Remove elements"
96
330
  - "Let me describe differently"
97
331
 
98
332
  ---
99
333
 
100
- ## Phase 3: Orchestrator Interview
334
+ ## Phase 4: Orchestrator Interview
101
335
 
102
336
  Ask HIGH-LEVEL questions that apply to ALL sub-workflows.
103
337
 
@@ -105,25 +339,25 @@ Ask HIGH-LEVEL questions that apply to ALL sub-workflows.
105
339
 
106
340
  ### Q1: Authentication
107
341
  "What's the authentication requirement for this feature?"
108
- - Protected (requires login) - DEFAULT
342
+ - Protected (requires login) (Recommended)
109
343
  - Public (no auth)
110
344
  - Mixed (specify per element)
111
345
 
112
346
  ### Q2: Error Handling
113
347
  "How should errors be handled across APIs?"
114
- - Partial success (show what works) - DEFAULT
348
+ - Partial success (show what works) (Recommended)
115
349
  - Fail-fast (one fails = all fail)
116
350
  - Retry with fallback
117
351
 
118
352
  ### Q3: Brand Guide
119
353
  "Use project brand guide for styling?"
120
- - Yes, use .claude/BRAND_GUIDE.md - DEFAULT
354
+ - Yes, use .claude/BRAND_GUIDE.md (Recommended)
121
355
  - No, custom theme
122
356
  - Match existing page
123
357
 
124
358
  ### Q4: Testing Level
125
359
  "What level of testing?"
126
- - Full TDD (all 14 phases per element) - DEFAULT
360
+ - Full TDD (all 14 phases per element) (Recommended)
127
361
  - Essential tests only
128
362
  - Smoke tests only
129
363
 
@@ -131,13 +365,13 @@ Store all answers in `shared_decisions` - these will be injected into sub-workfl
131
365
 
132
366
  ---
133
367
 
134
- ## Phase 4: Create Orchestration State
368
+ ## Phase 5: Create Orchestration State
135
369
 
136
370
  Create `.claude/hustle-build-state.json`:
137
371
 
138
372
  ```json
139
373
  {
140
- "version": "4.0.0",
374
+ "version": "4.6.0",
141
375
  "build_id": "build-[timestamp]-[name]",
142
376
  "status": "in_progress",
143
377
  "mode": "interactive|auto",
@@ -148,6 +382,22 @@ Create `.claude/hustle-build-state.json`:
148
382
  "parsed_at": "[timestamp]"
149
383
  },
150
384
 
385
+ "project_spec": {
386
+ "source": "file|paste|url|none",
387
+ "file_path": "[optional - path to document]",
388
+ "raw_content": "[document content if provided]",
389
+ "format": "markdown|json|text",
390
+ "parsed_at": "[timestamp]",
391
+ "extracted": {
392
+ "summary": "[AI-generated summary]",
393
+ "pages": [],
394
+ "components": [],
395
+ "apis": [],
396
+ "data_models": [],
397
+ "integrations": []
398
+ }
399
+ },
400
+
151
401
  "orchestrator_interview": {
152
402
  "status": "complete",
153
403
  "decisions": {
@@ -160,14 +410,14 @@ Create `.claude/hustle-build-state.json`:
160
410
 
161
411
  "decomposition": {
162
412
  "apis": [
163
- {"name": "user-stats", "status": "pending", "depends_on": []}
413
+ {"name": "user-stats", "status": "pending", "depends_on": [], "from_project_spec": true}
164
414
  ],
165
415
  "components": [
166
- {"name": "StatCard", "status": "pending", "depends_on": ["user-stats"]}
416
+ {"name": "StatCard", "status": "pending", "depends_on": ["user-stats"], "from_project_spec": true}
167
417
  ],
168
418
  "combined_apis": [],
169
419
  "pages": [
170
- {"name": "Dashboard", "status": "pending", "depends_on": ["StatCard"]}
420
+ {"name": "Dashboard", "status": "pending", "depends_on": ["StatCard"], "from_project_spec": true}
171
421
  ]
172
422
  },
173
423
 
@@ -183,13 +433,15 @@ Create `.claude/hustle-build-state.json`:
183
433
  }
184
434
  ```
185
435
 
436
+ **Note:** Elements with `from_project_spec: true` were extracted from the project document. This helps track provenance and allows referencing the original spec during implementation.
437
+
186
438
  ---
187
439
 
188
- ## Phase 5: Execute Workflows
440
+ ## Phase 6: Execute Workflows
189
441
 
190
442
  For each workflow in execution order:
191
443
 
192
- ### 5.1 Set Active Workflow
444
+ ### 6.1 Set Active Workflow
193
445
 
194
446
  Update state:
195
447
  ```json
@@ -201,7 +453,7 @@ Update state:
201
453
  }
202
454
  ```
203
455
 
204
- ### 5.2 Invoke Sub-Workflow
456
+ ### 6.2 Invoke Sub-Workflow
205
457
 
206
458
  The orchestrator hooks will automatically:
207
459
  1. Inject `shared_decisions` into `api-dev-state.json`
@@ -217,27 +469,51 @@ Run the appropriate skill:
217
469
  | combined_api | `/hustle-combine api` |
218
470
  | page | `/hustle-ui-create-page [name]` |
219
471
 
220
- ### 5.3 Sub-Workflow Behavior
472
+ ### 6.3 Sub-Workflow Behavior
221
473
 
222
474
  When `orchestrated: true`:
223
475
  - Skip questions answered in `shared_decisions`
224
476
  - Only ask element-specific questions
225
477
  - Report completion back to orchestrator
226
478
 
227
- ### 5.4 On Completion
479
+ ### 6.4 On Completion
480
+
481
+ When a sub-workflow completes:
482
+
483
+ 1. **Mark Complete:** Update state with `"status": "complete"`
484
+ 2. **Find Next:** Identify next pending workflow in decomposition
228
485
 
229
- The `orchestrator-completion.py` hook will:
230
- 1. Mark workflow as complete in state
231
- 2. Find next pending workflow
232
- 3. Inject context for next workflow
486
+ 3. **⚠️ CRITICAL: Use AskUserQuestion for Transitions**
487
+
488
+ You MUST use `AskUserQuestion` tool (not plain text) to ask about continuing:
489
+
490
+ ```json
491
+ {
492
+ "questions": [{
493
+ "question": "✅ Completed [workflow-name]. Next: [next-name]. Continue?",
494
+ "header": "Continue",
495
+ "multiSelect": false,
496
+ "options": [
497
+ {"label": "Yes, proceed (Recommended)", "description": "Continue to next workflow"},
498
+ {"label": "Review first", "description": "Show me what was created"},
499
+ {"label": "Stop here", "description": "Pause build for review"}
500
+ ]
501
+ }]
502
+ }
503
+ ```
504
+
505
+ **Why:** The `auto-answer.py` hook only intercepts `AskUserQuestion` tool calls.
506
+ If you use plain text like "Should I continue?", auto-mode will halt.
507
+
508
+ 4. **Inject Context:** Pass shared_decisions and completed element info to next workflow
233
509
 
234
510
  ---
235
511
 
236
- ## Phase 6: Cross-Workflow Wiring
512
+ ## Phase 7: Cross-Workflow Wiring
237
513
 
238
514
  After all workflows complete, wire them together:
239
515
 
240
- ### 6.1 Import Generation
516
+ ### 7.1 Import Generation
241
517
 
242
518
  For pages that use components and APIs:
243
519
 
@@ -248,7 +524,7 @@ import { StatCard } from '@/components/StatCard';
248
524
  import { ChartWidget } from '@/components/ChartWidget';
249
525
  ```
250
526
 
251
- ### 6.2 Prop Wiring
527
+ ### 7.2 Prop Wiring
252
528
 
253
529
  Wire component props to API response types:
254
530
 
@@ -259,13 +535,13 @@ interface DashboardProps {
259
535
  }
260
536
  ```
261
537
 
262
- ### 6.3 Registry Updates
538
+ ### 7.3 Registry Updates
263
539
 
264
540
  Update `.claude/registry.json` with all created elements and their relationships.
265
541
 
266
542
  ---
267
543
 
268
- ## Phase 7: Final Verification
544
+ ## Phase 8: Final Verification
269
545
 
270
546
  Run comprehensive test suite:
271
547
 
@@ -290,7 +566,7 @@ Report results:
290
566
 
291
567
  ---
292
568
 
293
- ## Phase 8: Documentation Rollup
569
+ ## Phase 9: Documentation Rollup
294
570
 
295
571
  Generate unified documentation:
296
572
 
@@ -311,7 +587,7 @@ Generate unified documentation:
311
587
 
312
588
  ---
313
589
 
314
- ## Phase 9: Completion
590
+ ## Phase 10: Completion
315
591
 
316
592
  Mark build as complete:
317
593
 
@@ -352,27 +628,78 @@ Next Steps:
352
628
 
353
629
  ---
354
630
 
355
- ## Auto Mode Behavior
631
+ ## Auto Mode Behavior (Test Mode)
356
632
 
357
- When `--auto` flag is used:
633
+ When `--auto` flag is used, the workflow runs end-to-end without prompts:
634
+
635
+ ```bash
636
+ # Full autonomous build - perfect for testing
637
+ /hustle-build --auto "photo gallery with search and favorites"
638
+
639
+ # Autonomous with parallel execution
640
+ /hustle-build --auto --parallel "e-commerce checkout flow"
641
+ ```
642
+
643
+ ### How It Works
358
644
 
359
645
  1. **No Interactive Questions:**
360
646
  - All questions auto-answered with comprehensive defaults
361
647
  - Uses `.claude/hustle-build-defaults.json` for overrides
648
+ - Selects "recommended" option for every choice
649
+ - Uses `AskUserQuestion` tool for all prompts (auto-answer.py intercepts)
650
+
651
+ 2. **ALL Phases Execute:**
652
+ - Auto mode ONLY auto-answers questions, it does NOT skip phases
653
+ - Every sub-workflow runs all 14 phases
654
+ - If a phase can't fully complete (missing API key), mark as "partial" not "skipped"
362
655
 
363
- 2. **Error Handling:**
364
- - Test failures: Retry 3x, then log and continue
365
- - Verification gaps: Log, continue
366
- - Missing API keys: Skip element, log warning
656
+ 3. **Error Handling:**
657
+ - Test failures: Retry 3x, then fix issues
658
+ - Verification gaps: Add tests for gaps, then fix
659
+ - Missing API keys: Mark phase "partial", continue
367
660
 
368
- 3. **Notifications:**
661
+ 4. **Notifications:**
369
662
  - Single NTFY notification at completion
370
663
  - Includes summary and review link
371
664
 
372
- 4. **Logging:**
665
+ 5. **Logging:**
373
666
  - All decisions logged to `.claude/workflow-logs/[build-id].json`
374
667
  - Review with `/hustle-build-review [build-id]`
375
668
 
669
+ ### Customizing Defaults
670
+
671
+ Copy the template and customize for your project:
672
+
673
+ ```bash
674
+ cp templates/hustle-build-defaults.json .claude/hustle-build-defaults.json
675
+ ```
676
+
677
+ Then edit `.claude/hustle-build-defaults.json`:
678
+
679
+ ```json
680
+ {
681
+ "orchestrator": {
682
+ "auth_required": true, // Change to false for public APIs
683
+ "error_handling": "partial-success",
684
+ "brand_guide": true,
685
+ "testing_level": "essential" // Change from "full" for faster runs
686
+ },
687
+ "testing": {
688
+ "coverage_threshold": 80,
689
+ "e2e_tests": false // Skip E2E for faster testing
690
+ }
691
+ }
692
+ ```
693
+
694
+ ### Use Cases
695
+
696
+ | Scenario | Command |
697
+ |----------|---------|
698
+ | Full end-to-end test | `/hustle-build --auto "feature"` |
699
+ | Quick test (skip E2E) | Edit defaults, then `--auto` |
700
+ | CI/CD integration | `/hustle-build --auto --dry-run` first |
701
+ | Demo mode | `/hustle-build --auto --parallel` |
702
+
376
703
  ---
377
704
 
378
705
  ## Resume Behavior