specweave 0.22.0 → 0.22.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 (220) hide show
  1. package/CLAUDE.md +373 -13
  2. package/README.md +5 -5
  3. package/bin/specweave.js +5 -8
  4. package/dist/plugins/specweave-github/lib/CodeValidator.d.ts +1 -1
  5. package/dist/plugins/specweave-github/lib/CodeValidator.js +1 -1
  6. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +10 -0
  7. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -1
  8. package/dist/plugins/specweave-github/lib/github-client-v2.js +26 -0
  9. package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -1
  10. package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
  11. package/dist/plugins/specweave-github/lib/task-sync.js +7 -0
  12. package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
  13. package/dist/src/cli/commands/migrate-to-profiles.d.ts +1 -0
  14. package/dist/src/cli/commands/migrate-to-profiles.d.ts.map +1 -1
  15. package/dist/src/cli/commands/migrate-to-profiles.js +12 -1
  16. package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -1
  17. package/dist/src/cli/commands/next-command.d.ts +52 -0
  18. package/dist/src/cli/commands/next-command.d.ts.map +1 -0
  19. package/dist/src/cli/commands/next-command.js +204 -0
  20. package/dist/src/cli/commands/next-command.js.map +1 -0
  21. package/dist/src/cli/commands/repair-status-desync.d.ts +69 -0
  22. package/dist/src/cli/commands/repair-status-desync.d.ts.map +1 -0
  23. package/dist/src/cli/commands/repair-status-desync.js +221 -0
  24. package/dist/src/cli/commands/repair-status-desync.js.map +1 -0
  25. package/dist/src/cli/commands/sync-specs.d.ts +16 -0
  26. package/dist/src/cli/commands/sync-specs.d.ts.map +1 -0
  27. package/dist/src/cli/commands/sync-specs.js +130 -0
  28. package/dist/src/cli/commands/sync-specs.js.map +1 -0
  29. package/dist/src/cli/commands/validate-status-sync.d.ts +52 -0
  30. package/dist/src/cli/commands/validate-status-sync.d.ts.map +1 -0
  31. package/dist/src/cli/commands/validate-status-sync.js +176 -0
  32. package/dist/src/cli/commands/validate-status-sync.js.map +1 -0
  33. package/dist/src/cli/count-tasks.d.ts +20 -0
  34. package/dist/src/cli/count-tasks.d.ts.map +1 -0
  35. package/dist/src/cli/count-tasks.js +50 -0
  36. package/dist/src/cli/count-tasks.js.map +1 -0
  37. package/dist/src/cli/update-status-line.d.ts +16 -0
  38. package/dist/src/cli/update-status-line.d.ts.map +1 -0
  39. package/dist/src/cli/update-status-line.js +44 -0
  40. package/dist/src/cli/update-status-line.js.map +1 -0
  41. package/dist/src/config/ConfigManager.d.ts.map +1 -1
  42. package/dist/src/config/ConfigManager.js +2 -1
  43. package/dist/src/config/ConfigManager.js.map +1 -1
  44. package/dist/src/config/types.d.ts +50 -50
  45. package/dist/src/core/cicd/state-manager.d.ts +8 -0
  46. package/dist/src/core/cicd/state-manager.d.ts.map +1 -1
  47. package/dist/src/core/cicd/state-manager.js +60 -15
  48. package/dist/src/core/cicd/state-manager.js.map +1 -1
  49. package/dist/src/core/cost-tracker.d.ts.map +1 -1
  50. package/dist/src/core/cost-tracker.js +2 -1
  51. package/dist/src/core/cost-tracker.js.map +1 -1
  52. package/dist/src/core/iac/template-engine.d.ts.map +1 -1
  53. package/dist/src/core/iac/template-engine.js +28 -0
  54. package/dist/src/core/iac/template-engine.js.map +1 -1
  55. package/dist/src/core/iac/template-generator.d.ts +53 -0
  56. package/dist/src/core/iac/template-generator.d.ts.map +1 -0
  57. package/dist/src/core/iac/template-generator.js +125 -0
  58. package/dist/src/core/iac/template-generator.js.map +1 -0
  59. package/dist/src/core/increment/completion-validator.d.ts +56 -0
  60. package/dist/src/core/increment/completion-validator.d.ts.map +1 -0
  61. package/dist/src/core/increment/completion-validator.js +102 -0
  62. package/dist/src/core/increment/completion-validator.js.map +1 -0
  63. package/dist/src/core/increment/metadata-manager.d.ts.map +1 -1
  64. package/dist/src/core/increment/metadata-manager.js +10 -0
  65. package/dist/src/core/increment/metadata-manager.js.map +1 -1
  66. package/dist/src/core/increment/spec-frontmatter-updater.d.ts +78 -0
  67. package/dist/src/core/increment/spec-frontmatter-updater.d.ts.map +1 -0
  68. package/dist/src/core/increment/spec-frontmatter-updater.js +152 -0
  69. package/dist/src/core/increment/spec-frontmatter-updater.js.map +1 -0
  70. package/dist/src/core/increment/status-auto-transition.js +3 -3
  71. package/dist/src/core/increment/status-auto-transition.js.map +1 -1
  72. package/dist/src/core/living-docs/CodeValidator.js +1 -1
  73. package/dist/src/core/living-docs/CodeValidator.js.map +1 -1
  74. package/dist/src/core/living-docs/content-distributor.d.ts.map +1 -1
  75. package/dist/src/core/living-docs/content-distributor.js +11 -1
  76. package/dist/src/core/living-docs/content-distributor.js.map +1 -1
  77. package/dist/src/core/living-docs/living-docs-sync.d.ts +166 -0
  78. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -0
  79. package/dist/src/core/living-docs/living-docs-sync.js +727 -0
  80. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -0
  81. package/dist/src/core/living-docs/task-project-specific-generator.d.ts +7 -3
  82. package/dist/src/core/living-docs/task-project-specific-generator.d.ts.map +1 -1
  83. package/dist/src/core/living-docs/task-project-specific-generator.js +40 -24
  84. package/dist/src/core/living-docs/task-project-specific-generator.js.map +1 -1
  85. package/dist/src/core/plugin-loader.d.ts +7 -0
  86. package/dist/src/core/plugin-loader.d.ts.map +1 -1
  87. package/dist/src/core/plugin-loader.js +18 -1
  88. package/dist/src/core/plugin-loader.js.map +1 -1
  89. package/dist/src/core/serverless/platform-data-loader.d.ts +8 -0
  90. package/dist/src/core/serverless/platform-data-loader.d.ts.map +1 -1
  91. package/dist/src/core/serverless/platform-data-loader.js +14 -0
  92. package/dist/src/core/serverless/platform-data-loader.js.map +1 -1
  93. package/dist/src/core/serverless/types.d.ts +1 -1
  94. package/dist/src/core/serverless/types.d.ts.map +1 -1
  95. package/dist/src/core/status-line/status-line-manager.d.ts +7 -2
  96. package/dist/src/core/status-line/status-line-manager.d.ts.map +1 -1
  97. package/dist/src/core/status-line/status-line-manager.js +47 -18
  98. package/dist/src/core/status-line/status-line-manager.js.map +1 -1
  99. package/dist/src/core/status-line/status-line-updater.d.ts +67 -0
  100. package/dist/src/core/status-line/status-line-updater.d.ts.map +1 -0
  101. package/dist/src/core/status-line/status-line-updater.js +203 -0
  102. package/dist/src/core/status-line/status-line-updater.js.map +1 -0
  103. package/dist/src/core/status-line/task-counter.d.ts +69 -0
  104. package/dist/src/core/status-line/task-counter.d.ts.map +1 -0
  105. package/dist/src/core/status-line/task-counter.js +107 -0
  106. package/dist/src/core/status-line/task-counter.js.map +1 -0
  107. package/dist/src/core/status-line/types.d.ts +19 -5
  108. package/dist/src/core/status-line/types.d.ts.map +1 -1
  109. package/dist/src/core/status-line/types.js +3 -3
  110. package/dist/src/core/status-line/types.js.map +1 -1
  111. package/dist/src/core/workflow/autonomous-executor.d.ts +111 -0
  112. package/dist/src/core/workflow/autonomous-executor.d.ts.map +1 -0
  113. package/dist/src/core/workflow/autonomous-executor.js +275 -0
  114. package/dist/src/core/workflow/autonomous-executor.js.map +1 -0
  115. package/dist/src/core/workflow/backlog-scanner.d.ts +94 -0
  116. package/dist/src/core/workflow/backlog-scanner.d.ts.map +1 -0
  117. package/dist/src/core/workflow/backlog-scanner.js +170 -0
  118. package/dist/src/core/workflow/backlog-scanner.js.map +1 -0
  119. package/dist/src/core/workflow/command-invoker.d.ts +86 -0
  120. package/dist/src/core/workflow/command-invoker.d.ts.map +1 -0
  121. package/dist/src/core/workflow/command-invoker.js +131 -0
  122. package/dist/src/core/workflow/command-invoker.js.map +1 -0
  123. package/dist/src/core/workflow/cost-estimator.d.ts +120 -0
  124. package/dist/src/core/workflow/cost-estimator.d.ts.map +1 -0
  125. package/dist/src/core/workflow/cost-estimator.js +222 -0
  126. package/dist/src/core/workflow/cost-estimator.js.map +1 -0
  127. package/dist/src/core/workflow/index.d.ts +20 -0
  128. package/dist/src/core/workflow/index.d.ts.map +1 -0
  129. package/dist/src/core/workflow/index.js +24 -0
  130. package/dist/src/core/workflow/index.js.map +1 -0
  131. package/dist/src/core/workflow/state-manager.d.ts +107 -0
  132. package/dist/src/core/workflow/state-manager.d.ts.map +1 -0
  133. package/dist/src/core/workflow/state-manager.js +126 -0
  134. package/dist/src/core/workflow/state-manager.js.map +1 -0
  135. package/dist/src/core/workflow/workflow-orchestrator.d.ts +93 -0
  136. package/dist/src/core/workflow/workflow-orchestrator.d.ts.map +1 -0
  137. package/dist/src/core/workflow/workflow-orchestrator.js +195 -0
  138. package/dist/src/core/workflow/workflow-orchestrator.js.map +1 -0
  139. package/dist/src/init/architecture/types.d.ts +10 -10
  140. package/dist/src/metrics/dora-calculator.js +2 -2
  141. package/dist/src/metrics/dora-calculator.js.map +1 -1
  142. package/dist/src/utils/pricing-constants.d.ts +5 -2
  143. package/dist/src/utils/pricing-constants.d.ts.map +1 -1
  144. package/dist/src/utils/pricing-constants.js +3 -2
  145. package/dist/src/utils/pricing-constants.js.map +1 -1
  146. package/package.json +4 -4
  147. package/plugins/specweave/agents/infrastructure/AGENT.md +88 -46
  148. package/plugins/specweave/agents/pm/AGENT.md +58 -1
  149. package/plugins/specweave/commands/specweave-archive-features.md +1 -1
  150. package/plugins/specweave/commands/specweave-archive-increments.md +1 -1
  151. package/plugins/specweave/commands/specweave-check-hooks.md +5 -0
  152. package/plugins/specweave/commands/specweave-done.md +72 -4
  153. package/plugins/specweave/commands/specweave-plan.md +1 -1
  154. package/plugins/specweave/commands/specweave-progress.md +108 -379
  155. package/plugins/specweave/commands/specweave-reopen.md +30 -3
  156. package/plugins/specweave/commands/specweave-restore-feature.md +1 -1
  157. package/plugins/specweave/commands/specweave-sync-docs.md +71 -4
  158. package/plugins/specweave/commands/specweave-sync-specs.md +20 -48
  159. package/plugins/specweave/commands/specweave-update-status.md +151 -0
  160. package/plugins/specweave/hooks/lib/update-status-line.sh +78 -41
  161. package/plugins/specweave/hooks/lib/validate-spec-status.sh +163 -0
  162. package/plugins/specweave/hooks/user-prompt-submit.sh +38 -35
  163. package/plugins/specweave/hooks/validate-increment-completion.sh +113 -0
  164. package/plugins/specweave/lib/hooks/update-tasks-md.js +52 -9
  165. package/plugins/specweave/lib/hooks/update-tasks-md.ts +77 -16
  166. package/plugins/specweave/templates/iac/aws-lambda/defaults.json +24 -0
  167. package/plugins/specweave/templates/iac/aws-lambda/templates/README.md.hbs +260 -0
  168. package/plugins/specweave/templates/iac/aws-lambda/templates/environments/dev.tfvars.hbs +34 -0
  169. package/plugins/specweave/templates/iac/aws-lambda/templates/environments/prod.tfvars.hbs +37 -0
  170. package/plugins/specweave/templates/iac/aws-lambda/templates/environments/staging.tfvars.hbs +35 -0
  171. package/plugins/specweave/templates/iac/aws-lambda/templates/outputs.tf.hbs +77 -0
  172. package/plugins/specweave/templates/iac/aws-lambda/templates/providers.tf.hbs +36 -0
  173. package/plugins/specweave/templates/iac/aws-lambda/templates/variables.tf.hbs +115 -0
  174. package/plugins/specweave/templates/iac/azure-functions/defaults.json +25 -0
  175. package/plugins/specweave/templates/iac/azure-functions/templates/README.md.hbs +268 -0
  176. package/plugins/specweave/templates/iac/azure-functions/templates/environments/dev.tfvars.hbs +34 -0
  177. package/plugins/specweave/templates/iac/azure-functions/templates/environments/prod.tfvars.hbs +46 -0
  178. package/plugins/specweave/templates/iac/azure-functions/templates/environments/staging.tfvars.hbs +34 -0
  179. package/plugins/specweave/templates/iac/azure-functions/templates/main.tf.hbs +225 -0
  180. package/plugins/specweave/templates/iac/azure-functions/templates/outputs.tf.hbs +89 -0
  181. package/plugins/specweave/templates/iac/azure-functions/templates/provider.tf.hbs +27 -0
  182. package/plugins/specweave/templates/iac/azure-functions/templates/providers.tf.hbs +35 -0
  183. package/plugins/specweave/templates/iac/azure-functions/templates/variables.tf.hbs +124 -0
  184. package/plugins/specweave/templates/iac/firebase/defaults.json +29 -0
  185. package/plugins/specweave/templates/iac/firebase/templates/README.md.hbs +35 -0
  186. package/plugins/specweave/templates/iac/firebase/templates/environments/dev.tfvars.hbs +7 -0
  187. package/plugins/specweave/templates/iac/firebase/templates/environments/prod.tfvars.hbs +7 -0
  188. package/plugins/specweave/templates/iac/firebase/templates/environments/staging.tfvars.hbs +7 -0
  189. package/plugins/specweave/templates/iac/firebase/templates/main.tf.hbs +90 -0
  190. package/plugins/specweave/templates/iac/firebase/templates/outputs.tf.hbs +15 -0
  191. package/plugins/specweave/templates/iac/firebase/templates/providers.tf.hbs +23 -0
  192. package/plugins/specweave/templates/iac/firebase/templates/variables.tf.hbs +42 -0
  193. package/plugins/specweave/templates/iac/gcp-cloud-functions/defaults.json +26 -0
  194. package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/README.md.hbs +299 -0
  195. package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/dev.tfvars.hbs +36 -0
  196. package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/prod.tfvars.hbs +48 -0
  197. package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/environments/staging.tfvars.hbs +41 -0
  198. package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/main.tf.hbs +192 -0
  199. package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/outputs.tf.hbs +66 -0
  200. package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/providers.tf.hbs +25 -0
  201. package/plugins/specweave/templates/iac/gcp-cloud-functions/templates/variables.tf.hbs +119 -0
  202. package/plugins/specweave/templates/iac/supabase/defaults.json +15 -0
  203. package/plugins/specweave/templates/iac/supabase/templates/README.md.hbs +46 -0
  204. package/plugins/specweave/templates/iac/supabase/templates/main.tf.hbs +50 -0
  205. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +0 -1
  206. package/plugins/specweave-github/agents/github-manager/AGENT.md +39 -7
  207. package/plugins/specweave-github/commands/specweave-github-cleanup-duplicates.md +21 -0
  208. package/plugins/specweave-github/commands/specweave-github-create-issue.md +5 -5
  209. package/plugins/specweave-github/lib/CodeValidator.ts +1 -1
  210. package/plugins/specweave-github/lib/github-client-v2.js +29 -0
  211. package/plugins/specweave-github/lib/github-client-v2.ts +30 -0
  212. package/plugins/specweave-github/lib/task-sync.js +4 -0
  213. package/plugins/specweave-github/lib/task-sync.ts +7 -0
  214. package/src/templates/CLAUDE.md.template +31 -0
  215. package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts +0 -116
  216. package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts.map +0 -1
  217. package/dist/src/core/living-docs/ThreeLayerSyncManager.js +0 -356
  218. package/dist/src/core/living-docs/ThreeLayerSyncManager.js.map +0 -1
  219. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
  220. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -1200
