@jaguilar87/gaia-ops 4.7.2 → 5.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/ARCHITECTURE.md +8 -7
  4. package/INSTALL.md +3 -3
  5. package/README.md +5 -5
  6. package/agents/cloud-troubleshooter.md +1 -1
  7. package/agents/{devops-developer.md → developer.md} +9 -2
  8. package/agents/gaia-operator.md +60 -0
  9. package/agents/gaia-orchestrator.md +113 -0
  10. package/agents/gaia-system.md +2 -1
  11. package/agents/gitops-operator.md +1 -1
  12. package/agents/speckit-planner.md +1 -1
  13. package/agents/terraform-architect.md +7 -5
  14. package/bin/README.md +1 -1
  15. package/bin/gaia-doctor.js +23 -7
  16. package/bin/gaia-scan +34 -10
  17. package/bin/gaia-skills-diagnose.js +19 -11
  18. package/bin/gaia-update.js +64 -21
  19. package/commands/speckit.add-task.md +2 -2
  20. package/commands/speckit.tasks.md +1 -1
  21. package/config/cloud/aws.json +1 -1
  22. package/config/cloud/gcp.json +1 -1
  23. package/config/context-contracts.json +13 -1
  24. package/config/surface-routing.json +253 -26
  25. package/dist/gaia-ops/.claude-plugin/plugin.json +1 -1
  26. package/dist/gaia-ops/agents/cloud-troubleshooter.md +1 -1
  27. package/dist/gaia-ops/agents/{devops-developer.md → developer.md} +9 -2
  28. package/dist/gaia-ops/agents/gaia-operator.md +60 -0
  29. package/dist/gaia-ops/agents/gaia-orchestrator.md +113 -0
  30. package/dist/gaia-ops/agents/gaia-system.md +2 -1
  31. package/dist/gaia-ops/agents/gitops-operator.md +1 -1
  32. package/dist/gaia-ops/agents/speckit-planner.md +1 -1
  33. package/dist/gaia-ops/agents/terraform-architect.md +7 -5
  34. package/dist/gaia-ops/config/cloud/aws.json +1 -1
  35. package/dist/gaia-ops/config/cloud/gcp.json +1 -1
  36. package/dist/gaia-ops/config/context-contracts.json +13 -1
  37. package/dist/gaia-ops/config/surface-routing.json +253 -26
  38. package/dist/gaia-ops/hooks/adapters/claude_code.py +135 -5
  39. package/dist/gaia-ops/hooks/modules/agents/state_tracker.py +267 -0
  40. package/dist/gaia-ops/hooks/modules/context/compact_context_builder.py +8 -5
  41. package/dist/gaia-ops/hooks/modules/context/context_writer.py +13 -1
  42. package/dist/gaia-ops/hooks/modules/context/contracts_loader.py +1 -1
  43. package/dist/gaia-ops/hooks/modules/core/plugin_setup.py +23 -5
  44. package/dist/gaia-ops/hooks/modules/orchestrator/delegate_mode.py +3 -9
  45. package/dist/gaia-ops/hooks/modules/security/approval_grants.py +161 -4
  46. package/dist/gaia-ops/hooks/modules/security/approval_scopes.py +14 -3
  47. package/dist/gaia-ops/hooks/modules/security/blocked_commands.py +18 -0
  48. package/dist/gaia-ops/hooks/modules/security/blocked_message_formatter.py +8 -7
  49. package/dist/gaia-ops/hooks/modules/security/mutative_verbs.py +12 -6
  50. package/dist/gaia-ops/hooks/modules/session/session_event_injector.py +4 -2
  51. package/dist/gaia-ops/hooks/modules/tools/bash_validator.py +135 -14
  52. package/dist/gaia-ops/hooks/modules/tools/cloud_pipe_validator.py +59 -9
  53. package/dist/gaia-ops/hooks/modules/tools/task_validator.py +13 -4
  54. package/dist/gaia-ops/hooks/subagent_stop.py +8 -1
  55. package/dist/gaia-ops/hooks/user_prompt_submit.py +12 -8
  56. package/dist/gaia-ops/skills/README.md +4 -3
  57. package/dist/gaia-ops/skills/agent-protocol/SKILL.md +31 -43
  58. package/dist/gaia-ops/skills/agent-protocol/examples.md +60 -7
  59. package/dist/gaia-ops/skills/agent-response/SKILL.md +17 -4
  60. package/dist/gaia-ops/skills/approval/SKILL.md +20 -18
  61. package/dist/gaia-ops/skills/command-execution/SKILL.md +2 -2
  62. package/dist/gaia-ops/skills/context-updater/SKILL.md +9 -3
  63. package/dist/gaia-ops/skills/context-updater/examples.md +1 -1
  64. package/dist/gaia-ops/skills/developer-patterns/SKILL.md +26 -69
  65. package/dist/gaia-ops/skills/execution/SKILL.md +16 -15
  66. package/dist/gaia-ops/skills/fast-queries/SKILL.md +16 -20
  67. package/dist/gaia-ops/skills/gaia-patterns/SKILL.md +4 -2
  68. package/dist/gaia-ops/skills/gaia-patterns/reference.md +367 -15
  69. package/dist/gaia-ops/skills/gaia-release/SKILL.md +103 -0
  70. package/dist/gaia-ops/skills/gaia-release/reference.md +102 -0
  71. package/dist/gaia-ops/skills/git-conventions/SKILL.md +3 -1
  72. package/dist/gaia-ops/skills/gitops-patterns/SKILL.md +25 -38
  73. package/dist/gaia-ops/skills/gmail-policy/SKILL.md +73 -0
  74. package/dist/gaia-ops/skills/gmail-triage/SKILL.md +80 -0
  75. package/dist/gaia-ops/skills/gws-setup/SKILL.md +99 -0
  76. package/dist/gaia-ops/skills/gws-setup/reference.md +73 -0
  77. package/dist/gaia-ops/skills/investigation/SKILL.md +30 -7
  78. package/dist/gaia-ops/skills/memory-management/SKILL.md +65 -0
  79. package/dist/gaia-ops/skills/orchestrator-approval/SKILL.md +51 -7
  80. package/dist/gaia-ops/skills/skill-creation/SKILL.md +28 -2
  81. package/dist/gaia-ops/skills/specification/SKILL.md +59 -139
  82. package/dist/gaia-ops/skills/speckit-workflow/SKILL.md +66 -112
  83. package/dist/gaia-ops/skills/speckit-workflow/reference.md +3 -3
  84. package/dist/gaia-ops/skills/terraform-patterns/SKILL.md +27 -1
  85. package/dist/gaia-ops/speckit/README.md +2 -2
  86. package/dist/gaia-ops/speckit/templates/tasks-template.md +8 -8
  87. package/dist/gaia-ops/tools/context/context_section_reader.py +13 -1
  88. package/dist/gaia-ops/tools/context/surface_router.py +3 -3
  89. package/dist/gaia-ops/tools/gaia_simulator/routing_simulator.py +1 -1
  90. package/dist/gaia-ops/tools/scan/setup.py +32 -7
  91. package/dist/gaia-ops/tools/scan/tests/test_integration.py +1 -1
  92. package/dist/gaia-ops/tools/scan/tests/test_merge.py +1 -1
  93. package/dist/gaia-ops/tools/scan/ui.py +1 -1
  94. package/dist/gaia-security/.claude-plugin/plugin.json +1 -1
  95. package/dist/gaia-security/hooks/adapters/claude_code.py +135 -5
  96. package/dist/gaia-security/hooks/modules/agents/state_tracker.py +267 -0
  97. package/dist/gaia-security/hooks/modules/context/compact_context_builder.py +8 -5
  98. package/dist/gaia-security/hooks/modules/context/context_writer.py +13 -1
  99. package/dist/gaia-security/hooks/modules/context/contracts_loader.py +1 -1
  100. package/dist/gaia-security/hooks/modules/core/plugin_setup.py +23 -5
  101. package/dist/gaia-security/hooks/modules/orchestrator/delegate_mode.py +3 -9
  102. package/dist/gaia-security/hooks/modules/security/approval_grants.py +161 -4
  103. package/dist/gaia-security/hooks/modules/security/approval_scopes.py +14 -3
  104. package/dist/gaia-security/hooks/modules/security/blocked_commands.py +18 -0
  105. package/dist/gaia-security/hooks/modules/security/blocked_message_formatter.py +8 -7
  106. package/dist/gaia-security/hooks/modules/security/mutative_verbs.py +12 -6
  107. package/dist/gaia-security/hooks/modules/session/session_event_injector.py +4 -2
  108. package/dist/gaia-security/hooks/modules/tools/bash_validator.py +135 -14
  109. package/dist/gaia-security/hooks/modules/tools/cloud_pipe_validator.py +59 -9
  110. package/dist/gaia-security/hooks/modules/tools/task_validator.py +13 -4
  111. package/dist/gaia-security/hooks/user_prompt_submit.py +12 -8
  112. package/hooks/adapters/claude_code.py +135 -5
  113. package/hooks/elicitation_result.py +1 -0
  114. package/hooks/modules/agents/state_tracker.py +267 -0
  115. package/hooks/modules/context/compact_context_builder.py +8 -5
  116. package/hooks/modules/context/context_writer.py +13 -1
  117. package/hooks/modules/context/contracts_loader.py +1 -1
  118. package/hooks/modules/core/plugin_setup.py +23 -5
  119. package/hooks/modules/orchestrator/delegate_mode.py +3 -9
  120. package/hooks/modules/security/approval_grants.py +161 -4
  121. package/hooks/modules/security/approval_scopes.py +14 -3
  122. package/hooks/modules/security/blocked_commands.py +18 -0
  123. package/hooks/modules/security/blocked_message_formatter.py +8 -7
  124. package/hooks/modules/security/mutative_verbs.py +12 -6
  125. package/hooks/modules/session/session_event_injector.py +4 -2
  126. package/hooks/modules/tools/bash_validator.py +135 -14
  127. package/hooks/modules/tools/cloud_pipe_validator.py +59 -9
  128. package/hooks/modules/tools/task_validator.py +13 -4
  129. package/hooks/subagent_stop.py +8 -1
  130. package/hooks/user_prompt_submit.py +12 -8
  131. package/package.json +1 -4
  132. package/pyproject.toml +1 -1
  133. package/skills/README.md +4 -3
  134. package/skills/agent-protocol/SKILL.md +31 -43
  135. package/skills/agent-protocol/examples.md +60 -7
  136. package/skills/agent-response/SKILL.md +17 -4
  137. package/skills/approval/SKILL.md +20 -18
  138. package/skills/command-execution/SKILL.md +2 -2
  139. package/skills/context-updater/SKILL.md +9 -3
  140. package/skills/context-updater/examples.md +1 -1
  141. package/skills/developer-patterns/SKILL.md +26 -69
  142. package/skills/execution/SKILL.md +16 -15
  143. package/skills/fast-queries/SKILL.md +16 -20
  144. package/skills/gaia-patterns/SKILL.md +4 -2
  145. package/skills/gaia-patterns/reference.md +367 -15
  146. package/skills/gaia-release/SKILL.md +103 -0
  147. package/skills/gaia-release/reference.md +102 -0
  148. package/skills/git-conventions/SKILL.md +3 -1
  149. package/skills/gitops-patterns/SKILL.md +25 -38
  150. package/skills/gmail-policy/SKILL.md +73 -0
  151. package/skills/gmail-triage/SKILL.md +80 -0
  152. package/skills/gws-setup/SKILL.md +99 -0
  153. package/skills/gws-setup/reference.md +73 -0
  154. package/skills/investigation/SKILL.md +30 -7
  155. package/skills/memory-management/SKILL.md +65 -0
  156. package/skills/orchestrator-approval/SKILL.md +51 -7
  157. package/skills/skill-creation/SKILL.md +28 -2
  158. package/skills/specification/SKILL.md +59 -139
  159. package/skills/speckit-workflow/SKILL.md +66 -112
  160. package/skills/speckit-workflow/reference.md +3 -3
  161. package/skills/terraform-patterns/SKILL.md +27 -1
  162. package/speckit/README.md +2 -2
  163. package/speckit/templates/tasks-template.md +8 -8
  164. package/templates/README.md +1 -1
  165. package/tools/context/context_section_reader.py +13 -1
  166. package/tools/context/surface_router.py +3 -3
  167. package/tools/gaia_simulator/routing_simulator.py +1 -1
  168. package/tools/scan/setup.py +32 -7
  169. package/tools/scan/tests/test_integration.py +1 -1
  170. package/tools/scan/tests/test_merge.py +1 -1
  171. package/tools/scan/ui.py +1 -1
  172. package/dist/gaia-ops/hooks/modules/context/context_cache.py +0 -129
  173. package/dist/gaia-ops/hooks/modules/identity/__init__.py +0 -0
  174. package/dist/gaia-ops/hooks/modules/identity/identity_provider.py +0 -21
  175. package/dist/gaia-ops/hooks/modules/identity/ops_identity.py +0 -34
  176. package/dist/gaia-ops/hooks/modules/identity/security_identity.py +0 -10
  177. package/dist/gaia-security/hooks/modules/context/context_cache.py +0 -129
  178. package/dist/gaia-security/hooks/modules/identity/__init__.py +0 -0
  179. package/dist/gaia-security/hooks/modules/identity/identity_provider.py +0 -21
  180. package/dist/gaia-security/hooks/modules/identity/ops_identity.py +0 -34
  181. package/dist/gaia-security/hooks/modules/identity/security_identity.py +0 -10
  182. package/hooks/modules/context/context_cache.py +0 -129
  183. package/hooks/modules/identity/__init__.py +0 -0
  184. package/hooks/modules/identity/identity_provider.py +0 -21
  185. package/hooks/modules/identity/ops_identity.py +0 -34
  186. package/hooks/modules/identity/security_identity.py +0 -10
