gaia-framework 1.65.1 → 1.83.2

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 (57) hide show
  1. package/.claude/commands/gaia-create-stakeholder.md +20 -0
  2. package/.claude/commands/gaia-test-gap-analysis.md +17 -0
  3. package/CLAUDE.md +102 -1
  4. package/README.md +2 -2
  5. package/_gaia/_config/global.yaml +5 -1
  6. package/_gaia/_config/lifecycle-sequence.yaml +20 -0
  7. package/_gaia/_config/skill-manifest.csv +2 -0
  8. package/_gaia/_config/workflow-manifest.csv +3 -1
  9. package/_gaia/core/engine/workflow.xml +11 -1
  10. package/_gaia/core/protocols/review-gate-check.xml +29 -1
  11. package/_gaia/core/workflows/party-mode/steps/step-01-agent-loading.md +60 -9
  12. package/_gaia/creative/workflows/problem-solving/checklist.md +64 -14
  13. package/_gaia/creative/workflows/problem-solving/instructions.xml +367 -22
  14. package/_gaia/creative/workflows/problem-solving/workflow.yaml +31 -1
  15. package/_gaia/dev/agents/_base-dev.md +7 -1
  16. package/_gaia/dev/skills/_skill-index.yaml +9 -0
  17. package/_gaia/dev/skills/figma-integration.md +296 -0
  18. package/_gaia/lifecycle/knowledge/brownfield/config-contradiction-scan.md +137 -0
  19. package/_gaia/lifecycle/knowledge/brownfield/dead-code-scan.md +179 -0
  20. package/_gaia/lifecycle/knowledge/brownfield/test-execution-scan.md +209 -0
  21. package/_gaia/lifecycle/skills/document-rulesets.md +91 -6
  22. package/_gaia/lifecycle/templates/brownfield-scan-doc-code-prompt.md +219 -0
  23. package/_gaia/lifecycle/templates/brownfield-scan-hardcoded-prompt.md +169 -0
  24. package/_gaia/lifecycle/templates/brownfield-scan-integration-seam-prompt.md +127 -0
  25. package/_gaia/lifecycle/templates/brownfield-scan-runtime-behavior-prompt.md +141 -0
  26. package/_gaia/lifecycle/templates/brownfield-scan-security-prompt.md +440 -0
  27. package/_gaia/lifecycle/templates/gap-entry-schema.md +282 -0
  28. package/_gaia/lifecycle/templates/infra-prd-template.md +356 -0
  29. package/_gaia/lifecycle/templates/platform-prd-template.md +431 -0
  30. package/_gaia/lifecycle/templates/prd-template.md +70 -0
  31. package/_gaia/lifecycle/templates/story-template.md +22 -1
  32. package/_gaia/lifecycle/workflows/2-planning/create-ux-design/instructions.xml +52 -3
  33. package/_gaia/lifecycle/workflows/4-implementation/add-feature/checklist.md +1 -1
  34. package/_gaia/lifecycle/workflows/4-implementation/add-feature/instructions.xml +2 -3
  35. package/_gaia/lifecycle/workflows/4-implementation/add-stories/checklist.md +5 -0
  36. package/_gaia/lifecycle/workflows/4-implementation/add-stories/instructions.xml +73 -1
  37. package/_gaia/lifecycle/workflows/4-implementation/create-stakeholder/checklist.md +25 -0
  38. package/_gaia/lifecycle/workflows/4-implementation/create-stakeholder/instructions.xml +79 -0
  39. package/_gaia/lifecycle/workflows/4-implementation/create-stakeholder/workflow.yaml +22 -0
  40. package/_gaia/lifecycle/workflows/4-implementation/create-story/instructions.xml +11 -1
  41. package/_gaia/lifecycle/workflows/4-implementation/retrospective/instructions.xml +21 -1
  42. package/_gaia/lifecycle/workflows/4-implementation/retrospective/workflow.yaml +1 -1
  43. package/_gaia/lifecycle/workflows/4-implementation/validate-story/instructions.xml +11 -0
  44. package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/checklist.md +12 -0
  45. package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/instructions.xml +248 -4
  46. package/_gaia/lifecycle/workflows/anytime/brownfield-onboarding/workflow.yaml +1 -0
  47. package/_gaia/testing/workflows/test-gap-analysis/checklist.md +8 -0
  48. package/_gaia/testing/workflows/test-gap-analysis/instructions.xml +53 -0
  49. package/_gaia/testing/workflows/test-gap-analysis/workflow.yaml +38 -0
  50. package/bin/gaia-framework.js +44 -8
  51. package/bin/helpers/derive-bump-label.js +41 -0
  52. package/bin/helpers/validate-bump-labels.js +38 -0
  53. package/gaia-install.sh +96 -21
  54. package/package.json +1 -1
  55. package/_gaia/_memory/tier2-results/.gitkeep +0 -0
  56. package/_gaia/_memory/tier2-results/checkpoint-resume-2026-03-24.yaml +0 -6
  57. package/_gaia/_memory/tier2-results/engine-scenarios-2026-03-22.yaml +0 -14
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: 'create-stakeholder'
3
+ description: 'Scaffold a new stakeholder file for Party Mode. Use when "create a stakeholder".'
4
+ model: sonnet
5
+ ---
6
+
7
+ IT IS CRITICAL THAT YOU FOLLOW THESE STEPS:
8
+
9
+ <steps CRITICAL="TRUE">
10
+ 1. PARSE arguments from $ARGUMENTS:
11
+ - Check for "yolo" keyword (case-insensitive): if present, set yolo_mode=true
12
+ 2. LOAD the FULL {project-root}/_gaia/core/engine/workflow.xml
13
+ 3. READ its entire contents — this is the CORE OS
14
+ 4. Pass {project-root}/_gaia/lifecycle/workflows/4-implementation/create-stakeholder/workflow.yaml as 'workflow-config'
15
+ 5. If yolo_mode=true: tell the engine "Run in YOLO mode — auto-proceed past all template-outputs."
16
+ 6. Follow workflow.xml instructions EXACTLY
17
+ 7. Save outputs after EACH section
18
+ </steps>
19
+
20
+ $ARGUMENTS
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: 'test-gap-analysis'
3
+ description: 'Scan test suite against requirements to identify coverage gaps. Use when "test gap analysis".'
4
+ model: opus
5
+ ---
6
+
7
+ IT IS CRITICAL THAT YOU FOLLOW THESE STEPS:
8
+
9
+ <steps CRITICAL="TRUE">
10
+ 1. LOAD the FULL {project-root}/_gaia/core/engine/workflow.xml
11
+ 2. READ its entire contents — this is the CORE OS
12
+ 3. Pass {project-root}/_gaia/testing/workflows/test-gap-analysis/workflow.yaml as 'workflow-config'
13
+ 4. Follow workflow.xml instructions EXACTLY
14
+ 5. Save outputs after EACH section
15
+ </steps>
16
+
17
+ $ARGUMENTS
package/CLAUDE.md CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
- # GAIA Framework v1.65.1
2
+ # GAIA Framework
3
+
4
+ > Version: see `package.json` or `_gaia/_config/global.yaml`
3
5
 