@@ -60,24 +60,38 @@ I generate Terraform configurations for 5 serverless platforms:
60
60
 
61
61
  ### 2. Template Engine Integration
62
62
 
63
- I use the **TerraformTemplateEngine** to render Handlebars templates:
64
-
65
- **Template Location**: `plugins/specweave/iac-templates/{platform-id}/`
66
-
67
- **Template Files**:
68
- - `main.tf.hbs` - Core infrastructure resources
69
- - `variables.tf.hbs` - Input variables with defaults
70
- - `outputs.tf.hbs` - Output values (URLs, ARNs, IDs)
71
- - `provider.tf.hbs` - Cloud provider configuration
72
- - `iam.tf.hbs` - IAM roles, policies, service accounts (security)
73
- - `README.md.hbs` - Deployment instructions and documentation
74
-
75
- **Custom Helpers**:
76
- - `{{snakeCase name}}` - Convert to snake_case
77
- - `{{kebabCase name}}` - Convert to kebab-case
78
- - `{{tfList items}}` - Format as Terraform list
79
- - `{{tfMap obj}}` - Format as Terraform map
63
+ I use the **TerraformTemplateEngine** to render Handlebars templates with full serverless platform support:
64
+
65
+ **Template Location**: `plugins/specweave/templates/iac/{platform}/`
66
+
67
+ **Supported Platforms**:
68
+ - `aws-lambda/` - AWS Lambda + API Gateway + DynamoDB
69
+ - `azure-functions/` - Azure Functions + Cosmos DB
70
+ - `gcp-cloud-functions/` - GCP Cloud Functions + Firestore
71
+ - `firebase/` - Firebase Hosting + Functions + Firestore
72
+ - `supabase/` - Supabase (PostgreSQL + Auth + Storage)
73
+
74
+ **Template Files** (each platform has):
75
+ - `templates/main.tf.hbs` - Core infrastructure resources
76
+ - `templates/variables.tf.hbs` - Input variables with defaults
77
+ - `templates/outputs.tf.hbs` - Output values (URLs, ARNs, IDs)
78
+ - `templates/providers.tf.hbs` - Cloud provider configuration
79
+ - `templates/iam.tf.hbs` - IAM roles, policies, service accounts (AWS/GCP)
80
+ - `templates/README.md.hbs` - Deployment instructions and cost estimates
81
+ - `templates/environments/dev.tfvars.hbs` - Development config (free tier optimized)
82
+ - `templates/environments/staging.tfvars.hbs` - Staging config
83
+ - `templates/environments/prod.tfvars.hbs` - Production config (HA, backup)
84
+ - `defaults.json` - Default values for template variables
85
+
86
+ **Custom Handlebars Helpers**:
87
+ - `{{snakeCase name}}` - Convert to snake_case (e.g., "myFunction" → "my_function")
88
+ - `{{kebabCase name}}` - Convert to kebab-case (e.g., "myFunction" → "my-function")
89
+ - `{{tfList items}}` - Format array as Terraform list (e.g., ["a","b"] → `["a", "b"]`)
90
+ - `{{tfMap obj}}` - Format object as Terraform map
80
91
  - `{{#if (eq var "value")}}...{{/if}}` - Conditional rendering
