gaia-framework 1.64.0 → 1.65.1

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 (74) 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 +1 -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 +25 -5
  18. package/_gaia/core/workflows/brainstorming/template.md +6 -0
  19. package/_gaia/lifecycle/agents/pm.md +9 -10
  20. package/_gaia/lifecycle/agents/ux-designer.md +1 -0
  21. package/_gaia/lifecycle/agents/validator.md +2 -1
  22. package/_gaia/lifecycle/config.yaml +1 -1
  23. package/_gaia/lifecycle/module-help.csv +1 -1
  24. package/_gaia/lifecycle/skills/document-rulesets.md +166 -0
  25. package/_gaia/lifecycle/skills/memory-management-cross-agent.md +218 -0
  26. package/_gaia/lifecycle/skills/memory-management.md +32 -122
  27. package/_gaia/lifecycle/templates/story-template.md +1 -0
  28. package/_gaia/lifecycle/workflows/1-analysis/create-product-brief/workflow.yaml +1 -0
  29. package/_gaia/lifecycle/workflows/2-planning/create-prd/instructions.xml +4 -2
  30. package/_gaia/lifecycle/workflows/2-planning/create-prd/workflow.yaml +1 -0
  31. package/_gaia/lifecycle/workflows/2-planning/create-ux-design/workflow.yaml +1 -0
  32. package/_gaia/lifecycle/workflows/2-planning/edit-prd/instructions.xml +4 -4
  33. package/_gaia/lifecycle/workflows/2-planning/edit-prd/workflow.yaml +1 -0
  34. package/_gaia/lifecycle/workflows/2-planning/edit-ux-design/checklist.md +18 -0
  35. package/_gaia/lifecycle/workflows/2-planning/edit-ux-design/instructions.xml +66 -0
  36. package/_gaia/lifecycle/workflows/2-planning/edit-ux-design/workflow.yaml +27 -0
  37. package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/instructions.xml +3 -1
  38. package/_gaia/lifecycle/workflows/3-solutioning/create-architecture/workflow.yaml +1 -0
  39. package/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories/workflow.yaml +1 -0
  40. package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/instructions.xml +4 -7
  41. package/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/workflow.yaml +1 -0
  42. package/_gaia/lifecycle/workflows/3-solutioning/security-threat-model/workflow.yaml +1 -0
  43. package/_gaia/lifecycle/workflows/4-implementation/add-feature/checklist.md +42 -0
  44. package/_gaia/lifecycle/workflows/4-implementation/add-feature/instructions.xml +197 -0
  45. package/_gaia/lifecycle/workflows/{cross-phase → 4-implementation}/add-feature/workflow.yaml +20 -9
  46. package/_gaia/lifecycle/workflows/4-implementation/add-stories/workflow.yaml +1 -0
  47. package/_gaia/lifecycle/workflows/4-implementation/code-review/workflow.yaml +1 -0
  48. package/_gaia/lifecycle/workflows/4-implementation/correct-course/workflow.yaml +1 -0
  49. package/_gaia/lifecycle/workflows/4-implementation/create-story/checklist.md +1 -1
  50. package/_gaia/lifecycle/workflows/4-implementation/create-story/instructions.xml +4 -3
  51. package/_gaia/lifecycle/workflows/4-implementation/dev-story/workflow.yaml +1 -1
  52. package/_gaia/lifecycle/workflows/4-implementation/retrospective/workflow.yaml +1 -0
  53. package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/instructions.xml +3 -0
  54. package/_gaia/lifecycle/workflows/4-implementation/sprint-planning/workflow.yaml +2 -0
  55. package/_gaia/lifecycle/workflows/4-implementation/triage-findings/workflow.yaml +1 -0
  56. package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/checklist.md +15 -0
  57. package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/instructions.xml +153 -57
  58. package/_gaia/lifecycle/workflows/4-implementation/val-refresh-ground-truth/workflow.yaml +5 -0
  59. package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/instructions.xml +23 -12
  60. package/_gaia/lifecycle/workflows/4-implementation/val-validate-artifact/workflow.yaml +11 -0
  61. package/_gaia/lifecycle/workflows/4-implementation/val-validate-plan/instructions.xml +0 -2
  62. package/_gaia/lifecycle/workflows/5-deployment/deployment-checklist/workflow.yaml +1 -0
  63. package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/instructions.xml +69 -1
  64. package/_gaia/lifecycle/workflows/anytime/memory-hygiene/instructions.xml +8 -18
  65. package/_gaia/testing/config.yaml +1 -1
  66. package/_gaia/testing/workflows/edit-test-plan/workflow.yaml +1 -0
  67. package/_gaia/testing/workflows/test-design/workflow.yaml +2 -0
  68. package/_gaia/testing/workflows/traceability/workflow.yaml +1 -0
  69. package/bin/gaia-framework.js +17 -3
  70. package/bin/generate-checksums.js +124 -0
  71. package/gaia-install.sh +46 -8
  72. package/package.json +6 -2
  73. package/_gaia/lifecycle/workflows/cross-phase/add-feature/checklist.md +0 -30
  74. package/_gaia/lifecycle/workflows/cross-phase/add-feature/instructions.xml +0 -85