4
6
  This project uses the **GAIA** (Generative Agile Intelligence Architecture) framework — an AI agent framework for Claude Code that orchestrates software product development through 26 specialized agents, 65 workflows, and 8 shared skills.
5
7
 
@@ -149,10 +151,109 @@ Run `/gaia-run-all-reviews` to execute all six reviews sequentially via subagent
149
151
 
150
152
  If any review fails, the story returns to `in-progress`. The Review Gate table in the story file tracks progress.
151
153
 
154
+ ### Infra Review Gate Substitutions
155
+
156
+ For infrastructure stories (those whose `traces_to` field contains `IR-###`, `OR-###`, or `SR-###` requirement IDs), 4 of the 6 review gates use adapted criteria. Code Review and Security Review remain unchanged for all story types.
157
+
158
+ | Standard Gate | Infra Equivalent | Change |
159
+ |---|---|---|
160
+ | Code Review | IaC Code Review | Unchanged — same workflow, IaC expertise expected |
161
+ | QA Tests | Policy-as-Code Validation | Checkov/tfsec/OPA pass replaces unit/integration test pass |
162
+ | Security Review | Security Review | Unchanged — critical for infrastructure |
163
+ | Test Automation | Plan Validation + Drift Checks | terraform plan assertions replace automated test coverage |
164
+ | Test Review | Policy Review | OPA/Rego coverage replaces test quality review |
165
+ | Performance Review | Cost Review + Scaling Validation | Cost analysis and autoscaling validation replace load testing |
166
+
167
+ **Detection mechanism:** The `review-gate-check` protocol reads the story's `traces_to` field and checks the requirement ID prefix. Each story is evaluated independently — platform projects with mixed stories get per-story gate selection based on their own requirement prefix.
168
+
152
169
  ## Memory Hygiene
153
170
 
154
171
  Agent memory sidecars accumulate decisions across sessions. Run `/gaia-memory-hygiene` periodically (recommended before each sprint) to detect stale, contradicted, or orphaned entries by cross-referencing sidecar decisions against current planning and architecture artifacts.
155
172
 
