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
@@ -0,0 +1,192 @@
1
+ # GCP Cloud Functions + Firestore Terraform Configuration
2
+ # Generated by SpecWeave Serverless Architecture Intelligence
3
+
4
+ # Enable required APIs
5
+ resource "google_project_service" "cloudfunctions" {
6
+ project = "{{projectId}}"
7
+ service = "cloudfunctions.googleapis.com"
8
+
9
+ disable_on_destroy = false
10
+ }
11
+
12
+ resource "google_project_service" "cloudbuild" {
13
+ project = "{{projectId}}"
14
+ service = "cloudbuild.googleapis.com"
15
+
16
+ disable_on_destroy = false
17
+ }
18
+
19
+ resource "google_project_service" "firestore" {
20
+ project = "{{projectId}}"
21
+ service = "firestore.googleapis.com"
22
+
23
+ disable_on_destroy = false
24
+ }
25
+
26
+ resource "google_project_service" "run" {
27
+ project = "{{projectId}}"
28
+ service = "run.googleapis.com"
29
+
30
+ disable_on_destroy = false
31
+ }
32
+
33
+ # Service Account for Cloud Function
34
+ resource "google_service_account" "{{snakeCase serviceAccountId}}" {
35
+ account_id = "{{serviceAccountId}}"
36
+ display_name = "Service Account for {{functionName}}"
37
+ project = "{{projectId}}"
38
+ }
39
+
40
+ # IAM binding for Firestore access
41
+ resource "google_project_iam_member" "firestore_user" {
42
+ project = "{{projectId}}"
43
+ role = "roles/datastore.user"
44
+ member = "serviceAccount:${google_service_account.{{snakeCase serviceAccountId}}.email}"
45
+ }
46
+
47
+ # Storage Bucket for function source code
48
+ resource "google_storage_bucket" "{{snakeCase bucketName}}" {
49
+ name = "{{bucketName}}-{{projectId}}"
50
+ location = "{{bucketLocation}}"
51
+ project = "{{projectId}}"
52
+
53
+ uniform_bucket_level_access = true
54
+
55
+ labels = {
56
+ environment = "{{environment}}"
57
+ managed_by = "terraform"
58
+ project = "{{projectName}}"
59
+ }
60
+ }
61
+
62
+ # Storage Bucket Object for function source code (placeholder)
63
+ resource "google_storage_bucket_object" "function_source" {
64
+ name = "function-source-{{environment}}.zip"
65
+ bucket = google_storage_bucket.{{snakeCase bucketName}}.name
66
+ source = "function-source.zip" # You need to provide this file
67
+ }
68
+
69
+ # Cloud Function (2nd generation)
70
+ resource "google_cloudfunctions2_function" "{{snakeCase functionName}}" {
71
+ name = "{{functionName}}"
72
+ location = "{{region}}"
73
+ project = "{{projectId}}"
74
+
75
+ build_config {
76
+ runtime = "{{runtime}}"
77
+ entry_point = "{{entryPoint}}"
78
+
79
+ source {
80
+ storage_source {
81
+ bucket = google_storage_bucket.{{snakeCase bucketName}}.name
82
+ object = google_storage_bucket_object.function_source.name
83
+ }
84
+ }
85
+ }
86
+
87
+ service_config {
88
+ max_instance_count = {{maxInstances}}
89
+ min_instance_count = {{minInstances}}
90
+ available_memory = "{{memoryMb}}M"
91
+ timeout_seconds = {{timeoutSeconds}}
92
+
93
+ {{#if enableConcurrency}}
94
+ max_instance_request_concurrency = {{maxConcurrentRequests}}
95
+ {{/if}}
96
+
97
+ environment_variables = {
98
+ ENVIRONMENT = "{{environment}}"
99
+ GCP_PROJECT = "{{projectId}}"
100
+ FIRESTORE_DATABASE = "{{databaseId}}"
101
+ COLLECTION_ID = "{{collectionId}}"
102
+ {{#if customEnvVars}}
103
+ {{#each customEnvVars}}
104
+ {{@key}} = "{{this}}"
105
+ {{/each}}
106
+ {{/if}}
107
+ }
108
+
109
+ service_account_email = google_service_account.{{snakeCase serviceAccountId}}.email
110
+
111
+ {{#if enableVpc}}
112
+ vpc_connector = google_vpc_access_connector.connector.id
113
+ vpc_connector_egress_settings = "ALL_TRAFFIC"
114
+ {{/if}}
115
+
116
+ {{#if corsOrigins}}
117
+ ingress_settings = "ALLOW_ALL"
118
+ {{/if}}
119
+ }
120
+
121
+ labels = {
122
+ environment = "{{environment}}"
123
+ managed_by = "terraform"
124
+ project = "{{projectName}}"
125
+ }
126
+
127
+ depends_on = [
128
+ google_project_service.cloudfunctions,
129
+ google_project_service.cloudbuild,
130
+ google_project_service.run,
131
+ google_project_iam_member.firestore_user
132
+ ]
133
+ }
134
+
135
+ # Cloud Function IAM - Allow unauthenticated invocations (API Gateway equivalent)
136
+ resource "google_cloudfunctions2_function_iam_member" "invoker" {
137
+ project = google_cloudfunctions2_function.{{snakeCase functionName}}.project
138
+ location = google_cloudfunctions2_function.{{snakeCase functionName}}.location
139
+ cloud_function = google_cloudfunctions2_function.{{snakeCase functionName}}.name
140
+
141
+ role = "roles/cloudfunctions.invoker"
142
+ member = "allUsers" # For public API. Use specific members for private APIs
143
+ }
144
+
145
+ # Firestore Database
146
+ resource "google_firestore_database" "{{snakeCase databaseId}}" {
147
+ project = "{{projectId}}"
148
+ name = "{{databaseId}}"
149
+ location_id = "{{region}}"
150
+ type = "FIRESTORE_NATIVE"
151
+
152
+ concurrency_mode = "OPTIMISTIC"
153
+ app_engine_integration_mode = "DISABLED"
154
+
155
+ depends_on = [google_project_service.firestore]
156
+ }
157
+
158
+ {{#if enableVpc}}
159
+ # VPC Access Connector for private networking
160
+ resource "google_vpc_access_connector" "connector" {
161
+ name = "{{functionName}}-vpc-connector"
162
+ region = "{{region}}"
163
+ project = "{{projectId}}"
164
+ ip_cidr_range = "10.8.0.0/28"
165
+ network = var.vpc_network
166
+ }
167
+ {{/if}}
168
+
169
+ {{#if enableSecretManager}}
170
+ # Secret Manager for sensitive configuration
171
+ resource "google_secret_manager_secret" "{{snakeCase functionName}}_secrets" {
172
+ secret_id = "{{functionName}}-secrets"
173
+ project = "{{projectId}}"
174
+
175
+ replication {
176
+ auto {}
177
+ }
178
+
179
+ labels = {
180
+ environment = "{{environment}}"
181
+ managed_by = "terraform"
182
+ }
183
+ }
184
+
185
+ # IAM binding for Secret Manager access
186
+ resource "google_secret_manager_secret_iam_member" "secret_accessor" {
187
+ project = google_secret_manager_secret.{{snakeCase functionName}}_secrets.project
188
+ secret_id = google_secret_manager_secret.{{snakeCase functionName}}_secrets.secret_id
189
+ role = "roles/secretmanager.secretAccessor"
190
+ member = "serviceAccount:${google_service_account.{{snakeCase serviceAccountId}}.email}"
191
+ }
192
+ {{/if}}
@@ -0,0 +1,66 @@
1
+ # Output Values for GCP Cloud Functions + Firestore
2
+ # Generated by SpecWeave Serverless Architecture Intelligence
3
+
4
+ output "function_name" {
5
+ description = "Cloud Function name"
6
+ value = google_cloudfunctions2_function.{{snakeCase functionName}}.name
7
+ }
8
+
9
+ output "function_id" {
10
+ description = "Cloud Function ID"
11
+ value = google_cloudfunctions2_function.{{snakeCase functionName}}.id
12
+ }
13
+
14
+ output "function_url" {
15
+ description = "Cloud Function HTTPS trigger URL"
16
+ value = google_cloudfunctions2_function.{{snakeCase functionName}}.service_config[0].uri
17
+ }
18
+
19
+ output "function_region" {
20
+ description = "Cloud Function region"
21
+ value = google_cloudfunctions2_function.{{snakeCase functionName}}.location
22
+ }
23
+
24
+ output "service_account_email" {
25
+ description = "Service Account email for Cloud Function"
26
+ value = google_service_account.{{snakeCase serviceAccountId}}.email
27
+ }
28
+
29
+ output "firestore_database_name" {
30
+ description = "Firestore database name"
31
+ value = google_firestore_database.{{snakeCase databaseId}}.name
32
+ }
33
+
34
+ output "firestore_location" {
35
+ description = "Firestore database location"
36
+ value = google_firestore_database.{{snakeCase databaseId}}.location_id
37
+ }
38
+
39
+ output "storage_bucket_name" {
40
+ description = "Storage bucket name for function source code"
41
+ value = google_storage_bucket.{{snakeCase bucketName}}.name
42
+ }
43
+
44
+ output "storage_bucket_url" {
45
+ description = "Storage bucket URL"
46
+ value = google_storage_bucket.{{snakeCase bucketName}}.url
47
+ }
48
+
49
+ {{#if enableSecretManager}}
50
+ output "secret_manager_secret_id" {
51
+ description = "Secret Manager secret ID"
52
+ value = google_secret_manager_secret.{{snakeCase functionName}}_secrets.secret_id
53
+ }
54
+ {{/if}}
55
+
56
+ {{#if enableVpc}}
57
+ output "vpc_connector_id" {
58
+ description = "VPC Access Connector ID"
59
+ value = google_vpc_access_connector.connector.id
60
+ }
61
+ {{/if}}
62
+
63
+ output "project_id" {
64
+ description = "GCP Project ID"
65
+ value = "{{projectId}}"
66
+ }
@@ -0,0 +1,25 @@
1
+ # Terraform Provider Configuration for GCP
2
+ # Generated by SpecWeave Serverless Architecture Intelligence
3
+
4
+ terraform {
5
+ required_version = ">= 1.5.0"
6
+
7
+ required_providers {
8
+ google = {
9
+ source = "hashicorp/google"
10
+ version = "~> 5.0"
11
+ }
12
+ }
13
+
14
+ {{#if enableRemoteState}}
15
+ backend "gcs" {
16
+ bucket = "{{tfStateBucket}}"
17
+ prefix = "terraform/state/{{projectName}}-{{environment}}"
18
+ }
19
+ {{/if}}
20
+ }
21
+
22
+ provider "google" {
23
+ project = "{{projectId}}"
24
+ region = "{{region}}"
25
+ }
@@ -0,0 +1,119 @@
1
+ # Input Variables for GCP Cloud Functions + Firestore
2
+ # Generated by SpecWeave Serverless Architecture Intelligence
3
+
4
+ variable "project_id" {
5
+ description = "GCP Project ID"
6
+ type = string
7
+ default = "{{projectId}}"
8
+ }
9
+
10
+ variable "region" {
11
+ description = "GCP region for all resources"
12
+ type = string
13
+ default = "{{region}}"
14
+ }
15
+
16
+ variable "function_name" {
17
+ description = "Cloud Function name"
18
+ type = string
19
+ default = "{{functionName}}"
20
+ }
21
+
22
+ variable "runtime" {
23
+ description = "Cloud Function runtime (nodejs20, python312, go121, etc.)"
24
+ type = string
25
+ default = "{{runtime}}"
26
+ }
27
+
28
+ variable "entry_point" {
29
+ description = "Function entry point (handler function name)"
30
+ type = string
31
+ default = "{{entryPoint}}"
32
+ }
33
+
34
+ variable "memory_mb" {
35
+ description = "Memory allocation in MB (128-32768)"
36
+ type = number
37
+ default = {{memoryMb}}
38
+ }
39
+
40
+ variable "timeout_seconds" {
41
+ description = "Function timeout in seconds (1-3600)"
42
+ type = number
43
+ default = {{timeoutSeconds}}
44
+ }
45
+
46
+ variable "min_instances" {
47
+ description = "Minimum number of instances (0 for auto-scale to zero)"
48
+ type = number
49
+ default = {{minInstances}}
50
+ }
51
+
52
+ variable "max_instances" {
53
+ description = "Maximum number of instances"
54
+ type = number
55
+ default = {{maxInstances}}
56
+ }
57
+
58
+ variable "environment" {
59
+ description = "Environment name (dev, staging, prod)"
60
+ type = string
61
+ default = "{{environment}}"
62
+ }
63
+
64
+ variable "database_id" {
65
+ description = "Firestore database ID"
66
+ type = string
67
+ default = "{{databaseId}}"
68
+ }
69
+
70
+ variable "collection_id" {
71
+ description = "Firestore collection ID"
72
+ type = string
73
+ default = "{{collectionId}}"
74
+ }
75
+
76
+ variable "service_account_id" {
77
+ description = "Service Account ID for Cloud Function"
78
+ type = string
79
+ default = "{{serviceAccountId}}"
80
+ }
81
+
82
+ variable "cors_origins" {
83
+ description = "List of allowed CORS origins"
84
+ type = list(string)
85
+ default = {{tfList corsOrigins}}
86
+ }
87
+
88
+ variable "project_name" {
89
+ description = "Project name for resource labeling"
90
+ type = string
91
+ default = "{{projectName}}"
92
+ }
93
+
94
+ variable "bucket_name" {
95
+ description = "Storage bucket name for function source code"
96
+ type = string
97
+ default = "{{bucketName}}"
98
+ }
99
+
100
+ variable "bucket_location" {
101
+ description = "Storage bucket location (US, EU, ASIA, or region)"
102
+ type = string
103
+ default = "{{bucketLocation}}"
104
+ }
105
+
106
+ {{#if enableConcurrency}}
107
+ variable "max_concurrent_requests" {
108
+ description = "Maximum concurrent requests per instance"
109
+ type = number
110
+ default = {{maxConcurrentRequests}}
111
+ }
112
+ {{/if}}
113
+
114
+ {{#if enableVpc}}
115
+ variable "vpc_network" {
116
+ description = "VPC network name for private networking"
117
+ type = string
118
+ }
119
+ {{/if}}
@@ -0,0 +1,15 @@
1
+ {
2
+ "projectName": "my-supabase-project",
3
+ "orgId": "your-org-id",
4
+ "region": "us-east-1",
5
+ "databasePassword": "changeme123",
6
+ "planType": "free",
7
+ "environment": "dev",
8
+ "enableAuth": true,
9
+ "enableStorage": true,
10
+ "enableRealtime": true,
11
+ "enableEdgeFunctions": true,
12
+ "storageBuckets": ["avatars", "documents"],
13
+ "authProviders": ["email"],
14
+ "postgresVersion": "15"
15
+ }
@@ -0,0 +1,46 @@
1
+ # Supabase (PostgreSQL + Auth + Storage + Edge Functions) Configuration
2
+
3
+ **Generated by SpecWeave Serverless Architecture Intelligence**
4
+
5
+ Supabase provides complete backend-as-a-service:
6
+ - PostgreSQL database (Postgres {{postgresVersion}})
7
+ - Built-in Auth ({{authProviders}})
8
+ - Object Storage
9
+ - Edge Functions (Deno runtime)
10
+ - Realtime subscriptions
11
+
12
+ ## Prerequisites
13
+
14
+ 1. Install Supabase CLI: `npm install -g supabase`
15
+ 2. Login: `supabase login`
16
+ 3. Get Org ID: `supabase orgs list`
17
+
18
+ ## Deployment
19
+
20
+ ```bash
21
+ # Initialize Supabase
22
+ supabase init
23
+
24
+ # Link to project
25
+ supabase link --project-ref {{projectName}}
26
+
27
+ # Deploy database migrations
28
+ supabase db push
29
+
30
+ # Deploy edge functions
31
+ supabase functions deploy
32
+ ```
33
+
34
+ ## Cost: $0/month (Free Tier)
35
+
36
+ Supabase free tier includes:
37
+ - 500 MB database storage
38
+ - 1 GB file storage
39
+ - 2 GB bandwidth
40
+ - 50,000 monthly active users
41
+ - 500,000 Edge Function invocations
42
+
43
+ ## Support
44
+
45
+ - Supabase Docs: https://supabase.com/docs
46
+ - SpecWeave: https://spec-weave.com
@@ -0,0 +1,50 @@
1
+ # Supabase (Database + Auth + Storage + Edge Functions) Configuration
2
+ # Generated by SpecWeave Serverless Architecture Intelligence
3
+ #
4
+ # Note: Supabase doesn't have official Terraform provider yet.
5
+ # This uses Supabase CLI with null_resource provisioners.
6
+ # For production, use Supabase Management API or wait for official provider.
7
+
8
+ # Supabase Project (using CLI)
9
+ resource "null_resource" "supabase_project" {
10
+ provisioner "local-exec" {
11
+ command = <<-EOT
12
+ supabase projects create {{projectName}} \
13
+ --org-id {{orgId}} \
14
+ --region {{region}} \
15
+ --plan {{planType}} \
16
+ --db-password '{{databasePassword}}'
17
+ EOT
18
+ }
19
+
20
+ provisioner "local-exec" {
21
+ when = destroy
22
+ command = "supabase projects delete {{projectName}} --org-id {{orgId}}"
23
+ }
24
+ }
25
+
26
+ # Storage Buckets
27
+ {{#each storageBuckets}}
28
+ resource "null_resource" "storage_bucket_{{this}}" {
29
+ provisioner "local-exec" {
30
+ command = <<-EOT
31
+ supabase storage create {{this}} \
32
+ --project-ref {{projectName}} \
33
+ --public
34
+ EOT
35
+ }
36
+
37
+ depends_on = [null_resource.supabase_project]
38
+ }
39
+ {{/each}}
40
+
41
+ # Edge Functions
42
+ {{#if enableEdgeFunctions}}
43
+ resource "null_resource" "edge_functions" {
44
+ provisioner "local-exec" {
45
+ command = "supabase functions deploy --project-ref {{projectName}}"
46
+ }
47
+
48
+ depends_on = [null_resource.supabase_project]
49
+ }
50
+ {{/if}}
@@ -373,7 +373,6 @@ ${userStory.technicalContext}
373
373
  return mapping.task || "Task";
374
374
  case "Subtask":
375
375
  return mapping.task || "Task";
376
- // ADO doesn't have subtasks, use Task
377
376
  default:
378
377
  return "User Story";
379
378
  }
@@ -1,6 +1,38 @@
1
1
  # GitHub Manager Agent
2
2
 
3
- **Role**: GitHub integration specialist for SpecWeave increments
3
+ ⚠️ **DEPRECATED: Use Living Docs Sync Instead** ⚠️
4
+
5
+ **CRITICAL**: This agent creates GitHub issues using the OLD `[Increment XXXX]` format,
6
+ which violates SpecWeave's data flow architecture.
7
+
8
+ **CORRECT DATA FLOW**:
9
+ ```
10
+ Increment → Living Docs → GitHub
11
+ (source of truth)
12
+ ```
13
+
14
+ **USE INSTEAD**:
15
+ - `/specweave:sync-docs update` - Generate living docs from increments
16
+ - `/specweave-github:sync` - Sync living docs to GitHub Issues
17
+ - Result: Issues use correct `US-XXX` or `FS-YY-MM-DD` format
18
+
19
+ **WHY THIS IS DEPRECATED**:
20
+ 1. Creates issues with `[Increment XXXX]` format (rejected by validation)
21
+ 2. Bypasses living docs (source of truth)
22
+ 3. No traceability to User Stories/Feature Specs
23
+ 4. Cannot sync bidirectionally with living docs
24
+
25
+ **IF YOU USE THIS AGENT**: GitHub client will REJECT issue creation with error:
26
+ ```
27
+ ❌ DEPRECATED FORMAT DETECTED: "[Increment 0043] Title"
28
+ GitHub issues MUST use living docs format:
29
+ ✅ CORRECT: "US-XXX: Title" (User Story)
30
+ ✅ CORRECT: "FS-YY-MM-DD: Title" (Feature Spec)
31
+ ```
32
+
33
+ ---
34
+
35
+ **Role**: GitHub integration specialist for SpecWeave increments (DEPRECATED)
4
36
 
5
37
  **Expertise**: GitHub CLI, GitHub API, issue management, project boards, automation, webhooks, Actions
6
38
 
@@ -143,9 +175,9 @@ Invoke the github-manager agent (via Task tool) for:
143
175
  ### Issue Management
144
176
 
145
177
  ```bash
146
- # Create issue
178
+ # ❌ DEPRECATED - Create issue (OLD FORMAT - DO NOT USE)
147
179
  gh issue create \
148
- --title "[Increment 0004] Plugin Architecture" \
180
+ --title "[Increment 0004] Plugin Architecture" \ # ❌ DEPRECATED
149
181
  --body "$(cat issue-body.md)" \
150
182
  --label "specweave,increment,P1" \
151
183
  --milestone "v0.4.0"
@@ -384,10 +416,10 @@ When a new increment is created:
384
416
  - Parse `tasks.md` for task checklist
385
417
  - Format using issue template
386
418
 
387
- 4. **Create GitHub Issue**
419
+ 4. **Create GitHub Issue** (❌ DEPRECATED - DO NOT USE)
388
420
  ```bash
389
421
  gh issue create \
390
- --title "[Increment 0004] Plugin Architecture" \
422
+ --title "[Increment 0004] Plugin Architecture" \ # ❌ DEPRECATED
391
423
  --body "$(cat /tmp/issue-body.md)" \
392
424
  --label "specweave,increment,P1" \
393
425
  --milestone "v0.4.0"
@@ -680,9 +712,9 @@ GitHub Manager Agent:
680
712
  5. Updating metadata...
681
713
  ✓ Saved to .metadata.yaml
682
714
 
683
- ✅ GitHub Issue Created!
715
+ ✅ GitHub Issue Created! (❌ DEPRECATED FORMAT)
684
716
 
685
- Issue #130: [Increment 0004] Plugin Architecture
717
+ Issue #130: [Increment 0004] Plugin Architecture # ❌ DEPRECATED
686
718
  URL: https://github.com/owner/repo/issues/130
687
719
 
688
720
  You can now:
@@ -1,6 +1,27 @@
1
1
  ---
2
2
  name: specweave-github:cleanup-duplicates
3
3
  description: Clean up duplicate GitHub issues for an Epic. Finds issues with duplicate titles and closes all except the first created issue.
4
+ justification: |
5
+ CRITICAL INCIDENT RESPONSE TOOL - DO NOT DELETE!
6
+
7
+ Why This Command Exists:
8
+ - Prevention systems (deduplication, GitHub self-healing) work for single-process execution
9
+ - Multiple parallel Claude Code instances bypass all prevention (file-based cache, no distributed locking)
10
+ - GitHub API race conditions: Time gap between "check exists" and "create issue" allows duplicates
11
+ - Historical duplicates from pre-v0.14.1 users (before prevention was added)
12
+
13
+ Evidence of Need:
14
+ - 2025-11-13: 123 duplicate GitHub issues incident (cleaned to 29 unique)
15
+ - Parallel execution creates race conditions that prevention CANNOT solve
16
+ - Industry standard: Prevention + Detection + Cleanup (defense in depth)
17
+
18
+ When to Delete:
19
+ - ONLY if distributed locking implemented (Redis/file locks)
20
+ - AND parallel execution tested (100+ concurrent syncs with zero duplicates)
21
+ - AND zero duplicates for 6+ months in production
22
+ - AND all users migrated to prevention-enabled versions
23
+
24
+ See: .specweave/increments/0043-spec-md-desync-fix/reports/ULTRATHINK-CLEANUP-DUPLICATES-NECESSITY-2025-11-18.md
4
25
  ---
5
26
 
6
27
  # Clean Up Duplicate GitHub Issues
@@ -175,9 +175,9 @@ Creating issue...
175
175
  ✓ Milestone set: v0.4.0
176
176
  ✓ Metadata updated
177
177
 
178
- ✅ GitHub Issue Created!
178
+ ✅ GitHub Issue Created! (❌ DEPRECATED FORMAT)
179
179
 
180
- Issue #130: [Increment 0004] Plugin Architecture
180
+ Issue #130: [Increment 0004] Plugin Architecture # ❌ DEPRECATED
181
181
  URL: https://github.com/owner/repo/issues/130
182
182
 
183
183
  Auto-sync enabled: progress will update automatically after each task.
@@ -274,15 +274,15 @@ Preview issue body before creating:
274
274
 
275
275
  Output:
276
276
  ```
277
- 📄 Preview: Issue body for increment 0004
277
+ 📄 Preview: Issue body for increment 0004 (❌ DEPRECATED FORMAT)
278
278
 
279
- Title: [Increment 0004] Plugin Architecture
279
+ Title: [Increment 0004] Plugin Architecture # ❌ DEPRECATED
280
280
  Labels: specweave, increment, P1
281
281
  Milestone: v0.4.0
282
282
 
283
283
  Body:
284
284
  ---
285
- # [Increment 0004] Plugin Architecture
285
+ # [Increment 0004] Plugin Architecture # ❌ DEPRECATED
286
286
 
287
287
  **Status**: Planning
288
288
  **Priority**: P1
@@ -7,7 +7,7 @@
7
7
  * - Files are empty or have trivial content
8
8
  * - Implementation is incomplete
9
9
  *
10
- * Used by ThreeLayerSyncManager to enforce code-completion discipline.
10
+ * Used by GitHub sync to enforce code-completion discipline.
11
11
  *
12
12
  * @module CodeValidator
13
13
  */