@@ -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>
@@ -0,0 +1,27 @@
1
+ name: edit-ux-design
2
+ description: 'Edit an existing UX design document'
3
+ module: lifecycle
4
+ agent: ux-designer
5
+ val_validate_output: true
6
+ config_resolved: "{installed_path}/.resolved/edit-ux-design.yaml"
7
+ config_source: "{project-root}/_gaia/lifecycle/config.yaml"
8
+ installed_path: "{project-root}/_gaia/lifecycle/workflows/2-planning/edit-ux-design"
9
+ instructions: "{installed_path}/instructions.xml"
10
+ validation: "{installed_path}/checklist.md"
11
+ input_file_patterns:
12
+ ux_design:
13
+ whole: "{planning_artifacts}/ux-design.md"
14
+ load_strategy: "FULL_LOAD"
15
+ architecture:
16
+ whole: "{planning_artifacts}/architecture.md"
17
+ load_strategy: "SELECTIVE_LOAD"
18
+ quality_gates:
19
+ pre_start:
20
+ - check: "ux_design_exists"
21
+ on_fail: "HALT: No ux-design.md found. Run /gaia-create-ux first."
22
+ on_error:
23
+ missing_file: "ask_user"
24
+ unresolved_variable: "halt"
25
+
26
+ output:
27
+ primary: "{planning_artifacts}/ux-design.md"
@@ -78,7 +78,9 @@
78
78
  <action>If skip: API review can be run anytime later with /gaia-review-api</action>
79
79
  </step>
80
80
  <step n="11" title="Adversarial Review">
81
- <action>Spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/tasks/review-adversarial.xml. Read its entire contents. Target: {planning_artifacts}/architecture.md. Target label: architecture. Follow the task instructions EXACTLY." This is required findings will be incorporated back into the architecture document.</action>
81
+ <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 architecture creation), default to "feature". Determine the current magnitude from the architecture scope classification (NONE/MINOR/SIGNIFICANT/BREAKING) — default to SIGNIFICANT for standalone creation.</action>
82
+ <action>Look up the trigger rule for change_type + artifact "architecture". If adversarial is false for this combination: skip the adversarial review — log "Adversarial review skipped: change_type={change_type} does not trigger for architecture per adversarial-triggers.yaml" and proceed to next step. If adversarial is true but the rule has a magnitude_threshold and the current magnitude is below it: skip — log "Adversarial review skipped: magnitude {magnitude} is below threshold {magnitude_threshold} per adversarial-triggers.yaml". Add "## Review Findings Incorporated" with "Adversarial review not triggered — change type: {change_type}, magnitude: {magnitude}".</action>
83
+ <action>If adversarial is true and magnitude meets or exceeds threshold: Spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/tasks/review-adversarial.xml. Read its entire contents. Target: {planning_artifacts}/architecture.md. Target label: architecture. Follow the task instructions EXACTLY." This is required — findings will be incorporated back into the architecture document.</action>
82
84
  <action>When subagent returns: verify adversarial-review-architecture-{date}.md exists in {planning_artifacts}/</action>
83
85
  </step>
84
86
  <step n="12" title="Incorporate Adversarial Findings">
@@ -2,6 +2,7 @@ name: create-architecture
2
2
  description: 'Create architecture and solution design'
3
3
  module: lifecycle
4
4
  agent: architect
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/create-architecture.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/3-solutioning/create-architecture"
@@ -2,6 +2,7 @@ name: create-epics-stories
2
2
  description: 'Break requirements into epics and user stories'
3
3
  module: lifecycle
4
4
  agent: pm
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/create-epics-stories.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/3-solutioning/create-epics-stories"
@@ -57,8 +57,10 @@
57
57
  <template-output file="{planning_artifacts}/architecture.md">
58
58
  Save updated architecture document with all edits applied, new ADRs appended, version incremented, and version note added.
59
59
  </template-output>