173
+ ## Branching Model
174
+
175
+ This project uses a three-tier branch flow:
176
+
177
+ ```
178
+ feature branches → staging → main
179
+ ```
180
+
181
+ - **Feature branches** — all development happens on feature branches. Never commit directly to `staging` or `main`.
182
+ - **`staging`** — integration branch for release candidates. Merging a PR to `staging` triggers an automated version bump and produces an RC prerelease version (e.g., `1.66.0-rc.1`). Each subsequent merge increments the RC counter (e.g., `1.66.0-rc.2`).
183
+ - **`main`** — production branch. Merging a promotion PR from `staging` to `main` strips the `-rc.N` suffix and produces the release version (e.g., `1.66.0`).
184
+
185
+ **Example version flow:**
186
+ ```
187
+ main 1.65.1 → PR bump:patch → staging 1.65.2-rc.1 → PR bump:none → staging 1.65.2-rc.2 → promote → main 1.65.2
188
+ ```
189
+
190
+ ## Version Bumping
191
+
192
+ **CRITICAL: Do NOT bump versions manually.** Version bumping is fully automated via GitHub Actions, triggered by PR merges.
193
+
194
+ ### How it works
195
+
196
+ - When a PR is merged to `staging`, the `version-bump-staging.yml` workflow reads the PR's bump label and updates the version automatically.
197
+ - Version state lives in **2 files only**: `package.json` and `_gaia/_config/global.yaml`.
198
+ - `gaia-install.sh` reads version dynamically from `package.json` at runtime — it does not carry a hardcoded version.
199
+ - `manifest.yaml`, `CLAUDE.md`, and `README.md` do not carry version numbers.
200
+
201
+ ### Bump labels
202
+
203
+ Every PR merged to `staging` must have exactly one `bump:*` label:
204
+
205
+ | Label | Effect | Example |
206
+ |-------|--------|---------|
207
+ | `bump:major` | Bump 1st number, reset 2nd+3rd, set RC=1 | `1.65.1` → `2.0.0-rc.1` |
208
+ | `bump:minor` | Bump 2nd number, reset 3rd, set RC=1 | `1.65.1` → `1.66.0-rc.1` |
209
+ | `bump:patch` | Bump 3rd number, set RC=1 | `1.65.1` → `1.65.2-rc.1` |
210
+ | `bump:none` | Keep version numbers, increment RC only | `1.65.2-rc.1` → `1.65.2-rc.2` |
211
+
212
+ ### What NOT to do
213
+
214
+ - Do NOT run `npm run version:bump` — this command no longer exists
215
+ - Do NOT manually edit version numbers in `package.json` or `global.yaml`
216
+ - Do NOT bump versions in feature branches — version changes happen automatically on merge to `staging`
217
+
218
+ ## Branch Protection
219
+
220
+ Both `staging` and `main` branches are protected in GitHub settings:
221
+
222
+ - **PR required** — no direct push allowed to either branch
223
+ - **Status checks required** — lint, security audit, and tests must pass before merge
224
+ - **Bump label enforcement** — PRs to `staging` are blocked without exactly one `bump:*` label (`bump:major`, `bump:minor`, `bump:patch`, or `bump:none`)
225
+
226
+ Branch protection is configured in GitHub repository settings, not in code.
227
+
228
+ ## Git Discipline
229
+
230
+ - Always commit AND push after completing changes. Do not leave unpushed commits.
231
+ - Write clear, conventional commit messages focused on what changed and why.
232
+ - Always use feature branches — NEVER commit directly to `staging` or `main`.
233
+ - PR workflow: feature branch → `staging` (with bump label) → `main` (promotion PR).
234
+
235
+ ## npm Publishing
236
+
237
+ Publishing is fully automated — no manual steps required beyond creating the promotion PR.
238
+
239
+ ### Automated pipeline
240
+
241
+ 1. **Feature development:** develop on a feature branch, create PR to `staging` with a `bump:*` label
242
+ 2. **Staging merge:** `version-bump-staging.yml` bumps the version and commits the RC version to `staging`
243
+ 3. **Promotion:** create a PR from `staging` to `main`
244
+ 4. **Release:** `promote-to-main.yml` strips the `-rc.N` suffix, commits the release version, creates a git tag `vX.Y.Z`, and creates a GitHub Release
245
+ 5. **Publish:** the GitHub Release triggers `publish.yml`, which runs tests, verifies the version matches the tag, and publishes to npm with provenance attestation
246
+
247
+ ### What NOT to do
248
+
249
+ - Do NOT manually create git tags — tags are created automatically by `promote-to-main.yml`
250
+ - Do NOT manually run `gh release create` — releases are created automatically
251
+ - Do NOT manually run `npm publish` — publishing is triggered by the GitHub Release
252
+
253
+ ### Verification
254
+
255
+ After a release, verify: `npm view gaia-framework version`
256
+
156
257
  ## Do Not
157
258
 
158
259
  - Pre-load files — load at runtime when needed
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GAIA — Generative Agile Intelligence Architecture
2
2
 