92
+ - `{{#each items}}...{{/each}}` - Loop over arrays
93
+ - `{{multiply a b}}` - Arithmetic operations
94
+ - `{{add a b}}` - Addition for cost calculations
81
95
 
82
96
  ### 3. Environment-Specific Configurations
83
97
 
@@ -156,37 +170,65 @@ Architect Agent: → Recommends: AWS Lambda for startup project
156
170
 
157
171
  Infrastructure Agent (me):
158
172
  1. Load Templates:
159
- - Locate: plugins/specweave/iac-templates/aws-lambda/
160
- - Read: main.tf.hbs, variables.tf.hbs, outputs.tf.hbs, provider.tf.hbs, iam.tf.hbs, README.md.hbs
173
+ - Locate: plugins/specweave/templates/iac/aws-lambda/
174
+ - Read all template files:
175
+ * templates/main.tf.hbs
176
+ * templates/variables.tf.hbs
177
+ * templates/outputs.tf.hbs
178
+ * templates/providers.tf.hbs
179
+ * templates/iam.tf.hbs
180
+ * templates/README.md.hbs
181
+ * templates/environments/*.tfvars.hbs
161
182
 
162
183
  2. Merge Defaults:
163
- - Load: aws-lambda/defaults.json
164
- - Merge: defaults + project metadata
165
- - Result: Complete variable set
184
+ - Load: defaults.json from aws-lambda/
185
+ - Merge: defaults + architect recommendation metadata
186
+ - Result: Complete variable set with all required values
166
187
 
167
188
  3. Render Templates:
168
- - Use: TerraformTemplateEngine
169
- - Render: Each .hbs file → .tf file
170
- - Apply: Custom helpers (snakeCase, conditionals)
189
+ - Use: Handlebars template engine
190
+ - Render: Each .hbs file → corresponding output file
191
+ - Apply: Custom helpers (snakeCase, tfList, conditionals, loops)
192
+ - Substitute: All {{variableName}} placeholders with actual values
171
193
 
172
194
  4. Generate Environment Configs:
173
- - Load: environments/dev.defaults.json
174
- - Generate: environments/dev.tfvars
175
- - Load: environments/staging.defaults.json
176
- - Generate: environments/staging.tfvars
177
- - Load: environments/prod.defaults.json
178
- - Generate: environments/prod.tfvars
195
+ - Dev environment:
196
+ * Render: templates/environments/dev.tfvars.hbs → dev.tfvars
197
+ * Optimize: Free tier settings (min resources, pay-per-request)
198
+ - Staging environment:
199
+ * Render: templates/environments/staging.tfvars.hbs → staging.tfvars
200
+ * Balance: Performance vs cost
201
+ - Production environment:
202
+ * Render: templates/environments/prod.tfvars.hbs → prod.tfvars
203
+ * Maximize: Availability, backup, multi-region
179
204
 
180
205
  5. Write Files:
181
- - Create: .infrastructure/aws-lambda/ directory
182
- - Write: main.tf, variables.tf, outputs.tf, provider.tf, iam.tf
183
- - Write: README.md (deployment instructions)
184
- - Write: environments/*.tfvars
206
+ - Create: .infrastructure/aws-lambda/ directory in project root
207
+ - Write Terraform files:
208
+ * main.tf (infrastructure resources)
209
+ * variables.tf (input variables)
210
+ * outputs.tf (output values)
211
+ * providers.tf (AWS provider config)
212
+ * iam.tf (IAM roles and policies)
213
+ - Write documentation:
214
+ * README.md (deployment instructions, cost estimates, troubleshooting)
215
+ - Write environment configs:
216
+ * environments/dev.tfvars
217
+ * environments/staging.tfvars
218
+ * environments/prod.tfvars
185
219
 
186
220
  6. Output Summary:
187
221
  ✅ Generated 9 files in .infrastructure/aws-lambda/
188
- 📄 Review files before deploying
189
- 🚀 Next steps: terraform init plan → apply
222
+ 📄 Review generated files:
223
+ - main.tf: Lambda, API Gateway, DynamoDB resources
224
+ - iam.tf: Least-privilege IAM roles
225
+ - README.md: Deployment guide with cost estimates
226
+ 💰 Estimated cost (dev): $0/month (free tier)
227
+ 🚀 Next steps:
228
+ 1. Review infrastructure files
229
+ 2. Run: terraform init
230
+ 3. Run: terraform plan -var-file="environments/dev.tfvars"
231
+ 4. Run: terraform apply -var-file="environments/dev.tfvars"
190
232
  ```
191
233
 
192
234
  ### Workflow 2: Multi-Environment Deployment
@@ -239,12 +281,12 @@ Infrastructure Agent:
239
281
  **My Process**:
240
282
  ```
241
283
  1. Load Templates:
242
- ✅ plugins/specweave/iac-templates/aws-lambda/main.tf.hbs
243
- ✅ plugins/specweave/iac-templates/aws-lambda/variables.tf.hbs
244
- ✅ plugins/specweave/iac-templates/aws-lambda/outputs.tf.hbs
245
- ✅ plugins/specweave/iac-templates/aws-lambda/provider.tf.hbs
246
- ✅ plugins/specweave/iac-templates/aws-lambda/iam.tf.hbs
247
- ✅ plugins/specweave/iac-templates/aws-lambda/README.md.hbs
284
+ ✅ plugins/specweave/templates/iac/aws-lambda/main.tf.hbs
285
+ ✅ plugins/specweave/templates/iac/aws-lambda/variables.tf.hbs
286
+ ✅ plugins/specweave/templates/iac/aws-lambda/outputs.tf.hbs
287
+ ✅ plugins/specweave/templates/iac/aws-lambda/provider.tf.hbs
288
+ ✅ plugins/specweave/templates/iac/aws-lambda/iam.tf.hbs
289
+ ✅ plugins/specweave/templates/iac/aws-lambda/README.md.hbs
248
290
 
249
291
  2. Render with Variables:
250
292
  - projectName: "my-startup-api"
@@ -362,7 +404,7 @@ import { TerraformTemplateEngine } from '@specweave/core/iac/template-engine';
362
404
 
363
405
  const engine = new TerraformTemplateEngine();
364
406
  const result = await engine.render({
365
- templatePath: 'plugins/specweave/iac-templates/aws-lambda',
407
+ templatePath: 'plugins/specweave/templates/iac/aws-lambda',
366
408
  variables: {
367
409
  projectName: 'my-api',
368
410
  functionName: 'my-handler',
@@ -406,7 +448,7 @@ const platformTemplateMap = {
406
448
  'supabase': 'supabase'
407
449
  };
408
450
 
409
- const templateDir = `plugins/specweave/iac-templates/${platformTemplateMap[platformId]}`;
451
+ const templateDir = `plugins/specweave/templates/iac/${platformTemplateMap[platformId]}`;
410
452
  ```
411
453
 
412
454
  **Required Files**:
@@ -694,7 +736,7 @@ for (const env of environments) {
694
736
  **Solution**:
695
737
  ```bash
696
738
  # Verify template exists
697
- ls plugins/specweave/iac-templates/aws-lambda/
739
+ ls plugins/specweave/templates/iac/aws-lambda/
698
740
 
699
741
  # Check platform ID mapping
700
742
  # Valid IDs: aws-lambda, azure-functions, gcp-cloud-functions, firebase, supabase
@@ -10,6 +10,50 @@ fallback_behavior: strict
10
10
 
11
11
  # PM Agent - Product Manager AI Assistant
12
12
 
13
+ ## ⛔ CRITICAL: Increment Folder Structure (MANDATORY)
14
+
15
+ **ALL files created by this agent MUST follow this structure**:
16
+
17
+ ### Allowed Files in Increment Root
18
+ **ONLY these 3 files are allowed** in `.specweave/increments/####-name/`:
19
+ 1. ✅ `spec.md` - Specification
20
+ 2. ✅ `plan.md` - Implementation plan
21
+ 3. ✅ `tasks.md` - Tasks with embedded tests
22
+
23
+ ### ALL Other Files Go in Subfolders
24
+
25
+ **MANDATORY subfolder organization**:
26
+ ```
27
+ .specweave/increments/####-name/
28
+ ├── spec.md # ✅ ONLY core file 1
29
+ ├── plan.md # ✅ ONLY core file 2
30
+ ├── tasks.md # ✅ ONLY core file 3
31
+ ├── reports/ # ✅ ALL reports here
32
+ │ ├── PM-VALIDATION-REPORT.md
33
+ │ ├── COMPLETION-SUMMARY.md
34
+ │ ├── SESSION-NOTES.md
35
+ │ └── ANALYSIS-*.md
36
+ ├── scripts/ # ✅ ALL scripts here
37
+ │ └── helper-*.sh
38
+ └── logs/ # ✅ ALL logs here
39
+ └── execution.log
40
+ ```
41
+
42
+ **When writing ANY file**:
43
+ - ❌ **NEVER** write `.md` files to increment root (except spec.md, plan.md, tasks.md)
44
+ - ✅ **ALWAYS** write reports to `reports/` subfolder
45
+ - ✅ **ALWAYS** write scripts to `scripts/` subfolder
46
+ - ✅ **ALWAYS** write logs to `logs/` subfolder
47
+
48
+ **Example correct paths**:
49
+ - ✅ `.specweave/increments/0001-auth/reports/PM-VALIDATION-REPORT.md`
50
+ - ✅ `.specweave/increments/0001-auth/reports/COMPLETION-SUMMARY.md`
51
+ - ❌ `.specweave/increments/0001-auth/PM-VALIDATION-REPORT.md` (WRONG!)
52
+
53
+ **This is NON-NEGOTIABLE**. Violations will be flagged and files will be moved by maintainers.
54
+
55
+ ---
56
+
13
57
  ## 📚 Required Reading (LOAD FIRST)
14
58
 
15
59
  **CRITICAL**: Before planning features or increments, read these guides:
@@ -1164,10 +1208,23 @@ When creating metadata.json, extract values from spec.md frontmatter:
1164
1208
  - `priority`: Look for `priority: P1|P2|P3`
1165
1209
  - `testMode`: Look for `test_mode: TDD|BDD|Standard` (default: "TDD")
1166
1210
  - `coverageTarget`: Look for `coverage_target: 80|85|90|95|100` (default: 95)
1167
- - `epic`: Look for `epic: FS-YY-MM-DD` (optional)
1211
+ - `epic`: **CRITICAL - Format depends on increment type**:
1212
+ - **Greenfield** (SpecWeave-native): Leave EMPTY (auto-generated as `FS-{increment-number}` during sync)
1213
+ - **Brownfield** (imported from Jira/GitHub/ADO): Use `epic: FS-YY-MM-DD-name` + add `imported: true`
1168
1214
 
1169
1215
  **DO NOT hardcode values** - always extract from spec.md when possible!
1170
1216
 
1217
+ **⛔ CRITICAL: Epic Field Rules**
1218
+
1219
+ When creating spec.md frontmatter:
1220
+ - **NEW increments** (greenfield): DO NOT add `epic:` field (leave it empty for auto-generation)
1221
+ - **Imported work** (brownfield): Add `epic: FS-YY-MM-DD-name` AND `imported: true`
1222
+
1223
+ **Why this matters**:
1224
+ - Greenfield increments use `FS-{increment-number}` format (e.g., `FS-031`, `FS-043`)
1225
+ - Brownfield increments use `FS-YY-MM-DD-name` format (e.g., `FS-25-11-14-jira-epic`)
1226
+ - Mixing formats pollutes living docs and breaks feature tracking
1227
+
1171
1228
  ### Code Reference (TypeScript Pseudocode)
1172
1229
 
1173
1230
  This is what you're executing with Read/Write tools:
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: specweave-archive-features
2
+ name: specweave:archive-features
3
3
  description: Archive features and epics when all related increments are archived
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: specweave-archive-increments
2
+ name: specweave:archive-increments
3
3
  description: Archive completed increments to keep workspace clean
4
4
  ---
5
5
 
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: specweave:check-hooks
3
+ description: Comprehensive health check for hooks - detects import errors, runtime failures, performance issues, and provides auto-fix suggestions
4
+ ---
5
+
1
6
  # Check Hook Health
2
7
 
3
8
  **Command**: `/specweave:check-hooks`
@@ -51,10 +51,78 @@ You are acting as the Product Manager to validate increment completion before cl
51
51
  🎯 Validating readiness for closure...
52
52
  ```
53
53
 
54
- ### Step 2: PM Validation (3 Gates)
54
+ ### Step 2: Automated Completion Validation (Gate 0)
55
+
56
+ **🔥 CRITICAL: Automated validation runs BEFORE PM validation to catch obvious issues!**
57
+
58
+ **BEFORE** invoking the PM agent, run automated validation using `IncrementCompletionValidator`:
59
+
60
+ ```typescript
61
+ import { IncrementCompletionValidator } from '../../../src/core/increment/completion-validator.js';
62
+
63
+ // Validate increment is ready for completion
64
+ const validation = await IncrementCompletionValidator.validateCompletion(incrementId);
65
+
66
+ if (!validation.isValid) {
67
+ // BLOCK completion and show errors
68
+ console.error('❌ CANNOT CLOSE INCREMENT - Automated validation failed');
69
+ console.error('');
70
+ validation.errors.forEach(err => console.error(` • ${err}`));
71
+ console.error('');
72
+ console.error('Fix these issues before running /specweave:done again');
73
+ process.exit(1);
74
+ }
75
+ ```
76
+
77
+ **Example validation output** (FAIL):
78
+ ```
79
+ ❌ CANNOT CLOSE INCREMENT - Automated validation failed
80
+
81
+ • 17 acceptance criteria still open
82
+ • 13 tasks still pending
83
+
84
+ Fix these issues before running /specweave:done again
85
+ ```
86
+
87
+ **Example validation output** (PASS):
88
+ ```
89
+ ✅ Automated validation passed
90
+ • All acceptance criteria completed
91
+ • All tasks completed
92
+
93
+ Proceeding to PM validation...
94
+ ```
95
+
96
+ **What Gate 0 validates**:
97
+ - [ ] All acceptance criteria are checked (`- [x] **AC-...`)
98
+ - [ ] All tasks are completed (`**Status**: [x] completed`)
99
+ - [ ] Required files exist (`spec.md`, `tasks.md`)
100
+
101
+ **Why Gate 0 matters**:
102
+ - **Prevents false completion**: Can't mark increment "completed" with open work
103
+ - **Fast feedback**: Fails immediately (< 1s) vs waiting for PM agent (30s+)
104
+ - **Data integrity**: Ensures status matches reality (no spec.md desync)
105
+
106
+ **CRITICAL**: Gate 0 is MANDATORY and CANNOT be bypassed. If validation fails, increment stays "in-progress" and command exits.
107
+
108
+ ---
109
+
110
+ ### Step 3: PM Validation (3 Gates)
55
111
 
56
112
  **🔥 CRITICAL: PM agent MUST validate all 3 gates before allowing closure!**
57
113
 
114
+ **⛔ CRITICAL: PM Validation Report File Location**
115
+
116
+ When the PM agent writes the validation report, it MUST go in the `reports/` subfolder:
117
+ - ✅ **CORRECT**: `.specweave/increments/####-name/reports/PM-VALIDATION-REPORT.md`
118
+ - ❌ **WRONG**: `.specweave/increments/####-name/PM-VALIDATION-REPORT.md`
119
+
120
+ **Folder structure rules**:
121
+ - ONLY spec.md, plan.md, tasks.md allowed in increment root
122
+ - ALL reports MUST go in `reports/` subfolder
123
+ - ALL scripts MUST go in `scripts/` subfolder
124
+ - ALL logs MUST go in `logs/` subfolder
125
+
58
126
  Invoke PM agent with validation task:
59
127
 
60
128
  ```
@@ -276,7 +344,7 @@ Recommendation: ❌ CANNOT close increment
276
344
  • Estimated effort: 1-2 hours
277
345
  ```
278
346
 
279
- ### Step 3: PM Decision
347
+ ### Step 4: PM Decision
280
348
 
281
349
  **Based on 3-gate validation**:
282
350
 
@@ -314,7 +382,7 @@ Closing increment 0001-user-authentication...
314
382
  🎉 Increment 0001 closed successfully!
315
383
  ```
316
384
 
317
- ### Step 4: Post-Closure Sync (AUTOMATIC)
385
+ ### Step 5: Post-Closure Sync (AUTOMATIC)
318
386
 
319
387
  **CRITICAL**: After increment closes, automatically perform these syncs:
320
388
 
@@ -639,7 +707,7 @@ Increment remains: in-progress
639
707
  Try again after fixing blockers: /specweave:done 0001
640
708
  ```
641
709
 
642
- ### Step 4: Handle Incomplete Work
710
+ ### Step 6: Handle Incomplete Work
643
711
 
644
712
  **If increment cannot close due to scope creep**:
645
713
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: specweave-plan
2
+ name: specweave:plan
3
3
  description: Generate plan.md and tasks.md for PLANNING increment using Architect Agent
4
4
  ---
5
5