60
- <check if="change_scope == SIGNIFICANT OR change_scope == BREAKING">
61
- <action>Adversarial review is REQUIRED for SIGNIFICANT/BREAKING changes.</action>
60
+ <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 and driver: adversarial-finding or technical-discovery maps to "feature", change-request depends on the CR classification.</action>
61
+ <action>Look up the trigger rule for change_type + artifact "architecture". If adversarial is false for this combination: skip adversarial review — mark "Review Findings Incorporated" as "Adversarial review not triggered — change type: {change_type} per adversarial-triggers.yaml". If adversarial is true but the rule has a magnitude_threshold and change_scope is below it (e.g., MINOR is below SIGNIFICANT): skip — mark "Review Findings Incorporated" as "Adversarial review not triggered — magnitude {change_scope} below threshold per adversarial-triggers.yaml".</action>
62
+ <check if="adversarial trigger rule is true AND magnitude meets or exceeds threshold">
63
+ <action>Adversarial review triggered per adversarial-triggers.yaml: change_type={change_type}, magnitude={change_scope}.</action>
62
64
  <action>Spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/tasks/review-adversarial.xml. Read its entire contents. Target: {planning_artifacts}/architecture.md. Target label: architecture. Follow the task instructions EXACTLY. Focus review on changed sections: {sections_affected}."</action>
63
65
  <action>When subagent returns: verify adversarial-review-architecture-{date}.md exists.</action>
64
66
  <action>Read findings — extract critical and high severity items.</action>
@@ -68,11 +70,6 @@
68
70
  Update architecture with adversarial review findings incorporated. Append to existing "Review Findings Incorporated" section with amendment date.
69
71
  </template-output>
70
72
  </check>
71
- <check if="change_scope == MINOR">
72
- <ask>The architecture has been updated with MINOR changes. Would you like to run an adversarial review? (yes / skip for minor edits)</ask>
73
- <action>If yes: spawn subagent as above, incorporate findings.</action>
74
- <action>If skip: mark "Review Findings Incorporated" as "Incremental edit — adversarial review skipped (minor change)"</action>
75
- </check>
76
73
  </step>
77
74
  <step n="7" title="Cascade Impact Analysis">
78
75
  <action>Classify cascade impact on downstream artifacts:</action>
@@ -2,6 +2,7 @@ name: edit-architecture
2
2
  description: 'Edit an existing architecture document'
3
3
  module: lifecycle
4
4
  agent: architect
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/edit-architecture.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/3-solutioning/edit-architecture"
@@ -2,6 +2,7 @@ name: security-threat-model
2
2
  description: 'Create security threat model using STRIDE/DREAD methodology'
3
3
  module: lifecycle
