@jaguilar87/gaia 5.0.0-rc.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 (621) hide show
  1. package/.claude-plugin/marketplace.json +33 -0
  2. package/.claude-plugin/plugin.json +26 -0
  3. package/ARCHITECTURE.md +335 -0
  4. package/CHANGELOG.md +1298 -0
  5. package/CODE_OF_CONDUCT.md +11 -0
  6. package/CONTRIBUTING.md +146 -0
  7. package/INSTALL.md +436 -0
  8. package/LICENSE +21 -0
  9. package/README.md +222 -0
  10. package/SECURITY.md +47 -0
  11. package/agents/README.md +78 -0
  12. package/agents/cloud-troubleshooter.md +73 -0
  13. package/agents/developer.md +65 -0
  14. package/agents/gaia-operator.md +64 -0
  15. package/agents/gaia-orchestrator.md +111 -0
  16. package/agents/gaia-planner.md +53 -0
  17. package/agents/gaia-system.md +71 -0
  18. package/agents/gitops-operator.md +61 -0
  19. package/agents/terraform-architect.md +63 -0
  20. package/bin/README.md +106 -0
  21. package/bin/cli/__init__.py +1 -0
  22. package/bin/cli/approvals.py +740 -0
  23. package/bin/cli/cleanup.py +562 -0
  24. package/bin/cli/context.py +283 -0
  25. package/bin/cli/doctor.py +651 -0
  26. package/bin/cli/history.py +305 -0
  27. package/bin/cli/memory.py +483 -0
  28. package/bin/cli/metrics.py +1068 -0
  29. package/bin/cli/plans.py +515 -0
  30. package/bin/cli/status.py +302 -0
  31. package/bin/cli/update.py +382 -0
  32. package/bin/gaia +112 -0
  33. package/bin/gaia-cleanup.js +531 -0
  34. package/bin/gaia-doctor.js +635 -0
  35. package/bin/gaia-evidence +126 -0
  36. package/bin/gaia-history.js +251 -0
  37. package/bin/gaia-metrics.js +1278 -0
  38. package/bin/gaia-review.js +269 -0
  39. package/bin/gaia-scan +44 -0
  40. package/bin/gaia-scan.py +589 -0
  41. package/bin/gaia-skills-diagnose.js +929 -0
  42. package/bin/gaia-status.js +278 -0
  43. package/bin/gaia-uninstall.js +111 -0
  44. package/bin/gaia-update.js +919 -0
  45. package/bin/pre-publish-validate.js +610 -0
  46. package/bin/python-detect.js +60 -0
  47. package/bin/validate-sandbox.sh +601 -0
  48. package/commands/README.md +64 -0
  49. package/commands/gaia.md +37 -0
  50. package/commands/scan-project.md +67 -0
  51. package/config/README.md +71 -0
  52. package/config/cloud/aws.json +134 -0
  53. package/config/cloud/gcp.json +139 -0
  54. package/config/context-contracts.json +158 -0
  55. package/config/crons-schema.md +81 -0
  56. package/config/git_standards.json +72 -0
  57. package/config/surface-routing.json +417 -0
  58. package/config/universal-rules.json +102 -0
  59. package/dist/gaia-ops/.claude-plugin/plugin.json +24 -0
  60. package/dist/gaia-ops/README.md +80 -0
  61. package/dist/gaia-ops/agents/cloud-troubleshooter.md +73 -0
  62. package/dist/gaia-ops/agents/developer.md +65 -0
  63. package/dist/gaia-ops/agents/gaia-operator.md +64 -0
  64. package/dist/gaia-ops/agents/gaia-orchestrator.md +111 -0
  65. package/dist/gaia-ops/agents/gaia-planner.md +53 -0
  66. package/dist/gaia-ops/agents/gaia-system.md +71 -0
  67. package/dist/gaia-ops/agents/gitops-operator.md +61 -0
  68. package/dist/gaia-ops/agents/terraform-architect.md +63 -0
  69. package/dist/gaia-ops/commands/gaia.md +37 -0
  70. package/dist/gaia-ops/config/README.md +71 -0
  71. package/dist/gaia-ops/config/cloud/aws.json +134 -0
  72. package/dist/gaia-ops/config/cloud/gcp.json +139 -0
  73. package/dist/gaia-ops/config/context-contracts.json +158 -0
  74. package/dist/gaia-ops/config/crons-schema.md +81 -0
  75. package/dist/gaia-ops/config/git_standards.json +72 -0
  76. package/dist/gaia-ops/config/surface-routing.json +417 -0
  77. package/dist/gaia-ops/config/universal-rules.json +102 -0
  78. package/dist/gaia-ops/hooks/adapters/__init__.py +52 -0
  79. package/dist/gaia-ops/hooks/adapters/base.py +219 -0
  80. package/dist/gaia-ops/hooks/adapters/channel.py +17 -0
  81. package/dist/gaia-ops/hooks/adapters/claude_code.py +1890 -0
  82. package/dist/gaia-ops/hooks/adapters/types.py +194 -0
  83. package/dist/gaia-ops/hooks/adapters/utils.py +25 -0
  84. package/dist/gaia-ops/hooks/hooks.json +192 -0
  85. package/dist/gaia-ops/hooks/modules/__init__.py +15 -0
  86. package/dist/gaia-ops/hooks/modules/agents/__init__.py +29 -0
  87. package/dist/gaia-ops/hooks/modules/agents/contract_validator.py +647 -0
  88. package/dist/gaia-ops/hooks/modules/agents/response_contract.py +496 -0
  89. package/dist/gaia-ops/hooks/modules/agents/skill_injection_verifier.py +120 -0
  90. package/dist/gaia-ops/hooks/modules/agents/state_tracker.py +267 -0
  91. package/dist/gaia-ops/hooks/modules/agents/task_info_builder.py +74 -0
  92. package/dist/gaia-ops/hooks/modules/agents/transcript_analyzer.py +458 -0
  93. package/dist/gaia-ops/hooks/modules/agents/transcript_reader.py +152 -0
  94. package/dist/gaia-ops/hooks/modules/audit/__init__.py +28 -0
  95. package/dist/gaia-ops/hooks/modules/audit/event_detector.py +168 -0
  96. package/dist/gaia-ops/hooks/modules/audit/logger.py +131 -0
  97. package/dist/gaia-ops/hooks/modules/audit/metrics.py +134 -0
  98. package/dist/gaia-ops/hooks/modules/audit/workflow_auditor.py +611 -0
  99. package/dist/gaia-ops/hooks/modules/audit/workflow_recorder.py +296 -0
  100. package/dist/gaia-ops/hooks/modules/context/__init__.py +11 -0
  101. package/dist/gaia-ops/hooks/modules/context/agentic_loop_detector.py +165 -0
  102. package/dist/gaia-ops/hooks/modules/context/anchor_tracker.py +317 -0
  103. package/dist/gaia-ops/hooks/modules/context/compact_context_builder.py +218 -0
  104. package/dist/gaia-ops/hooks/modules/context/context_freshness.py +145 -0
  105. package/dist/gaia-ops/hooks/modules/context/context_injector.py +558 -0
  106. package/dist/gaia-ops/hooks/modules/context/context_writer.py +530 -0
  107. package/dist/gaia-ops/hooks/modules/context/contracts_loader.py +161 -0
  108. package/dist/gaia-ops/hooks/modules/core/__init__.py +40 -0
  109. package/dist/gaia-ops/hooks/modules/core/hook_entry.py +78 -0
  110. package/dist/gaia-ops/hooks/modules/core/paths.py +160 -0
  111. package/dist/gaia-ops/hooks/modules/core/plugin_mode.py +149 -0
  112. package/dist/gaia-ops/hooks/modules/core/plugin_setup.py +577 -0
  113. package/dist/gaia-ops/hooks/modules/core/state.py +179 -0
  114. package/dist/gaia-ops/hooks/modules/core/stdin.py +24 -0
  115. package/dist/gaia-ops/hooks/modules/events/__init__.py +1 -0
  116. package/dist/gaia-ops/hooks/modules/events/event_writer.py +210 -0
  117. package/dist/gaia-ops/hooks/modules/memory/__init__.py +8 -0
  118. package/dist/gaia-ops/hooks/modules/memory/episode_writer.py +216 -0
  119. package/dist/gaia-ops/hooks/modules/orchestrator/__init__.py +1 -0
  120. package/dist/gaia-ops/hooks/modules/orchestrator/delegate_mode.py +122 -0
  121. package/dist/gaia-ops/hooks/modules/scanning/__init__.py +8 -0
  122. package/dist/gaia-ops/hooks/modules/scanning/scan_trigger.py +84 -0
  123. package/dist/gaia-ops/hooks/modules/security/__init__.py +120 -0
  124. package/dist/gaia-ops/hooks/modules/security/approval_cleanup.py +87 -0
  125. package/dist/gaia-ops/hooks/modules/security/approval_constants.py +23 -0
  126. package/dist/gaia-ops/hooks/modules/security/approval_grants.py +1638 -0
  127. package/dist/gaia-ops/hooks/modules/security/approval_messages.py +71 -0
  128. package/dist/gaia-ops/hooks/modules/security/approval_scopes.py +222 -0
  129. package/dist/gaia-ops/hooks/modules/security/blocked_commands.py +595 -0
  130. package/dist/gaia-ops/hooks/modules/security/blocked_message_formatter.py +87 -0
  131. package/dist/gaia-ops/hooks/modules/security/command_semantics.py +181 -0
  132. package/dist/gaia-ops/hooks/modules/security/composition_rules.py +547 -0
  133. package/dist/gaia-ops/hooks/modules/security/flag_classifiers.py +873 -0
  134. package/dist/gaia-ops/hooks/modules/security/gitops_validator.py +179 -0
  135. package/dist/gaia-ops/hooks/modules/security/mutative_verbs.py +1131 -0
  136. package/dist/gaia-ops/hooks/modules/security/network_hosts.py +481 -0
  137. package/dist/gaia-ops/hooks/modules/security/prompt_validator.py +40 -0
  138. package/dist/gaia-ops/hooks/modules/security/shell_unwrapper.py +165 -0
  139. package/dist/gaia-ops/hooks/modules/security/tiers.py +196 -0
  140. package/dist/gaia-ops/hooks/modules/session/__init__.py +10 -0
  141. package/dist/gaia-ops/hooks/modules/session/pending_scanner.py +174 -0
  142. package/dist/gaia-ops/hooks/modules/session/session_context_writer.py +100 -0
  143. package/dist/gaia-ops/hooks/modules/session/session_event_injector.py +160 -0
  144. package/dist/gaia-ops/hooks/modules/session/session_manager.py +31 -0
  145. package/dist/gaia-ops/hooks/modules/session/session_registry.py +333 -0
  146. package/dist/gaia-ops/hooks/modules/tools/__init__.py +29 -0
  147. package/dist/gaia-ops/hooks/modules/tools/bash_validator.py +1008 -0
  148. package/dist/gaia-ops/hooks/modules/tools/cloud_pipe_validator.py +231 -0
  149. package/dist/gaia-ops/hooks/modules/tools/hook_response.py +55 -0
  150. package/dist/gaia-ops/hooks/modules/tools/shell_parser.py +227 -0
  151. package/dist/gaia-ops/hooks/modules/tools/stage_decomposer.py +315 -0
  152. package/dist/gaia-ops/hooks/modules/tools/task_validator.py +294 -0
  153. package/dist/gaia-ops/hooks/modules/validation/__init__.py +23 -0
  154. package/dist/gaia-ops/hooks/modules/validation/commit_validator.py +380 -0
  155. package/dist/gaia-ops/hooks/post_compact.py +43 -0
  156. package/dist/gaia-ops/hooks/post_tool_use.py +54 -0
  157. package/dist/gaia-ops/hooks/pre_compact.py +60 -0
  158. package/dist/gaia-ops/hooks/pre_tool_use.py +413 -0
  159. package/dist/gaia-ops/hooks/session_end_hook.py +77 -0
  160. package/dist/gaia-ops/hooks/session_start.py +81 -0
  161. package/dist/gaia-ops/hooks/stop_hook.py +70 -0
  162. package/dist/gaia-ops/hooks/subagent_start.py +71 -0
  163. package/dist/gaia-ops/hooks/subagent_stop.py +295 -0
  164. package/dist/gaia-ops/hooks/task_completed.py +70 -0
  165. package/dist/gaia-ops/hooks/user_prompt_submit.py +246 -0
  166. package/dist/gaia-ops/settings.json +72 -0
  167. package/dist/gaia-ops/skills/README.md +158 -0
  168. package/dist/gaia-ops/skills/agent-creation/SKILL.md +87 -0
  169. package/dist/gaia-ops/skills/agent-creation/examples.md +170 -0
  170. package/dist/gaia-ops/skills/agent-creation/reference.md +191 -0
  171. package/dist/gaia-ops/skills/agent-protocol/SKILL.md +93 -0
  172. package/dist/gaia-ops/skills/agent-protocol/examples.md +223 -0
  173. package/dist/gaia-ops/skills/agent-response/SKILL.md +69 -0
  174. package/dist/gaia-ops/skills/agentic-loop/SKILL.md +80 -0
  175. package/dist/gaia-ops/skills/agentic-loop/reference.md +378 -0
  176. package/dist/gaia-ops/skills/blog-writing/SKILL.md +98 -0
  177. package/dist/gaia-ops/skills/blog-writing/reference.md +130 -0
  178. package/dist/gaia-ops/skills/brief-spec/SKILL.md +185 -0
  179. package/dist/gaia-ops/skills/command-execution/SKILL.md +64 -0
  180. package/dist/gaia-ops/skills/command-execution/reference.md +83 -0
  181. package/dist/gaia-ops/skills/context-updater/SKILL.md +87 -0
  182. package/dist/gaia-ops/skills/context-updater/examples.md +71 -0
  183. package/dist/gaia-ops/skills/developer-patterns/SKILL.md +50 -0
  184. package/dist/gaia-ops/skills/developer-patterns/reference.md +112 -0
  185. package/dist/gaia-ops/skills/execution/SKILL.md +99 -0
  186. package/dist/gaia-ops/skills/fast-queries/SKILL.md +43 -0
  187. package/dist/gaia-ops/skills/gaia-compact/SKILL.md +74 -0
  188. package/dist/gaia-ops/skills/gaia-patterns/SKILL.md +108 -0
  189. package/dist/gaia-ops/skills/gaia-patterns/reference.md +395 -0
  190. package/dist/gaia-ops/skills/gaia-planner/SKILL.md +37 -0
  191. package/dist/gaia-ops/skills/gaia-planner/reference.md +107 -0
  192. package/dist/gaia-ops/skills/gaia-release/SKILL.md +85 -0
  193. package/dist/gaia-ops/skills/gaia-release/reference.md +92 -0
  194. package/dist/gaia-ops/skills/gaia-self-check/SKILL.md +114 -0
  195. package/dist/gaia-ops/skills/gaia-self-check/reference.md +453 -0
  196. package/dist/gaia-ops/skills/gaia-verify/SKILL.md +77 -0
  197. package/dist/gaia-ops/skills/gaia-verify/reference.md +80 -0
  198. package/dist/gaia-ops/skills/git-conventions/SKILL.md +47 -0
  199. package/dist/gaia-ops/skills/gitops-patterns/SKILL.md +60 -0
  200. package/dist/gaia-ops/skills/gitops-patterns/reference.md +183 -0
  201. package/dist/gaia-ops/skills/gmail-policy/SKILL.md +200 -0
  202. package/dist/gaia-ops/skills/gmail-policy/reference.md +150 -0
  203. package/dist/gaia-ops/skills/gmail-triage/SKILL.md +100 -0
  204. package/dist/gaia-ops/skills/gws-setup/SKILL.md +99 -0
  205. package/dist/gaia-ops/skills/gws-setup/reference.md +73 -0
  206. package/dist/gaia-ops/skills/investigation/SKILL.md +100 -0
  207. package/dist/gaia-ops/skills/memory-curation/SKILL.md +83 -0
  208. package/dist/gaia-ops/skills/memory-search/SKILL.md +88 -0
  209. package/dist/gaia-ops/skills/orchestrator-approval/SKILL.md +160 -0
  210. package/dist/gaia-ops/skills/orchestrator-approval/reference.md +174 -0
  211. package/dist/gaia-ops/skills/pending-approvals/SKILL.md +72 -0
  212. package/dist/gaia-ops/skills/pending-approvals/reference.md +214 -0
  213. package/dist/gaia-ops/skills/readme-writing/SKILL.md +71 -0
  214. package/dist/gaia-ops/skills/readme-writing/reference.md +188 -0
  215. package/dist/gaia-ops/skills/reference.md +135 -0
  216. package/dist/gaia-ops/skills/request-approval/SKILL.md +140 -0
  217. package/dist/gaia-ops/skills/request-approval/examples.md +140 -0
  218. package/dist/gaia-ops/skills/request-approval/reference.md +57 -0
  219. package/dist/gaia-ops/skills/schedule-task/SKILL.md +64 -0
  220. package/dist/gaia-ops/skills/schedule-task/reference.md +233 -0
  221. package/dist/gaia-ops/skills/security-tiers/SKILL.md +141 -0
  222. package/dist/gaia-ops/skills/security-tiers/destructive-commands-reference.md +623 -0
  223. package/dist/gaia-ops/skills/security-tiers/reference.md +39 -0
  224. package/dist/gaia-ops/skills/session-reflection/SKILL.md +69 -0
  225. package/dist/gaia-ops/skills/skill-creation/SKILL.md +92 -0
  226. package/dist/gaia-ops/skills/skill-creation/reference.md +29 -0
  227. package/dist/gaia-ops/skills/terraform-patterns/SKILL.md +89 -0
  228. package/dist/gaia-ops/skills/terraform-patterns/reference.md +93 -0
  229. package/dist/gaia-ops/tools/__init__.py +9 -0
  230. package/dist/gaia-ops/tools/agentic-loop/decide-status.py +210 -0
  231. package/dist/gaia-ops/tools/agentic-loop/parse-metric.py +106 -0
  232. package/dist/gaia-ops/tools/agentic-loop/record-iteration.py +221 -0
  233. package/dist/gaia-ops/tools/context/README.md +132 -0
  234. package/dist/gaia-ops/tools/context/__init__.py +42 -0
  235. package/dist/gaia-ops/tools/context/_paths.py +20 -0
  236. package/dist/gaia-ops/tools/context/context_provider.py +721 -0
  237. package/dist/gaia-ops/tools/context/context_section_reader.py +342 -0
  238. package/dist/gaia-ops/tools/context/deep_merge.py +159 -0
  239. package/dist/gaia-ops/tools/context/pending_updates.py +760 -0
  240. package/dist/gaia-ops/tools/context/surface_router.py +278 -0
  241. package/dist/gaia-ops/tools/fast-queries/README.md +65 -0
  242. package/dist/gaia-ops/tools/fast-queries/__init__.py +30 -0
  243. package/dist/gaia-ops/tools/fast-queries/appservices/quicktriage_devops_developer.sh +75 -0
  244. package/dist/gaia-ops/tools/fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh +32 -0
  245. package/dist/gaia-ops/tools/fast-queries/cloud/gcp/quicktriage_gcp_troubleshooter.sh +88 -0
  246. package/dist/gaia-ops/tools/fast-queries/gitops/quicktriage_gitops_operator.sh +48 -0
  247. package/dist/gaia-ops/tools/fast-queries/run_triage.sh +59 -0
  248. package/dist/gaia-ops/tools/fast-queries/terraform/quicktriage_terraform_architect.sh +80 -0
  249. package/dist/gaia-ops/tools/gaia_simulator/__init__.py +33 -0
  250. package/dist/gaia-ops/tools/gaia_simulator/cli.py +354 -0
  251. package/dist/gaia-ops/tools/gaia_simulator/extractor.py +457 -0
  252. package/dist/gaia-ops/tools/gaia_simulator/reporter.py +258 -0
  253. package/dist/gaia-ops/tools/gaia_simulator/routing_simulator.py +334 -0
  254. package/dist/gaia-ops/tools/gaia_simulator/runner.py +539 -0
  255. package/dist/gaia-ops/tools/gaia_simulator/skills_mapper.py +264 -0
  256. package/dist/gaia-ops/tools/memory/README.md +0 -0
  257. package/dist/gaia-ops/tools/memory/__init__.py +20 -0
  258. package/dist/gaia-ops/tools/memory/backfill_fts5.py +107 -0
  259. package/dist/gaia-ops/tools/memory/conflict_detector.py +295 -0
  260. package/dist/gaia-ops/tools/memory/episodic.py +1210 -0
  261. package/dist/gaia-ops/tools/memory/git_invalidator.py +262 -0
  262. package/dist/gaia-ops/tools/memory/paths.py +102 -0
  263. package/dist/gaia-ops/tools/memory/scoring.py +193 -0
  264. package/dist/gaia-ops/tools/memory/search_store.py +375 -0
  265. package/dist/gaia-ops/tools/persist_transcript_analysis.py +85 -0
  266. package/dist/gaia-ops/tools/review/__init__.py +1 -0
  267. package/dist/gaia-ops/tools/review/review_engine.py +157 -0
  268. package/dist/gaia-ops/tools/scan/__init__.py +35 -0
  269. package/dist/gaia-ops/tools/scan/config.py +247 -0
  270. package/dist/gaia-ops/tools/scan/merge.py +212 -0
  271. package/dist/gaia-ops/tools/scan/orchestrator.py +549 -0
  272. package/dist/gaia-ops/tools/scan/registry.py +127 -0
  273. package/dist/gaia-ops/tools/scan/scanners/__init__.py +18 -0
  274. package/dist/gaia-ops/tools/scan/scanners/base.py +137 -0
  275. package/dist/gaia-ops/tools/scan/scanners/environment.py +349 -0
  276. package/dist/gaia-ops/tools/scan/scanners/git.py +570 -0
  277. package/dist/gaia-ops/tools/scan/scanners/infrastructure.py +875 -0
  278. package/dist/gaia-ops/tools/scan/scanners/orchestration.py +600 -0
  279. package/dist/gaia-ops/tools/scan/scanners/stack.py +1085 -0
  280. package/dist/gaia-ops/tools/scan/scanners/tools.py +260 -0
  281. package/dist/gaia-ops/tools/scan/setup.py +686 -0
  282. package/dist/gaia-ops/tools/scan/tests/__init__.py +1 -0
  283. package/dist/gaia-ops/tools/scan/tests/conftest.py +796 -0
  284. package/dist/gaia-ops/tools/scan/tests/test_environment.py +323 -0
  285. package/dist/gaia-ops/tools/scan/tests/test_git.py +419 -0
  286. package/dist/gaia-ops/tools/scan/tests/test_infrastructure.py +382 -0
  287. package/dist/gaia-ops/tools/scan/tests/test_integration.py +920 -0
  288. package/dist/gaia-ops/tools/scan/tests/test_merge.py +269 -0
  289. package/dist/gaia-ops/tools/scan/tests/test_orchestration.py +304 -0
  290. package/dist/gaia-ops/tools/scan/tests/test_stack.py +604 -0
  291. package/dist/gaia-ops/tools/scan/tests/test_tools.py +349 -0
  292. package/dist/gaia-ops/tools/scan/ui.py +624 -0
  293. package/dist/gaia-ops/tools/scan/verify.py +270 -0
  294. package/dist/gaia-ops/tools/scan/walk.py +118 -0
  295. package/dist/gaia-ops/tools/scan/workspace.py +85 -0
  296. package/dist/gaia-ops/tools/validation/README.md +244 -0
  297. package/dist/gaia-ops/tools/validation/__init__.py +17 -0
  298. package/dist/gaia-ops/tools/validation/approval_gate.py +321 -0
  299. package/dist/gaia-ops/tools/validation/validate_skills.py +189 -0
  300. package/dist/gaia-security/.claude-plugin/plugin.json +24 -0
  301. package/dist/gaia-security/README.md +90 -0
  302. package/dist/gaia-security/config/universal-rules.json +102 -0
  303. package/dist/gaia-security/hooks/adapters/__init__.py +52 -0
  304. package/dist/gaia-security/hooks/adapters/base.py +219 -0
  305. package/dist/gaia-security/hooks/adapters/channel.py +17 -0
  306. package/dist/gaia-security/hooks/adapters/claude_code.py +1890 -0
  307. package/dist/gaia-security/hooks/adapters/types.py +194 -0
  308. package/dist/gaia-security/hooks/adapters/utils.py +25 -0
  309. package/dist/gaia-security/hooks/hooks.json +113 -0
  310. package/dist/gaia-security/hooks/modules/__init__.py +15 -0
  311. package/dist/gaia-security/hooks/modules/agents/__init__.py +29 -0
  312. package/dist/gaia-security/hooks/modules/agents/contract_validator.py +647 -0
  313. package/dist/gaia-security/hooks/modules/agents/response_contract.py +496 -0
  314. package/dist/gaia-security/hooks/modules/agents/skill_injection_verifier.py +120 -0
  315. package/dist/gaia-security/hooks/modules/agents/state_tracker.py +267 -0
  316. package/dist/gaia-security/hooks/modules/agents/task_info_builder.py +74 -0
  317. package/dist/gaia-security/hooks/modules/agents/transcript_analyzer.py +458 -0
  318. package/dist/gaia-security/hooks/modules/agents/transcript_reader.py +152 -0
  319. package/dist/gaia-security/hooks/modules/audit/__init__.py +28 -0
  320. package/dist/gaia-security/hooks/modules/audit/event_detector.py +168 -0
  321. package/dist/gaia-security/hooks/modules/audit/logger.py +131 -0
  322. package/dist/gaia-security/hooks/modules/audit/metrics.py +134 -0
  323. package/dist/gaia-security/hooks/modules/audit/workflow_auditor.py +611 -0
  324. package/dist/gaia-security/hooks/modules/audit/workflow_recorder.py +296 -0
  325. package/dist/gaia-security/hooks/modules/context/__init__.py +11 -0
  326. package/dist/gaia-security/hooks/modules/context/agentic_loop_detector.py +165 -0
  327. package/dist/gaia-security/hooks/modules/context/anchor_tracker.py +317 -0
  328. package/dist/gaia-security/hooks/modules/context/compact_context_builder.py +218 -0
  329. package/dist/gaia-security/hooks/modules/context/context_freshness.py +145 -0
  330. package/dist/gaia-security/hooks/modules/context/context_injector.py +558 -0
  331. package/dist/gaia-security/hooks/modules/context/context_writer.py +530 -0
  332. package/dist/gaia-security/hooks/modules/context/contracts_loader.py +161 -0
  333. package/dist/gaia-security/hooks/modules/core/__init__.py +40 -0
  334. package/dist/gaia-security/hooks/modules/core/hook_entry.py +78 -0
  335. package/dist/gaia-security/hooks/modules/core/paths.py +160 -0
  336. package/dist/gaia-security/hooks/modules/core/plugin_mode.py +149 -0
  337. package/dist/gaia-security/hooks/modules/core/plugin_setup.py +577 -0
  338. package/dist/gaia-security/hooks/modules/core/state.py +179 -0
  339. package/dist/gaia-security/hooks/modules/core/stdin.py +24 -0
  340. package/dist/gaia-security/hooks/modules/events/__init__.py +1 -0
  341. package/dist/gaia-security/hooks/modules/events/event_writer.py +210 -0
  342. package/dist/gaia-security/hooks/modules/memory/__init__.py +8 -0
  343. package/dist/gaia-security/hooks/modules/memory/episode_writer.py +216 -0
  344. package/dist/gaia-security/hooks/modules/orchestrator/__init__.py +1 -0
  345. package/dist/gaia-security/hooks/modules/orchestrator/delegate_mode.py +122 -0
  346. package/dist/gaia-security/hooks/modules/scanning/__init__.py +8 -0
  347. package/dist/gaia-security/hooks/modules/scanning/scan_trigger.py +84 -0
  348. package/dist/gaia-security/hooks/modules/security/__init__.py +120 -0
  349. package/dist/gaia-security/hooks/modules/security/approval_cleanup.py +87 -0
  350. package/dist/gaia-security/hooks/modules/security/approval_constants.py +23 -0
  351. package/dist/gaia-security/hooks/modules/security/approval_grants.py +1638 -0
  352. package/dist/gaia-security/hooks/modules/security/approval_messages.py +71 -0
  353. package/dist/gaia-security/hooks/modules/security/approval_scopes.py +222 -0
  354. package/dist/gaia-security/hooks/modules/security/blocked_commands.py +595 -0
  355. package/dist/gaia-security/hooks/modules/security/blocked_message_formatter.py +87 -0
  356. package/dist/gaia-security/hooks/modules/security/command_semantics.py +181 -0
  357. package/dist/gaia-security/hooks/modules/security/composition_rules.py +547 -0
  358. package/dist/gaia-security/hooks/modules/security/flag_classifiers.py +873 -0
  359. package/dist/gaia-security/hooks/modules/security/gitops_validator.py +179 -0
  360. package/dist/gaia-security/hooks/modules/security/mutative_verbs.py +1131 -0
  361. package/dist/gaia-security/hooks/modules/security/network_hosts.py +481 -0
  362. package/dist/gaia-security/hooks/modules/security/prompt_validator.py +40 -0
  363. package/dist/gaia-security/hooks/modules/security/shell_unwrapper.py +165 -0
  364. package/dist/gaia-security/hooks/modules/security/tiers.py +196 -0
  365. package/dist/gaia-security/hooks/modules/session/__init__.py +10 -0
  366. package/dist/gaia-security/hooks/modules/session/pending_scanner.py +174 -0
  367. package/dist/gaia-security/hooks/modules/session/session_context_writer.py +100 -0
  368. package/dist/gaia-security/hooks/modules/session/session_event_injector.py +160 -0
  369. package/dist/gaia-security/hooks/modules/session/session_manager.py +31 -0
  370. package/dist/gaia-security/hooks/modules/session/session_registry.py +333 -0
  371. package/dist/gaia-security/hooks/modules/tools/__init__.py +29 -0
  372. package/dist/gaia-security/hooks/modules/tools/bash_validator.py +1008 -0
  373. package/dist/gaia-security/hooks/modules/tools/cloud_pipe_validator.py +231 -0
  374. package/dist/gaia-security/hooks/modules/tools/hook_response.py +55 -0
  375. package/dist/gaia-security/hooks/modules/tools/shell_parser.py +227 -0
  376. package/dist/gaia-security/hooks/modules/tools/stage_decomposer.py +315 -0
  377. package/dist/gaia-security/hooks/modules/tools/task_validator.py +294 -0
  378. package/dist/gaia-security/hooks/modules/validation/__init__.py +23 -0
  379. package/dist/gaia-security/hooks/modules/validation/commit_validator.py +380 -0
  380. package/dist/gaia-security/hooks/post_tool_use.py +54 -0
  381. package/dist/gaia-security/hooks/pre_tool_use.py +413 -0
  382. package/dist/gaia-security/hooks/session_end_hook.py +77 -0
  383. package/dist/gaia-security/hooks/session_start.py +81 -0
  384. package/dist/gaia-security/hooks/stop_hook.py +70 -0
  385. package/dist/gaia-security/hooks/user_prompt_submit.py +246 -0
  386. package/dist/gaia-security/settings.json +58 -0
  387. package/git-hooks/commit-msg +41 -0
  388. package/hooks/README.md +100 -0
  389. package/hooks/adapters/__init__.py +52 -0
  390. package/hooks/adapters/base.py +219 -0
  391. package/hooks/adapters/channel.py +17 -0
  392. package/hooks/adapters/claude_code.py +1890 -0
  393. package/hooks/adapters/types.py +194 -0
  394. package/hooks/adapters/utils.py +25 -0
  395. package/hooks/elicitation_result.py +179 -0
  396. package/hooks/hooks.json +84 -0
  397. package/hooks/modules/README.md +189 -0
  398. package/hooks/modules/__init__.py +15 -0
  399. package/hooks/modules/agents/__init__.py +29 -0
  400. package/hooks/modules/agents/contract_validator.py +647 -0
  401. package/hooks/modules/agents/response_contract.py +496 -0
  402. package/hooks/modules/agents/skill_injection_verifier.py +120 -0
  403. package/hooks/modules/agents/state_tracker.py +267 -0
  404. package/hooks/modules/agents/task_info_builder.py +74 -0
  405. package/hooks/modules/agents/transcript_analyzer.py +458 -0
  406. package/hooks/modules/agents/transcript_reader.py +152 -0
  407. package/hooks/modules/audit/__init__.py +28 -0
  408. package/hooks/modules/audit/event_detector.py +168 -0
  409. package/hooks/modules/audit/logger.py +131 -0
  410. package/hooks/modules/audit/metrics.py +134 -0
  411. package/hooks/modules/audit/workflow_auditor.py +611 -0
  412. package/hooks/modules/audit/workflow_recorder.py +296 -0
  413. package/hooks/modules/context/__init__.py +11 -0
  414. package/hooks/modules/context/agentic_loop_detector.py +165 -0
  415. package/hooks/modules/context/anchor_tracker.py +317 -0
  416. package/hooks/modules/context/compact_context_builder.py +218 -0
  417. package/hooks/modules/context/context_freshness.py +145 -0
  418. package/hooks/modules/context/context_injector.py +558 -0
  419. package/hooks/modules/context/context_writer.py +530 -0
  420. package/hooks/modules/context/contracts_loader.py +161 -0
  421. package/hooks/modules/core/__init__.py +40 -0
  422. package/hooks/modules/core/hook_entry.py +78 -0
  423. package/hooks/modules/core/paths.py +160 -0
  424. package/hooks/modules/core/plugin_mode.py +149 -0
  425. package/hooks/modules/core/plugin_setup.py +577 -0
  426. package/hooks/modules/core/state.py +179 -0
  427. package/hooks/modules/core/stdin.py +24 -0
  428. package/hooks/modules/events/__init__.py +1 -0
  429. package/hooks/modules/events/event_writer.py +210 -0
  430. package/hooks/modules/evidence/__init__.py +34 -0
  431. package/hooks/modules/evidence/assertions.py +137 -0
  432. package/hooks/modules/evidence/index_writer.py +57 -0
  433. package/hooks/modules/evidence/loader.py +126 -0
  434. package/hooks/modules/evidence/runner.py +241 -0
  435. package/hooks/modules/memory/__init__.py +8 -0
  436. package/hooks/modules/memory/episode_writer.py +216 -0
  437. package/hooks/modules/orchestrator/__init__.py +1 -0
  438. package/hooks/modules/orchestrator/delegate_mode.py +122 -0
  439. package/hooks/modules/scanning/__init__.py +8 -0
  440. package/hooks/modules/scanning/scan_trigger.py +84 -0
  441. package/hooks/modules/security/__init__.py +120 -0
  442. package/hooks/modules/security/approval_cleanup.py +87 -0
  443. package/hooks/modules/security/approval_constants.py +23 -0
  444. package/hooks/modules/security/approval_grants.py +1638 -0
  445. package/hooks/modules/security/approval_messages.py +71 -0
  446. package/hooks/modules/security/approval_scopes.py +222 -0
  447. package/hooks/modules/security/blocked_commands.py +595 -0
  448. package/hooks/modules/security/blocked_message_formatter.py +87 -0
  449. package/hooks/modules/security/command_semantics.py +181 -0
  450. package/hooks/modules/security/composition_rules.py +547 -0
  451. package/hooks/modules/security/flag_classifiers.py +873 -0
  452. package/hooks/modules/security/gitops_validator.py +179 -0
  453. package/hooks/modules/security/mutative_verbs.py +1131 -0
  454. package/hooks/modules/security/network_hosts.py +481 -0
  455. package/hooks/modules/security/prompt_validator.py +40 -0
  456. package/hooks/modules/security/shell_unwrapper.py +165 -0
  457. package/hooks/modules/security/tiers.py +196 -0
  458. package/hooks/modules/session/__init__.py +10 -0
  459. package/hooks/modules/session/pending_scanner.py +174 -0
  460. package/hooks/modules/session/session_context_writer.py +100 -0
  461. package/hooks/modules/session/session_event_injector.py +160 -0
  462. package/hooks/modules/session/session_manager.py +31 -0
  463. package/hooks/modules/session/session_registry.py +333 -0
  464. package/hooks/modules/tools/__init__.py +29 -0
  465. package/hooks/modules/tools/bash_validator.py +1008 -0
  466. package/hooks/modules/tools/cloud_pipe_validator.py +231 -0
  467. package/hooks/modules/tools/hook_response.py +55 -0
  468. package/hooks/modules/tools/shell_parser.py +227 -0
  469. package/hooks/modules/tools/stage_decomposer.py +315 -0
  470. package/hooks/modules/tools/task_validator.py +294 -0
  471. package/hooks/modules/validation/__init__.py +23 -0
  472. package/hooks/modules/validation/commit_validator.py +380 -0
  473. package/hooks/post_compact.py +43 -0
  474. package/hooks/post_tool_use.py +54 -0
  475. package/hooks/pre_compact.py +60 -0
  476. package/hooks/pre_tool_use.py +413 -0
  477. package/hooks/session_end_hook.py +77 -0
  478. package/hooks/session_start.py +81 -0
  479. package/hooks/stop_hook.py +70 -0
  480. package/hooks/subagent_start.py +71 -0
  481. package/hooks/subagent_stop.py +295 -0
  482. package/hooks/task_completed.py +70 -0
  483. package/hooks/user_prompt_submit.py +246 -0
  484. package/index.js +83 -0
  485. package/package.json +103 -0
  486. package/pyproject.toml +32 -0
  487. package/skills/README.md +158 -0
  488. package/skills/agent-creation/SKILL.md +87 -0
  489. package/skills/agent-creation/examples.md +170 -0
  490. package/skills/agent-creation/reference.md +191 -0
  491. package/skills/agent-protocol/SKILL.md +93 -0
  492. package/skills/agent-protocol/examples.md +223 -0
  493. package/skills/agent-response/SKILL.md +69 -0
  494. package/skills/agentic-loop/SKILL.md +80 -0
  495. package/skills/agentic-loop/reference.md +378 -0
  496. package/skills/blog-writing/SKILL.md +98 -0
  497. package/skills/blog-writing/reference.md +130 -0
  498. package/skills/brief-spec/SKILL.md +185 -0
  499. package/skills/command-execution/SKILL.md +64 -0
  500. package/skills/command-execution/reference.md +83 -0
  501. package/skills/context-updater/SKILL.md +87 -0
  502. package/skills/context-updater/examples.md +71 -0
  503. package/skills/developer-patterns/SKILL.md +50 -0
  504. package/skills/developer-patterns/reference.md +112 -0
  505. package/skills/execution/SKILL.md +99 -0
  506. package/skills/fast-queries/SKILL.md +43 -0
  507. package/skills/gaia-compact/SKILL.md +74 -0
  508. package/skills/gaia-patterns/SKILL.md +108 -0
  509. package/skills/gaia-patterns/reference.md +395 -0
  510. package/skills/gaia-planner/SKILL.md +37 -0
  511. package/skills/gaia-planner/reference.md +107 -0
  512. package/skills/gaia-release/SKILL.md +85 -0
  513. package/skills/gaia-release/reference.md +92 -0
  514. package/skills/gaia-self-check/SKILL.md +114 -0
  515. package/skills/gaia-self-check/reference.md +453 -0
  516. package/skills/gaia-verify/SKILL.md +77 -0
  517. package/skills/gaia-verify/reference.md +80 -0
  518. package/skills/git-conventions/SKILL.md +47 -0
  519. package/skills/gitops-patterns/SKILL.md +60 -0
  520. package/skills/gitops-patterns/reference.md +183 -0
  521. package/skills/gmail-policy/SKILL.md +200 -0
  522. package/skills/gmail-policy/reference.md +150 -0
  523. package/skills/gmail-triage/SKILL.md +100 -0
  524. package/skills/gws-setup/SKILL.md +99 -0
  525. package/skills/gws-setup/reference.md +73 -0
  526. package/skills/investigation/SKILL.md +100 -0
  527. package/skills/memory-curation/SKILL.md +83 -0
  528. package/skills/memory-search/SKILL.md +88 -0
  529. package/skills/orchestrator-approval/SKILL.md +160 -0
  530. package/skills/orchestrator-approval/reference.md +174 -0
  531. package/skills/pending-approvals/SKILL.md +72 -0
  532. package/skills/pending-approvals/reference.md +214 -0
  533. package/skills/readme-writing/SKILL.md +71 -0
  534. package/skills/readme-writing/reference.md +188 -0
  535. package/skills/reference.md +135 -0
  536. package/skills/request-approval/SKILL.md +140 -0
  537. package/skills/request-approval/examples.md +140 -0
  538. package/skills/request-approval/reference.md +57 -0
  539. package/skills/schedule-task/SKILL.md +64 -0
  540. package/skills/schedule-task/reference.md +233 -0
  541. package/skills/security-tiers/SKILL.md +141 -0
  542. package/skills/security-tiers/destructive-commands-reference.md +623 -0
  543. package/skills/security-tiers/reference.md +39 -0
  544. package/skills/session-reflection/SKILL.md +69 -0
  545. package/skills/skill-creation/SKILL.md +92 -0
  546. package/skills/skill-creation/reference.md +29 -0
  547. package/skills/terraform-patterns/SKILL.md +89 -0
  548. package/skills/terraform-patterns/reference.md +93 -0
  549. package/templates/README.md +69 -0
  550. package/templates/managed-settings.template.json +43 -0
  551. package/tools/__init__.py +9 -0
  552. package/tools/agentic-loop/decide-status.py +210 -0
  553. package/tools/agentic-loop/parse-metric.py +106 -0
  554. package/tools/agentic-loop/record-iteration.py +221 -0
  555. package/tools/context/README.md +132 -0
  556. package/tools/context/__init__.py +42 -0
  557. package/tools/context/_paths.py +20 -0
  558. package/tools/context/context_provider.py +721 -0
  559. package/tools/context/context_section_reader.py +342 -0
  560. package/tools/context/deep_merge.py +159 -0
  561. package/tools/context/pending_updates.py +760 -0
  562. package/tools/context/surface_router.py +278 -0
  563. package/tools/fast-queries/README.md +65 -0
  564. package/tools/fast-queries/__init__.py +30 -0
  565. package/tools/fast-queries/appservices/quicktriage_devops_developer.sh +75 -0
  566. package/tools/fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh +32 -0
  567. package/tools/fast-queries/cloud/gcp/quicktriage_gcp_troubleshooter.sh +88 -0
  568. package/tools/fast-queries/gitops/quicktriage_gitops_operator.sh +48 -0
  569. package/tools/fast-queries/run_triage.sh +59 -0
  570. package/tools/fast-queries/terraform/quicktriage_terraform_architect.sh +80 -0
  571. package/tools/gaia_simulator/__init__.py +33 -0
  572. package/tools/gaia_simulator/cli.py +354 -0
  573. package/tools/gaia_simulator/extractor.py +457 -0
  574. package/tools/gaia_simulator/reporter.py +258 -0
  575. package/tools/gaia_simulator/routing_simulator.py +334 -0
  576. package/tools/gaia_simulator/runner.py +539 -0
  577. package/tools/gaia_simulator/skills_mapper.py +264 -0
  578. package/tools/memory/README.md +0 -0
  579. package/tools/memory/__init__.py +20 -0
  580. package/tools/memory/backfill_fts5.py +107 -0
  581. package/tools/memory/conflict_detector.py +295 -0
  582. package/tools/memory/episodic.py +1210 -0
  583. package/tools/memory/git_invalidator.py +262 -0
  584. package/tools/memory/paths.py +102 -0
  585. package/tools/memory/scoring.py +193 -0
  586. package/tools/memory/search_store.py +375 -0
  587. package/tools/persist_transcript_analysis.py +85 -0
  588. package/tools/review/__init__.py +1 -0
  589. package/tools/review/review_engine.py +157 -0
  590. package/tools/scan/__init__.py +35 -0
  591. package/tools/scan/config.py +247 -0
  592. package/tools/scan/merge.py +212 -0
  593. package/tools/scan/orchestrator.py +549 -0
  594. package/tools/scan/registry.py +127 -0
  595. package/tools/scan/scanners/__init__.py +18 -0
  596. package/tools/scan/scanners/base.py +137 -0
  597. package/tools/scan/scanners/environment.py +349 -0
  598. package/tools/scan/scanners/git.py +570 -0
  599. package/tools/scan/scanners/infrastructure.py +875 -0
  600. package/tools/scan/scanners/orchestration.py +600 -0
  601. package/tools/scan/scanners/stack.py +1085 -0
  602. package/tools/scan/scanners/tools.py +260 -0
  603. package/tools/scan/setup.py +686 -0
  604. package/tools/scan/tests/__init__.py +1 -0
  605. package/tools/scan/tests/conftest.py +796 -0
  606. package/tools/scan/tests/test_environment.py +323 -0
  607. package/tools/scan/tests/test_git.py +419 -0
  608. package/tools/scan/tests/test_infrastructure.py +382 -0
  609. package/tools/scan/tests/test_integration.py +920 -0
  610. package/tools/scan/tests/test_merge.py +269 -0
  611. package/tools/scan/tests/test_orchestration.py +304 -0
  612. package/tools/scan/tests/test_stack.py +604 -0
  613. package/tools/scan/tests/test_tools.py +349 -0
  614. package/tools/scan/ui.py +624 -0
  615. package/tools/scan/verify.py +270 -0
  616. package/tools/scan/walk.py +118 -0
  617. package/tools/scan/workspace.py +85 -0
  618. package/tools/validation/README.md +244 -0
  619. package/tools/validation/__init__.py +17 -0
  620. package/tools/validation/approval_gate.py +321 -0
  621. package/tools/validation/validate_skills.py +189 -0
