gaia-framework 1.65.0 → 1.66.0

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 (92) hide show
  1. package/.claude/commands/gaia-add-feature.md +2 -2
  2. package/.claude/commands/gaia-change-request.md +16 -4
  3. package/.claude/commands/gaia-edit-ux.md +17 -0
  4. package/.claude/commands/gaia-resume.md +1 -1
  5. package/.claude/commands/gaia-validate-prd.md +9 -3
  6. package/CLAUDE.md +16 -1
  7. package/README.md +3 -3
  8. package/_gaia/_config/adversarial-triggers.yaml +91 -0
  9. package/_gaia/_config/files-manifest.csv +1 -0
  10. package/_gaia/_config/gaia-help.csv +10 -6
  11. package/_gaia/_config/global.yaml +2 -1
  12. package/_gaia/_config/lifecycle-sequence.yaml +26 -4
  13. package/_gaia/_config/manifest.yaml +3 -3
  14. package/_gaia/_config/skill-manifest.csv +3 -1
  15. package/_gaia/_config/workflow-manifest.csv +5 -3
  16. package/_gaia/core/config.yaml +1 -1
  17. package/_gaia/core/engine/workflow.xml +31 -5
  18. package/_gaia/core/protocols/review-gate-check.xml +29 -1
  19. package/_gaia/core/workflows/brainstorming/template.md +6 -0
  20. package/_gaia/lifecycle/agents/pm.md +9 -10
  21. package/_gaia/lifecycle/agents/ux-designer.md +1 -0
  22. package/_gaia/lifecycle/agents/validator.md +2 -1
  23. package/_gaia/lifecycle/config.yaml +1 -1
  24. package/_gaia/lifecycle/knowledge/brownfield/config-contradiction-scan.md +137 -0
  25. package/_gaia/lifecycle/knowledge/brownfield/dead-code-scan.md +179 -0
  26. package/_gaia/lifecycle/knowledge/brownfield/test-execution-scan.md +209 -0
  27. package/_gaia/lifecycle/module-help.csv +1 -1
  28. package/_gaia/lifecycle/skills/document-rulesets.md +251 -0
  29. package/_gaia/lifecycle/skills/memory-management-cross-agent.md +218 -0
  30. package/_gaia/lifecycle/skills/memory-management.md +32 -122
  31. package/_gaia/lifecycle/templates/brownfield-scan-doc-code-prompt.md +219 -0
  32. package/_gaia/lifecycle/templates/brownfield-scan-hardcoded-prompt.md +169 -0
  33. package/_gaia/lifecycle/templates/brownfield-scan-integration-seam-prompt.md +127 -0
  34. package/_gaia/lifecycle/templates/brownfield-scan-runtime-behavior-prompt.md +141 -0
  35. package/_gaia/lifecycle/templates/brownfield-scan-security-prompt.md +212 -0
  36. package/_gaia/lifecycle/templates/gap-entry-schema.md +247 -0
  37. package/_gaia/lifecycle/templates/infra-prd-template.md +356 -0
  38. package/_gaia/lifecycle/templates/platform-prd-template.md +431 -0
  39. package/_gaia/lifecycle/templates/prd-template.md +70 -0
  40. package/_gaia/lifecycle/templates/story-template.md +1 -0
  41. package/_gaia/lifecycle/workflows/1-analysis/create-product-brief/workflow.yaml +1 -0
  42. package/_gaia/lifecycle/workflows/2-planning/create-prd/instructions.xml +4 -2
  43. package/_gaia/lifecycle/workflows/2-planning/create-prd/workflow.yaml +1 -0
  44. package/_gaia/lifecycle/workflows/2-planning/create-ux-design/workflow.yaml +1 -0
  45. package/_gaia/lifecycle/workflows/2-planning/edit-prd/instructions.xml +4 -4
  46. package/_gaia/lifecycle/workflows/2-planning/edit-prd/workflow.yaml +1 -0
  47. package/_gaia/lifecycle/workflows/2-planning/edit-ux-design/checklist.md +18 -0
  48. package/_gaia/lifecycle/workflows/2-planning/edit-ux-design/instructions.xml +66 -0
  49. package/_gaia/lifecycle/workflows/2-planning/edit-ux-design/workflow.yaml +27 -0
  50. package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/instructions.xml +3 -1
  51. package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/workflow.yaml +1 -0
  52. package/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories/workflow.yaml +1 -0
  53. package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/instructions.xml +4 -7
  54. package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/workflow.yaml +1 -0
  55. package/_gaia/lifecycle/workflows/3-solutioning/security-threat-model/workflow.yaml +1 -0
  56. package/_gaia/lifecycle/workflows/4-implementation/add-feature/checklist.md +42 -0
  57. package/_gaia/lifecycle/workflows/4-implementation/add-feature/instructions.xml +196 -0
  58. package/_gaia/lifecycle/workflows/{cross-phase → 4-implementation}/add-feature/workflow.yaml +20 -9
  59. package/_gaia/lifecycle/workflows/4-implementation/add-stories/checklist.md +5 -0
  60. package/_gaia/lifecycle/workflows/4-implementation/add-stories/instructions.xml +73 -1
  61. package/_gaia/lifecycle/workflows/4-implementation/add-stories/workflow.yaml +1 -0
  62. package/_gaia/lifecycle/workflows/4-implementation/code-review/workflow.yaml +1 -0
  63. package/_gaia/lifecycle/workflows/4-implementation/correct-course/workflow.yaml +1 -0
  64. package/_gaia/lifecycle/workflows/4-implementation/create-story/checklist.md +1 -1
  65. package/_gaia/lifecycle/workflows/4-implementation/create-story/instructions.xml +5 -4
  66. package/_gaia/lifecycle/workflows/4-implementation/dev-story/workflow.yaml +1 -1
  67. package/_gaia/lifecycle/workflows/4-implementation/retrospective/instructions.xml +21 -1
  68. package/_gaia/lifecycle/workflows/4-implementation/retrospective/workflow.yaml +2 -1
  69. package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/instructions.xml +3 -0
  70. package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/workflow.yaml +2 -0
  71. package/_gaia/lifecycle/workflows/4-implementation/triage-findings/workflow.yaml +1 -0
  72. package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/checklist.md +15 -0
  73. package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/instructions.xml +153 -57
  74. package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/workflow.yaml +5 -0
  75. package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/instructions.xml +23 -12
  76. package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/workflow.yaml +11 -0
  77. package/_gaia/lifecycle/workflows/4-implementation/val-validate-plan/instructions.xml +0 -2
  78. package/_gaia/lifecycle/workflows/5-deployment/deployment-checklist/workflow.yaml +1 -0
  79. package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/checklist.md +12 -0
  80. package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/instructions.xml +313 -5
  81. package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/workflow.yaml +1 -0
  82. package/_gaia/lifecycle/workflows/anytime/memory-hygiene/instructions.xml +8 -18
  83. package/_gaia/testing/config.yaml +1 -1
  84. package/_gaia/testing/workflows/edit-test-plan/workflow.yaml +1 -0
  85. package/_gaia/testing/workflows/test-design/workflow.yaml +2 -0
  86. package/_gaia/testing/workflows/traceability/workflow.yaml +1 -0
  87. package/bin/gaia-framework.js +25 -9
  88. package/bin/generate-checksums.js +124 -0
  89. package/gaia-install.sh +74 -28
  90. package/package.json +5 -2
  91. package/_gaia/lifecycle/workflows/cross-phase/add-feature/checklist.md +0 -30
  92. package/_gaia/lifecycle/workflows/cross-phase/add-feature/instructions.xml +0 -85