3
- [![Framework](https://img.shields.io/badge/framework-v1.65.1-blue)]()
3
+ [![Framework](https://img.shields.io/badge/framework-GAIA-blue)]()
4
4
  [![License](https://img.shields.io/badge/license-AGPL--3.0-green)]()
5
5
  [![Agents](https://img.shields.io/badge/agents-26-purple)]()
6
6
  [![Workflows](https://img.shields.io/badge/workflows-73-orange)]()
@@ -460,7 +460,7 @@ The single source of truth is `_gaia/_config/global.yaml`:
460
460
 
461
461
  ```yaml
462
462
  framework_name: "GAIA"
463
- framework_version: "1.65.1"
463
+ framework_version: "<current>"
464
464
  user_name: "your-name"
465
465
  project_name: "your-project"
466
466
  ```
@@ -3,7 +3,7 @@
3
3
  # After modifying this file, run /gaia-build-configs to regenerate resolved configs.
4
4
 
5
5
  framework_name: "GAIA"
6
- framework_version: "1.65.1"
6
+ framework_version: "1.83.2"
7
7
 
8
8
  # User settings
9
9
  user_name: "jlouage"
@@ -39,6 +39,10 @@ sizing_map:
39
39
  L: 8
40
40
  XL: 13
41
41
 
42
+ # Problem-solving workflow — context gathering configuration
43
+ problem_solving:
44
+ context_budget: 30000 # Max tokens for auto-gathered context (Step 0)
45
+
42
46
  # Framework paths
43
47
  installed_path: "{project-root}/_gaia"
44
48
  config_path: "{project-root}/_gaia/_config"
@@ -450,6 +450,15 @@ sequence:
450
450
  standalone: true
451
451
  note: "Run periodically to detect stale or contradicted decisions in agent memory sidecars"
452
452
 
453
+ create-stakeholder:
454
+ module: lifecycle
455
+ command: /gaia-create-stakeholder
456
+ next:
457
+ standalone: true
458
+ suggestions:
459
+ - command: /gaia-party
460
+ context: "To start a Party Mode discussion with the new stakeholder"
461
+
453
462
  performance-review:
454
463
  module: lifecycle
455
464
  command: /gaia-performance-review
@@ -549,6 +558,17 @@ sequence:
549
558
  - command: /gaia-run-all-reviews
550
559
  context: "To complete the review gate"
551
560
 
561
+ test-gap-analysis:
562
+ module: testing
563
+ command: /gaia-test-gap-analysis
564
+ next:
565
+ standalone: true
566
+ suggestions:
567
+ - command: /gaia-test-design
568
+ context: "To design tests covering newly identified coverage gaps"
569
+ - command: /gaia-test-automate
570
+ context: "To automate tests filling the identified gaps"
571
+
552
572
  traceability:
553
573
  module: testing
554
574
  command: /gaia-trace
@@ -7,8 +7,10 @@ name,displayName,description,path,applicable_agents
7
7
  "code-review-standards","Code Review Standards","Universal review checklist, SOLID, complexity metrics","_gaia/dev/skills/code-review-standards.md","all-dev"
8
8
  "documentation-standards","Documentation Standards","README templates, ADRs, inline comments, API docs","_gaia/dev/skills/documentation-standards.md","all-dev,tech-writer,analyst,pm"
9
9
  "security-basics","Security Basics","OWASP Top 10, input validation, secrets, CORS/CSRF","_gaia/dev/skills/security-basics.md","all-dev,architect,security,devops"
10
+ "figma-integration","Figma Integration","Figma MCP detection probe, design tokens (W3C DTCG), component specs, frame generation, asset export, per-stack resolution","_gaia/dev/skills/figma-integration.md","all-dev"
10
11
  "validation-patterns","Validation Patterns","Claim extraction, filesystem verification, cross-reference, severity classification, findings formatting","_gaia/lifecycle/skills/validation-patterns.md","validator"
11
12
  "ground-truth-management","Ground Truth Management","Entry structure, incremental/full refresh, conflict resolution, archival, token budget, brownfield extraction","_gaia/lifecycle/skills/ground-truth-management.md","validator"
12
13
  "memory-management","Memory Management","Session load/save, decision formatting, stale detection, deduplication, context summarization, cross-ref loading, budget-monitoring","_gaia/lifecycle/skills/memory-management.md","all"
13
14
  "memory-management-cross-agent","Memory Management Cross-Agent","Cross-agent memory read protocol for loading other agents' sidecar files","_gaia/lifecycle/skills/memory-management-cross-agent.md","all"
14
15
  "document-rulesets","Document Rulesets","Artifact type detection, document-specific validation rulesets (prd, arch, ux, test-plan, epics), two-pass validation logic","_gaia/lifecycle/skills/document-rulesets.md","validator"
16
+ "figma-integration","Figma Integration","Design tool detection, token extraction (W3C DTCG), component specs, frame generation, asset export, per-stack resolution","_gaia/dev/skills/figma-integration.md","all-dev"
@@ -33,7 +33,7 @@ name,displayName,description,module,phase,path,command,agent
33
33
  "quick-dev","Quick Dev","Implement a quick spec","lifecycle","quick-flow","_gaia/lifecycle/workflows/quick-flow/quick-dev/workflow.yaml","gaia-quick-dev","dev-*"
34
34
  "design-thinking","Design Thinking","Guide human-centered design process","creative","anytime","_gaia/creative/workflows/design-thinking/workflow.yaml","gaia-design-thinking","design-thinking-coach"
35
35
  "innovation-strategy","Innovation Strategy","Identify disruption opportunities","creative","anytime","_gaia/creative/workflows/innovation-strategy/workflow.yaml","gaia-innovation","innovation-strategist"
36
- "problem-solving","Problem Solving","Apply systematic problem-solving methodologies","creative","anytime","_gaia/creative/workflows/problem-solving/workflow.yaml","gaia-problem-solving","problem-solver"
36
+ "problem-solving","Problem Solving","Apply systematic problem-solving methodologies with resolution routing","creative","anytime","_gaia/creative/workflows/problem-solving/workflow.yaml","gaia-problem-solving","problem-solver"
37
37
  "storytelling","Storytelling","Craft compelling narratives","creative","anytime","_gaia/creative/workflows/storytelling/workflow.yaml","gaia-storytelling","storyteller"
38
38
  "teach-me-testing","Teach Me Testing","Teach testing progressively","testing","anytime","_gaia/testing/workflows/teach-me-testing/workflow.yaml","gaia-teach-testing","test-architect"
39
39
  "edit-test-plan","Edit Test Plan","Edit an existing test plan — add test cases without regenerating","testing","anytime","_gaia/testing/workflows/edit-test-plan/workflow.yaml","gaia-edit-test-plan","test-architect"
@@ -45,6 +45,7 @@ name,displayName,description,module,phase,path,command,agent
45
45
  "test-review","Test Review","Review test quality","testing","anytime","_gaia/testing/workflows/test-review/workflow.yaml","gaia-test-review","test-architect"
46
46
  "nfr-assessment","NFR Assessment","Assess non-functional requirements","testing","anytime","_gaia/testing/workflows/nfr-assessment/workflow.yaml","gaia-nfr","test-architect"
47
47
  "traceability","Traceability","Generate traceability matrix","testing","anytime","_gaia/testing/workflows/traceability/workflow.yaml","gaia-trace","test-architect"
48
+ "test-gap-analysis","Test Gap Analysis","Scan test suite against requirements to identify coverage gaps","testing","anytime","_gaia/testing/workflows/test-gap-analysis/workflow.yaml","gaia-test-gap-analysis","test-architect"
48
49
  "security-threat-model","Security Threat Model","Create STRIDE/DREAD threat model","lifecycle","3-solutioning","_gaia/lifecycle/workflows/3-solutioning/security-threat-model/workflow.yaml","gaia-threat-model","security"
49
50
  "security-review","Security Review","Pre-merge OWASP security review","lifecycle","4-implementation","_gaia/lifecycle/workflows/4-implementation/security-review/workflow.yaml","gaia-security-review","security"
50
51
  "infrastructure-design","Infrastructure Design","Design deployment topology and IaC","lifecycle","3-solutioning","_gaia/lifecycle/workflows/3-solutioning/infrastructure-design/workflow.yaml","gaia-infra-design","devops"
@@ -73,3 +74,4 @@ name,displayName,description,module,phase,path,command,agent
73
74
  "run-all-reviews","Run All Reviews","Runs all 6 review workflows sequentially via subagents","lifecycle","4-implementation","_gaia/lifecycle/workflows/4-implementation/run-all-reviews/workflow.yaml","gaia-run-all-reviews","orchestrator"
74
75
  "check-review-gate","Check Review Gate","Check composite review gate status and transition story to done if all reviews pass","lifecycle","4-implementation","_gaia/lifecycle/workflows/4-implementation/check-review-gate/workflow.yaml","gaia-check-review-gate","sm"
75
76
  "action-items","Action Items","Process and resolve action items from retro, triage, tech-debt, and correct-course","lifecycle","4-implementation","_gaia/lifecycle/workflows/4-implementation/action-items/workflow.yaml","gaia-action-items","orchestrator"
77
+ "create-stakeholder","Create Stakeholder","Scaffold new stakeholder file for Party Mode","lifecycle","4-implementation","_gaia/lifecycle/workflows/4-implementation/create-stakeholder/workflow.yaml","gaia-create-stakeholder","orchestrator"
@@ -50,6 +50,12 @@ execution modes (normal/yolo/planning), checkpoints, and quality gates.
50
50
  <action>Resolve {installed_path} from workflow.yaml location</action>
51
51
  <action>Resolve {date} to current date</action>
52
52
  <action>Ask user for any remaining unresolved variables</action>
53
+
54
+ <!-- Template Resolution (ADR-020, FR-101) — custom/templates/ overrides _gaia/lifecycle/templates/ -->
55
+ <!-- Resolution order for template reads: custom/templates/{filename} > _gaia/lifecycle/templates/{filename} -->
56
+ <!-- Resolution order for template writes: custom/templates/ ONLY — NEVER _gaia/lifecycle/templates/ -->
57
+ <action>Resolve template paths: If workflow.yaml declares a 'template' field, extract the template filename from the fully resolved template path (e.g., extract "story-template.md" from "{project-root}/_gaia/lifecycle/templates/story-template.md"). Check if {project-root}/custom/templates/{filename} exists and is non-empty (file size > 0 bytes). If yes: the custom template overrides the framework default — replace the resolved template variable with the custom path ({project-root}/custom/templates/{filename}). The custom template takes full precedence and completely replaces the framework default (no merge). If no (custom/templates/ directory does not exist, the specific file is not found, or the file is empty / 0 bytes): keep the original resolved framework path unchanged. No error, no warning on fallback — this is silent. If workflow.yaml has no 'template' field, skip template resolution entirely.</action>
58
+ <action>Template write-path mandate: Any workflow that writes or modifies template files MUST write to {project-root}/custom/templates/, NEVER to {project-root}/_gaia/lifecycle/templates/. Framework default templates are read-only.</action>
53
59
  </step>
54
60
 
55
61
  <step n="2" title="Preflight Validation">
@@ -68,7 +74,11 @@ execution modes (normal/yolo/planning), checkpoints, and quality gates.
68
74
  <action if="agent is 'dev-*' (wildcard)">Check if workflow.yaml declares agent_auto_detect: true. If true, execute the agent_auto_detect_strategy from workflow.yaml to determine the stack. If auto-detection succeeds, resolve to {project-root}/_gaia/dev/agents/{detected_stack}-dev.md and inform user: "Auto-detected developer: {agent_name} based on {detection_source}." If auto-detection fails or agent_auto_detect is false/absent: ask user which stack developer to use (typescript, angular, flutter, java, python, mobile, go), then resolve to {project-root}/_gaia/dev/agents/{stack}-dev.md</action>
69
75
  <action if="agent file resolved">Read the agent persona file — adopt its persona, name, communication style, rules, and domain knowledge for the duration of this workflow</action>
70
76
  <action if="agent file resolved">Do NOT execute the agent's activation protocol, greeting, or menu — the workflow engine controls step execution</action>
71
- <action if="agent file resolved">Check for {project-root}/_gaia/_config/agents/{agent-id}.customize.yaml. If found, load and merge overrides (persona_overrides, menu_additions, menu_removals, skill_additions, rule_additions, skill_overrides, skill_section_overrides). For dev agents, also check all-dev.customize.yaml and merge (agent-specific takes precedence over all-dev).</action>
77
+ <action if="agent file resolved">Check for .customize.yaml using the following lookup order (file-level replacement no merge between locations; if found in custom/skills/, skip _gaia/_config/agents/ entirely):
78
+ 1. Check {project-root}/custom/skills/{agent-id}.customize.yaml — primary location (survives framework upgrades)
79
+ 2. Fall back to {project-root}/_gaia/_config/agents/{agent-id}.customize.yaml — legacy/default location (silent fallback, no error or warning if custom/skills/ file does not exist)
80
+ For dev agents, also check custom/skills/all-dev.customize.yaml before _gaia/_config/agents/all-dev.customize.yaml (same file-level replacement semantics — if found in custom/skills/, skip _gaia/_config/agents/ entirely).
81
+ If a .customize.yaml is found at either location, load and merge overrides (persona_overrides, menu_additions, menu_removals, skill_additions, rule_additions, skill_overrides, skill_section_overrides). Agent-specific takes precedence over all-dev.</action>
72
82
 
73
83
  <!-- Memory Load Protocol (E9-S7) — Load agent memory sidecar files after persona, before instructions -->
74
84
  <action if="agent file resolved">Read {project-root}/_memory/config.yaml to resolve agent tier and sidecar path. If the file does not exist, log "Memory config not found — skipping memory loading." and skip all remaining memory load actions in this step.</action>
@@ -2,16 +2,44 @@
2
2
  <description>
3
3
  Shared protocol invoked by each review workflow after updating its Review Gate row.
4
4
  Checks if ALL reviews have passed and transitions story to done if so.
5
+ Supports infrastructure review gate adaptations (ADR-022 §10.16.6):
6
+ stories tracing to infra requirements (IR-/OR-/SR- prefixes) use adapted gate criteria.
5
7
  </description>
6
8
  <critical>
7
9
  <mandate>The Review Gate table must have EXACTLY 6 rows: Code Review, QA Tests, Security Review, Test Automation, Test Review, Performance Review. No other rows are valid. If extra rows exist, remove them.</mandate>
10
+ <mandate>For infrastructure stories, 4 of 6 gates use adapted criteria. Code Review and Security Review remain unchanged for all story types.</mandate>
8
11
  </critical>
9
- <step n="1" title="Read Review Gate">
12
+
13
+ <!-- Infra Review Gate Substitutions (FR-128, ADR-022 §10.16.6)
14
+ When a story traces to infrastructure requirements, the following gate
15
+ criteria are substituted. The gate row NAMES in the Review Gate table
16
+ stay the same (for compatibility), but the review workflows apply
17
+ infra-specific criteria instead of standard application criteria.
18
+
19
+ | Standard Gate | Infra Equivalent | Changed? |
20
+ | Code Review | IaC Code Review | Unchanged — same workflow, IaC expertise expected |
21
+ | QA Tests | Policy-as-Code Validation | Checkov/tfsec/OPA pass replaces unit/integration test pass |
22
+ | Security Review | Security Review | Unchanged — critical for infrastructure |
23
+ | Test Automation | Plan Validation + Drift Checks | terraform plan assertions replace automated test coverage |
24
+ | Test Review | Policy Review | OPA/Rego coverage replaces test quality review |
25
+ | Performance Review | Cost Review + Scaling Validation | Cost analysis and autoscaling validation replace load testing |
26
+ -->
27
+
28
+ <step n="1" title="Read Review Gate and Determine Gate Type">
10
29
  <action>Read the story file's Review Gate table</action>
11
30
  <action>If Review Gate section is missing: initialize it with EXACTLY 6 rows — Code Review (PENDING), QA Tests (PENDING), Security Review (PENDING), Test Automation (PENDING), Test Review (PENDING), Performance Review (PENDING). Do NOT add any other rows.</action>
12
31
  <action>If Review Gate table has extra rows beyond the 6 valid ones: remove the invalid rows</action>
13
32
  <action>Parse each row: Review name, Status (PENDING | PASSED | FAILED), Report link</action>
33
+
34
+ <!-- Infra Gate Detection (FR-129): per-story gate type selection based on requirement ID prefix -->
35
+ <action>Read the story file's YAML frontmatter traces_to field (e.g., traces_to: [IR-001, FR-128])</action>
36
+ <action>Determine gate_type for this individual story by scanning its traces_to entries:
37
+ - If ANY entry has an IR-, OR-, or SR- prefix → set gate_type = "infra"
38
+ - If entries have only FR- or NFR- prefixes (or traces_to is empty/absent) → set gate_type = "standard"
39
+ Each story is evaluated independently — in platform projects with mixed stories, each story gets the gate set matching its own requirement prefix, not a single gate set for the whole project.</action>
40
+ <action if="gate_type == infra">Log: "Infra review gates detected for this story (traces to IR-/OR-/SR- requirements). Applying infrastructure gate criteria: QA Tests → Policy-as-Code Validation, Test Automation → Plan Validation + Drift Checks, Performance Review → Cost Review + Scaling Validation, Test Review → Policy Review. Code Review and Security Review remain unchanged."</action>
14
41
  </step>
42
+
15
43
  <step n="2" title="Evaluate Gate and Transition">
16
44
  <critical>
17
45
  <mandate>You MUST execute the transition even if the gate was already fully passed before this run. The purpose is to ensure story status matches gate state.</mandate>
@@ -1,11 +1,62 @@
1
1
  # Step 1: Agent Loading
2
2
 
3
- 1. Read `_gaia/_config/agent-manifest.csv` to discover all installed agents
4
- 2. Ask the user which agents to invite to the discussion:
5
- - Option A: "All agents" — load all from manifest
6
- - Option B: "By module" — let user pick modules (lifecycle, dev, creative, testing)
7
- - Option C: "Specific agents" let user pick individual agents by name
8
- 3. For each selected agent, load their persona (name, title, communication_style, principles)
9
- 4. Do NOT load full agent files only extract persona summaries
10
- 5. Present the guest list to the user for confirmation
11
- 6. Ask for the discussion topic or question
3
+ <!-- References: architecture.md#10.18.2, ADR-026, FR-158/159/160/161, NFR-029 -->
4
+
5
+ ## Source 1: GAIA Agent Discovery
6
+
7
+ 1. Read `_gaia/_config/agent-manifest.csv` to discover all installed GAIA agents
8
+ 2. For each agent row, extract: name, displayName, title, module
9
+ 3. Build the GAIA agent list (existing behavior, unchanged)
10
+
11
+ ## Source 2: Stakeholder Discovery
12
+
13
+ 4. Glob `custom/stakeholders/*.md` to discover stakeholder persona files
14
+ - If the `custom/stakeholders/` directory does not exist, silently produce zero stakeholders — no error, no warning
15
+ - Skip empty files (0 bytes) silently
16
+ - If a file has malformed YAML frontmatter, skip it with a warning: "Skipping {filename}: invalid YAML frontmatter" — do not crash discovery
17
+ 5. Parse only YAML frontmatter from each discovered stakeholder file — extract: name (required), role (required), tags (optional)
18
+ - The `tags` field is an optional array in frontmatter (e.g., `tags: ["hotel-ops", "cleaning"]`)
19
+ - Build a tag-to-stakeholder index: map each tag to the list of stakeholders whose `tags` array contains it
20
+ - Stakeholders with multiple tags appear in the index under every tag they have
21
+ - If a stakeholder has no `tags` field or an empty array, it is excluded from tag-based searches but remains available for individual selection
22
+ - Do NOT load the full Markdown body at discovery time — frontmatter only
23
+ 6. Enforce 50-file cap: if more than 50 stakeholder files are found, warn "Stakeholder cap exceeded: {count} files found, using first 50 alphabetically" and truncate to the first 50 sorted alphabetically
24
+ 7. Track token budget during frontmatter scan — estimate each file's frontmatter at ~100 tokens (approx 400 chars). Total discovery across all stakeholder files must stay within 5K token budget (NFR-029). If cumulative budget reaches 80%, warn and stop scanning additional files.
25
+ 8. If `custom/stakeholders/` does not exist or is empty, display hint: "Tip: Create stakeholder personas with `/gaia-create-stakeholder` to invite domain experts to discussions." (FR-162)
26
+
27
+ ## Merge and Display Invite List
28
+
29
+ 9. Build a combined invite list from GAIA agents (Source 1) and stakeholders (Source 2)
30
+ - GAIA agents display as: `{displayName} — {title} ({module})`
31
+ - Stakeholders display with an `[S]` marker: `[S] {name} — {role}`
32
+ 10. Name disambiguation (FR-159): compare each stakeholder name against GAIA agent displayNames (case-insensitive). If a collision is detected, prefix the stakeholder with `[Stakeholder]` in the invite list and during discussion. GAIA agents always take precedence — agents retain their original name unchanged.
33
+ 11. Ask the user which participants to invite:
34
+ - Option A: "All agents" — GAIA agents only (unchanged from original behavior)
35
+ - Option B: "By module" — let user pick GAIA modules: lifecycle, dev, creative, testing (unchanged)
36
+ - Option C: "Specific agents" — let user pick individual participants from the combined GAIA + stakeholder list
37
+ - Option D: "Stakeholders only" — let user pick from stakeholders only (FR-160). This creates a valid stakeholder-only party with zero GAIA agents.
38
+ - Option E: "By tag" — invite stakeholders matching a tag (FR-161)
39
+ - Prompt the user for a tag name
40
+ - Look up the tag in the tag-to-stakeholder index (case-insensitive matching)
41
+ - All stakeholders whose `tags` array contains the specified tag are invited
42
+ - If the tag matches zero stakeholders, display warning: "Tag '{tag}' matches no stakeholders" and continue with any other invitees
43
+ - Tag-based invitations can be combined alongside individual agent/stakeholder name selections in the same invitation
44
+ - Alternative syntax: "invite all {tag}" (e.g., "invite all hotel-ops") — parsed and resolved using the same tag index with case-insensitive matching
45
+
46
+ ## Validation
47
+
48
+ 12. Validate the selection:
49
+ - Zero GAIA agents + one or more stakeholders = valid party — the orchestrator manages discussion flow (FR-160)
50
+ - One or more GAIA agents + zero stakeholders = valid party (original behavior)
51
+ - One or more GAIA agents + one or more stakeholders = valid party
52
+ - Zero GAIA agents + zero stakeholders = invalid party — halt with message: "Cannot start party: no agents or stakeholders selected. Select at least one participant."
53
+
54
+ ## Load Participant Personas
55
+
56
+ 13. For each selected GAIA agent: load their persona (name, title, communication_style, principles) — do NOT load full agent files, only extract persona summaries
57
+ 14. For each selected stakeholder: use the frontmatter already parsed at discovery time for the persona summary. Full file content (Markdown body) is loaded JIT when the stakeholder actually participates in discussion — not at selection time. If a stakeholder file exceeds 100 lines, display a warning when the full file is loaded: "Stakeholder file {filename} exceeds 100 lines — consider trimming for optimal context usage."
58
+
59
+ ## Confirm and Proceed
60
+
61
+ 15. Present the guest list to the user for confirmation
62
+ 16. Ask for the discussion topic or question
@@ -1,26 +1,76 @@
1
1
  # Problem Solving Checklist
2
2
 
3
- ## Problem Framing
3
+ ## Phase 1: Intake
4
+
5
+ ### Problem Intake
6
+ - [ ] Problem statement captured from user
7
+ - [ ] Urgency level classified (critical / high / medium / low)
8
+ - [ ] Domain keywords extracted and semantically expanded
9
+
10
+ ### Context Gathering
11
+ - [ ] Tier 1 artifact scan completed:
12
+ - [ ] Story files searched for keyword matches
13
+ - [ ] Architecture doc scanned for affected components
14
+ - [ ] PRD scanned for relevant requirements
15
+ - [ ] Agent decision logs checked (PM, architect, SM sidecars)
16
+ - [ ] Test artifacts checked for coverage and gaps
17
+ - [ ] Tier 2 codebase scan completed (if technical problem):
18
+ - [ ] Source code grepped for affected routes/services/components
19
+ - [ ] Recent git history checked for affected area
20
+ - [ ] Related test files identified
21
+ - [ ] Context Brief synthesized within 30K token budget
22
+ - [ ] Context Brief presented to user for validation
23
+ - [ ] User confirmed or added missing context
24
+
25
+ ## Phase 2: Context-Informed Analysis
26
+
27
+ ### Context-Informed vs Fallback Behavior
28
+ - [ ] context_brief_available flag correctly determined from Step 2 checkpoint
29
+ - [ ] When Context Brief available: steps read context from checkpoint (not user interrogation)
30
+ - [ ] When Context Brief available: user only asked for information NOT in the Context Brief
31
+ - [ ] When Context Brief unavailable (Step 0 skipped or empty): steps fall back to interrogation-based behavior
32
+ - [ ] Fallback mode operates with no errors and no degraded experience
33
+
34
+ ### Problem Framing
4
35
  - [ ] Problem clearly articulated (not a symptom)
5
- - [ ] Success criteria defined
6
- - [ ] Stakeholders and impact identified
36
+ - [ ] Symptoms separated from root causes using artifact evidence (or user input in fallback mode)
37
+ - [ ] Success criteria defined (grounded in existing acceptance criteria, or user goals in fallback mode)
7
38
 
8
- ## Root Cause Analysis
39
+ ### Root Cause Analysis
9
40
  - [ ] Methodology applied (5 Whys, Fishbone, TRIZ)
10
- - [ ] Root cause identified and validated
41
+ - [ ] Root cause identified with artifact evidence (or user-provided evidence in fallback mode)
11
42
  - [ ] Causal chain documented
43
+ - [ ] Root cause validated — fixing it fixes the symptoms
44
+ - [ ] Test gap identified (what test should have caught this)
45
+ - [ ] `test_gaps` array populated (AC4): each entry has file_path, gap_description, suggested_test_type, severity
46
+ - [ ] `test_gaps` uses correct schema: file_path (string), gap_description (string), suggested_test_type (unit/integration/e2e), severity (critical/high/medium/low)
47
+ - [ ] `test_gaps` is empty array (not absent) when no gaps found
48
+ - [ ] `test_gaps` persisted to workflow checkpoint for downstream steps
12
49
 
13
- ## Constraints
14
- - [ ] Real constraints separated from assumptions
15
- - [ ] Each constraint challenged and verified
50
+ ### Constraints
51
+ - [ ] Real constraints verified against ADRs and decision logs (or user input in fallback mode)
52
+ - [ ] Assumed constraints challenged with evidence
16
53
  - [ ] Contradictions identified
17
54
 
18
- ## Solutions
55
+ ### Solutions
19
56
  - [ ] At least 5 candidate solutions generated
20
57
  - [ ] Solutions address root cause, not symptoms
21
- - [ ] Feasibility/impact/effort assessed
58
+ - [ ] Solutions cross-checked against architecture constraints (from Context Brief or user input)
59
+ - [ ] Feasibility/impact/effort assessed (grounded in codebase context or user estimates in fallback mode)
60
+ - [ ] Rejected solutions documented with clear reasoning
61
+
62
+ ## Phase 3: Resolution Routing
63
+
64
+ ### Classification
65
+ - [ ] Resolution classified (quick fix / bug / critical / enhancement / systemic)
66
+ - [ ] Classification confirmed by user
22
67
 
23
- ## Action Plan
24
- - [ ] Concrete next steps defined
25
- - [ ] Owners and timelines assigned
26
- - [ ] Success metrics specified
68
+ ### Resolution Execution
69
+ - [ ] Problem-solving artifact saved to {creative_artifacts}/
70
+ - [ ] Resolution path executed:
71
+ - [ ] Quick fix / Bug / Critical: /gaia-create-story invoked with pre-populated context
72
+ - [ ] Enhancement: /gaia-add-feature invoked with problem-solving artifact
73
+ - [ ] Systemic: Problem Brief generated and escalation target identified
74
+ - [ ] Story includes origin: problem-solving and origin_ref fields (if story created)
75
+ - [ ] `test_gaps` array carried into story Dev Notes (if story created)
76
+ - [ ] Completion summary presented with next steps