4
4
  agent: security
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/security-threat-model.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/3-solutioning/security-threat-model"
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: 'Add Feature Triage Validation'
3
+ validation-target: 'Feature/Enhancement/Patch Triage and Cascade'
4
+ ---
5
+ ## Intake
6
+ - [ ] User description captured
7
+ - [ ] Driver identified (user feedback / stakeholder / technical / market / regulatory)
8
+ - [ ] Urgency classified (critical / high / normal)
9
+ - [ ] Feature ID assigned (AF-{date}-{seq})
10
+ ## Classification
11
+ - [ ] Change classified as patch / enhancement / feature
12
+ - [ ] Affected artifacts list built based on classification
13
+ - [ ] Classification confirmed by user
14
+ ## Impact Scan
15
+ - [ ] Each affected artifact scanned for specific sections impacted
16
+ - [ ] Impact summary generated per artifact
17
+ ## Val Review
18
+ - [ ] Proposed changes validated by Val
19
+ - [ ] CRITICAL findings addressed before proceeding
20
+ - [ ] WARNING findings noted
21
+ ## Approval
22
+ - [ ] Triage plan presented to user
23
+ - [ ] User APPROVED or REJECTED the plan
24
+ ## CR Record (if applicable)
25
+ - [ ] CR record created for enhancements and features
26
+ - [ ] Skipped for patches with justification
27
+ ## Cascade
28
+ - [ ] Cascade follows corrected lifecycle order: PRD → UX → Architecture → Test Plan → Threat Model → Traceability
29
+ - [ ] Only affected artifacts processed — patches skip most steps
30
+ - [ ] Each step spawned as subagent (owning agent's workflow)
31
+ - [ ] Cascade manifest tracks state across steps
32
+ - [ ] Failed steps handled with retry/skip/abort options
33
+ - [ ] Checkpoint saved for /gaia-resume recovery
34
+ ## Story
35
+ - [ ] Implementation stories created (or patch story recommended)
36
+ - [ ] Story keys captured
37
+ ## Assessment Doc
38
+ - [ ] Assessment document generated at {planning_artifacts}/add-feature-{feature_id}.md
39
+ - [ ] All sections populated (classification, impact, cascade results, stories, next steps)
40
+ ## Completion
41
+ - [ ] Next steps communicated based on classification
42
+ - [ ] Cascade manifest finalized
@@ -0,0 +1,197 @@
1
+ <workflow name="add-feature">
2
+ <critical>
3
+ <mandate>This is a PM-owned triage workflow — classify the change before cascading</mandate>
4
+ <mandate>Only cascade through AFFECTED artifacts — patches skip most steps</mandate>
5
+ <mandate>Cascade follows corrected lifecycle order: PRD → UX → Architecture → Test Plan → Threat Model → Traceability</mandate>
6
+ <mandate>Each cascade step spawns the owning agent's workflow as a subagent — do not perform edits directly</mandate>
7
+ <mandate>In yolo mode: auto-proceed through all steps EXCEPT CRITICAL Val findings which require user confirmation</mandate>
8
+ <mandate>On cascade failure: halt at the failed step, record partial state in assessment doc and checkpoint, present retry/skip/abort options (FR-89a)</mandate>
9
+ <mandate>Track cascade state via a lightweight manifest — do not hold subagent context in memory. Stay within the 40K token framework budget (FR-89b)</mandate>
10
+ </critical>
11
+
12
+ <step n="1" title="Intake">
13
+ <ask>Describe the fix, enhancement, or feature you want to add.</ask>
14
+ <ask>What is driving this change? (user feedback / stakeholder request / technical discovery / market shift / regulatory)</ask>
15
+ <ask>Urgency level? (critical — blocks current sprint / high — next sprint / normal — backlog)</ask>
16
+ <action>Assign a feature ID: AF-{date}-{seq} (e.g., AF-2026-03-26-1). Check {planning_artifacts}/ for existing add-feature-*.md files to determine next sequence number.</action>
17
+ <action>Record: feature_id, description, driver, urgency</action>
18
+ </step>
19
+
20
+ <step n="2" title="Classify">
21
+ <action>Analyze the user's description against the classification matrix:
22
+
23
+ **Patch** — bug fix, typo, config correction. Characteristics:
24
+ - Affects 1-2 files in a single module
25
+ - No new requirements (FR/NFR) needed
26
+ - No architecture changes
27
+ - No UX changes
28
+ - Existing tests cover the fix (or need minor additions)
29
+
30
+ **Enhancement** — improvement to existing feature. Characteristics:
31
+ - Modifies existing requirements or adds minor new ones
32
+ - May require architecture adjustments (MINOR)
33
+ - May affect UX flows
34
+ - Needs test updates for changed behavior
35
+
36
+ **Feature** — wholly new capability. Characteristics:
37
+ - Adds new requirements (FR/NFR)
38
+ - Requires architecture review (SIGNIFICANT)
39
+ - Adds new UX flows or screens
40
+ - Needs new test cases and possibly threat model updates
41
+ </action>
42
+ <action>Determine classification: patch | enhancement | feature</action>
43
+ <action>Build the affected artifacts list based on classification:
44
+ - **Patch**: PRD (optional — if wording fix), Traceability (if test changes)
45
+ - **Enhancement**: PRD, UX (if UI changes), Architecture (if technical changes), Test Plan, Traceability
46
+ - **Feature**: PRD, UX, Architecture, Test Plan, Threat Model, Traceability (all artifacts)
47
+ </action>
48
+ <action>Present classification and affected artifacts list to user for confirmation.</action>
49
+ </step>
50
+
51
+ <step n="3" title="Impact Scan">
52
+ <action>For each affected artifact, scan current content to identify specific sections impacted:</action>
53
+ <action>— PRD: identify affected requirement IDs (FR-*, NFR-*), feature sections, user personas</action>
54
+ <action>— UX Design: identify affected screens, interaction patterns, navigation flows</action>
55
+ <action>— Architecture: identify affected components, APIs, data models, ADRs</action>
56
+ <action>— Test Plan: identify affected test suites, risk areas, coverage gaps</action>
57
+ <action>— Threat Model: identify new attack surfaces or changed trust boundaries</action>
58
+ <action>— Traceability: identify requirement-to-test-to-story linkages that will change</action>
59
+ <action>Build impact summary: for each affected artifact, list specific sections and what will change.</action>
60
+ </step>
61
+
62
+ <step n="4" title="Val Review">
63
+ <action>Present the proposed changes (classification, affected artifacts, impact summary) to Val for validation.</action>
64
+ <action>Invoke val-validate-artifact as a subagent, passing the impact summary as the artifact to validate.</action>
65
+ <action>If Val returns CRITICAL findings: present findings to user. In yolo mode, HALT and require user confirmation before proceeding. In normal mode, present [c]ontinue / [r]evise / [x]abort options.</action>
66
+ <action>If Val returns WARNING findings: present findings. In yolo mode, auto-proceed with findings noted. In normal mode, present options.</action>
67
+ <action>If Val returns no findings or INFO only: auto-proceed.</action>
68
+ </step>
69
+
70
+ <step n="5" title="User Approval">
71
+ <action>Present the complete triage plan:
72
+
73
+ **Add-Feature Triage: {feature_id}**
74
+
75
+ | Field | Value |
76
+ |-------|-------|
77
+ | Description | {description} |
78
+ | Classification | {patch/enhancement/feature} |
79
+ | Driver | {driver} |
80
+ | Urgency | {urgency} |
81
+
82
+ **Affected Artifacts:**
83
+ {list each artifact and what will change}
84
+
85
+ **Cascade Steps:**
86
+ {numbered list of cascade steps that will execute, with skipped steps noted}
87
+
88
+ **Val Review:** {passed/warnings noted/findings summary}
89
+ </action>
90
+ <ask>Review the triage plan above. Do you APPROVE or REJECT? [approve / reject / revise]</ask>
91
+ <check if="user_rejects">Set status = REJECTED. Skip steps 6-8 — proceed directly to step 9 (Assessment Doc) to record the rejection.</check>
92
+ </step>
93
+
94
+ <step n="6" title="CR Record" optional="true" condition="classification != patch">
95
+ <action>Skip if classification is 'patch' — patches do not need a formal change request record.</action>
96
+ <action>For enhancements and features: create a change request record.</action>
97
+ <action>Assign CR ID: CR-{date}-{seq}. Check {planning_artifacts}/ for existing CR files.</action>
98
+ <action>Record: cr_id, feature_id, classification, driver, urgency, affected_artifacts, impact_summary.</action>
99
+ </step>
100
+
101
+ <step n="7" title="Cascade">
102
+ <action>Initialize cascade manifest:
103
+ ```yaml
104
+ cascade_manifest:
105
+ feature_id: "{feature_id}"
106
+ classification: "{classification}"
107
+ steps_total: {count of affected artifacts}
108
+ steps_completed: 0
109
+ steps_failed: 0
110
+ status: "in_progress"
111
+ steps: []
112
+ ```
113
+ </action>
114
+
115
+ <action>Execute cascade in corrected lifecycle order, skipping unaffected artifacts:
116
+
117
+ **7a. PRD Update** (if affected)
118
+ Spawn subagent: "Load {project-root}/_gaia/core/engine/workflow.xml, then process {project-root}/_gaia/lifecycle/workflows/2-planning/edit-prd/workflow.yaml as workflow-config. Run in YOLO mode. Context: {classification} — {description}. Impact: {prd_impact}. Feature ID: {feature_id}."
119
+ On success: record prd_diff (new FR/NFR IDs), update cascade manifest.
120
+ On failure: record failure in manifest, present retry/skip/abort to user (FR-89a). If skip: note in assessment. If abort: halt cascade, save checkpoint.
121
+
122
+ **7b. UX Update** (if affected — skip for patches)
123
+ Spawn subagent: "Load {project-root}/_gaia/core/engine/workflow.xml, then process {project-root}/_gaia/lifecycle/workflows/3-solutioning/edit-ux/workflow.yaml as workflow-config. Run in YOLO mode. Context: {classification} — {description}. PRD changes: {prd_diff}. Impact: {ux_impact}. Feature ID: {feature_id}."
124
+ On success: record ux_diff, update manifest. On failure: retry/skip/abort.
125
+
126
+ **7c. Architecture Update** (if affected — skip for patches)
127
+ Spawn subagent: "Load {project-root}/_gaia/core/engine/workflow.xml, then process {project-root}/_gaia/lifecycle/workflows/3-solutioning/edit-architecture/workflow.yaml as workflow-config. Run in YOLO mode. Context: {classification} — {description}. PRD changes: {prd_diff}. UX changes: {ux_diff}. Impact: {arch_impact}. Feature ID: {feature_id}."
128
+ On success: record arch_diff, update manifest. On failure: retry/skip/abort.
129
+
130
+ **7d. Test Plan Update via test-design** (if affected — skip for patches unless test changes needed)
131
+ Spawn subagent: "Load {project-root}/_gaia/core/engine/workflow.xml, then process {project-root}/_gaia/testing/workflows/edit-test-plan/workflow.yaml as workflow-config. Run in YOLO mode. Context: {classification} — {description}. PRD changes: {prd_diff}. Architecture changes: {arch_diff}. Feature ID: {feature_id}." Alternative: use /gaia-test-design for full test plan regeneration when the scope warrants it.
132
+ On success: record test_diff, update manifest. On failure: retry/skip/abort.
133
+
134
+ **7e. Threat Model Update** (if affected — features only, skip for patches and enhancements)
135
+ Spawn subagent: "Load {project-root}/_gaia/core/engine/workflow.xml, then process {project-root}/_gaia/testing/workflows/threat-model/workflow.yaml as workflow-config. Run in YOLO mode. Context: {classification} — {description}. Architecture changes: {arch_diff}. Feature ID: {feature_id}."
136
+ On success: record threat_diff, update manifest. On failure: retry/skip/abort.
137
+
138
+ **7f. Traceability Update** (if affected)
139
+ Spawn subagent: "Load {project-root}/_gaia/core/engine/workflow.xml, then process {project-root}/_gaia/testing/workflows/traceability/workflow.yaml as workflow-config. Run in YOLO mode. Context: Regenerate traceability to include changes from {feature_id}."
140
+ On success: record trace_updated, update manifest. On failure: retry/skip/abort.
141
+ </action>
142
+
143
+ <action>After all cascade steps complete (or are skipped/failed): finalize cascade manifest with status summary.</action>
144
+ <action>Save cascade checkpoint to {checkpoint_path}/add-feature-{feature_id}.yaml for /gaia-resume recovery.</action>
145
+ </step>
146
+
147
+ <step n="8" title="Story">
148
+ <action>If classification is 'feature' or 'enhancement': spawn subagent to create implementation stories.</action>
149
+ <action>Spawn subagent: "Load {project-root}/_gaia/core/engine/workflow.xml, then process {project-root}/_gaia/lifecycle/workflows/4-implementation/add-stories/workflow.yaml as workflow-config. Run in YOLO mode. Context: {classification} — {description}. New requirements: {prd_diff}. Architecture changes: {arch_diff}. Feature ID: {feature_id}."</action>
150
+ <action>When subagent returns: capture new story keys and epic assignments.</action>
151
+ <action>If classification is 'patch': create a single fix story inline or recommend /gaia-create-story.</action>
152
+ <action>Priority flag integration: if the feature driver is high-urgency (P0 priority, business-critical, or regulatory driver), set priority_flag: "next-sprint" in each created story's frontmatter. This signals sprint planning to auto-include these stories in the next sprint cycle. For non-urgent features, priority_flag remains null (default).</action>
153
+ </step>
154
+
155
+ <step n="9" title="Assessment Doc">
156
+ <template-output file="{planning_artifacts}/add-feature-{feature_id}.md">
157
+ Generate assessment document with YAML frontmatter:
158
+ ---
159
+ feature_id: "{feature_id}"
160
+ date: "{date}"
161
+ classification: "{patch|enhancement|feature}"
162
+ status: "{APPROVED|REJECTED}"
163
+ urgency: "{critical|high|normal}"
164
+ driver: "{source}"
165
+ cr_id: "{cr_id or null}"
166
+ ---
167
+ Then detailed sections:
168
+ - Description: what was requested and why
169
+ - Classification: how it was classified with reasoning
170
+ - Impact Analysis: per-artifact impact summary
171
+ - Val Review: findings summary
172
+ - Cascade Results: for each artifact — updated/skipped/failed with details
173
+ - Stories Created: list of new story keys (or N/A for patches)
174
+ - Cascade Manifest: final manifest state (steps completed, failed, skipped)
175
+ - Recommended Next Actions: what to do next based on outcome
176
+ If REJECTED: include rejection reason and impact analysis for future reference.
177
+ </template-output>
178
+ </step>
179
+
180
+ <step n="10" title="Next Steps">
181
+ <action>Present summary and recommended next actions based on classification and outcome:
182
+
183
+ **Patch:**
184
+ - If story created: "Run /gaia-dev-story {story_key} to implement the fix."
185
+ - If no story: "The patch is straightforward — apply directly or create a story with /gaia-create-story."
186
+
187
+ **Enhancement:**
188
+ - "New stories created: {story_keys}. Run /gaia-sprint-plan or /gaia-correct-course to schedule."
189
+ - If architecture updated: "Architecture changes recorded. Review with /gaia-agent-architect."
190
+
191
+ **Feature:**
192
+ - "Full cascade complete. New stories: {story_keys}."
193
+ - "Run /gaia-sprint-plan to schedule implementation."
194
+ - "Consider running /gaia-implementation-readiness to verify consistency."
195
+ </action>
196
+ </step>
197
+ </workflow>
@@ -1,10 +1,14 @@
1
1
  name: add-feature
2
- description: 'Guided orchestrator for adding a new feature — cascades through PRD, architecture, test plan, stories, traceability, and readiness'
2
+ description: 'PM-owned triage workflow for adding a fix, enhancement, or feature — classifies, scans impact, cascades only through affected artifacts'
3
3
  module: lifecycle
4
- agent: orchestrator
4
+ agent: pm
5
+ execution_mode: planning
6
+ val_validate_output: true
7
+ val_auto_in_yolo: true
8
+ val_auto_in_yolo_steps: [4, 9]
5
9
  config_resolved: "{installed_path}/.resolved/add-feature.yaml"
6
10
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
- installed_path: "{project-root}/_gaia/lifecycle/workflows/cross-phase/add-feature"
11
+ installed_path: "{project-root}/_gaia/lifecycle/workflows/4-implementation/add-feature"
8
12
  instructions: "{installed_path}/instructions.xml"
9
13
  validation: "{installed_path}/checklist.md"
10
14
  input_file_patterns:
@@ -14,24 +18,31 @@ input_file_patterns:
14
18
  architecture:
15
19
  whole: "{planning_artifacts}/architecture.md"
16
20
  load_strategy: "SELECTIVE_LOAD"
17
- test_plan:
18
- whole: "{test_artifacts}/test-plan.md"
19
- load_strategy: "SELECTIVE_LOAD"
21
+ ux_design:
22
+ whole: "{planning_artifacts}/ux-design.md"
23
+ load_strategy: "INDEX_GUIDED"
20
24
  epics:
21
25
  whole: "{planning_artifacts}/epics-and-stories.md"
22
26
  load_strategy: "SELECTIVE_LOAD"
23
27
  sprint_status:
24
28
  whole: "{implementation_artifacts}/sprint-status.yaml"
25
29
  load_strategy: "SELECTIVE_LOAD"
30
+ test_plan:
31
+ whole: "{test_artifacts}/test-plan.md"
32
+ load_strategy: "SELECTIVE_LOAD"
33
+ threat_model:
34
+ whole: "{test_artifacts}/threat-model.md"
35
+ load_strategy: "SELECTIVE_LOAD"
36
+ traceability:
37
+ whole: "{test_artifacts}/traceability-matrix.md"
38
+ load_strategy: "SELECTIVE_LOAD"
26
39
  quality_gates:
27
40
  pre_start:
28
41
  - check: "prd_exists"
29
42
  on_fail: "HALT: prd.md does not exist. Run /gaia-create-prd first."
30
- - check: "epics_exists"
31
- on_fail: "HALT: epics-and-stories.md does not exist. Run /gaia-create-epics first."
32
43
  on_error:
33
44
  missing_file: "ask_user"
34
45
  unresolved_variable: "halt"
35
46
 
36
47
  output:
37
- primary: "{planning_artifacts}/epics-and-stories.md"
48
+ primary: "{planning_artifacts}/add-feature-{feature_id}.md"
@@ -2,6 +2,7 @@ name: add-stories
2
2
  description: 'Add new stories to existing epics or create new epics with stories'
3
3
  module: lifecycle
4
4
  agent: pm
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/add-stories.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/4-implementation/add-stories"
@@ -7,6 +7,7 @@ config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
7
  installed_path: "{project-root}/_gaia/lifecycle/workflows/4-implementation/code-review"
8
8
  instructions: "{installed_path}/instructions.xml"
9
9
  validation: "{installed_path}/checklist.md"
10
+ template: "{project-root}/_gaia/lifecycle/templates/review-template.md"
10
11
  input_file_patterns:
11
12
  architecture:
12
13
  whole: "{planning_artifacts}/architecture.md"
@@ -2,6 +2,7 @@ name: correct-course
2
2
  description: 'Manage significant sprint scope changes'
3
3
  module: lifecycle
4
4
  agent: sm
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/correct-course.yaml"
6
7
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/lifecycle/workflows/4-implementation/correct-course"
@@ -3,7 +3,7 @@ title: 'Story Creation Validation'
3
3
  validation-target: 'Story file'
4
4
  ---
5
5
  ## Structure
6
- - [ ] YAML frontmatter present with all 14 required fields: key, title, epic, status, priority, size, points, risk, sprint_id, depends_on, blocks, traces_to, date, author
6
+ - [ ] YAML frontmatter present with all 15 required fields: key, title, epic, status, priority, size, points, risk, sprint_id, depends_on, blocks, traces_to, date, author, priority_flag
7
7
  - [ ] Acceptance criteria section complete
8
8
  - [ ] Technical notes included
9
9
  - [ ] Subtasks defined
@@ -1,6 +1,6 @@
1
1
  <workflow name="create-story">
2
2
  <critical>
3
- <mandate>Story files must include complete YAML frontmatter with ALL required fields: key, title, epic, status, priority, size, points, risk, sprint_id, depends_on, blocks, traces_to, date, author</mandate>
3
+ <mandate>Story files must include complete YAML frontmatter with ALL required fields: key, title, epic, status, priority, size, points, risk, sprint_id, depends_on, blocks, traces_to, date, author, priority_flag. The priority_flag field accepts only null (default) or "next-sprint" as valid values.</mandate>
4
4
  <mandate>All acceptance criteria MUST use Given/When/Then format: "Given {context}, when {action}, then {expected result}"</mandate>
5
5
  <mandate>Check web access availability if story references external APIs</mandate>
6
6
  </critical>
@@ -109,9 +109,10 @@
109
109
  - traces_to: requirement IDs this story traces to (from epics)
110
110
  - date: current date
111
111
  - author: agent name (e.g., "Nate (Scrum Master)")
112
+ - priority_flag: null (default — set to "next-sprint" by add-feature for high-urgency stories)
112
113
  </action>
113
114
  <template-output file="{implementation_artifacts}/{story_key}-{story_title_slug}.md">
114
- Generate the story file following the story-template.md structure. The filename must use the story key and slugified title (e.g., E1-S1-user-login.md). Include complete YAML frontmatter with ALL 14 fields populated. Fill all template sections: User Story, Acceptance Criteria, Tasks/Subtasks (linked to AC numbers), Dev Notes, Technical Notes, Dependencies, Test Scenarios, Project Structure Notes, References, Dev Agent Record, and Estimate. IMPORTANT: The body "**Status:**" line MUST match the frontmatter status field exactly. Both must say the same status value.
115
+ Generate the story file following the story-template.md structure. The filename must use the story key and slugified title (e.g., E1-S1-user-login.md). Include complete YAML frontmatter with ALL 15 fields populated. Fill all template sections: User Story, Acceptance Criteria, Tasks/Subtasks (linked to AC numbers), Dev Notes, Technical Notes, Dependencies, Test Scenarios, Project Structure Notes, References, Dev Agent Record, and Estimate. IMPORTANT: The body "**Status:**" line MUST match the frontmatter status field exactly. Both must say the same status value.
115
116
  </template-output>
116
117
  <action>Add the new story to {implementation_artifacts}/story-index.yaml:
117
118
  1. Read story-index.yaml (create with header if doesn't exist)
@@ -122,7 +123,7 @@
122
123
  <step n="7" title="Val Full Validation">
123
124
  <action>Invoke Val as a subagent to perform full validation on the saved story file. Val validates:
124
125
 
125
- (a) Completeness — all 14 YAML frontmatter fields present and valid, all template sections present
126
+ (a) Completeness — all 15 YAML frontmatter fields present and valid, all template sections present
126
127
  (b) Clarity — all ACs in Given/When/Then format, subtasks linked to AC numbers, DoD items measurable
127
128
  (c) Semantic quality — duplicate detection across epic, ADR cross-references against architecture.md
128
129
  (d) Dependencies — all declared dependencies exist and resolve
@@ -28,7 +28,7 @@ quality_gates:
28
28
  - check: "story_file_exists({implementation_artifacts}/{story_key}-*.md)"
29
29
  on_fail: "HALT: Story file not found. Expected {implementation_artifacts}/{story_key}-*.md. Run /gaia-create-story first."
30
30
  - check: "story_status in ['ready-for-dev', 'in-progress']"
31
- on_fail: "HALT: Story must be in ready-for-dev or in-progress status."
31
+ on_fail: "HALT: Story must be in ready-for-dev or in-progress status. Check {implementation_artifacts}/{story_key}-*.md frontmatter or run /gaia-sprint-status to verify."
32
32
  post_complete:
33
33
  - check: "all_tests_pass == true"
34
34
  on_fail: "HALT: All tests must pass before marking complete. Run test suite in {project-path}/ and fix failing tests."
@@ -2,6 +2,7 @@ name: retrospective
2
2
  description: 'Post-sprint retrospective with learning loop'
3
3
  module: lifecycle
4
4
  agent: sm
5
+ val_validate_output: true
5
6
  template_output_prompt: "auto"
6
7
  config_resolved: "{installed_path}/.resolved/retrospective.yaml"
7
8
  config_source: "{project-root}/_gaia/lifecycle/config.yaml"