@@ -0,0 +1,395 @@
1
+ # Gaia Patterns -- Reference
2
+
3
+ Package: `@jaguilar87/gaia` v5.0.0-rc1 | Node >=18 | Python >=3.9
4
+
5
+ ---
6
+
7
+ ## 1. Component Map
8
+
9
+ ### Hook Entry Points (10 files)
10
+
11
+ | File | Event | Matchers |
12
+ |------|-------|----------|
13
+ | `hooks/pre_tool_use.py` | PreToolUse | `Bash`, `Task`, `Agent`, `SendMessage`, `Read\|Edit\|Write\|Glob\|Grep\|WebSearch\|WebFetch\|NotebookEdit` |
14
+ | `hooks/post_tool_use.py` | PostToolUse | `Bash`, `AskUserQuestion` |
15
+ | `hooks/stop_hook.py` | Stop | (all) |
16
+ | `hooks/user_prompt_submit.py` | UserPromptSubmit | (all) |
17
+ | `hooks/subagent_start.py` | SubagentStart | `*` |
18
+ | `hooks/subagent_stop.py` | SubagentStop | `*` |
19
+ | `hooks/session_start.py` | SessionStart | `startup` |
20
+ | `hooks/task_completed.py` | TaskCompleted | (all) |
21
+ | `hooks/post_compact.py` | PostCompact | (all) |
22
+ | `hooks/elicitation_result.py` | ElicitationResult | (none registered) |
23
+
24
+ ### Hook Modules (13 packages)
25
+
26
+ | Package | Files | Purpose |
27
+ |---------|-------|---------|
28
+ | `core/` | `hook_entry`, `paths`, `plugin_mode`, `plugin_setup`, `state`, `stdin` | Entry dispatch, path resolution, mode detection, shared state |
29
+ | `security/` | `blocked_commands`, `mutative_verbs`, `tiers`, `gitops_validator`, `command_semantics`, `approval_grants`, `approval_scopes`, `approval_cleanup`, `approval_constants`, `approval_messages`, `blocked_message_formatter`, `prompt_validator` | T3 gate, blocked commands, approval nonce lifecycle |
30
+ | `audit/` | `logger`, `metrics`, `event_detector`, `workflow_auditor`, `workflow_recorder` | Structured logging, metrics collection, workflow audit trail |
31
+ | `tools/` | `bash_validator`, `cloud_pipe_validator`, `shell_parser`, `task_validator`, `hook_response` | Command validation, pipe detection, shell parsing |
32
+ | `context/` | `context_injector`, `context_writer`, `context_freshness`, `contracts_loader`, `compact_context_builder`, `anchor_tracker` | Project-context injection, freshness checks, contract loading |
33
+ | `agents/` | `contract_validator`, `response_contract`, `skill_injection_verifier`, `task_info_builder`, `transcript_analyzer`, `transcript_reader` | json:contract validation, skill verification, transcript analysis |
34
+ | `session/` | `session_manager`, `session_context_writer`, `session_event_injector` | Session lifecycle, context persistence |
35
+ | `orchestrator/` | `delegate_mode` | Delegation mode detection |
36
+ | `validation/` | `commit_validator` | Git commit validation |
37
+ | `scanning/` | `scan_trigger` | Auto-scan trigger |
38
+ | `events/` | `event_writer` | Structured event output |
39
+ | `memory/` | `episode_writer` | Episodic memory persistence |
40
+ | `adapters/` | `base`, `channel`, `claude_code`, `types`, `utils` | Hook I/O abstraction layer |
41
+
42
+ ### Agents (8)
43
+
44
+ | Agent | File | Domain | permissionMode |
45
+ |-------|------|--------|----------------|
46
+ | gaia-orchestrator | `agents/gaia-orchestrator.md` | Routes requests, manages workflow, consolidation | (not set) |
47
+ | gaia-operator | `agents/gaia-operator.md` | Workspace operator -- personal workspace tasks, memory management, integrations | `acceptEdits` |
48
+ | gaia-system | `agents/gaia-system.md` | Gaia-ops meta-system itself | `acceptEdits` |
49
+ | developer | `agents/developer.md` | Application code (Node/TS, Python) | `acceptEdits` |
50
+ | cloud-troubleshooter | `agents/cloud-troubleshooter.md` | Live cloud diagnostics | (not set) |
51
+ | gitops-operator | `agents/gitops-operator.md` | Kubernetes, HelmRelease, Flux | `acceptEdits` |
52
+ | terraform-architect | `agents/terraform-architect.md` | Terraform/Terragrunt IaC | `acceptEdits` |
53
+ | gaia-planner | `agents/gaia-planner.md` | Feature planning, briefs, and task decomposition | `acceptEdits` |
54
+
55
+ ### Skills (24 directories + 1 top-level reference)
56
+
57
+ | Skill | Type | Injection |
58
+ |-------|------|-----------|
59
+ | `agent-protocol/` | Protocol | Injected (all agents) |
60
+ | `agent-response/` | Protocol | Injected (orchestrator) |
61
+ | `approval/` | Technique | On-demand |
62
+ | `blog-writing/` | Technique | Injected (gaia-operator) |
63
+ | `command-execution/` | Discipline | Injected |
64
+ | `context-updater/` | Protocol | Injected |
65
+ | `developer-patterns/` | Domain | Injected (developer) |
66
+ | `execution/` | Discipline | On-demand |
67
+ | `fast-queries/` | Reference | Injected |
68
+ | `gaia-patterns/` | Domain | Injected (gaia-system) |
69
+ | `gaia-release/` | Technique | Injected (gaia-system) |
70
+ | `git-conventions/` | Reference | On-demand |
71
+ | `gitops-patterns/` | Domain | Injected (gitops-operator) |
72
+ | `gmail-policy/` | Reference | Injected (orchestrator) |
73
+ | `gmail-triage/` | Technique | Injected (gaia-operator) |
74
+ | `gws-setup/` | Technique | On-demand |
75
+ | `investigation/` | Technique | Injected |
76
+ | `memory-curation/` | Reference | Injected (orchestrator) |
77
+ | `orchestrator-approval/` | Discipline | Injected (orchestrator) |
78
+ | `security-tiers/` | Reference | Injected (all agents) |
79
+ | `skill-creation/` | Technique | Injected (gaia-system) |
80
+ | `terraform-patterns/` | Domain | Injected (terraform-architect) |
81
+ | `skills/reference.md` | Reference | On-demand (shared security-tiers ref) |
82
+
83
+ ### Commands (slash commands)
84
+
85
+ | Command | File | Purpose |
86
+ |---------|------|---------|
87
+ | `/gaia` | `commands/gaia.md` | Invoke gaia meta-agent |
88
+ | `/scan-project` | `commands/scan-project.md` | Scan project, generate project-context.json |
89
+ | `/gaia-plan` | `commands/gaia-plan.md` | Plan a feature, create brief, decompose into tasks |
90
+
91
+ ### Tools (7 subsystems)
92
+
93
+ | Subsystem | Location | Purpose |
94
+ |-----------|----------|---------|
95
+ | context | `tools/context/` | `context_provider`, `context_section_reader`, `deep_merge`, `pending_updates`, `surface_router` |
96
+ | fast-queries | `tools/fast-queries/` | Triage scripts for cloud/gitops/terraform/appservices |
97
+ | gaia_simulator | `tools/gaia_simulator/` | Routing simulator: `cli`, `extractor`, `reporter`, `routing_simulator`, `runner`, `skills_mapper` |
98
+ | memory | `tools/memory/` | `episodic` -- episodic memory store |
99
+ | review | `tools/review/` | `review_engine` -- code review engine |
100
+ | scan | `tools/scan/` | Project scanner: `orchestrator`, `registry`, `scanners/`, `config`, `merge`, `verify`, `walk`, `workspace`, `ui` |
101
+ | validation | `tools/validation/` | `approval_gate`, `validate_skills` |
102
+ | (top-level) | `tools/persist_transcript_analysis.py` | Transcript persistence utility |
103
+
104
+ ### CLI Tools (10 bin commands + 1 wrapper)
105
+
106
+ | Command | File | Purpose |
107
+ |---------|------|---------|
108
+ | `gaia-doctor` | `bin/gaia-doctor.js` | Health check: hooks, symlinks, Python, config |
109
+ | `gaia-skills-diagnose` | `bin/gaia-skills-diagnose.js` | Skills injection diagnostics |
110
+ | `gaia-cleanup` | `bin/gaia-cleanup.js` | Remove symlinks and settings (preuninstall) |
111
+ | `gaia-uninstall` | `bin/gaia-uninstall.js` | Full uninstall |
112
+ | `gaia-metrics` | `bin/gaia-metrics.js` | Usage metrics and analytics |
113
+ | `gaia-review` | `bin/gaia-review.js` | Code review utility |
114
+ | `gaia-status` | `bin/gaia-status.js` | Installation status report |
115
+ | `gaia-history` | `bin/gaia-history.js` | Session history viewer |
116
+ | `gaia-update` | `bin/gaia-update.js` | Postinstall: symlinks, settings merge, verification |
117
+ | `gaia-scan` | `bin/gaia-scan` | Shell wrapper for `gaia-scan.py` |
118
+ | `gaia-scan.py` | `bin/gaia-scan.py` | Project scanner (Python implementation) |
119
+ | `pre-publish-validate` | `bin/pre-publish-validate.js` | Pre-publish validation (not a bin export) |
120
+
121
+ ### Config Files
122
+
123
+ | File | Purpose |
124
+ |------|---------|
125
+ | `config/universal-rules.json` | Rules shared by both plugin modes |
126
+ | `config/context-contracts.json` | Context injection contracts per agent |
127
+ | `config/surface-routing.json` | Surface routing table (intent to agent mapping) |
128
+ | `config/git_standards.json` | Git commit and branch standards |
129
+ | `config/cloud/aws.json` | AWS service patterns and commands |
130
+ | `config/cloud/gcp.json` | GCP service patterns and commands |
131
+
132
+ ---
133
+
134
+ ## 2. Plugin Modes
135
+
136
+ | Mode | Package | What ships |
137
+ |------|---------|-----------|
138
+ | `gaia-ops` | `@jaguilar87/gaia` (full) | All hooks, all modules, all agents, all skills, all commands, all tools, all config |
139
+ | `gaia-security` | `@jaguilar87/gaia` (security dist) | 5 hooks (`pre_tool_use`, `post_tool_use`, `stop_hook`, `user_prompt_submit`, `session_start`), all modules, no agents, no skills, `config/universal-rules.json` only |
140
+
141
+ ### Detection Cascade (`hooks/modules/core/plugin_mode.py`)
142
+
143
+ ```
144
+ 1. plugin-registry.json -- checks installed[].name for "gaia-ops" or "gaia-security"
145
+ 2. CLAUDE_PLUGIN_ROOT + plugin.json -- reads .claude-plugin/plugin.json name field
146
+ 3. NPM package path -- inspects node_modules path for package name
147
+ 4. GAIA_PLUGIN_MODE env -- explicit override ("security" or "ops")
148
+ 5. Default: "security" -- most restrictive fallback
149
+ ```
150
+
151
+ ### Mode Behavioral Differences
152
+
153
+ | Behavior | `security` mode | `ops` mode |
154
+ |----------|----------------|------------|
155
+ | T3 approval | Claude Code native dialog (`permissionDecision: ask`) | Hook blocks with nonce, orchestrator approval flow |
156
+ | Agents | None | 8 agents routed by orchestrator |
157
+ | Skills | None | 24 skills injected per frontmatter |
158
+ | Commands | None | 7 slash commands |
159
+ | PreToolUse matchers | `Bash` only | `Bash`, `Task`, `Agent`, `SendMessage`, multi-tool |
160
+ | File write protection | `_is_protected()` blocks hooks/ and settings*.json for Edit/Write tools | Same -- fires regardless of permissionMode |
161
+
162
+ ### Security Tiers (quick reference)
163
+
164
+ | Tier | Name | Side Effects | Approval |
165
+ |------|------|-------------|----------|
166
+ | T0 | Read-Only | None | No |
167
+ | T1 | Validation | None (local) | No |
168
+ | T2 | Simulation | None (dry-run) | No |
169
+ | T3 | Realization | Modifies state | Yes |
170
+
171
+ Enforcement: `blocked_commands.py` (permanent deny) + `mutative_verbs.py` (nonce-based approval). Everything not blocked and not mutative is safe by elimination.
172
+
173
+ ---
174
+
175
+ ## 3. Build / Publish Pipeline
176
+
177
+ ### Build
178
+
179
+ ```
180
+ scripts/build-plugin.py <plugin-name> [--output-dir <path>]
181
+ ```
182
+
183
+ 1. Reads `build/<plugin-name>.manifest.json`
184
+ 2. Resolves `"all"` to concrete file lists
185
+ 3. Copies to `dist/<plugin-name>/`
186
+ 4. Generates `hooks.json` and `settings.json` from manifest
187
+
188
+ ### Publish
189
+
190
+ ```
191
+ npm run build:plugins # builds both gaia-security + gaia-ops to dist/
192
+ npm run pre-publish:validate # validates dist/ contents
193
+ npm run prepublishOnly # build + validate (automatic before npm publish)
194
+ npm publish # publishes @jaguilar87/gaia
195
+ ```
196
+
197
+ ### Postinstall (`bin/gaia-update.js`, runs on `npm install`)
198
+
199
+ **First install** (no `.claude/`):
200
+ 1. Check Python 3 available
201
+ 2. Run `gaia-scan --npm-postinstall` to create `.claude/`, symlinks, settings, project-context
202
+ 3. Create `plugin-registry.json`
203
+ 4. Merge permissions into `settings.local.json`
204
+ 5. Merge hooks into `settings.local.json` -- also writes `defaultMode: acceptEdits` to `settings.local.json` for the parent session
205
+ 6. Verification
206
+
207
+ **Update** (`.claude/` exists):
208
+ 1. Show version transition
209
+ 2. `settings.json`: create only if missing (non-invasive)
210
+ 3. Merge permissions, env vars, agent key into `settings.local.json` (union, preserves user config)
211
+ 4. Merge hooks from `hooks.json` into `settings.local.json`
212
+ 5. Recreate/fix broken symlinks
213
+ 6. Verify hooks, Python, project-context, config
214
+
215
+ ### Symlinks Created
216
+
217
+ ```
218
+ .claude/agents -> node_modules/@jaguilar87/gaia/agents/
219
+ .claude/hooks -> node_modules/@jaguilar87/gaia/hooks/
220
+ .claude/skills -> node_modules/@jaguilar87/gaia/skills/
221
+ .claude/tools -> node_modules/@jaguilar87/gaia/tools/
222
+ .claude/commands -> node_modules/@jaguilar87/gaia/commands/
223
+ .claude/config -> node_modules/@jaguilar87/gaia/config/
224
+ ```
225
+
226
+ ---
227
+
228
+ ## 4. Test Pyramid
229
+
230
+ ### Layers
231
+
232
+ | Layer | Command | Cost | Speed | Count |
233
+ |-------|---------|------|-------|-------|
234
+ | L1 | `npm test` | Free | ~0.25s | ~1462 |
235
+ | L2 | `npm run test:layer2` | ~$0.10 | Minutes | ~11 |
236
+ | L3 | `npm run test:layer3` | Free | Minutes | ~13 |
237
+
238
+ ### L1 Categories (46 test files)
239
+
240
+ | Category | Directory | What it tests |
241
+ |----------|-----------|---------------|
242
+ | Prompt regression | `tests/layer1_prompt_regression/` | Routing table, skill content rules, agent frontmatter, agent prompts, security tier consistency, skills cross-reference, context contracts |
243
+ | Hooks | `tests/hooks/modules/` | Security modules (mutative_verbs, blocked_commands, tiers, gitops_validator, approval_grants, approval_scopes, command_semantics), tools (bash_validator, shell_parser, cloud_pipe_validator, task_validator), core (paths, state), context (context_writer) |
244
+ | System | `tests/system/` | Directory structure, permissions, agent definitions, configuration, schema compatibility |
245
+ | Tools | `tests/tools/` | context_provider, episodic, pending_updates, deep_merge, review_engine, surface_router |
246
+ | Integration | `tests/integration/` | Context enrichment, subagent lifecycle, subagent stop, nonce approval relay |
247
+ | Performance | `tests/performance/` | Context injection benchmarks |
248
+ | Cross-layer | `tests/test_cross_layer_consistency.py` | Consistency between hooks, config, and agents |
249
+
250
+ ### L2 (LLM Evaluation)
251
+
252
+ | File | What it tests |
253
+ |------|---------------|
254
+ | `tests/layer2_llm_evaluation/test_agent_behavior.py` | Agent response quality via LLM judge |
255
+
256
+ ### L3 (End-to-End)
257
+
258
+ | File | What it tests |
259
+ |------|---------------|
260
+ | `tests/layer3_e2e/test_installation_smoke.py` | npm install in /tmp/, symlinks, settings, hooks |
261
+ | `tests/layer3_e2e/test_hook_lifecycle.py` | Full hook lifecycle: pre/post tool use, session |
262
+
263
+ ### Which Tests for Which Changes
264
+
265
+ | Change | Run |
266
+ |--------|-----|
267
+ | Hook module (security, tools, core) | `pytest tests/hooks/ -v` |
268
+ | Agent definition (.md) | `pytest tests/layer1_prompt_regression/ tests/system/ -v` |
269
+ | Skill content | `pytest tests/layer1_prompt_regression/ -v` |
270
+ | Config file | `pytest tests/system/ tests/test_cross_layer_consistency.py -v` |
271
+ | Context/routing | `pytest tests/tools/ tests/integration/ -v` |
272
+ | CLI tool (bin/) | `pytest tests/layer3_e2e/ -v -m e2e` |
273
+ | Any change (pre-commit) | `npm test` (full L1) |
274
+ | Pre-publish | `npm run build:plugins && npm run pre-publish:validate` |
275
+
276
+ ---
277
+
278
+ ## 5. CLI Tools
279
+
280
+ | Command | Purpose | When to use |
281
+ |---------|---------|-------------|
282
+ | `npx gaia-doctor` | Health check: hooks reachable, symlinks valid, Python available, config present | After install, after update, debugging |
283
+ | `npx gaia-skills-diagnose` | Skills injection: verifies frontmatter, SKILL.md presence, injection pipeline | Skills not loading, wrong skills in agent |
284
+ | `npx gaia-status` | Installation status: version, mode, symlinks, settings | Quick status check |
285
+ | `npx gaia-metrics` | Usage analytics: hook invocations, tier distribution, approval rates | Performance analysis |
286
+ | `npx gaia-review` | Code review utility | PR review |
287
+ | `npx gaia-history` | Session history viewer | Debugging past sessions |
288
+ | `npx gaia-update` | Re-run postinstall: fix symlinks, merge settings | Manual repair |
289
+ | `npx gaia-cleanup` | Remove symlinks and settings (runs on preuninstall) | Before uninstall |
290
+ | `npx gaia-uninstall` | Full uninstall: cleanup + remove package artifacts | Complete removal |
291
+ | `npx gaia-scan` | Project scanner: detect stack, generate project-context.json | New project setup |
292
+ | `node bin/pre-publish-validate.js` | Validate dist/ before npm publish | Release workflow |
293
+
294
+ ---
295
+
296
+ ## 6. Metrics and Anomaly Detection
297
+
298
+ | Module | What It Tracks |
299
+ |--------|----------------|
300
+ | `audit/metrics.py` | Hook invocations, tier distribution, approval rates |
301
+ | `audit/event_detector.py` | Anomalous patterns in agent behavior |
302
+ | `audit/workflow_auditor.py` | Workflow compliance and audit trail |
303
+ | `npx gaia-metrics` | CLI access to collected metrics |
304
+
305
+ ---
306
+
307
+ ## 7. Dev Workflow
308
+
309
+ ### Dev Mode (symlinks to source)
310
+
311
+ ```bash
312
+ # In any project directory:
313
+ ln -sf /home/jorge/ws/me/gaia-dev/agents .claude/agents
314
+ ln -sf /home/jorge/ws/me/gaia-dev/hooks .claude/hooks
315
+ ln -sf /home/jorge/ws/me/gaia-dev/skills .claude/skills
316
+ ln -sf /home/jorge/ws/me/gaia-dev/tools .claude/tools
317
+ ln -sf /home/jorge/ws/me/gaia-dev/commands .claude/commands
318
+ ln -sf /home/jorge/ws/me/gaia-dev/config .claude/config
319
+ ```
320
+
321
+ Changes to source files take effect immediately (no build step).
322
+
323
+ ### Release Mode (npm install)
324
+
325
+ ```bash
326
+ npm install @jaguilar87/gaia
327
+ # postinstall creates symlinks: .claude/* -> node_modules/@jaguilar87/gaia/*
328
+ ```
329
+
330
+ ### Test Isolation
331
+
332
+ ```bash
333
+ cd /tmp
334
+ mkdir test-project && cd test-project
335
+ npm init -y
336
+ npm install ~/ws/me/gaia-dev # installs from local source
337
+ npx gaia-doctor # verify installation
338
+ npm test # run L1 suite from gaia-dev
339
+ ```
340
+
341
+ ### Version Bump + Publish
342
+
343
+ ```bash
344
+ npm version patch|minor|major # bump in package.json
345
+ npm run build:plugins # rebuild dist/
346
+ npm run pre-publish:validate # validate
347
+ npm publish # publish to npm
348
+ ```
349
+
350
+ ---
351
+
352
+ ## 8. Validation Tools
353
+
354
+ ### Routing Simulator
355
+
356
+ ```bash
357
+ python3 tools/gaia_simulator/cli.py "deploy the terraform changes"
358
+ ```
359
+
360
+ Tests the surface-routing pipeline: prompt -> intent extraction -> agent selection. Validates that `config/surface-routing.json` routes correctly without invoking any agent.
361
+
362
+ Components: `cli.py` (entry), `routing_simulator.py` (engine), `extractor.py` (intent), `skills_mapper.py` (skill resolution), `runner.py` (batch), `reporter.py` (output).
363
+
364
+ ### Transcript Analyzer
365
+
366
+ ```bash
367
+ # Within hooks, automatically invoked by subagent_stop
368
+ hooks/modules/agents/transcript_analyzer.py
369
+ ```
370
+
371
+ Analyzes agent transcripts for contract compliance, skill adherence, and behavioral patterns. Used by `subagent_stop.py` to validate agent output. Paired with `transcript_reader.py` for parsing.
372
+
373
+ ### Skills Diagnostics
374
+
375
+ ```bash
376
+ npx gaia-skills-diagnose
377
+ ```
378
+
379
+ Validates the full skills pipeline: frontmatter declarations, SKILL.md file presence, injection chain integrity, on-demand vs injected classification.
380
+
381
+ ### Approval Gate
382
+
383
+ ```bash
384
+ python3 tools/validation/approval_gate.py
385
+ ```
386
+
387
+ Validates T3 approval nonce lifecycle: generation, scope matching, expiry, grant/deny.
388
+
389
+ ### Doctor
390
+
391
+ ```bash
392
+ npx gaia-doctor
393
+ ```
394
+
395
+ Full system health: hook reachability (all 10 entry points), symlink integrity, Python environment, config file presence, settings.json/settings.local.json correctness.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: gaia-planner
3
+ description: Use when planning features or decomposing work into tasks from a brief
4
+ metadata:
5
+ user-invocable: false
6
+ type: technique
7
+ ---
8
+
9
+ # Gaia Planner
10
+
11
+ Plan creation from briefs. The planner produces plan.md and returns it
12
+ to the orchestrator. The orchestrator owns task dispatch and execution.
13
+
14
+ ## When to Activate
15
+
16
+ - A brief.md exists and needs to become an execution plan
17
+ - A plan.md needs revision or restructuring
18
+
19
+ ## Create Plan
20
+
21
+ Read the brief.md. Decompose into tasks. Write plan.md using the
22
+ plan structure defined in `reference.md`. For the full decomposition
23
+ process and task rules, see `reference.md`.
24
+
25
+ **Quick path:** Read brief -> decompose into tasks -> write plan.md
26
+ -> return plan.md to orchestrator.
27
+
28
+ Each task in plan.md carries: goal, AC with verify command, agent
29
+ assignment, context slice, and dependencies. This gives the orchestrator
30
+ everything it needs to dispatch using its own goal+AC model.
31
+
32
+ ## Anti-Patterns
33
+
34
+ - **Dispatching agents** -- the planner writes the plan; the orchestrator dispatches. If you have Agent() in your tools, something is wrong.
35
+ - **Fat tasks** -- a task needing more than one context window forces the agent to lose track. Split it.
36
+ - **Thin tasks** -- a task without its own context slice forces the agent to read the full brief. Inline the slice.
37
+ - **Vague ACs** -- every task needs a verify command the orchestrator can run post-dispatch. No verify command = no way to confirm completion.
@@ -0,0 +1,107 @@
1
+ # Gaia Planner -- Reference
2
+
3
+ ## Phase 1: Create Plan
4
+
5
+ ### Step 1: Read the Brief
6
+
7
+ Read the brief.md provided by the orchestrator. Extract:
8
+ - Objectives and approach
9
+ - Acceptance criteria: id, description, evidence{type, shape}, artifact
10
+ - Constraints from project-context
11
+ - Out of scope boundaries
12
+
13
+ Every task you write must cite which brief AC-id(s) it satisfies. A task
14
+ with no AC-id satisfies nothing observable; split or delete it.
15
+
16
+ No brief -> BLOCKED. Tell the orchestrator to create one first (brief-spec skill).
17
+
18
+ ### Step 2: Decompose into Tasks
19
+
20
+ Each task MUST:
21
+ - **Fit in one context window.** If you need to say "see also", split it.
22
+ - **Name its agent target.** Route by domain: terraform keywords -> terraform-architect, k8s/helm -> gitops-operator, code/test/build -> developer, gaia internals -> gaia-system.
23
+ - **Carry its own context slice.** The agent receives the task description, not the brief. Inline relevant constraints, file paths, and tech stack.
24
+ - **Cite the brief AC-ids it satisfies.** Every task lists `satisfies: [AC-1, AC-3]`. Unreferenced tasks get removed; uncovered ACs get new tasks.
25
+ - **Have a task-level AC with a command.** Binary pass/fail, internal to the task (build green, test passes, file exists).
26
+ - **Inherit the evidence slot from the brief AC.** The task AC is the technical proof (e.g. `pytest tests/auth/ -q` exits 0); the brief AC (e.g. login URL flow) is verified separately by the orchestrator post-dispatch.
27
+
28
+ Two AC levels, one per layer:
29
+ - **Brief AC (product):** what the user observes. Verified once, post-execution.
30
+ - **Task AC (technical):** what the agent must produce. Verified per task.
31
+
32
+ A feature is COMPLETE only when every task AC passes AND every brief AC's
33
+ evidence has been executed and persisted.
34
+
35
+ Task sizing: aim for 2-5 minutes of agent work. A task that takes 15 minutes
36
+ is three tasks that should have been split.
37
+
38
+ ### Step 3: Write plan.md
39
+
40
+ Use the structure below. Write plan.md to the same directory as the brief.
41
+ Do not reconstruct the path from the feature name -- read the brief's actual
42
+ directory path (which may have any prefix: `open_`, `in-progress_`, `closed_`)
43
+ and write plan.md there. This keeps the skill prefix-tolerant.
44
+
45
+ If the directory does not exist yet, default to:
46
+ `.claude/project-context/briefs/open_{feature-name}/plan.md`
47
+
48
+ ## Plan Structure
49
+
50
+ ```markdown
51
+ ---
52
+ status: draft
53
+ brief: ./brief.md
54
+ created: {date}
55
+ ---
56
+
57
+ # Plan: {Feature Name}
58
+
59
+ ## Approach
60
+ {Technical strategy -- 3-5 sentences}
61
+
62
+ ## Tasks
63
+
64
+ ### T1: {Task title}
65
+ - agent: {agent-type}
66
+ - status: pending
67
+ - satisfies: [AC-1, AC-2] # brief AC-ids this task contributes to
68
+ - AC: `{verify command}` # task-level technical proof, binary pass/fail
69
+ - blocked-by: none
70
+
71
+ **Context:** {Inline context slice}
72
+ **Change:** {Exact files + what changes}
73
+
74
+ ## Execution Order
75
+ {Dependency graph}
76
+ ```
77
+
78
+ Fill in:
79
+ - Approach (technical strategy, 3-5 sentences)
80
+ - Tasks with agent, status, AC, blocked-by, context, and change description
81
+ - Execution order (dependency graph)
82
+
83
+ ### Step 4: Task List Checkpoint
84
+
85
+ Before executing any tasks, present the complete task list and wait for
86
+ confirmation. The checkpoint must show:
87
+
88
+ - Task number, title, and target agent
89
+ - Dependencies (blocked-by relationships)
90
+ - Execution order
91
+
92
+ Ask: "Here are the tasks I plan to execute. Confirm to proceed, or
93
+ suggest changes." Do not dispatch until the user confirms.
94
+
95
+ ## Agent Routing Reference
96
+
97
+ Use this table to assign agent types to tasks in plan.md. The orchestrator
98
+ uses these assignments when dispatching.
99
+
100
+ | Domain Signal | Agent |
101
+ |---------------|-------|
102
+ | Terraform, IaC, cloud resources | `terraform-architect` |
103
+ | Kubernetes, Helm, Flux, manifests | `gitops-operator` |
104
+ | Live cluster, pods, logs, diagnostics | `cloud-troubleshooter` |
105
+ | App code, tests, CI/CD, Docker | `developer` |
106
+ | Gaia hooks, skills, agents, routing | `gaia-system` |
107
+ | Workspace, memory, email, automation | `gaia-operator` |
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: gaia-release
3
+ description: Use when testing, validating, or publishing Gaia releases (live testing, dry-run, beta, stable)
4
+ metadata:
5
+ user-invocable: false
6
+ type: technique
7
+ ---
8
+
9
+ # Gaia Release
10
+
11
+ Each mode tests a different surface. Live tests your code changes in your real workspace. Dry-run tests the install pipeline in an ephemeral sandbox. Beta and release test the distribution channel. Skipping a layer means discovering its bugs in production -- a live install over an existing workspace does not predict a missing file in `package.json`'s `files` array on a clean project, and a clean dry-run does not prove npm registry delivery works.
12
+
13
+ ## Decision Tree
14
+
15
+ ```
16
+ "I want to test Gaia"
17
+ ├─ Quick iteration on code? -> live (LOCAL)
18
+ ├─ Validate before publishing? -> dry-run (LOCAL)
19
+ ├─ Share pre-release with testers? -> beta (PIPELINE)
20
+ └─ Ship to all users? -> release (PIPELINE)
21
+ ```
22
+
23
+ ## Mode: live
24
+
25
+ Fresh tarball install over the current workspace -- packs the working tree and installs it like a real consumer would, but into the user's `.claude/` so restarts pick it up.
26
+
27
+ **When:** "test here", "try this out", "put it in live mode"
28
+
29
+ 1. From the gaia-ops-dev repo root, run: `npm run gaia:install-local`
30
+ - Runs `npm pack` to build the tarball from the working tree
31
+ - Invokes `bin/validate-sandbox.sh --target local` which detects the workspace (walk-up from cwd for a `.claude/` with a Gaia instance marker, falling back to `$HOME/ws/me/` if present), installs the tarball there, and runs the 8-check harness (settings-preservation check is skipped -- no pre-snapshot possible for a real workspace).
32
+ - Pass `--workspace <path>` to `bin/validate-sandbox.sh` directly to override auto-detection when you want to install into a specific project.
33
+ 2. Tell user: "Gaia fresh-installed locally from dev working tree. Restart Claude Code to activate."
34
+
35
+ **Default path:** Detected by the harness. Nearest `.claude/` ancestor of cwd with a Gaia marker, otherwise `$HOME/ws/me/` if present. Override with `--workspace <path>`.
36
+
37
+ **Revert:** `npm install @jaguilar87/gaia@rc` (or `@latest`) over the same workspace -- the next install wins.
38
+
39
+ Re-run `npm run gaia:install-local` whenever you want the workspace to pick up new edits from the working tree.
40
+
41
+ Live mode does not test build output's consumer path end-to-end in a clean project -- dry-run (`gaia:verify-install:local` -> sandbox in `/tmp/`) does.
42
+
43
+ ## Mode: dry-run
44
+
45
+ Validates the full install flow without publishing. Tests exactly what `npm publish` would ship.
46
+
47
+ **When:** "test the install", "dry-run", "validate before release"
48
+
49
+ Core sequence: build plugins -> validate build -> `npm pack` -> install .tgz in clean `/tmp/` project -> run `gaia-doctor` + `gaia-status` -> test both plugin modes (ops and security).
50
+
51
+ For step-by-step commands, see `reference.md`.
52
+
53
+ Test both modes: default (ops) validates orchestration and delegation. Security mode (`GAIA_PLUGIN_MODE=security`) validates the stripped-down path with no agents and native T3 dialog. A change that works in one mode can break the other because they load different skill sets and hook configurations.
54
+
55
+ ## Mode: beta
56
+
57
+ Pre-release published to npm via GitHub Actions. Install with `@beta` tag.
58
+
59
+ **When:** "publish beta", "beta release", "pre-release"
60
+
61
+ Dry-run must pass first. Then: bump version with beta pre-release tag -> merge PR to `main` -> create GitHub Release with beta version tag -> `publish.yml` triggers automatically.
62
+
63
+ For version bump details and verification steps, see `reference.md`.
64
+
65
+ ## Mode: release
66
+
67
+ Stable release published to npm via GitHub Actions. Install with `@latest` tag.
68
+
69
+ **When:** "publish release", "stable release", "ship it"
70
+
71
+ Same flow as beta with a stable version bump. The pipeline owns publishing -- `NPM_TOKEN` is in GitHub Secrets.
72
+
73
+ For step-by-step commands, see `reference.md`.
74
+
75
+ ## Pipeline: publish.yml
76
+
77
+ Triggered by GitHub Release events. Builds plugins, validates artifacts, auto-detects npm tag from version string (`-beta.` -> beta, `-rc.` -> rc, else -> latest), and publishes. Details in `reference.md`.
78
+
79
+ ## Anti-Patterns
80
+
81
+ - **Live-only testing** -- live tests the tarball on your actual workspace but with your accumulated state; an ephemeral sandbox (`gaia:verify-install:local`) is still needed to prove a clean-install works.
82
+ - **Local npm publish** -- the pipeline owns publishing; local publish bypasses build verification.
83
+ - **Single-mode testing** -- ops and security load different configurations; one can break independently.
84
+ - **Stale dist/** -- forgetting `npm run build:plugins` before pack means validating old code.
85
+ - **Missing restart** -- the process caches skills at startup; mode switches require restart.