@@ -8,7 +8,7 @@
8
8
  {
9
9
  "name": "gaia-security",
10
10
  "description": "Keeps you in the loop only when it matters. Gaia Security analyzes every command and classifies it into risk tiers: read-only queries run freely, simulations and validations pass through, and state-changing operations (create, delete, apply, push) pause for your explicit approval before executing. Irreversible commands like dropping databases or deleting cloud infrastructure are permanently blocked.",
11
- "version": "4.7.2",
11
+ "version": "5.0.0-beta.3",
12
12
  "source": "./dist/gaia-security"
13
13
  }
14
14
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaia-ops",
3
- "version": "4.7.2",
3
+ "version": "5.0.0-beta.3",
4
4
  "description": "Security-first orchestrator with specialized agents, hooks, and governance for AI coding",
5
5
  "author": {
6
6
  "name": "jaguilar87"
package/ARCHITECTURE.md CHANGED
@@ -15,7 +15,7 @@ The package is published as `@jaguilar87/gaia-ops` on npm and installed into a p
15
15
  | **Hook** | Python scripts that intercept tool calls before and after execution |
16
16
  | **Tool** | Python modules in `tools/` providing context assembly, memory, and validation |
17
17
  | **Config** | JSON files in `config/` defining contracts, rules, surface routing, and security |
18
- | **Orchestrator** | Identity injected by UserPromptSubmit hook; routes requests to the correct agent via on-demand skills |
18
+ | **Orchestrator** | Agent definition in `agents/gaia-orchestrator.md`, activated via `settings.json: { "agent": "gaia-orchestrator" }`; routes requests to the correct agent via on-demand skills |
19
19
 
20
20
  ## Runtime Flow
21
21
 
@@ -23,9 +23,9 @@ The package is published as `@jaguilar87/gaia-ops` on npm and installed into a p
23
23
  User request
24
24
  |
25
25
  v
26
- user_prompt_submit.py (UserPromptSubmit hook)
27
- | Inject orchestrator identity via ops_identity.py
28
- | Inject surface routing recommendation (deterministic)
26
+ Orchestrator (agents/gaia-orchestrator.md, activated via settings.json agent config)
27
+ | Identity defined in agent definition file
28
+ | Surface routing recommendation injected by UserPromptSubmit hook (deterministic)
29
29
  | Skills loaded on-demand: agent-response
30
30
  v
31
31
  Orchestrator dispatches to agent
@@ -120,9 +120,10 @@ Classifies user tasks into surfaces using signal matching against `config/surfac
120
120
  | `live_runtime` | cloud-troubleshooter | pods, services, logs, kubectl, gcloud |
121
121
  | `gitops_desired_state` | gitops-operator | manifests, Flux, Helm, Kustomize |
122
122
  | `terraform_iac` | terraform-architect | Terraform, Terragrunt, IAM, modules |
123
- | `app_ci_tooling` | devops-developer | CI/CD, Docker, package tooling |
123
+ | `app_ci_tooling` | developer | CI/CD, Docker, package tooling |
124
124
  | `planning_specs` | speckit-planner | specs, plans, task breakdowns |
125
125
  | `gaia_system` | gaia | hooks, skills, agents/, CLAUDE.md |
126
+ | `workspace` | gaia-operator | memory, email, schedules, file transfers |
126
127
 
127
128
  **Classification algorithm:**
128
129
  1. Normalize task text
@@ -264,7 +265,7 @@ The adapter layer connects Claude Code's hook protocol to gaia-ops business logi
264
265
  | **File (plugin channel)** | `hooks/hooks.json` -- paths use `${CLAUDE_PLUGIN_ROOT}/hooks/` prefix |
265
266
  | **File (npm channel)** | `hooks/hooks.json` (symlinked into `.claude/hooks/`) |
266
267
  | **What it does** | Maps Claude Code hook events to handler scripts. Defines which events fire which entry points, the tool matchers (Bash, Task, Agent, `*`), and permissions (allow/deny lists). |
267
- | **Events configured** | PreToolUse (Bash, Task, Agent, SendMessage), PostToolUse, SubagentStop, SessionStart, Stop, TaskCompleted, SubagentStart, UserPromptSubmit (identity injection) |
268
+ | **Events configured** | PreToolUse (Bash, Task, Agent, SendMessage), PostToolUse, SubagentStop, SessionStart, Stop, TaskCompleted, SubagentStart, UserPromptSubmit (routing injection) |
268
269
 
269
270
  ### HookAdapter ABC Contract
270
271
 
@@ -311,7 +312,7 @@ To support a CLI other than Claude Code (e.g., a hypothetical Cursor or Windsurf
311
312
 
312
313
  | File | Purpose |
313
314
  |------|---------|
314
- | `hooks/modules/identity/ops_identity.py` | Orchestrator identity (injected by UserPromptSubmit) |
315
+ | `agents/gaia-orchestrator.md` | Orchestrator identity and routing (activated via settings.json agent config) |
315
316
  | `config/surface-routing.json` | Surface routing config (agent table, signals, dispatch) |
316
317
  | `skills/agent-response/SKILL.md` | Contract status handling protocol (on-demand) |
317
318
  | `hooks/pre_tool_use.py` | PreToolUse hook entry point |
package/INSTALL.md CHANGED
@@ -276,7 +276,7 @@ When you update `@jaguilar87/gaia-ops`, these files are **regenerated from templ
276
276
  | `.claude/logs/` | ✅ **Preserved** | Safe |
277
277
  | Other `.claude/` files | ✅ **Auto-updated via symlinks** | Safe |
278
278
 
279
- Orchestrator identity is injected dynamically by the UserPromptSubmit hook -- no `CLAUDE.md` is generated.
279
+ Orchestrator identity lives in `agents/gaia-orchestrator.md` and is activated via `settings.json: { "agent": "gaia-orchestrator" }` -- no `CLAUDE.md` is generated.
280
280
 
281
281
  ### Update Process
282
282
 
@@ -431,7 +431,7 @@ A: `npm update @jaguilar87/gaia-ops` - symlinks point to the new version automat
431
431
 
432
432
  ---
433
433
 
434
- **Version:** 4.4.0-rc.5
435
- **Last updated:** 2026-03-19
434
+ **Version:** 4.7.2
435
+ **Last updated:** 2026-04-09
436
436
  **Maintained by:** Jorge Aguilar + Gaia (meta-agent)
437
437
 
package/README.md CHANGED
@@ -15,9 +15,9 @@ Multi-agent DevOps system that classifies every operation by risk, routes work t
15
15
  ### Features
16
16
 
17
17
  - **Multi-cloud support** - GCP, AWS, Azure
18
- - **6 agents** - terraform-architect, gitops-operator, cloud-troubleshooter, devops-developer, speckit-planner, gaia-system (meta-agent)
18
+ - **8 agents** - terraform-architect, gitops-operator, cloud-troubleshooter, developer, speckit-planner, gaia-operator, gaia-orchestrator, gaia-system (meta-agent)
19
19
  - **Contracts as SSOT** - Cloud-agnostic base contracts with per-cloud extensions (GCP, AWS)
20
- - **Dynamic identity** - Orchestrator identity injected by UserPromptSubmit hook; skills loaded on-demand
20
+ - **Dynamic identity** - Orchestrator identity defined in `agents/gaia-orchestrator.md`, activated via `settings.json` agent config; skills loaded on-demand
21
21
  - **Dual-barrier security** - Settings deny rules (Claude Code native) + hook-level blocking (inalterable via symlink)
22
22
  - **Indirect execution detection** - Catches `bash -c`, `eval`, `python -c` wrappers that bypass regex patterns
23
23
  - **Approval gates** for T3 operations via native `ask` dialog
@@ -64,7 +64,7 @@ This will:
64
64
  4. Create `settings.json` with hooks only (no permissions in settings.json)
65
65
  5. Merge deny rules + allow permissions into `settings.local.json` (preserves existing user config)
66
66
 
67
- No `CLAUDE.md` is generated -- orchestrator identity is injected dynamically by the UserPromptSubmit hook.
67
+ No `CLAUDE.md` is generated -- orchestrator identity lives in `agents/gaia-orchestrator.md` and is activated via `settings.json: { "agent": "gaia-orchestrator" }`.
68
68
 
69
69
  ### Settings Architecture
70
70
 
@@ -105,7 +105,7 @@ Once installed, the agent system is ready:
105
105
  claude
106
106
  ```
107
107
 
108
- The orchestrator identity is injected dynamically by the UserPromptSubmit hook. Skills are loaded on-demand.
108
+ The orchestrator identity is defined in `agents/gaia-orchestrator.md` and activated via `settings.json` agent config. Skills are loaded on-demand.
109
109
 
110
110
  Skills and injection diagnosis:
111
111
 
@@ -136,7 +136,7 @@ For organization-wide enforcement, deploy `templates/managed-settings.template.j
136
136
 
137
137
  ```
138
138
  node_modules/@jaguilar87/gaia-ops/
139
- ├── agents/ # Agent definitions (6 agents)
139
+ ├── agents/ # Agent definitions (8 agents)
140
140
  ├── skills/ # Skill modules (21 skills)
141
141
  ├── tools/ # Orchestration tools
142
142
  ├── hooks/ # Claude Code hooks (modular architecture)
@@ -57,7 +57,7 @@ If unclear, ask before proceeding.
57
57
  |------|-------|
58
58
  | Fix infrastructure drift | `terraform-architect` |
59
59
  | Fix Kubernetes manifests | `gitops-operator` |
60
- | Application code changes | `devops-developer` |
60
+ | Application code changes | `developer` |
61
61
  | gaia-ops modifications | `gaia` |
62
62
 
63
63
  **This agent never modifies files, never executes writes, never invokes other agents directly.**
@@ -1,6 +1,6 @@
1
1
  ---
2
- name: devops-developer
3
- description: Full-stack DevOps specialist unifying application code, infrastructure, and developer tooling across Node.js/TypeScript and Python ecosystems.
2
+ name: developer
3
+ description: Full-stack software engineer for application code, CI/CD, and developer tooling across Node.js/TypeScript and Python stacks.
4
4
  tools: Read, Edit, Write, Agent, Glob, Grep, Bash, Task, Skill, WebSearch, WebFetch
5
5
  model: inherit
6
6
  maxTurns: 50
@@ -46,6 +46,13 @@ You are a full-stack software engineer. You build, debug, and improve applicatio
46
46
  | Live cloud diagnostics | `cloud-troubleshooter` |
47
47
  | gaia-ops modifications | `gaia` |
48
48
 
49
+ During investigation, if you discover that a resource type is managed
50
+ by Terraform, Terragrunt, Helm, Flux, or any other IaC/GitOps tool,
51
+ creating new instances of that resource belongs to the agent that owns
52
+ that tool — even if you need the resource as a prerequisite for your
53
+ task. Report it as a dependency or blocker. The fastest path for you
54
+ is the wrong path for the project if it causes drift.
55
+
49
56
  ## Domain Errors
50
57
 
51
58
  | Error | Action |
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: gaia-operator
3
+ description: Workspace operator — extensible agent for personal workspace tasks, memory management, and integrations
4
+ tools: Read, Edit, Write, Glob, Grep, Bash, Task, Skill, WebSearch, WebFetch
5
+ model: sonnet
6
+ skills:
7
+ - agent-protocol
8
+ - security-tiers
9
+ - command-execution
10
+ - context-updater
11
+ - memory-management
12
+ - gmail-triage
13
+ - gws-setup
14
+ ---
15
+
16
+ # Workspace Operator
17
+
18
+ ## Identity
19
+
20
+ You are the workspace operator — an extensible agent that specializes in personal workspace
21
+ tasks. You manage the user's persistent memory, workspace organization, and tool integrations.
22
+ Your capabilities grow through on-demand skills — each new integration is a skill, not a
23
+ code change.
24
+
25
+ ## Core Capabilities
26
+
27
+ - **Memory management** — MEMORY.md index, memory files, cross-session knowledge persistence
28
+ - **Web research** — search and summarize information for the user
29
+ - **Workspace file operations** — organize, transfer, manage files across the workspace
30
+
31
+ Future capabilities arrive as on-demand skills (email, calendar, scheduling, etc.).
32
+ Load them with `Skill('skill-name')` when the task requires it.
33
+
34
+ ## Scope
35
+
36
+ ### CAN DO
37
+
38
+ | Task | How |
39
+ |------|-----|
40
+ | Create/update/search memory files | Read/Write + memory-management skill |
41
+ | Web research and summarization | WebSearch + WebFetch |
42
+ | File organization and management | Bash + Read/Write |
43
+ | Load integration skills on-demand | Skill('gmail-policy'), Skill('calendar'), etc. |
44
+
45
+ ### CANNOT DO → DELEGATE
46
+
47
+ | Task | Agent |
48
+ |------|-------|
49
+ | Application code, CI/CD, Docker | developer |
50
+ | Terraform, cloud resources, IaC | terraform-architect |
51
+ | Kubernetes manifests, Helm, Flux | gitops-operator |
52
+ | Live infrastructure diagnostics | cloud-troubleshooter |
53
+ | Gaia system changes (hooks, skills, agents) | gaia-system |
54
+ | Feature planning and specs | speckit-planner |
55
+
56
+ ## Domain Errors
57
+
58
+ - **Memory index conflict** — MEMORY.md does not match actual files → reconcile index before proceeding
59
+ - **Skill not found** — requested integration skill does not exist → report to orchestrator, suggest creation via gaia-system
60
+ - **File permission denied** — cannot access target path → verify path and permissions, report exact error
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: gaia-orchestrator
3
+ description: Gaia governance orchestrator — routes requests to specialist agents, enforces security tiers, presents results
4
+ tools: Agent, SendMessage, AskUserQuestion, Skill, TaskCreate, TaskUpdate, TaskList, TaskGet, CronCreate, CronDelete, CronList, WebSearch, WebFetch, ToolSearch
5
+ disallowedTools: [Read, Glob, Grep, Bash, Edit, Write, NotebookEdit, EnterPlanMode, ExitPlanMode, EnterWorktree, ExitWorktree]
6
+ model: inherit
7
+ maxTurns: 200
8
+ skills:
9
+ ---
10
+
11
+ # Gaia Orchestrator
12
+
13
+ The user installed Gaia, a governance layer for Claude Code agents.
14
+ Your role: analyze requests, decompose them into specialist tasks,
15
+ dispatch agents with focused objectives, and consolidate their results.
16
+
17
+ ## Why delegation matters
18
+
19
+ - Agents are injected with domain skills and security policies at spawn time
20
+ - Each agent has its own context window optimized for its domain
21
+ - Agents return structured json:contract responses (atomic, preserves your context)
22
+ - Direct tool use bypasses the governance pipeline (no audit trail, no security tiers)
23
+ - Built-in subagent types (Explore, Plan) return raw text that inflates your context
24
+
25
+ ## Capabilities
26
+
27
+ - Route user requests to specialist agents using deterministic signal matching
28
+ - Enforce security tiers and approval workflows for T3 operations
29
+ - Present structured agent responses and manage approval cycles
30
+ - Track work progress across multi-agent tasks
31
+
32
+ ## Your tools (ONLY these exist)
33
+
34
+ - **Agent** -- dispatch specialist agents (each has injected skills and tool restrictions)
35
+ - **SendMessage** -- resume a running agent by name or ID
36
+ - **AskUserQuestion** -- clarify with user, or present approval requests
37
+ - **Skill** -- load on-demand procedures (agent-response, orchestrator-approval)
38
+ - **TaskCreate/Update/List/Get** -- track work progress
39
+ - **WebSearch/WebFetch** -- web research (allowed, no delegation needed)
40
+ - **ToolSearch** -- discover deferred tool schemas
41
+
42
+ You do NOT have: Read, Glob, Grep, Bash, Edit, Write.
43
+ These tools do not exist in your session. Do not attempt to use them.
44
+
45
+ ## Routing
46
+
47
+ Each message may include a routing suggestion from signal matching.
48
+ Use it as input, not as a directive. Match the user's request against
49
+ these surface intents. Dispatch ALL agents whose intent matches.
50
+ If 2+ match, dispatch in parallel.
51
+
52
+ | Surface | Agent | Intent |
53
+ |---------|-------|--------|
54
+ | live_runtime | cloud-troubleshooter | Inspect, diagnose, or validate actual state of running systems — pods, logs, cloud resources, SSH, network |
55
+ | terraform_iac | terraform-architect | Create, modify, review, or validate IaC — Terraform, Terragrunt, cloud resources, state, plan/apply |
56
+ | gitops_desired_state | gitops-operator | Create, modify, or review Kubernetes desired state — Flux, Helm, Kustomize, manifests |
57
+ | app_ci_tooling | developer | Write, modify, test, or build app code — Node/TS, Python, Docker, CI/CD, packages |
58
+ | planning_specs | speckit-planner | Plan features, break down requirements, create specs, plans, task lists |
59
+ | gaia_system | gaia-system | Modify or analyze Gaia itself — hooks, skills, agents, routing, security, architecture |
60
+ | workspace | gaia-operator | Personal workspace — memory, schedules, loops, email, file transfers, general automation |
61
+
62
+ If no intent matches clearly — ask the user to clarify.
63
+ Do not default to built-in agents (Explore, Plan) for tasks that match a surface intent.
64
+
65
+ ## Dispatch strategy
66
+
67
+ When dispatching, ask yourself:
68
+ 1. What domains does this request touch? (match against intents above)
69
+ 2. What specific question does each specialist need to answer?
70
+ 3. Can they work in parallel, or does one depend on another?
71
+
72
+ Each agent gets a DIFFERENT prompt focused on their domain.
73
+ Do not send the same user message to multiple agents — decompose it.
74
+
75
+ ## Briefing agents
76
+
77
+ Dispatch objectives, not commands. Agents have domain skills,
78
+ injected project-context, and investigation procedures.
79
+ They choose their own execution path.
80
+
81
+ Your prompt = the objective + business requirements.
82
+ Never include:
83
+ - File names, paths, or directory structures to create
84
+ - Resource names, values, or configuration details
85
+ - Shell commands or implementation steps
86
+ - "What to create" or "How to implement" sections
87
+
88
+ Agents receive project-context with paths, names, and topology.
89
+ They investigate existing patterns before proposing anything.
90
+ Trust the agent's domain expertise — your job is WHAT to achieve
91
+ and WHY, never HOW.
92
+
93
+ ## Response handling
94
+
95
+ When an agent returns a json:contract, load Skill('agent-response').
96
+ When an agent returns REVIEW with approval_id, load Skill('orchestrator-approval').
97
+
98
+ ## Memory Protocol
99
+
100
+ Claude Code handles auto-save and auto-prune natively.
101
+ Gaia complements with structured curation via gaia-operator:
102
+
103
+ - After productive sessions with decisions → dispatch gaia-operator
104
+ - Operator loads memory-management skill → curates, categorizes, deduplicates
105
+ - Does NOT replace Claude Code's native memory — organizes it
106
+
107
+ Memory tasks route to workspace surface → gaia-operator.
108
+
109
+ ## Failures
110
+
111
+ - Hook blocks a command -- relay the message verbatim, do not suggest alternatives
112
+ - Routing unclear -- ask the user
113
+ - Agents contradict -- present both sides, user decides
@@ -11,6 +11,7 @@ skills:
11
11
  - investigation
12
12
  - command-execution
13
13
  - gaia-patterns
14
+ - gaia-release
14
15
  - skill-creation
15
16
  ---
16
17
 
@@ -47,7 +48,7 @@ You are the **meta-agent** — the agent that understands agents. Your specialty
47
48
  | Terraform / cloud infrastructure | `terraform-architect` |
48
49
  | Kubernetes / GitOps | `gitops-operator` |
49
50
  | Live cloud diagnostics | `cloud-troubleshooter` |
50
- | Application code | `devops-developer` |
51
+ | Application code | `developer` |
51
52
 
52
53
  ## Domain Errors
53
54
 
@@ -46,7 +46,7 @@ You are a senior GitOps operator. You manage the entire lifecycle of Kubernetes
46
46
  |------|-------|
47
47
  | Terraform / cloud infrastructure | `terraform-architect` |
48
48
  | Query live cloud state (`gcloud`, `aws`) | `cloud-troubleshooter` |
49
- | Application code (Python, Node.js) | `devops-developer` |
49
+ | Application code (Python, Node.js) | `developer` |
50
50
  | gaia-ops modifications | `gaia` |
51
51
 
52
52
  ## Domain Errors
@@ -58,7 +58,7 @@ If `speckit_root` resolves to a directory that does not exist, create it (T3 --
58
58
  | Execute tasks from tasks.md | Orchestrator (routes to agents) |
59
59
  | Execute infrastructure changes | `terraform-architect` |
60
60
  | Execute Kubernetes operations | `gitops-operator` |
61
- | Run application builds or tests | `devops-developer` |
61
+ | Run application builds or tests | `developer` |
62
62
  | Diagnose cloud issues | `cloud-troubleshooter` |
63
63
 
64
64
  ## Domain Errors
@@ -17,10 +17,12 @@ skills:
17
17
 
18
18
  ## Workflow
19
19
 
20
- 1. **Triage first**: When checking infrastructure state, run the fast-queries Terraform or cloud triage script before running plan/apply.
21
- 2. **Deep analysis**: When investigating drift or complex module dependencies, follow the investigation phases.
22
- 3. **Before T3 operations**: When `terragrunt apply` is needed, present a REVIEW plan first. If a hook blocks it, include the `approval_id` from the deny response in your REVIEW approval_request.
23
- 4. **Update context**: Before completing, if you discovered infrastructure topology, service accounts, or network configs not in Project Context, emit a CONTEXT_UPDATE block.
20
+ 1. **Understand what exists**: Follow the investigation phases — read existing modules, discover naming patterns, find the project's Terraform organization before proposing anything.
21
+ 2. **Check current state**: When drift is suspected or runtime data is needed, run the fast-queries Terraform or cloud triage script.
22
+ 3. **Propose with evidence**: Build a plan grounded in what you found which existing module you followed, which patterns you matched, what the plan output shows.
23
+ 4. **Present for review**: When `terragrunt apply` or other T3 operations are needed, present a REVIEW plan first. If a hook blocks it, include the `approval_id` from the deny response in your REVIEW approval_request.
24
+ 5. **Execute and verify**: After approval (T3) or after investigation confirms patterns (T0-T2), create/modify files and run verification.
25
+ 6. **Update context**: Before completing, if you discovered infrastructure topology, service accounts, or network configs not in Project Context, emit a CONTEXT_UPDATE block.
24
26
 
25
27
  ## Identity
26
28
 
@@ -46,7 +48,7 @@ You are a senior Terraform architect. You manage the entire lifecycle of cloud i
46
48
  |------|-------|
47
49
  | Query live cloud state (`gcloud`, `aws`) | `cloud-troubleshooter` |
48
50
  | Kubernetes / Flux manifests | `gitops-operator` |
49
- | Application code (Python, Node.js) | `devops-developer` |
51
+ | Application code (Python, Node.js) | `developer` |
50
52
  | gaia-ops modifications | `gaia` |
51
53
 
52
54
  ## Domain Errors
package/bin/README.md CHANGED
@@ -146,4 +146,4 @@ npx gaia-scan --non-interactive
146
146
 
147
147
  ---
148
148
 
149
- **Version:** 4.5.0 | **Updated:** 2026-03-24 | **Scripts:** 11
149
+ **Version:** 4.7.2 | **Updated:** 2026-04-09 | **Scripts:** 11
@@ -93,17 +93,27 @@ async function checkSettingsJson() {
93
93
  const data = JSON.parse(await fs.readFile(path, 'utf-8'));
94
94
  const issues = [];
95
95
 
96
- // Check hooks are configured
97
- if (!data.hooks) {
98
- issues.push('No hooks configured');
96
+ // Check hooks are configured — hooks may live in settings.json OR
97
+ // settings.local.json (gaia-update/gaia-scan puts them in local).
98
+ let hooksConfig = data.hooks || null;
99
+ const localPath = join(CWD, '.claude', 'settings.local.json');
100
+ if (!hooksConfig && existsSync(localPath)) {
101
+ try {
102
+ const localData = JSON.parse(await fs.readFile(localPath, 'utf-8'));
103
+ if (localData.hooks) hooksConfig = localData.hooks;
104
+ } catch { /* ignore parse errors */ }
105
+ }
106
+
107
+ if (!hooksConfig) {
108
+ issues.push('No hooks configured (check settings.json and settings.local.json)');
99
109
  } else {
100
- const hookTypes = Object.keys(data.hooks);
110
+ const hookTypes = Object.keys(hooksConfig);
101
111
  if (!hookTypes.includes('PreToolUse')) issues.push('Missing PreToolUse hook');
102
112
  if (!hookTypes.includes('PostToolUse')) issues.push('Missing PostToolUse hook');
103
113
  }
104
114
 
105
115
  // Check permissions — now live in settings.local.json (not settings.json)
106
- const localPath = join(CWD, '.claude', 'settings.local.json');
116
+ // localPath already declared above for hooks check
107
117
  let permCount = 0;
108
118
  if (existsSync(localPath)) {
109
119
  try {
@@ -125,7 +135,7 @@ async function checkSettingsJson() {
125
135
  return { name: 'settings.json', ok: false, detail: issues.join('; '), fix: 'Run gaia-scan or npx gaia-update' };
126
136
  }
127
137
 
128
- const hookCount = data.hooks ? Object.keys(data.hooks).length : 0;
138
+ const hookCount = hooksConfig ? Object.keys(hooksConfig).length : 0;
129
139
  return { name: 'settings.json', ok: true, detail: `${hookCount} hook types, ${permCount} rules` };
130
140
  } catch {
131
141
  return { name: 'settings.json', ok: false, detail: 'Invalid JSON', fix: 'Delete and run gaia-scan' };
@@ -331,12 +341,18 @@ async function autoFix() {
331
341
  if (existsSync(packagePath)) {
332
342
  const relPath = relative(claudeDir, packagePath);
333
343
  const names = ['agents', 'tools', 'hooks', 'commands', 'templates', 'config', 'speckit', 'skills'];
344
+ // Use junctions on Windows (no admin required), regular symlinks elsewhere
345
+ const linkType = process.platform === 'win32' ? 'junction' : 'dir';
334
346
 
335
347
  for (const name of names) {
336
348
  const link = join(claudeDir, name);
337
349
  if (!existsSync(link)) {
338
350
  try {
339
- await fs.symlink(join(relPath, name), link);
351
+ // Junctions on Windows require absolute targets; symlinks on Unix use relative
352
+ const target = process.platform === 'win32'
353
+ ? join(packagePath, name)
354
+ : join(relPath, name);
355
+ await fs.symlink(target, link, linkType);
340
356
  console.log(chalk.green(` Fixed: .claude/${name} symlink`));
341
357
  fixed++;
342
358
  } catch {
package/bin/gaia-scan CHANGED
@@ -1,14 +1,38 @@
1
- #!/usr/bin/env bash
2
- # Shell wrapper for gaia-scan CLI.
3
- # Invokes the Python scanner with all forwarded arguments.
4
- # Used as the npm bin entry point for `npx gaia-scan` / `npx gaia scan`.
1
+ #!/usr/bin/env node
5
2
 
6
- set -euo pipefail
3
+ /**
4
+ * Cross-platform wrapper for gaia-scan CLI.
5
+ * Invokes the Python scanner with all forwarded arguments.
6
+ * Used as the npm bin entry point for `npx gaia-scan`.
7
+ *
8
+ * Replaces the previous bash wrapper so that it works on Windows
9
+ * (where /usr/bin/env bash does not exist).
10
+ */
7
11
 
8
- SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "$0" 2>/dev/null || realpath "$0" 2>/dev/null || echo "$0")")" && pwd)"
9
- PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
12
+ import { execFileSync } from 'child_process';
13
+ import { fileURLToPath } from 'url';
14
+ import { dirname, join } from 'path';
10
15
 
11
- # Ensure PYTHONPATH includes the plugin root so `tools.scan` resolves
12
- export PYTHONPATH="${PLUGIN_ROOT}${PYTHONPATH:+:${PYTHONPATH}}"
16
+ const __filename = fileURLToPath(import.meta.url);
17
+ const __dirname = dirname(__filename);
18
+ const pluginRoot = join(__dirname, '..');
19
+ const scanScript = join(__dirname, 'gaia-scan.py');
13
20
 
14
- exec python3 "${SCRIPT_DIR}/gaia-scan.py" "$@"
21
+ // Forward all CLI arguments after the script name
22
+ const args = process.argv.slice(2);
23
+
24
+ // Set PYTHONPATH so `tools.scan` resolves inside the package
25
+ const sep = process.platform === 'win32' ? ';' : ':';
26
+ const pythonPath = process.env.PYTHONPATH
27
+ ? `${pluginRoot}${sep}${process.env.PYTHONPATH}`
28
+ : pluginRoot;
29
+
30
+ try {
31
+ execFileSync('python3', [scanScript, ...args], {
32
+ stdio: 'inherit',
33
+ env: { ...process.env, PYTHONPATH: pythonPath },
34
+ });
35
+ } catch (error) {
36
+ // execFileSync throws on non-zero exit; propagate the exit code
37
+ process.exit(error.status || 1);
38
+ }
@@ -28,12 +28,13 @@ const __filename = fileURLToPath(import.meta.url);
28
28
  const __dirname = path.dirname(__filename);
29
29
  const PACKAGE_ROOT = path.resolve(__dirname, "..");
30
30
 
31
- const META_AGENTS = new Set(["gaia-system", "Explore", "Plan"]);
31
+ const META_AGENTS = new Set(["gaia-system", "gaia-orchestrator", "Explore", "Plan", "general-purpose", "claude-code-guide"]);
32
32
  const CONTEXT_INJECTED_AGENTS = new Set([
33
+ "gaia-operator",
33
34
  "terraform-architect",
34
35
  "gitops-operator",
35
36
  "cloud-troubleshooter",
36
- "devops-developer",
37
+ "developer",
37
38
  ]);
38
39
  const REQUIRED_PROJECT_SKILLS = ["agent-protocol", "context-updater"];
39
40
 
@@ -180,7 +181,9 @@ function resolveRuntimePaths(projectRoot) {
180
181
  hooksDir: inProject && exists(path.join(claudeDir, "hooks"))
181
182
  ? path.join(claudeDir, "hooks")
182
183
  : path.join(PACKAGE_ROOT, "hooks"),
183
- settingsPath: path.join(claudeDir, "settings.json"),
184
+ settingsPath: exists(path.join(claudeDir, "settings.json"))
185
+ ? path.join(claudeDir, "settings.json")
186
+ : path.join(claudeDir, "settings.local.json"),
184
187
  testsDir: path.join(PACKAGE_ROOT, "tests"),
185
188
  };
186
189
 
@@ -477,12 +480,12 @@ function validateInjectionWiring(ctx, findings, checks) {
477
480
  } else {
478
481
  const content = readText(preToolUsePath);
479
482
 
480
- if (!content.includes("def _inject_project_context")) {
483
+ if (!content.includes("build_project_context")) {
481
484
  addFinding(findings, {
482
485
  severity: "high",
483
486
  code: "CONTEXT_INJECTION_FUNCTION_MISSING",
484
487
  title: "Context injection function missing",
485
- detail: "_inject_project_context() not found in pre_tool_use.py.",
488
+ detail: "build_project_context() not found in pre_tool_use.py.",
486
489
  evidence: preToolUsePath,
487
490
  remediation: "Reintroduce or repair context injection handler.",
488
491
  });
@@ -607,7 +610,12 @@ function validateRoutingContract(ctx, findings, checks) {
607
610
  }
608
611
 
609
612
  const content = readText(validatorPath);
610
- const match = content.match(/AVAILABLE_AGENTS\s*=\s*\[(.*?)\]/s);
613
+ // Try AVAILABLE_AGENTS first, then fall back to _BASE_AGENTS (used when
614
+ // AVAILABLE_AGENTS is derived via list comprehension)
615
+ let match = content.match(/AVAILABLE_AGENTS\s*=\s*\[(.*?)\]/s);
616
+ if (!match) {
617
+ match = content.match(/_BASE_AGENTS\s*=\s*\[(.*?)\]/s);
618
+ }
611
619
  if (!match) {
612
620
  addFinding(findings, {
613
621
  severity: "medium",
@@ -615,7 +623,7 @@ function validateRoutingContract(ctx, findings, checks) {
615
623
  title: "Could not parse AVAILABLE_AGENTS",
616
624
  detail: "Routing contract check skipped.",
617
625
  evidence: validatorPath,
618
- remediation: "Keep AVAILABLE_AGENTS as a simple static list for validation tooling.",
626
+ remediation: "Keep AVAILABLE_AGENTS or _BASE_AGENTS as a simple static list for validation tooling.",
619
627
  });
620
628
  checks.push({ name: "routing-contract", ok: false, detail: "could not parse AVAILABLE_AGENTS" });
621
629
  return;
@@ -626,7 +634,7 @@ function validateRoutingContract(ctx, findings, checks) {
626
634
  );
627
635
 
628
636
  const missingOnDisk = [...availableAgents].filter((agent) => !META_AGENTS.has(agent) && !agentsOnDisk.has(agent));
629
- const missingInValidator = [...agentsOnDisk].filter((agent) => !availableAgents.has(agent));
637
+ const missingInValidator = [...agentsOnDisk].filter((agent) => !META_AGENTS.has(agent) && !availableAgents.has(agent));
630
638
 
631
639
  if (missingOnDisk.length > 0) {
632
640
  addFinding(findings, {
@@ -690,8 +698,8 @@ function detectLegacyGapPatterns(ctx, findings, checks) {
690
698
  const conftestPath = path.join(testsDir, "conftest.py");
691
699
  if (exists(conftestPath)) {
692
700
  const content = readText(conftestPath);
693
- // CLAUDE.md is no longer generated -- identity injected by UserPromptSubmit hook.
694
- // conftest.py fixture now falls back to ops_identity.py + dispatch/response skills.
701
+ // CLAUDE.md is no longer generated -- identity lives in agents/gaia-orchestrator.md.
702
+ // conftest.py fixture reads agents/gaia-orchestrator.md directly.
695
703
  }
696
704
 
697
705
  checks.push({
@@ -756,7 +764,7 @@ function runTestProbe(ctx, findings, checks) {
756
764
  });
757
765
  }
758
766
 
759
- // CLAUDE.md is no longer required -- conftest.py falls back to ops_identity.py
767
+ // CLAUDE.md is no longer required -- conftest.py reads agents/gaia-orchestrator.md
760
768
  }
761
769
 
762
770
  checks.push({