@@ -0,0 +1,431 @@
1
+ ---
2
+ template: 'platform-prd'
3
+ version: 1.0.0
4
+ used_by: ['create-prd']
5
+ domain: '{domain}'
6
+ ---
7
+
8
+ # Platform PRD: {product_name}
9
+
10
+ > **Project:** {project_name}
11
+ > **Domain:** {domain}
12
+ > **Date:** {date}
13
+ > **Author:** {agent_name}
14
+ > **Status:** Draft | In Review | Approved
15
+ > **Project Type:** Platform (application + infrastructure)
16
+
17
+ > Requirement IDs use prefixes to disambiguate scope: FR-### and NFR-### for application requirements, IR-###, OR-###, and SR-### for infrastructure requirements. IDs are globally unique within a project — each prefix defines a separate namespace.
18
+
19
+ ---
20
+
21
+ # Part I: Application Requirements
22
+
23
+ ## 1. Overview
24
+
25
+ {Brief product overview and context. What is being built and why.}
26
+
27
+ ## 2. Goals and Non-Goals
28
+
29
+ ### Goals
30
+ - {Goal 1}
31
+ - {Goal 2}
32
+
33
+ ### Non-Goals
34
+ - {Explicitly out of scope item 1}
35
+
36
+ ## 3. User Stories
37
+
38
+ | ID | As a... | I want to... | So that... | Priority |
39
+ |----|---------|-------------|-----------|----------|
40
+ | US-01 | {role} | {action} | {benefit} | {P0-P3} |
41
+
42
+ ## 4. Functional Requirements
43
+
44
+ ### 4.1 {Feature Area}
45
+
46
+ - **FR-01:** {Requirement description}
47
+ - **FR-02:** {Requirement description}
48
+
49
+ ## 5. Non-Functional Requirements
50
+
51
+ | ID | Category | Requirement | Target |
52
+ |----|----------|------------|--------|
53
+ | NFR-001 | Performance | {requirement} | {target} |
54
+ | NFR-002 | Security | {requirement} | {target} |
55
+ | NFR-003 | Accessibility | {requirement} | {target} |
56
+
57
+ ## 6. Out of Scope
58
+
59
+ | Exclusion | Reason |
60
+ |-----------|--------|
61
+ | {feature or integration} | {deferred / not needed / separate product} |
62
+
63
+ ## 7. UX Requirements
64
+
65
+ {Key interaction patterns, wireframe references, accessibility needs.}
66
+
67
+ ## 8. Technical Constraints
68
+
69
+ - {Platform, language, or integration constraint}
70
+
71
+ ## 9. Dependencies
72
+
73
+ | Dependency | Type | Failure Mode | Fallback Behavior | SLA Expectation |
74
+ |------------|------|-------------|-------------------|-----------------|
75
+ | {service or system} | {API / Database / Message Queue / CDN / Auth Provider} | {What happens when it's unavailable} | {Graceful degradation / Retry / Queue / Circuit breaker / Hard fail} | {Expected uptime / latency / throughput} |
76
+
77
+ ## 10. Milestones
78
+
79
+ | Milestone | Target Date | Deliverables |
80
+ |-----------|------------|-------------|
81
+ | {milestone} | {date} | {deliverables} |
82
+
83
+ ---
84
+
85
+ # Part II: Infrastructure Requirements
86
+
87
+ ## 11. Platform Overview & Scope
88
+
89
+ {Platform purpose, target environments, and team ownership.}
90
+
91
+ ### Platform Purpose
92
+
93
+ {What this infrastructure provides and why it exists.}
94
+
95
+ ### Target Environments
96
+
97
+ | Environment | Purpose | Region(s) | Owner |
98
+ |-------------|---------|-----------|-------|
99
+ | {env_name} | {purpose} | {regions} | {team} |
100
+
101
+ ### Team Ownership
102
+
103
+ | Component | Owning Team | Escalation |
104
+ |-----------|-------------|------------|
105
+ | {component} | {team} | {contact} |
106
+
107
+ ## 12. Platform Capabilities
108
+
109
+ {What the infrastructure enables. Each capability follows the format below.}
110
+
111
+ | ID | Capability | SLO |
112
+ |----|-----------|-----|
113
+ | PC-01 | Enable {team/service} to {capability} with {SLO} | {target} |
114
+ | PC-02 | Enable {team/service} to {capability} with {SLO} | {target} |
115
+
116
+ ## 13. Resource Specifications
117
+
118
+ {Compute, storage, networking, IAM provisioning. Per-environment breakdown.}
119
+
120
+ ### Compute
121
+
122
+ | Resource | Environment | Spec | Scaling |
123
+ |----------|-------------|------|---------|
124
+ | {resource} | {env} | {cpu/memory} | {auto/manual, min-max} |
125
+
126
+ ### Storage
127
+
128
+ | Store | Type | Size | IOPS | Backup |
129
+ |-------|------|------|------|--------|
130
+ | {store} | {block/object/file} | {size} | {iops} | {policy} |
131
+
132
+ ### Networking
133
+
134
+ | Component | CIDR/Range | Protocol | Purpose |
135
+ |-----------|-----------|----------|---------|
136
+ | {component} | {cidr} | {protocol} | {purpose} |
137
+
138
+ ### IAM Provisioning
139
+
140
+ | Role/Policy | Scope | Permissions | Lifecycle |
141
+ |-------------|-------|-------------|-----------|
142
+ | {role} | {scope} | {permissions} | {create/rotate/revoke} |
143
+
144
+ ### State Management
145
+
146
+ {State backend strategy — e.g., Terraform remote state, locking, encryption.}
147
+
148
+ | Backend | Lock Provider | Encryption | Workspace Strategy |
149
+ |---------|--------------|------------|-------------------|
150
+ | {backend} | {lock} | {encryption} | {workspace} |
151
+
152
+ ### Data Persistence Requirements
153
+
154
+ | Data Store | Durability | Replication | Retention |
155
+ |------------|-----------|-------------|-----------|
156
+ | {store} | {durability} | {replication} | {retention} |
157
+
158
+ ## 14. Operational SLOs
159
+
160
+ {Availability targets, MTTR, RTO/RPO, error budgets, resource utilization targets.}
161
+
162
+ ### Availability & Recovery
163
+
164
+ | Metric | Target | Measurement |
165
+ |--------|--------|-------------|
166
+ | Availability | {99.x%} | {how measured} |
167
+ | MTTR | {minutes} | {how measured} |
168
+ | RTO | {minutes} | {recovery time objective} |
169
+ | RPO | {minutes} | {recovery point objective} |
170
+ | Error Budget | {x% per month} | {how calculated} |
171
+
172
+ ### Resource Utilization Targets
173
+
174
+ | Resource | Target Utilization | Alert Threshold |
175
+ |----------|-------------------|-----------------|
176
+ | CPU | {target%} | {alert%} |
177
+ | Memory | {target%} | {alert%} |
178
+ | Storage IOPS | {target} | {threshold} |
179
+ | Network Bandwidth | {target Gbps} | {threshold} |
180
+ | Network Latency | {target ms} | {threshold} |
181
+
182
+ ## 15. Security Posture
183
+
184
+ {Security requirements tailored for infrastructure projects.}
185
+
186
+ ### IAM/RBAC
187
+
188
+ {Identity and access management, role-based access control policies.}
189
+
190
+ | Principal | Role | Scope | MFA Required | Review Cadence |
191
+ |-----------|------|-------|-------------|----------------|
192
+ | {principal} | {role} | {scope} | {yes/no} | {quarterly/annually} |
193
+
194
+ ### Network Segmentation
195
+
196
+ {Network isolation, security groups, firewall rules, zero-trust boundaries.}
197
+
198
+ | Zone | CIDR | Ingress Rules | Egress Rules | Purpose |
199
+ |------|------|---------------|-------------|---------|
200
+ | {zone} | {cidr} | {rules} | {rules} | {purpose} |
201
+
202
+ ### Secrets Management
203
+
204
+ {Secrets storage, rotation, injection, and audit strategy.}
205
+
206
+ | Secret Type | Store | Rotation | Injection Method |
207
+ |-------------|-------|----------|-----------------|
208
+ | {type} | {vault/kms/ssm} | {cadence} | {env var/sidecar/init container} |
209
+
210
+ ### Image Provenance
211
+
212
+ {Container image signing, scanning, and supply chain verification.}
213
+
214
+ | Registry | Signing | Scanning | Admission Policy |
215
+ |----------|---------|----------|-----------------|
216
+ | {registry} | {cosign/notary} | {trivy/grype} | {policy} |
217
+
218
+ ### Compliance Mapping
219
+
220
+ {Regulatory and compliance framework alignment.}
221
+
222
+ | Framework | Controls | Evidence | Audit Frequency |
223
+ |-----------|----------|----------|----------------|
224
+ | {SOC2/HIPAA/PCI/ISO} | {control IDs} | {how demonstrated} | {cadence} |
225
+
226
+ ## 16. Environment Strategy & Developer Experience
227
+
228
+ {Environment parity, promotion pipeline, drift detection, self-service provisioning.}
229
+
230
+ ### Environment Parity
231
+
232
+ | Dimension | Dev | Staging | Production |
233
+ |-----------|-----|---------|-----------|
234
+ | {dimension} | {dev config} | {staging config} | {prod config} |
235
+
236
+ ### Promotion Pipeline
237
+
238
+ {How changes flow from dev to production.}
239
+
240
+ ```
241
+ {dev} → {staging} → {production}
242
+ ```
243
+
244
+ ### Drift Detection
245
+
246
+ {How configuration drift is detected and remediated.}
247
+
248
+ | Tool | Schedule | Remediation | Notification |
249
+ |------|----------|-------------|-------------|
250
+ | {tool} | {cron} | {auto/manual} | {channel} |
251
+
252
+ ### Self-Service Provisioning
253
+
254
+ {Developer self-service capabilities and guardrails.}
255
+
256
+ | Capability | Interface | Guardrails | Approval |
257
+ |------------|-----------|-----------|----------|
258
+ | {capability} | {CLI/portal/API} | {policy} | {auto/manual} |
259
+
260
+ ### Onboarding
261
+
262
+ {New team member and new service onboarding procedures.}
263
+
264
+ ### Observability
265
+
266
+ {Monitoring, logging, tracing, and alerting strategy.}
267
+
268
+ | Signal | Tool | Retention | Alerting |
269
+ |--------|------|-----------|---------|
270
+ | Metrics | {prometheus/cloudwatch} | {retention} | {pagerduty/slack} |
271
+ | Logs | {elk/cloudwatch} | {retention} | {rules} |
272
+ | Traces | {jaeger/xray} | {retention} | {rules} |
273
+
274
+ ## 17. Dependencies & Provider Constraints
275
+
276
+ {Cloud provider limits, Terraform provider versions, upstream service contracts.}
277
+
278
+ ### Cloud Provider Limits
279
+
280
+ | Provider | Service | Limit | Current Usage | Headroom |
281
+ |----------|---------|-------|--------------|----------|
282
+ | {provider} | {service} | {limit} | {current} | {remaining} |
283
+
284
+ ### Terraform Provider Versions
285
+
286
+ | Provider | Version | Constraint | Notes |
287
+ |----------|---------|-----------|-------|
288
+ | {provider} | {version} | {~> x.y} | {notes} |
289
+
290
+ ### Upstream Service Contracts
291
+
292
+ | Service | SLA | API Version | Deprecation |
293
+ |---------|-----|------------|-------------|
294
+ | {service} | {sla} | {version} | {date or N/A} |
295
+
296
+ ## 18. Cost Model
297
+
298
+ {Per-environment resource cost estimates, scaling cost projections, and cost-per-unit efficiency metrics.}
299
+
300
+ ### Per-Environment Resource Cost Estimates
301
+
302
+ | Resource | Dev (monthly) | Staging (monthly) | Production (monthly) |
303
+ |----------|--------------|-------------------|---------------------|
304
+ | Compute | ${cost} | ${cost} | ${cost} |
305
+ | Storage | ${cost} | ${cost} | ${cost} |
306
+ | Networking | ${cost} | ${cost} | ${cost} |
307
+ | Monitoring | ${cost} | ${cost} | ${cost} |
308
+ | **Total** | **${total}** | **${total}** | **${total}** |
309
+
310
+ ### Scaling Cost Projections
311
+
312
+ | Scenario | Trigger | Additional Cost | Timeline |
313
+ |----------|---------|----------------|----------|
314
+ | {scenario} | {trigger condition} | ${projection} | {timeframe} |
315
+
316
+ ### Cost-Per-Unit Efficiency Metrics
317
+
318
+ | Metric | Current | Target | Optimization |
319
+ |--------|---------|--------|-------------|
320
+ | Cost per request | ${cost} | ${target} | {strategy} |
321
+ | Cost per GB stored | ${cost} | ${target} | {strategy} |
322
+ | Cost per environment | ${cost} | ${target} | {strategy} |
323
+
324
+ ## 19. Verification Strategy
325
+
326
+ {Policy-as-code (OPA/Rego, Checkov, tfsec), plan validation, smoke tests, drift detection, chaos testing.}
327
+
328
+ ### Policy-as-Code
329
+
330
+ | Tool | Scope | Rules | Enforcement |
331
+ |------|-------|-------|-------------|
332
+ | OPA/Rego | {scope} | {rule count} | {warn/deny} |
333
+ | Checkov | {scope} | {rule count} | {warn/deny} |
334
+ | tfsec | {scope} | {rule count} | {warn/deny} |
335
+
336
+ ### Plan Validation
337
+
338
+ {Terraform plan review, cost estimation, blast radius analysis.}
339
+
340
+ | Check | Tool | Gate | Threshold |
341
+ |-------|------|------|-----------|
342
+ | {check} | {tool} | {CI/manual} | {threshold} |
343
+
344
+ ### Smoke Tests
345
+
346
+ {Post-deployment verification tests.}
347
+
348
+ | Test | Target | Expected | Timeout |
349
+ |------|--------|----------|---------|
350
+ | {test} | {endpoint/resource} | {result} | {timeout} |
351
+
352
+ ### Drift Detection
353
+
354
+ {Scheduled plan diffs, state file monitoring, compliance scanning.}
355
+
356
+ ### Chaos Testing
357
+
358
+ {Failure injection, resilience validation.}
359
+
360
+ | Experiment | Target | Hypothesis | Blast Radius |
361
+ |-----------|--------|-----------|-------------|
362
+ | {experiment} | {target} | {hypothesis} | {scope} |
363
+
364
+ ## 20. Operational Runbooks
365
+
366
+ {Scaling, failover, incident response, rollback procedures.}
367
+
368
+ ### Scaling Procedures
369
+
370
+ | Trigger | Action | Rollback | Owner |
371
+ |---------|--------|----------|-------|
372
+ | {trigger} | {action} | {rollback} | {team} |
373
+
374
+ ### Failover Procedures
375
+
376
+ | Scenario | Detection | Response | RTO |
377
+ |----------|-----------|----------|-----|
378
+ | {scenario} | {detection} | {response steps} | {rto} |
379
+
380
+ ### Incident Response
381
+
382
+ | Severity | Notification | Escalation | Runbook |
383
+ |----------|-------------|------------|---------|
384
+ | P1 | {channel} | {escalation path} | {link} |
385
+ | P2 | {channel} | {escalation path} | {link} |
386
+
387
+ ### Rollback Procedures
388
+
389
+ | Change Type | Rollback Method | Verification | Duration |
390
+ |-------------|----------------|-------------|----------|
391
+ | {type} | {method} | {verification} | {estimate} |
392
+
393
+ ---
394
+
395
+ # Part III: Combined Requirements Summary
396
+
397
+ ## 21. Requirements Summary
398
+
399
+ > IDs are globally unique within a project. The prefix disambiguates the requirement scope: FR/NFR for application, IR/OR/SR for infrastructure.
400
+
401
+ ### Application Requirements
402
+
403
+ | ID | Description | Priority | Status |
404
+ |----|------------|----------|--------|
405
+ | FR-001 | {description} | {Must-Have/Should-Have/Nice-to-Have} | {Draft/Approved} |
406
+ | NFR-001 | {description} | {Must-Have/Should-Have/Nice-to-Have} | {Draft/Approved} |
407
+
408
+ ### Infrastructure Requirements
409
+
410
+ | ID | Description | Priority | Status |
411
+ |----|------------|----------|--------|
412
+ | IR-001 | {description} | {Must-Have/Should-Have/Nice-to-Have} | {Draft/Approved} |
413
+ | IR-002 | {description} | {Must-Have/Should-Have/Nice-to-Have} | {Draft/Approved} |
414
+
415
+ ### Operational Requirements
416
+
417
+ | ID | Description | Priority | Status |
418
+ |----|------------|----------|--------|
419
+ | OR-001 | {description} | {Must-Have/Should-Have/Nice-to-Have} | {Draft/Approved} |
420
+ | OR-002 | {description} | {Must-Have/Should-Have/Nice-to-Have} | {Draft/Approved} |
421
+
422
+ ### Security Requirements
423
+
424
+ | ID | Description | Priority | Status |
425
+ |----|------------|----------|--------|
426
+ | SR-001 | {description} | {Must-Have/Should-Have/Nice-to-Have} | {Draft/Approved} |
427
+ | SR-002 | {description} | {Must-Have/Should-Have/Nice-to-Have} | {Draft/Approved} |
428
+
429
+ ## 22. Open Questions
430
+
431
+ - [ ] {Unresolved question}
@@ -81,3 +81,73 @@ used_by: ['create-prd']
81
81
  ## 12. Open Questions
82
82
 
83
83
  - [ ] {Unresolved question}
84
+
85
+ <!-- BROWNFIELD-ONLY-START -->
86
+
87
+ ## Gap Analysis Summary
88
+
89
+ | Category | Critical | High | Medium | Low | Total |
90
+ |----------|----------|------|--------|-----|-------|
91
+ | Config Contradictions | {count} | {count} | {count} | {count} | {count} |
92
+ | Dead Code & Dead State | {count} | {count} | {count} | {count} | {count} |
93
+ | Hard-Coded Business Logic | {count} | {count} | {count} | {count} | {count} |
94
+ | Security Endpoints | {count} | {count} | {count} | {count} | {count} |
95
+ | Runtime Behaviors | {count} | {count} | {count} | {count} | {count} |
96
+ | Documentation Drift | {count} | {count} | {count} | {count} | {count} |
97
+ | Integration Seams | {count} | {count} | {count} | {count} | {count} |
98
+ | **Overall** | **{count}** | **{count}** | **{count}** | **{count}** | **{count}** |
99
+
100
+ ## Gap Analysis by Category
101
+
102
+ ### Config Contradictions (`configuration`)
103
+
104
+ | ID | Severity | Title | Description | Evidence | Recommendation | Verified By | Confidence |
105
+ |----|----------|-------|-------------|----------|----------------|-------------|------------|
106
+ | — | — | No gaps detected in this category. | — | — | — | — | — |
107
+
108
+ ### Dead Code & Dead State (`functional`)
109
+
110
+ | ID | Severity | Title | Description | Evidence | Recommendation | Verified By | Confidence |
111
+ |----|----------|-------|-------------|----------|----------------|-------------|------------|
112
+ | — | — | No gaps detected in this category. | — | — | — | — | — |
113
+
114
+ ### Hard-Coded Business Logic (`functional`, `behavioral`)
115
+
116
+ | ID | Severity | Title | Description | Evidence | Recommendation | Verified By | Confidence |
117
+ |----|----------|-------|-------------|----------|----------------|-------------|------------|
118
+ | — | — | No gaps detected in this category. | — | — | — | — | — |
119
+
120
+ ### Security Endpoints (`security`)
121
+
122
+ | ID | Severity | Title | Description | Evidence | Recommendation | Verified By | Confidence |
123
+ |----|----------|-------|-------------|----------|----------------|-------------|------------|
124
+ | — | — | No gaps detected in this category. | — | — | — | — | — |
125
+
126
+ ### Runtime Behaviors (`behavioral`, `operational`)
127
+
128
+ | ID | Severity | Title | Description | Evidence | Recommendation | Verified By | Confidence |
129
+ |----|----------|-------|-------------|----------|----------------|-------------|------------|
130
+ | — | — | No gaps detected in this category. | — | — | — | — | — |
131
+
132
+ ### Documentation Drift (`documentation`)
133
+
134
+ | ID | Severity | Title | Description | Evidence | Recommendation | Verified By | Confidence |
135
+ |----|----------|-------|-------------|----------|----------------|-------------|------------|
136
+ | — | — | No gaps detected in this category. | — | — | — | — | — |
137
+
138
+ ### Integration Seams (`data-integrity`, `operational`)
139
+
140
+ | ID | Severity | Title | Description | Evidence | Recommendation | Verified By | Confidence |
141
+ |----|----------|-------|-------------|----------|----------------|-------------|------------|
142
+ | — | — | No gaps detected in this category. | — | — | — | — | — |
143
+
144
+ ### Verified By Legend
145
+
146
+ | Value | Description |
147
+ |-------|-------------|
148
+ | `machine-detected` | Gap found by automated scan subagent |
149
+ | `adversarial-review-detected` | Gap found during adversarial review |
150
+ | `code-verified` | Gap confirmed by code-verified review step |
151
+ | `human-reported` | Gap reported manually by a human reviewer |
152
+
153
+ <!-- BROWNFIELD-ONLY-END -->
@@ -11,6 +11,7 @@ size: "{S/M/L/XL}"
11
11
  points: "{story_points}"
12
12
  risk: "{high/medium/low}"
13
13
  sprint_id: null
14
+ priority_flag: null
14
15
  depends_on: []
15
16
  blocks: []
16
17
  traces_to: []
@@ -7,6 +7,7 @@ config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
7
  installed_path: "{project-root}/_gaia/lifecycle/workflows/1-analysis/create-product-brief"
8
8
  instructions: "{installed_path}/instructions.xml"
9
9
  validation: "{installed_path}/checklist.md"
10
+ template: "{project-root}/_gaia/lifecycle/templates/product-brief-template.md"
10
11
  input_file_patterns:
11
12
  brainstorm:
12
13
  whole: "{planning_artifacts}/project-brainstorm.md"
@@ -63,7 +63,9 @@
63
63
  </template-output>
64
64
  </step>
65
65
  <step n="12" title="Adversarial Review">
66
- <action>Spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/tasks/review-adversarial.xml. Read its entire contents. Target: {planning_artifacts}/prd.md. Target label: prd. Follow the task instructions EXACTLY." This is required findings will be incorporated back into the PRD.</action>
66
+ <action>Read {project-root}/_gaia/_config/adversarial-triggers.yaml to evaluate trigger rules. Determine the current change_type: if this workflow was invoked with a change_type context (e.g., from add-feature triage), use that value. If no context is available (standalone PRD creation), default to "feature".</action>
67
+ <action>Look up the trigger rule for change_type + artifact "prd". If adversarial is false for this combination: skip the adversarial review — log "Adversarial review skipped: change_type={change_type} does not trigger for PRD per adversarial-triggers.yaml" and proceed to next step. Add a "## Review Findings Incorporated" section with "Adversarial review not triggered — change type: {change_type}".</action>
68
+ <action>If adversarial is true: Spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/tasks/review-adversarial.xml. Read its entire contents. Target: {planning_artifacts}/prd.md. Target label: prd. Follow the task instructions EXACTLY." This is required — findings will be incorporated back into the PRD.</action>
67
69
  <action>When subagent returns: verify adversarial-review-prd-{date}.md exists in {planning_artifacts}/</action>
68
70
  </step>
69
71
  <step n="13" title="Incorporate Adversarial Findings">
@@ -75,6 +77,6 @@
75
77
  </template-output>
76
78
  </step>
77
79
  <next-step source="lifecycle-sequence.yaml">
78
- <primary command="/gaia-validate-prd">Validate the PRD against quality standards before proceeding</primary>
80
+ <primary command="/gaia-create-ux">Create UX design specifications for the validated PRD</primary>
79
81
  </next-step>
80
82
  </workflow>
@@ -2,6 +2,7 @@ name: create-prd
2
2
  description: 'Create a Product Requirements Document from scratch'
3
3
  module: lifecycle
4
4
  agent: pm
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/create-prd.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/2-planning/create-prd"
@@ -2,6 +2,7 @@ name: create-ux-design
2
2
  description: 'Plan UX patterns and design specifications'
3
3
  module: lifecycle
4
4
  agent: ux-designer
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/create-ux-design.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/2-planning/create-ux-design"
@@ -25,10 +25,10 @@
25
25
  </template-output>
26
26
  </step>
27
27
  <step n="5" title="Adversarial Review">
28
- <ask>The PRD has been updated. Would you like to run an adversarial review? This spawns a subagent in a separate context recommended for significant changes. (yes / skip for minor edits)</ask>
29
- <action>If yes: spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/tasks/review-adversarial.xml. Read its entire contents. Target: {planning_artifacts}/prd.md. Target label: prd. Follow the task instructions EXACTLY."</action>
30
- <action>If skip: proceed to step 7 mark "Review Findings Incorporated" as "Incremental edit adversarial review skipped (minor change)"</action>
31
- <action>If ok: wait for user to confirm adversarial-review-prd-{date}.md exists</action>
28
+ <action>Read {project-root}/_gaia/_config/adversarial-triggers.yaml to evaluate trigger rules. Determine the current change_type: if this workflow was invoked with a change_type context (e.g., from add-feature triage), use that value. If no context is available, infer from the change scope: minor edits map to "low-risk-enhancement", significant feature additions map to "feature".</action>
29
+ <action>Look up the trigger rule for change_type + artifact "prd". If adversarial is false: skip adversarial review mark "Review Findings Incorporated" as "Adversarial review not triggered change type: {change_type} per adversarial-triggers.yaml". Proceed to step 7.</action>
30
+ <action>If adversarial is true: spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/tasks/review-adversarial.xml. Read its entire contents. Target: {planning_artifacts}/prd.md. Target label: prd. Follow the task instructions EXACTLY."</action>
31
+ <action>When subagent returns: verify adversarial-review-prd-{date}.md exists in {planning_artifacts}/</action>
32
32
  </step>
33
33
  <step n="6" title="Incorporate Review Findings" optional="true" condition="adversarial_completed">
34
34
  <action>Read {planning_artifacts}/adversarial-review-prd-{date}.md — extract critical and high severity findings</action>
@@ -2,6 +2,7 @@ name: edit-prd
2
2
  description: 'Edit an existing PRD'
3
3
  module: lifecycle
4
4
  agent: pm
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/edit-prd.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/2-planning/edit-prd"
@@ -0,0 +1,18 @@
1
+ ---
2
+ title: 'UX Design Edit Validation'
3
+ validation-target: 'Edited UX Design'
4
+ ---
5
+ ## Edit Quality
6
+ - [ ] Requested changes applied correctly
7
+ - [ ] Unchanged sections preserved exactly
8
+ - [ ] Consistency maintained across sections
9
+ ## Version History
10
+ - [ ] Version note added with date, reason, and CR ID (if applicable)
11
+ ## Review Gate
12
+ - [ ] Adversarial review completed OR explicitly skipped for minor edits
13
+ - [ ] "Review Findings Incorporated" section updated (if review ran)
14
+ ## Cascade Assessment
15
+ - [ ] Impact classified for: architecture, stories, test plan
16
+ - [ ] Next steps communicated to user
17
+ ## Output Verification
18
+ - [ ] Output file saved to {planning_artifacts}/ux-design.md
@@ -0,0 +1,66 @@
1
+ <workflow name="edit-ux-design">
2
+ <critical>
3
+ <mandate>Preserve existing content not being changed — no silent drops, reorders, or modifications</mandate>
4
+ <mandate>Add version note documenting what changed and why</mandate>
5
+ <mandate>Update "Review Findings Incorporated" section after adversarial review</mandate>
6
+ </critical>
7
+ <step n="1" title="Load Existing UX Design">
8
+ <action>Read {planning_artifacts}/ux-design.md in full</action>
9
+ <action>Identify existing sections: personas, information architecture, wireframes, interaction patterns, accessibility</action>
10
+ <action>Identify existing Version History entries — note last version for auto-increment</action>
11
+ <action>Display current structure summary to user: section headers, persona count, wireframe count, current version</action>
12
+ </step>
13
+ <step n="2" title="Identify Changes">
14
+ <ask>What sections need to change?</ask>
15
+ <ask>Why are these changes needed?</ask>
16
+ <ask>Is this linked to a change request? If so, provide the CR ID.</ask>
17
+ <action>Classify change scope: MINOR (section update, text change) / SIGNIFICANT (new persona, new flow, navigation restructure) / BREAKING (complete redesign of major section)</action>
18
+ <action>Confirm scope of changes before proceeding</action>
19
+ </step>
20
+ <step n="3" title="Apply Edits">
21
+ <action>For each affected section: present current content, propose edits, wait for user confirmation or modification</action>
22
+ <action>Preserve all unchanged sections exactly as-is — no reordering, no reformatting, no content loss</action>
23
+ <action>Validate consistency between edited sections and remaining unchanged sections</action>
24
+ <action>If edits affect FR-to-Screen Mapping: verify traceability remains accurate</action>
25
+ </step>
26
+ <step n="4" title="Add Version Note">
27
+ <action>Append a new row to the Version History table:
28
+ | {date} | {change summary} | {driver} | {CR ID or reference} |
29
+ </action>
30
+ <action>If no Version History section exists, create one:
31
+ ## Version History
32
+ | Date | Change | Reason | CR/Reference |
33
+ |------|--------|--------|-------------|
34
+ | {date} | {change summary} | {driver} | {CR ID or reference} |
35
+ </action>
36
+ </step>
37
+ <step n="5" title="Save Updated UX Design">
38
+ <action>Generate a diff summary showing exactly what changed</action>
39
+ <template-output file="{planning_artifacts}/ux-design.md">
40
+ Save updated UX design document with all edits applied, unchanged sections preserved, and version note added.
41
+ </template-output>
42
+ </step>
43
+ <step n="6" title="Adversarial Review">
44
+ <ask>The UX design has been updated. Would you like to run an adversarial review? This spawns a subagent in a separate context — recommended for significant changes. (yes / skip for minor edits)</ask>
45
+ <action>If yes: spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/tasks/review-adversarial.xml. Read its entire contents. Target: {planning_artifacts}/ux-design.md. Target label: ux-design. Follow the task instructions EXACTLY."</action>
46
+ <action>If skip: proceed to step 7 — mark "Review Findings Incorporated" as "Incremental edit — adversarial review skipped (minor change)"</action>
47
+ <action>If ok: wait for user to confirm adversarial-review-ux-design-{date}.md exists</action>
48
+ </step>
49
+ <step n="7" title="Incorporate Review Findings" optional="true" condition="adversarial_completed">
50
+ <action>Read {planning_artifacts}/adversarial-review-ux-design-{date}.md — extract critical and high severity findings</action>
51
+ <action>For each critical/high finding: incorporate into UX design document</action>
52
+ <action>Update the "Review Findings Incorporated" section — append new entries with amendment date</action>
53
+ <template-output file="{planning_artifacts}/ux-design.md">
54
+ Update the UX design with adversarial review findings incorporated. Append to existing "Review Findings Incorporated" section with amendment date.
55
+ </template-output>
56
+ </step>
57
+ <step n="8" title="Cascade Impact Check">
58
+ <action>Read {planning_artifacts}/architecture.md section headers</action>
59
+ <action>Compare UX design changes against architecture and downstream artifacts</action>
60
+ <action>Classify cascade impact:</action>
61
+ <action> NONE: UX-only changes — architecture and stories unaffected</action>
62
+ <action> MINOR: architecture needs a section update — recommend /gaia-edit-arch</action>
63
+ <action> SIGNIFICANT: new components or interaction patterns affecting architecture — recommend /gaia-edit-arch with adversarial review, then /gaia-add-stories</action>
64
+ <action>Report cascade assessment to user with recommended next command(s)</action>
65
+ </step>
66
+ </workflow>