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
@@ -106,24 +106,14 @@
106
106
  </step>
107
107
 
108
108
  <step n="7" title="Token Budget Reporting">
109
- <action>For each agent sidecar, calculate token usage:
110
- - Sum file sizes in bytes across all sidecar files (from Step 2 inventory)
111
- - Convert to approximate token count: file size in bytes / 4 (chars-per-token approximation from config archival.token_approximation)
112
- - For Tier 1 agents: also calculate ground-truth.md token usage separately</action>
113
- <action>Compare against budgets from {memory_path}/config.yaml:
114
- - Tier 1 session budget: tiers.tier_1.session_budget (300K tokens)
115
- - Tier 1 ground truth budget: agents.{agent}.ground_truth_budget (per-agent: Val 200K, Theo 150K, Derek 100K, Nate 100K)
116
- - Tier 2 session budget: tiers.tier_2.session_budget (100K tokens)
117
- - Tier 3: no budget enforced
118
- - Untiered: no budget enforced</action>
119
- <action>Apply threshold status indicators per archival config:
120
- - OK: below 80% of budget
121
- - warning: at or above 80% but below 90%
122
- - critical: at or above 90% but below 100%
123
- - over-budget: at or above 100%</action>
124
- <action>Build Token Budget Table with columns:
125
- | Agent | Tier | Files Scanned | Token Usage | Session Budget | GT Budget | % Used | Status |
126
- For Tier 3 and untiered agents: budget column shows "no budget enforced" with actual token count reported</action>
109
+ <action>JIT-load the budget-monitoring section from {project-root}/_gaia/lifecycle/skills/memory-management.md
110
+ Load only the content between &lt;!-- SECTION: budget-monitoring --&gt; and &lt;!-- END SECTION --&gt; markers</action>
111
+ <action>Apply the budget-monitoring skill procedure using file sizes from Step 2 inventory and tier budgets from {memory_path}/config.yaml:
112
+ - Calculate token usage per agent (sum sidecar file sizes, convert via skill formula)
113
+ - Classify each agent by threshold status (OK / warning / critical / over-budget)
114
+ - For Tier 1 agents: also report ground truth budget usage separately
115
+ - For Tier 3 / untiered: report actual tokens with "no budget enforced"</action>
116
+ <action>Build Token Budget Table per the skill's output format</action>
127
117
  </step>
128
118
 
129
119
  <step n="8" title="Archival Recommendations">
@@ -2,7 +2,7 @@
2
2
  inherits: "{project-root}/_gaia/_config/global.yaml"
3
3
 
4
4
  module_name: "testing"
5
- module_version: "1.8.0"
5
+ module_version: "1.8.1"
6
6
 
7
7
  test_artifacts: "{project-root}/docs/test-artifacts"
8
8
  knowledge_path: "{project-root}/_gaia/testing/knowledge"
@@ -2,6 +2,7 @@ name: edit-test-plan
2
2
  description: 'Edit an existing test plan — add test cases for new features without regenerating'
3
3
  module: testing
4
4
  agent: test-architect
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/edit-test-plan.yaml"
6
7
  config_source: "{project-root}/_gaia/testing/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/testing/workflows/edit-test-plan"
@@ -2,10 +2,12 @@ name: test-design
2
2
  description: 'Create system-level or epic-level test plans'
3
3
  module: testing
4
4
  agent: test-architect
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/test-design.yaml"
6
7
  config_source: "{project-root}/_gaia/testing/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/testing/workflows/test-design"
8
9
  instructions: "{installed_path}/instructions.xml"
9
10
  validation: "{installed_path}/checklist.md"
11
+ template: "{project-root}/_gaia/lifecycle/templates/test-plan-template.md"
10
12
  output:
11
13
  primary: "{test_artifacts}/test-plan.md"
@@ -2,6 +2,7 @@ name: traceability
2
2
  description: 'Generate traceability matrix and quality gate decision'
3
3
  module: testing
4
4
  agent: test-architect
5
+ val_validate_output: true
5
6
  config_resolved: "{installed_path}/.resolved/traceability.yaml"
6
7
  config_source: "{project-root}/_gaia/testing/config.yaml"
7
8
  installed_path: "{project-root}/_gaia/testing/workflows/traceability"
@@ -178,8 +178,11 @@ Examples:
178
178
  function main(deps) {
179
179
  // Dependency injection for testability — defaults to real modules
180
180
  const _exec = (deps && deps.execSync) || execSync;
181
+ const _execFile = (deps && deps.execFileSync) || execFileSync;
181
182
  const _exists = (deps && deps.existsSync) || existsSync;
182
183
  const _join = (deps && deps.join) || join;
184
+ const _mkdtemp = (deps && deps.mkdtempSync) || mkdtempSync;
185
+ const _tmpdir = (deps && deps.tmpdir) || tmpdir;
183
186
 
184
187
  const args = process.argv.slice(2);
185
188
 
@@ -206,7 +209,7 @@ function main(deps) {
206
209
  ensureGit();
207
210
 
208
211
  // Clone the repo to a temp directory
209
- tempDir = mkdtempSync(join(tmpdir(), "gaia-framework-"));
212
+ tempDir = _mkdtemp(_join(_tmpdir(), "gaia-framework-"));
210
213
  // Resolve 8.3 short names to long paths on Windows (e.g., ELIASN~1 → Elias Nasser)
211
214
  // Node's realpathSync doesn't expand 8.3 names, so use PowerShell
212
215
  if (IS_WINDOWS) {
@@ -282,7 +285,7 @@ function main(deps) {
282
285
  info(`Temp dir: ${tempDir}`);
283
286
  }
284
287
 
285
- execFileSync(bashPath, [posixScript, ...posixArgs], {
288
+ _execFile(bashPath, [posixScript, ...posixArgs], {
286
289
  stdio: "inherit",
287
290
  env: { ...process.env, GAIA_SOURCE: toPosixPath(tempDir) },
288
291
  });
@@ -295,4 +298,15 @@ if (require.main === module) {
295
298
  main();
296
299
  }
297
300
 
298
- module.exports = { checkNodeVersion, getNodeVersionWarning, findBash, ensureGit, showUsage, fail, info, cleanup, readPackageVersion, main };
301
+ module.exports = {
302
+ checkNodeVersion,
303
+ getNodeVersionWarning,
304
+ findBash,
305
+ ensureGit,
306
+ showUsage,
307
+ fail,
308
+ info,
309
+ cleanup,
310
+ readPackageVersion,
311
+ main,
312
+ };
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * generate-checksums.js — File Integrity Manifest Generator
5
+ *
6
+ * Generates checksums.txt containing SHA-256 checksums for all published files.
7
+ * Runs as a prepublishOnly hook to ensure checksums are generated before tarball assembly.
8
+ *
9
+ * Uses only Node.js built-ins (crypto, fs, path) — zero runtime dependencies (ADR-005).
10
+ *
11
+ * Output format: BSD-compatible "<hash> <filename>" with two spaces.
12
+ * Compatible with both `shasum -a 256 -c` (macOS) and `sha256sum -c` (Linux).
13
+ */
14
+
15
+ "use strict";
16
+
17
+ const crypto = require("crypto");
18
+ const fs = require("fs");
19
+ const path = require("path");
20
+
21
+ const ROOT = path.resolve(__dirname, "..");
22
+ const CHECKSUMS_FILENAME = "checksums.txt";
23
+
24
+ /**
25
+ * Recursively expand a directory to a flat list of relative file paths.
26
+ */
27
+ function expandDirectory(relativeBase, absolutePath) {
28
+ const results = [];
29
+ const entries = fs.readdirSync(absolutePath, { withFileTypes: true });
30
+ for (const entry of entries) {
31
+ const relativePath = path.join(relativeBase, entry.name);
32
+ const absoluteChild = path.join(absolutePath, entry.name);
33
+ if (entry.isDirectory()) {
34
+ results.push(...expandDirectory(relativePath, absoluteChild));
35
+ } else if (entry.isFile()) {
36
+ results.push(relativePath);
37
+ }
38
+ }
39
+ return results;
40
+ }
41
+
42
+ /**
43
+ * Expand a single files-array entry to individual file paths.
44
+ * Directories are expanded recursively; plain files are returned as-is.
45
+ * Non-existent entries are returned for downstream error reporting.
46
+ */
47
+ function expandEntry(entry) {
48
+ const fullPath = path.join(ROOT, entry);
49
+ if (!fs.existsSync(fullPath)) return [entry];
50
+ return fs.statSync(fullPath).isDirectory() ? expandDirectory(entry, fullPath) : [entry];
51
+ }
52
+
53
+ /**
54
+ * Resolve the full list of publishable files from package.json.
55
+ * Expands directory entries, filters .gitkeep placeholders and checksums.txt itself,
56
+ * and always appends package.json.
57
+ */
58
+ function resolveFileList(filesArray) {
59
+ const expanded = filesArray.filter((entry) => entry !== CHECKSUMS_FILENAME).flatMap(expandEntry);
60
+
61
+ // Filter .gitkeep (intentionally zero-byte placeholders), add package.json
62
+ return [...expanded.filter((f) => path.basename(f) !== ".gitkeep"), "package.json"].sort();
63
+ }
64
+
65
+ /**
66
+ * Validate that every file exists and has non-zero size.
67
+ * Returns an array of error strings (empty if all valid).
68
+ */
69
+ function validateFiles(files) {
70
+ const errors = [];
71
+ for (const file of files) {
72
+ const fullPath = path.join(ROOT, file);
73
+ if (!fs.existsSync(fullPath)) {
74
+ errors.push(`MISSING: ${file}`);
75
+ } else if (fs.statSync(fullPath).size === 0) {
76
+ errors.push(`ZERO BYTES: ${file}`);
77
+ }
78
+ }
79
+ return errors;
80
+ }
81
+
82
+ /**
83
+ * Compute SHA-256 hash for a file and return BSD-format line.
84
+ */
85
+ function checksumLine(file) {
86
+ const content = fs.readFileSync(path.join(ROOT, file));
87
+ const hash = crypto.createHash("sha256").update(content).digest("hex");
88
+ return `${hash} ${file}`;
89
+ }
90
+
91
+ /**
92
+ * Main: read files array from package.json, validate, compute checksums, write manifest.
93
+ */
94
+ function main() {
95
+ const pkgPath = path.join(ROOT, "package.json");
96
+ if (!fs.existsSync(pkgPath)) {
97
+ console.error("ERROR: package.json not found at", pkgPath);
98
+ process.exit(1);
99
+ }
100
+
101
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
102
+ const filesArray = pkg.files || [];
103
+
104
+ if (filesArray.length === 0) {
105
+ console.error("ERROR: package.json 'files' array is empty or missing.");
106
+ process.exit(1);
107
+ }
108
+
109
+ const allFiles = resolveFileList(filesArray);
110
+ const errors = validateFiles(allFiles);
111
+
112
+ if (errors.length > 0) {
113
+ console.error("ERROR: File integrity check failed:");
114
+ errors.forEach((err) => console.error(" " + err));
115
+ process.exit(1);
116
+ }
117
+
118
+ const lines = allFiles.map(checksumLine);
119
+ fs.writeFileSync(path.join(ROOT, CHECKSUMS_FILENAME), lines.join("\n") + "\n", "utf8");
120
+
121
+ console.log(`${CHECKSUMS_FILENAME} generated with ${lines.length} entries.`);
122
+ }
123
+
124
+ main();
package/gaia-install.sh CHANGED
@@ -6,7 +6,6 @@ set -euo pipefail
6
6
  # Installs, updates, validates, and reports on GAIA installations.
7
7
  # ─────────────────────────────────────────────────────────────────────────────
8
8
 
9
- readonly VERSION="1.64.0"
10
9
  readonly GITHUB_REPO="https://github.com/jlouage/Gaia-framework.git"
11
10
  readonly MANIFEST_REL="_gaia/_config/manifest.yaml"
12
11
 
@@ -296,6 +295,23 @@ extract_yaml_value() {
296
295
  grep "^${key}:" "$file" 2>/dev/null | sed "s/^${key}:[[:space:]]*//" | sed 's/^"//;s/"$//' || echo ""
297
296
  }
298
297
 
298
+ read_package_version() {
299
+ local script_dir
300
+ script_dir="$(cd "$(dirname "$0")" && pwd)"
301
+ local pkg="$script_dir/package.json"
302
+ if [[ ! -f "$pkg" ]]; then
303
+ error "package.json not found at $pkg"
304
+ return 1
305
+ fi
306
+ local ver
307
+ ver="$(grep -E '^\s*"version"\s*:' "$pkg" | sed 's/.*"version":[[:space:]]*"\([^"]*\)".*/\1/')"
308
+ if [[ -z "$ver" ]]; then
309
+ error "version field is empty or missing in $pkg"
310
+ return 1
311
+ fi
312
+ echo "$ver"
313
+ }
314
+
299
315
  count_files() {
300
316
  local dir="$1" pattern="${2:-*}"
301
317
  find "$dir" -name "$pattern" -type f 2>/dev/null | wc -l | tr -d ' '
@@ -311,7 +327,9 @@ cmd_init() {
311
327
  local src_version
312
328
  src_version="$(extract_yaml_value "$source/_gaia/_config/global.yaml" "framework_version")"
313
329
 
314
- printf "\n${BOLD}GAIA Framework Installer v%s${RESET}\n" "$VERSION"
330
+ local pkg_version
331
+ pkg_version="$(read_package_version)"
332
+ printf "\n${BOLD}GAIA Framework Installer v%s${RESET}\n" "$pkg_version"
315
333
  printf " Source: %s\n" "$source"
316
334
  printf " Target: %s\n" "$TARGET"
317
335
  printf " Version: %s\n\n" "${src_version:-unknown}"
@@ -545,12 +563,24 @@ cmd_update() {
545
563
  exit 1
546
564
  fi
547
565
 
566
+ # Restore missing global.yaml from source before reading versions
567
+ if [[ ! -f "$TARGET/_gaia/_config/global.yaml" ]]; then
568
+ warn "global.yaml missing — restoring from source"
569
+ mkdir -p "$TARGET/_gaia/_config"
570
+ cp "$source/_gaia/_config/global.yaml" "$TARGET/_gaia/_config/global.yaml"
571
+ info "Review your settings in _gaia/_config/global.yaml after update"
572
+ fi
573
+
548
574
  local src_version
549
575
  src_version="$(extract_yaml_value "$source/_gaia/_config/global.yaml" "framework_version")"
576
+ if [[ -z "$src_version" ]]; then
577
+ error "framework_version not found in $source/_gaia/_config/global.yaml"
578
+ exit 1
579
+ fi
550
580
  local cur_version
551
581
  cur_version="$(extract_yaml_value "$TARGET/_gaia/_config/global.yaml" "framework_version")"
552
582
 
553
- printf "\n${BOLD}GAIA Framework Updater v%s${RESET}\n" "$VERSION"
583
+ printf "\n${BOLD}GAIA Framework Updater v%s${RESET}\n" "$src_version"
554
584
  printf " Source: %s (v%s)\n" "$source" "${src_version:-unknown}"
555
585
  printf " Target: %s (v%s)\n\n" "$TARGET" "${cur_version:-unknown}"
556
586
 
@@ -684,10 +714,14 @@ cmd_update() {
684
714
  step "Updating framework version: $cur_version → $src_version"
685
715
  if [[ "$OPT_DRY_RUN" != true ]]; then
686
716
  local global_file="$TARGET/_gaia/_config/global.yaml"
687
- if [[ "$(uname)" == "Darwin" ]]; then
688
- sed -i '' "s/^framework_version:.*/framework_version: \"$src_version\"/" "$global_file"
717
+ if [[ -f "$global_file" ]]; then
718
+ if [[ "$(uname)" == "Darwin" ]]; then
719
+ sed -i '' "s/^framework_version:.*/framework_version: \"$src_version\"/" "$global_file"
720
+ else
721
+ sed -i "s/^framework_version:.*/framework_version: \"$src_version\"/" "$global_file"
722
+ fi
689
723
  else
690
- sed -i "s/^framework_version:.*/framework_version: \"$src_version\"/" "$global_file"
724
+ warn "global.yaml not found at $global_file — skipping version update"
691
725
  fi
692
726
  # Update version in CLAUDE.md heading
693
727
  local claude_file="$TARGET/CLAUDE.md"
@@ -881,8 +915,10 @@ cmd_status() {
881
915
  # ─── Usage & Argument Parsing ───────────────────────────────────────────────
882
916
 
883
917
  usage() {
918
+ local pkg_ver
919
+ pkg_ver="$(read_package_version)"
884
920
  cat <<EOF
885
- ${BOLD}GAIA Framework Installer v${VERSION}${RESET}
921
+ ${BOLD}GAIA Framework Installer v${pkg_ver}${RESET}
886
922
 
887
923
  Usage: gaia-install.sh <command> [options] [target]
888
924
 
@@ -931,7 +967,9 @@ parse_args() {
931
967
  exit 0
932
968
  ;;
933
969
  --version|-v)
934
- echo "gaia-install.sh v${VERSION}"
970
+ local ver
971
+ ver="$(read_package_version)"
972
+ echo "$ver"
935
973
  exit 0
936
974
  ;;
937
975
  *)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaia-framework",
3
- "version": "1.64.0",
3
+ "version": "1.65.1",
4
4
  "description": "GAIA — Generative Agile Intelligence Architecture installer",
5
5
  "bin": {
6
6
  "gaia-framework": "./bin/gaia-framework.js"
@@ -19,7 +19,9 @@
19
19
  "lint": "eslint bin/**/*.js test/**/*.js",
20
20
  "lint:fix": "eslint --fix bin/**/*.js test/**/*.js",
21
21
  "format:check": "prettier --check \"bin/**/*.js\" \"test/**/*.js\"",
22
- "format": "prettier --write \"bin/**/*.js\" \"test/**/*.js\""
22
+ "format": "prettier --write \"bin/**/*.js\" \"test/**/*.js\"",
23
+ "bench": "node scripts/benchmark-runner.mjs",
24
+ "prepare": "echo \"Husky hooks disabled - activate in follow-up PR\""
23
25
  },
24
26
  "keywords": [
25
27
  "gaia",
@@ -55,7 +57,9 @@
55
57
  "eslint-config-prettier": "^10.1.8",
56
58
  "fast-xml-parser": "^5.2.0",
57
59
  "globals": "^17.4.0",
60
+ "husky": "^9.1.7",
58
61
  "js-yaml": "^4.1.0",
62
+ "lint-staged": "^15.5.2",
59
63
  "prettier": "^3.8.1",
60
64
  "vitest": "^3.1.0"
61
65
  }
@@ -1,30 +0,0 @@
1
- ---
2
- title: 'Add Feature Validation'
3
- validation-target: 'Feature Addition Cascade'
4
- ---
5
- ## Orchestration
6
- - [ ] Feature scope captured and confirmed by user
7
- - [ ] Context flows forward between steps (prd_diff → arch_diff → test_diff → stories)
8
- - [ ] Steps intelligently skipped when not needed
9
- ## PRD Update
10
- - [ ] PRD edited with new requirements
11
- - [ ] New FR/NFR IDs captured for downstream steps
12
- - [ ] Cascade to architecture classified (NONE/MINOR/SIGNIFICANT)
13
- ## Architecture Update (if applicable)
14
- - [ ] Architecture edited with changes supporting new requirements
15
- - [ ] New ADRs recorded
16
- - [ ] Skipped with justification if cascade_to_arch == NONE
17
- ## Test Plan Update (if applicable)
18
- - [ ] Test plan edited with new test cases
19
- - [ ] New test cases map to new FR/NFR IDs
20
- - [ ] Skipped with justification if no test-plan.md or no new testable behavior
21
- ## Story Creation
22
- - [ ] New stories created with correct format
23
- - [ ] Epic assignment confirmed (new or existing)
24
- - [ ] Story protection enforced (no modification of locked stories)
25
- ## Traceability
26
- - [ ] Traceability matrix regenerated
27
- - [ ] New requirements → test cases → stories linked
28
- ## Summary
29
- - [ ] Final summary presented to user with all artifact statuses
30
- - [ ] Next steps communicated
@@ -1,85 +0,0 @@
1
- <workflow name="add-feature">
2
- <critical>
3
- <mandate>This is an orchestrator — delegate to sub-workflows via subagents, do not perform edits directly</mandate>
4
- <mandate>Context flows forward: PRD diff feeds arch edit, which feeds test plan edit, which feeds story creation</mandate>
5
- <mandate>Intelligently skip steps when not needed — do not force all sub-workflows on every feature</mandate>
6
- </critical>
7
-
8
- <step n="1" title="Capture Feature Scope">
9
- <ask>Describe the new feature you want to add.</ask>
10
- <ask>What is the business driver? (customer request / market opportunity / technical improvement / regulatory)</ask>
11
- <ask>Is this linked to a change request? If so, provide the CR ID.</ask>
12
- <action>If CR exists: read {planning_artifacts}/change-request-{cr_id}.md for context (impact analysis, approval status)</action>
13
- <action>Classify initial scope: how many artifacts will likely need changes?</action>
14
- <action>Present scope summary to user for confirmation before proceeding:
15
- - Feature: {feature_description}
16
- - Driver: {driver}
17
- - CR: {cr_id or "none"}
18
- - Expected cascade: PRD (always) → Architecture ({likely/unlikely}) → Test Plan ({if exists}) → Stories (always) → Traceability (always)</action>
19
- </step>
20
-
21
- <step n="2" title="Edit PRD">
22
- <action>Spawn a subagent using the Agent tool: "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. Follow the workflow engine instructions EXACTLY. Context: Adding new feature: {feature_description}. Driver: {driver}. CR ID: {cr_id}. Add new functional and non-functional requirements for this feature. Use CR ID {cr_id} when prompted."</action>
23
- <action>When subagent returns: capture the PRD diff — identify NEW requirement IDs (FR-*, NFR-*) added</action>
24
- <action>Capture the cascade classification from edit-prd Step 7 (architecture impact: NONE/MINOR/SIGNIFICANT)</action>
25
- <action>Store: prd_diff = {new FR/NFR IDs and descriptions}, cascade_to_arch = {NONE/MINOR/SIGNIFICANT}</action>
26
- </step>
27
-
28
- <step n="3" title="Adversarial Review on PRD" optional="true" condition="edit_prd_offered_adversarial">
29
- <action>If edit-prd Step 5 ran adversarial review: the subagent already handled it — capture any refined requirements</action>
30
- <action>If adversarial findings were incorporated: update prd_diff with refined requirement IDs</action>
31
- <action>If adversarial was skipped: proceed to Step 4</action>
32
- </step>
33
-
34
- <step n="4" title="Edit Architecture" optional="true" condition="cascade_to_arch != NONE">
35
- <check if="cascade_to_arch == NONE">
36
- <action>Inform user: "No architecture changes needed for this feature — PRD changes are requirements-only." Skip to Step 5.</action>
37
- </check>
38
- <action>Spawn a subagent using the Agent tool: "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. Follow the workflow engine instructions EXACTLY. Context: PRD updated with new feature: {feature_description}. New requirements: {prd_diff}. Update architecture to support these requirements. CR ID: {cr_id}."</action>
39
- <action>When subagent returns: capture the architecture diff — new ADRs, changed sections, version note</action>
40
- <action>Store: arch_diff = {architecture changes made}</action>
41
- </step>
42
-
43
- <step n="5" title="Edit Test Plan" optional="true" condition="test_plan_exists">
44
- <check if="test_plan_not_found">
45
- <action>Inform user: "No test-plan.md exists. Recommend running /gaia-test-design to create an initial test plan." Skip to Step 6.</action>
46
- </check>
47
- <ask>Does this feature add new testable behavior? (yes / skip)</ask>
48
- <action>If skip: proceed to Step 6.</action>
49
- <action>If yes: spawn a subagent using the Agent tool: "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. Follow the workflow engine instructions EXACTLY. Context: New feature: {feature_description}. New PRD requirements: {prd_diff}. Architecture changes: {arch_diff}. Add test cases for the new feature."</action>
50
- <action>When subagent returns: capture test plan additions (new test case IDs)</action>
51
- <action>Store: test_diff = {new test cases added}</action>
52
- </step>
53
-
54
- <step n="6" title="Add Feature Stories">
55
- <action>Spawn a subagent using the Agent tool: "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. Follow the workflow engine instructions EXACTLY. Context: New feature: {feature_description}. New PRD requirements: {prd_diff}. Architecture changes: {arch_diff}. Create stories for this feature. Determine if a new epic is needed or if stories belong to an existing epic. CR ID: {cr_id}."</action>
56
- <action>When subagent returns: capture new story keys and epic assignments</action>
57
- <action>Store: new_stories = {list of new story keys created}</action>
58
- </step>
59
-
60
- <step n="7" title="Update Traceability">
61
- <action>Spawn a subagent using the Agent tool: "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. Follow the workflow engine instructions EXACTLY. Regenerate traceability matrix to include new requirements, test cases, and stories."</action>
62
- <action>When subagent returns: verify new FR/NFR IDs → test cases → stories are linked</action>
63
- </step>
64
-
65
- <step n="8" title="Readiness Re-check and Summary">
66
- <ask>Run readiness check to validate consistency? (yes / skip — recommended for significant features)</ask>
67
- <action>If yes: spawn a subagent using the Agent tool: "Load {project-root}/_gaia/core/engine/workflow.xml, then process {project-root}/_gaia/lifecycle/workflows/3-solutioning/implementation-readiness/workflow.yaml as workflow-config. Run in YOLO mode. Follow the workflow engine instructions EXACTLY."</action>
68
- <action>Present final summary:
69
- **Feature Addition Complete: {feature_description}**
70
-
71
- | Artifact | Status | Details |
72
- |----------|--------|---------|
73
- | PRD | Updated | {new FR/NFR IDs added} |
74
- | Architecture | {Updated/Skipped} | {new ADRs or "No changes needed"} |
75
- | Test Plan | {Updated/Skipped/Not found} | {new test case IDs or reason} |
76
- | Stories | Created | {new story keys} in {epic assignment} |
77
- | Traceability | Regenerated | {linkage verified} |
78
- | Readiness | {Passed/Skipped} | {status} |
79
-
80
- **Next steps:**
81
- - For each new story: run /gaia-create-story {story_key} to elaborate
82
- - To start development: run /gaia-sprint-plan or /gaia-correct-course
83
- </action>
84
- </step>
85
- </workflow>