@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.
- package/.claude-plugin/marketplace.json +33 -0
- package/.claude-plugin/plugin.json +26 -0
- package/ARCHITECTURE.md +335 -0
- package/CHANGELOG.md +1298 -0
- package/CODE_OF_CONDUCT.md +11 -0
- package/CONTRIBUTING.md +146 -0
- package/INSTALL.md +436 -0
- package/LICENSE +21 -0
- package/README.md +222 -0
- package/SECURITY.md +47 -0
- package/agents/README.md +78 -0
- package/agents/cloud-troubleshooter.md +73 -0
- package/agents/developer.md +65 -0
- package/agents/gaia-operator.md +64 -0
- package/agents/gaia-orchestrator.md +111 -0
- package/agents/gaia-planner.md +53 -0
- package/agents/gaia-system.md +71 -0
- package/agents/gitops-operator.md +61 -0
- package/agents/terraform-architect.md +63 -0
- package/bin/README.md +106 -0
- package/bin/cli/__init__.py +1 -0
- package/bin/cli/approvals.py +740 -0
- package/bin/cli/cleanup.py +562 -0
- package/bin/cli/context.py +283 -0
- package/bin/cli/doctor.py +651 -0
- package/bin/cli/history.py +305 -0
- package/bin/cli/memory.py +483 -0
- package/bin/cli/metrics.py +1068 -0
- package/bin/cli/plans.py +515 -0
- package/bin/cli/status.py +302 -0
- package/bin/cli/update.py +382 -0
- package/bin/gaia +112 -0
- package/bin/gaia-cleanup.js +531 -0
- package/bin/gaia-doctor.js +635 -0
- package/bin/gaia-evidence +126 -0
- package/bin/gaia-history.js +251 -0
- package/bin/gaia-metrics.js +1278 -0
- package/bin/gaia-review.js +269 -0
- package/bin/gaia-scan +44 -0
- package/bin/gaia-scan.py +589 -0
- package/bin/gaia-skills-diagnose.js +929 -0
- package/bin/gaia-status.js +278 -0
- package/bin/gaia-uninstall.js +111 -0
- package/bin/gaia-update.js +919 -0
- package/bin/pre-publish-validate.js +610 -0
- package/bin/python-detect.js +60 -0
- package/bin/validate-sandbox.sh +601 -0
- package/commands/README.md +64 -0
- package/commands/gaia.md +37 -0
- package/commands/scan-project.md +67 -0
- package/config/README.md +71 -0
- package/config/cloud/aws.json +134 -0
- package/config/cloud/gcp.json +139 -0
- package/config/context-contracts.json +158 -0
- package/config/crons-schema.md +81 -0
- package/config/git_standards.json +72 -0
- package/config/surface-routing.json +417 -0
- package/config/universal-rules.json +102 -0
- package/dist/gaia-ops/.claude-plugin/plugin.json +24 -0
- package/dist/gaia-ops/README.md +80 -0
- package/dist/gaia-ops/agents/cloud-troubleshooter.md +73 -0
- package/dist/gaia-ops/agents/developer.md +65 -0
- package/dist/gaia-ops/agents/gaia-operator.md +64 -0
- package/dist/gaia-ops/agents/gaia-orchestrator.md +111 -0
- package/dist/gaia-ops/agents/gaia-planner.md +53 -0
- package/dist/gaia-ops/agents/gaia-system.md +71 -0
- package/dist/gaia-ops/agents/gitops-operator.md +61 -0
- package/dist/gaia-ops/agents/terraform-architect.md +63 -0
- package/dist/gaia-ops/commands/gaia.md +37 -0
- package/dist/gaia-ops/config/README.md +71 -0
- package/dist/gaia-ops/config/cloud/aws.json +134 -0
- package/dist/gaia-ops/config/cloud/gcp.json +139 -0
- package/dist/gaia-ops/config/context-contracts.json +158 -0
- package/dist/gaia-ops/config/crons-schema.md +81 -0
- package/dist/gaia-ops/config/git_standards.json +72 -0
- package/dist/gaia-ops/config/surface-routing.json +417 -0
- package/dist/gaia-ops/config/universal-rules.json +102 -0
- package/dist/gaia-ops/hooks/adapters/__init__.py +52 -0
- package/dist/gaia-ops/hooks/adapters/base.py +219 -0
- package/dist/gaia-ops/hooks/adapters/channel.py +17 -0
- package/dist/gaia-ops/hooks/adapters/claude_code.py +1890 -0
- package/dist/gaia-ops/hooks/adapters/types.py +194 -0
- package/dist/gaia-ops/hooks/adapters/utils.py +25 -0
- package/dist/gaia-ops/hooks/hooks.json +192 -0
- package/dist/gaia-ops/hooks/modules/__init__.py +15 -0
- package/dist/gaia-ops/hooks/modules/agents/__init__.py +29 -0
- package/dist/gaia-ops/hooks/modules/agents/contract_validator.py +647 -0
- package/dist/gaia-ops/hooks/modules/agents/response_contract.py +496 -0
- package/dist/gaia-ops/hooks/modules/agents/skill_injection_verifier.py +120 -0
- package/dist/gaia-ops/hooks/modules/agents/state_tracker.py +267 -0
- package/dist/gaia-ops/hooks/modules/agents/task_info_builder.py +74 -0
- package/dist/gaia-ops/hooks/modules/agents/transcript_analyzer.py +458 -0
- package/dist/gaia-ops/hooks/modules/agents/transcript_reader.py +152 -0
- package/dist/gaia-ops/hooks/modules/audit/__init__.py +28 -0
- package/dist/gaia-ops/hooks/modules/audit/event_detector.py +168 -0
- package/dist/gaia-ops/hooks/modules/audit/logger.py +131 -0
- package/dist/gaia-ops/hooks/modules/audit/metrics.py +134 -0
- package/dist/gaia-ops/hooks/modules/audit/workflow_auditor.py +611 -0
- package/dist/gaia-ops/hooks/modules/audit/workflow_recorder.py +296 -0
- package/dist/gaia-ops/hooks/modules/context/__init__.py +11 -0
- package/dist/gaia-ops/hooks/modules/context/agentic_loop_detector.py +165 -0
- package/dist/gaia-ops/hooks/modules/context/anchor_tracker.py +317 -0
- package/dist/gaia-ops/hooks/modules/context/compact_context_builder.py +218 -0
- package/dist/gaia-ops/hooks/modules/context/context_freshness.py +145 -0
- package/dist/gaia-ops/hooks/modules/context/context_injector.py +558 -0
- package/dist/gaia-ops/hooks/modules/context/context_writer.py +530 -0
- package/dist/gaia-ops/hooks/modules/context/contracts_loader.py +161 -0
- package/dist/gaia-ops/hooks/modules/core/__init__.py +40 -0
- package/dist/gaia-ops/hooks/modules/core/hook_entry.py +78 -0
- package/dist/gaia-ops/hooks/modules/core/paths.py +160 -0
- package/dist/gaia-ops/hooks/modules/core/plugin_mode.py +149 -0
- package/dist/gaia-ops/hooks/modules/core/plugin_setup.py +577 -0
- package/dist/gaia-ops/hooks/modules/core/state.py +179 -0
- package/dist/gaia-ops/hooks/modules/core/stdin.py +24 -0
- package/dist/gaia-ops/hooks/modules/events/__init__.py +1 -0
- package/dist/gaia-ops/hooks/modules/events/event_writer.py +210 -0
- package/dist/gaia-ops/hooks/modules/memory/__init__.py +8 -0
- package/dist/gaia-ops/hooks/modules/memory/episode_writer.py +216 -0
- package/dist/gaia-ops/hooks/modules/orchestrator/__init__.py +1 -0
- package/dist/gaia-ops/hooks/modules/orchestrator/delegate_mode.py +122 -0
- package/dist/gaia-ops/hooks/modules/scanning/__init__.py +8 -0
- package/dist/gaia-ops/hooks/modules/scanning/scan_trigger.py +84 -0
- package/dist/gaia-ops/hooks/modules/security/__init__.py +120 -0
- package/dist/gaia-ops/hooks/modules/security/approval_cleanup.py +87 -0
- package/dist/gaia-ops/hooks/modules/security/approval_constants.py +23 -0
- package/dist/gaia-ops/hooks/modules/security/approval_grants.py +1638 -0
- package/dist/gaia-ops/hooks/modules/security/approval_messages.py +71 -0
- package/dist/gaia-ops/hooks/modules/security/approval_scopes.py +222 -0
- package/dist/gaia-ops/hooks/modules/security/blocked_commands.py +595 -0
- package/dist/gaia-ops/hooks/modules/security/blocked_message_formatter.py +87 -0
- package/dist/gaia-ops/hooks/modules/security/command_semantics.py +181 -0
- package/dist/gaia-ops/hooks/modules/security/composition_rules.py +547 -0
- package/dist/gaia-ops/hooks/modules/security/flag_classifiers.py +873 -0
- package/dist/gaia-ops/hooks/modules/security/gitops_validator.py +179 -0
- package/dist/gaia-ops/hooks/modules/security/mutative_verbs.py +1131 -0
- package/dist/gaia-ops/hooks/modules/security/network_hosts.py +481 -0
- package/dist/gaia-ops/hooks/modules/security/prompt_validator.py +40 -0
- package/dist/gaia-ops/hooks/modules/security/shell_unwrapper.py +165 -0
- package/dist/gaia-ops/hooks/modules/security/tiers.py +196 -0
- package/dist/gaia-ops/hooks/modules/session/__init__.py +10 -0
- package/dist/gaia-ops/hooks/modules/session/pending_scanner.py +174 -0
- package/dist/gaia-ops/hooks/modules/session/session_context_writer.py +100 -0
- package/dist/gaia-ops/hooks/modules/session/session_event_injector.py +160 -0
- package/dist/gaia-ops/hooks/modules/session/session_manager.py +31 -0
- package/dist/gaia-ops/hooks/modules/session/session_registry.py +333 -0
- package/dist/gaia-ops/hooks/modules/tools/__init__.py +29 -0
- package/dist/gaia-ops/hooks/modules/tools/bash_validator.py +1008 -0
- package/dist/gaia-ops/hooks/modules/tools/cloud_pipe_validator.py +231 -0
- package/dist/gaia-ops/hooks/modules/tools/hook_response.py +55 -0
- package/dist/gaia-ops/hooks/modules/tools/shell_parser.py +227 -0
- package/dist/gaia-ops/hooks/modules/tools/stage_decomposer.py +315 -0
- package/dist/gaia-ops/hooks/modules/tools/task_validator.py +294 -0
- package/dist/gaia-ops/hooks/modules/validation/__init__.py +23 -0
- package/dist/gaia-ops/hooks/modules/validation/commit_validator.py +380 -0
- package/dist/gaia-ops/hooks/post_compact.py +43 -0
- package/dist/gaia-ops/hooks/post_tool_use.py +54 -0
- package/dist/gaia-ops/hooks/pre_compact.py +60 -0
- package/dist/gaia-ops/hooks/pre_tool_use.py +413 -0
- package/dist/gaia-ops/hooks/session_end_hook.py +77 -0
- package/dist/gaia-ops/hooks/session_start.py +81 -0
- package/dist/gaia-ops/hooks/stop_hook.py +70 -0
- package/dist/gaia-ops/hooks/subagent_start.py +71 -0
- package/dist/gaia-ops/hooks/subagent_stop.py +295 -0
- package/dist/gaia-ops/hooks/task_completed.py +70 -0
- package/dist/gaia-ops/hooks/user_prompt_submit.py +246 -0
- package/dist/gaia-ops/settings.json +72 -0
- package/dist/gaia-ops/skills/README.md +158 -0
- package/dist/gaia-ops/skills/agent-creation/SKILL.md +87 -0
- package/dist/gaia-ops/skills/agent-creation/examples.md +170 -0
- package/dist/gaia-ops/skills/agent-creation/reference.md +191 -0
- package/dist/gaia-ops/skills/agent-protocol/SKILL.md +93 -0
- package/dist/gaia-ops/skills/agent-protocol/examples.md +223 -0
- package/dist/gaia-ops/skills/agent-response/SKILL.md +69 -0
- package/dist/gaia-ops/skills/agentic-loop/SKILL.md +80 -0
- package/dist/gaia-ops/skills/agentic-loop/reference.md +378 -0
- package/dist/gaia-ops/skills/blog-writing/SKILL.md +98 -0
- package/dist/gaia-ops/skills/blog-writing/reference.md +130 -0
- package/dist/gaia-ops/skills/brief-spec/SKILL.md +185 -0
- package/dist/gaia-ops/skills/command-execution/SKILL.md +64 -0
- package/dist/gaia-ops/skills/command-execution/reference.md +83 -0
- package/dist/gaia-ops/skills/context-updater/SKILL.md +87 -0
- package/dist/gaia-ops/skills/context-updater/examples.md +71 -0
- package/dist/gaia-ops/skills/developer-patterns/SKILL.md +50 -0
- package/dist/gaia-ops/skills/developer-patterns/reference.md +112 -0
- package/dist/gaia-ops/skills/execution/SKILL.md +99 -0
- package/dist/gaia-ops/skills/fast-queries/SKILL.md +43 -0
- package/dist/gaia-ops/skills/gaia-compact/SKILL.md +74 -0
- package/dist/gaia-ops/skills/gaia-patterns/SKILL.md +108 -0
- package/dist/gaia-ops/skills/gaia-patterns/reference.md +395 -0
- package/dist/gaia-ops/skills/gaia-planner/SKILL.md +37 -0
- package/dist/gaia-ops/skills/gaia-planner/reference.md +107 -0
- package/dist/gaia-ops/skills/gaia-release/SKILL.md +85 -0
- package/dist/gaia-ops/skills/gaia-release/reference.md +92 -0
- package/dist/gaia-ops/skills/gaia-self-check/SKILL.md +114 -0
- package/dist/gaia-ops/skills/gaia-self-check/reference.md +453 -0
- package/dist/gaia-ops/skills/gaia-verify/SKILL.md +77 -0
- package/dist/gaia-ops/skills/gaia-verify/reference.md +80 -0
- package/dist/gaia-ops/skills/git-conventions/SKILL.md +47 -0
- package/dist/gaia-ops/skills/gitops-patterns/SKILL.md +60 -0
- package/dist/gaia-ops/skills/gitops-patterns/reference.md +183 -0
- package/dist/gaia-ops/skills/gmail-policy/SKILL.md +200 -0
- package/dist/gaia-ops/skills/gmail-policy/reference.md +150 -0
- package/dist/gaia-ops/skills/gmail-triage/SKILL.md +100 -0
- package/dist/gaia-ops/skills/gws-setup/SKILL.md +99 -0
- package/dist/gaia-ops/skills/gws-setup/reference.md +73 -0
- package/dist/gaia-ops/skills/investigation/SKILL.md +100 -0
- package/dist/gaia-ops/skills/memory-curation/SKILL.md +83 -0
- package/dist/gaia-ops/skills/memory-search/SKILL.md +88 -0
- package/dist/gaia-ops/skills/orchestrator-approval/SKILL.md +160 -0
- package/dist/gaia-ops/skills/orchestrator-approval/reference.md +174 -0
- package/dist/gaia-ops/skills/pending-approvals/SKILL.md +72 -0
- package/dist/gaia-ops/skills/pending-approvals/reference.md +214 -0
- package/dist/gaia-ops/skills/readme-writing/SKILL.md +71 -0
- package/dist/gaia-ops/skills/readme-writing/reference.md +188 -0
- package/dist/gaia-ops/skills/reference.md +135 -0
- package/dist/gaia-ops/skills/request-approval/SKILL.md +140 -0
- package/dist/gaia-ops/skills/request-approval/examples.md +140 -0
- package/dist/gaia-ops/skills/request-approval/reference.md +57 -0
- package/dist/gaia-ops/skills/schedule-task/SKILL.md +64 -0
- package/dist/gaia-ops/skills/schedule-task/reference.md +233 -0
- package/dist/gaia-ops/skills/security-tiers/SKILL.md +141 -0
- package/dist/gaia-ops/skills/security-tiers/destructive-commands-reference.md +623 -0
- package/dist/gaia-ops/skills/security-tiers/reference.md +39 -0
- package/dist/gaia-ops/skills/session-reflection/SKILL.md +69 -0
- package/dist/gaia-ops/skills/skill-creation/SKILL.md +92 -0
- package/dist/gaia-ops/skills/skill-creation/reference.md +29 -0
- package/dist/gaia-ops/skills/terraform-patterns/SKILL.md +89 -0
- package/dist/gaia-ops/skills/terraform-patterns/reference.md +93 -0
- package/dist/gaia-ops/tools/__init__.py +9 -0
- package/dist/gaia-ops/tools/agentic-loop/decide-status.py +210 -0
- package/dist/gaia-ops/tools/agentic-loop/parse-metric.py +106 -0
- package/dist/gaia-ops/tools/agentic-loop/record-iteration.py +221 -0
- package/dist/gaia-ops/tools/context/README.md +132 -0
- package/dist/gaia-ops/tools/context/__init__.py +42 -0
- package/dist/gaia-ops/tools/context/_paths.py +20 -0
- package/dist/gaia-ops/tools/context/context_provider.py +721 -0
- package/dist/gaia-ops/tools/context/context_section_reader.py +342 -0
- package/dist/gaia-ops/tools/context/deep_merge.py +159 -0
- package/dist/gaia-ops/tools/context/pending_updates.py +760 -0
- package/dist/gaia-ops/tools/context/surface_router.py +278 -0
- package/dist/gaia-ops/tools/fast-queries/README.md +65 -0
- package/dist/gaia-ops/tools/fast-queries/__init__.py +30 -0
- package/dist/gaia-ops/tools/fast-queries/appservices/quicktriage_devops_developer.sh +75 -0
- package/dist/gaia-ops/tools/fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh +32 -0
- package/dist/gaia-ops/tools/fast-queries/cloud/gcp/quicktriage_gcp_troubleshooter.sh +88 -0
- package/dist/gaia-ops/tools/fast-queries/gitops/quicktriage_gitops_operator.sh +48 -0
- package/dist/gaia-ops/tools/fast-queries/run_triage.sh +59 -0
- package/dist/gaia-ops/tools/fast-queries/terraform/quicktriage_terraform_architect.sh +80 -0
- package/dist/gaia-ops/tools/gaia_simulator/__init__.py +33 -0
- package/dist/gaia-ops/tools/gaia_simulator/cli.py +354 -0
- package/dist/gaia-ops/tools/gaia_simulator/extractor.py +457 -0
- package/dist/gaia-ops/tools/gaia_simulator/reporter.py +258 -0
- package/dist/gaia-ops/tools/gaia_simulator/routing_simulator.py +334 -0
- package/dist/gaia-ops/tools/gaia_simulator/runner.py +539 -0
- package/dist/gaia-ops/tools/gaia_simulator/skills_mapper.py +264 -0
- package/dist/gaia-ops/tools/memory/README.md +0 -0
- package/dist/gaia-ops/tools/memory/__init__.py +20 -0
- package/dist/gaia-ops/tools/memory/backfill_fts5.py +107 -0
- package/dist/gaia-ops/tools/memory/conflict_detector.py +295 -0
- package/dist/gaia-ops/tools/memory/episodic.py +1210 -0
- package/dist/gaia-ops/tools/memory/git_invalidator.py +262 -0
- package/dist/gaia-ops/tools/memory/paths.py +102 -0
- package/dist/gaia-ops/tools/memory/scoring.py +193 -0
- package/dist/gaia-ops/tools/memory/search_store.py +375 -0
- package/dist/gaia-ops/tools/persist_transcript_analysis.py +85 -0
- package/dist/gaia-ops/tools/review/__init__.py +1 -0
- package/dist/gaia-ops/tools/review/review_engine.py +157 -0
- package/dist/gaia-ops/tools/scan/__init__.py +35 -0
- package/dist/gaia-ops/tools/scan/config.py +247 -0
- package/dist/gaia-ops/tools/scan/merge.py +212 -0
- package/dist/gaia-ops/tools/scan/orchestrator.py +549 -0
- package/dist/gaia-ops/tools/scan/registry.py +127 -0
- package/dist/gaia-ops/tools/scan/scanners/__init__.py +18 -0
- package/dist/gaia-ops/tools/scan/scanners/base.py +137 -0
- package/dist/gaia-ops/tools/scan/scanners/environment.py +349 -0
- package/dist/gaia-ops/tools/scan/scanners/git.py +570 -0
- package/dist/gaia-ops/tools/scan/scanners/infrastructure.py +875 -0
- package/dist/gaia-ops/tools/scan/scanners/orchestration.py +600 -0
- package/dist/gaia-ops/tools/scan/scanners/stack.py +1085 -0
- package/dist/gaia-ops/tools/scan/scanners/tools.py +260 -0
- package/dist/gaia-ops/tools/scan/setup.py +686 -0
- package/dist/gaia-ops/tools/scan/tests/__init__.py +1 -0
- package/dist/gaia-ops/tools/scan/tests/conftest.py +796 -0
- package/dist/gaia-ops/tools/scan/tests/test_environment.py +323 -0
- package/dist/gaia-ops/tools/scan/tests/test_git.py +419 -0
- package/dist/gaia-ops/tools/scan/tests/test_infrastructure.py +382 -0
- package/dist/gaia-ops/tools/scan/tests/test_integration.py +920 -0
- package/dist/gaia-ops/tools/scan/tests/test_merge.py +269 -0
- package/dist/gaia-ops/tools/scan/tests/test_orchestration.py +304 -0
- package/dist/gaia-ops/tools/scan/tests/test_stack.py +604 -0
- package/dist/gaia-ops/tools/scan/tests/test_tools.py +349 -0
- package/dist/gaia-ops/tools/scan/ui.py +624 -0
- package/dist/gaia-ops/tools/scan/verify.py +270 -0
- package/dist/gaia-ops/tools/scan/walk.py +118 -0
- package/dist/gaia-ops/tools/scan/workspace.py +85 -0
- package/dist/gaia-ops/tools/validation/README.md +244 -0
- package/dist/gaia-ops/tools/validation/__init__.py +17 -0
- package/dist/gaia-ops/tools/validation/approval_gate.py +321 -0
- package/dist/gaia-ops/tools/validation/validate_skills.py +189 -0
- package/dist/gaia-security/.claude-plugin/plugin.json +24 -0
- package/dist/gaia-security/README.md +90 -0
- package/dist/gaia-security/config/universal-rules.json +102 -0
- package/dist/gaia-security/hooks/adapters/__init__.py +52 -0
- package/dist/gaia-security/hooks/adapters/base.py +219 -0
- package/dist/gaia-security/hooks/adapters/channel.py +17 -0
- package/dist/gaia-security/hooks/adapters/claude_code.py +1890 -0
- package/dist/gaia-security/hooks/adapters/types.py +194 -0
- package/dist/gaia-security/hooks/adapters/utils.py +25 -0
- package/dist/gaia-security/hooks/hooks.json +113 -0
- package/dist/gaia-security/hooks/modules/__init__.py +15 -0
- package/dist/gaia-security/hooks/modules/agents/__init__.py +29 -0
- package/dist/gaia-security/hooks/modules/agents/contract_validator.py +647 -0
- package/dist/gaia-security/hooks/modules/agents/response_contract.py +496 -0
- package/dist/gaia-security/hooks/modules/agents/skill_injection_verifier.py +120 -0
- package/dist/gaia-security/hooks/modules/agents/state_tracker.py +267 -0
- package/dist/gaia-security/hooks/modules/agents/task_info_builder.py +74 -0
- package/dist/gaia-security/hooks/modules/agents/transcript_analyzer.py +458 -0
- package/dist/gaia-security/hooks/modules/agents/transcript_reader.py +152 -0
- package/dist/gaia-security/hooks/modules/audit/__init__.py +28 -0
- package/dist/gaia-security/hooks/modules/audit/event_detector.py +168 -0
- package/dist/gaia-security/hooks/modules/audit/logger.py +131 -0
- package/dist/gaia-security/hooks/modules/audit/metrics.py +134 -0
- package/dist/gaia-security/hooks/modules/audit/workflow_auditor.py +611 -0
- package/dist/gaia-security/hooks/modules/audit/workflow_recorder.py +296 -0
- package/dist/gaia-security/hooks/modules/context/__init__.py +11 -0
- package/dist/gaia-security/hooks/modules/context/agentic_loop_detector.py +165 -0
- package/dist/gaia-security/hooks/modules/context/anchor_tracker.py +317 -0
- package/dist/gaia-security/hooks/modules/context/compact_context_builder.py +218 -0
- package/dist/gaia-security/hooks/modules/context/context_freshness.py +145 -0
- package/dist/gaia-security/hooks/modules/context/context_injector.py +558 -0
- package/dist/gaia-security/hooks/modules/context/context_writer.py +530 -0
- package/dist/gaia-security/hooks/modules/context/contracts_loader.py +161 -0
- package/dist/gaia-security/hooks/modules/core/__init__.py +40 -0
- package/dist/gaia-security/hooks/modules/core/hook_entry.py +78 -0
- package/dist/gaia-security/hooks/modules/core/paths.py +160 -0
- package/dist/gaia-security/hooks/modules/core/plugin_mode.py +149 -0
- package/dist/gaia-security/hooks/modules/core/plugin_setup.py +577 -0
- package/dist/gaia-security/hooks/modules/core/state.py +179 -0
- package/dist/gaia-security/hooks/modules/core/stdin.py +24 -0
- package/dist/gaia-security/hooks/modules/events/__init__.py +1 -0
- package/dist/gaia-security/hooks/modules/events/event_writer.py +210 -0
- package/dist/gaia-security/hooks/modules/memory/__init__.py +8 -0
- package/dist/gaia-security/hooks/modules/memory/episode_writer.py +216 -0
- package/dist/gaia-security/hooks/modules/orchestrator/__init__.py +1 -0
- package/dist/gaia-security/hooks/modules/orchestrator/delegate_mode.py +122 -0
- package/dist/gaia-security/hooks/modules/scanning/__init__.py +8 -0
- package/dist/gaia-security/hooks/modules/scanning/scan_trigger.py +84 -0
- package/dist/gaia-security/hooks/modules/security/__init__.py +120 -0
- package/dist/gaia-security/hooks/modules/security/approval_cleanup.py +87 -0
- package/dist/gaia-security/hooks/modules/security/approval_constants.py +23 -0
- package/dist/gaia-security/hooks/modules/security/approval_grants.py +1638 -0
- package/dist/gaia-security/hooks/modules/security/approval_messages.py +71 -0
- package/dist/gaia-security/hooks/modules/security/approval_scopes.py +222 -0
- package/dist/gaia-security/hooks/modules/security/blocked_commands.py +595 -0
- package/dist/gaia-security/hooks/modules/security/blocked_message_formatter.py +87 -0
- package/dist/gaia-security/hooks/modules/security/command_semantics.py +181 -0
- package/dist/gaia-security/hooks/modules/security/composition_rules.py +547 -0
- package/dist/gaia-security/hooks/modules/security/flag_classifiers.py +873 -0
- package/dist/gaia-security/hooks/modules/security/gitops_validator.py +179 -0
- package/dist/gaia-security/hooks/modules/security/mutative_verbs.py +1131 -0
- package/dist/gaia-security/hooks/modules/security/network_hosts.py +481 -0
- package/dist/gaia-security/hooks/modules/security/prompt_validator.py +40 -0
- package/dist/gaia-security/hooks/modules/security/shell_unwrapper.py +165 -0
- package/dist/gaia-security/hooks/modules/security/tiers.py +196 -0
- package/dist/gaia-security/hooks/modules/session/__init__.py +10 -0
- package/dist/gaia-security/hooks/modules/session/pending_scanner.py +174 -0
- package/dist/gaia-security/hooks/modules/session/session_context_writer.py +100 -0
- package/dist/gaia-security/hooks/modules/session/session_event_injector.py +160 -0
- package/dist/gaia-security/hooks/modules/session/session_manager.py +31 -0
- package/dist/gaia-security/hooks/modules/session/session_registry.py +333 -0
- package/dist/gaia-security/hooks/modules/tools/__init__.py +29 -0
- package/dist/gaia-security/hooks/modules/tools/bash_validator.py +1008 -0
- package/dist/gaia-security/hooks/modules/tools/cloud_pipe_validator.py +231 -0
- package/dist/gaia-security/hooks/modules/tools/hook_response.py +55 -0
- package/dist/gaia-security/hooks/modules/tools/shell_parser.py +227 -0
- package/dist/gaia-security/hooks/modules/tools/stage_decomposer.py +315 -0
- package/dist/gaia-security/hooks/modules/tools/task_validator.py +294 -0
- package/dist/gaia-security/hooks/modules/validation/__init__.py +23 -0
- package/dist/gaia-security/hooks/modules/validation/commit_validator.py +380 -0
- package/dist/gaia-security/hooks/post_tool_use.py +54 -0
- package/dist/gaia-security/hooks/pre_tool_use.py +413 -0
- package/dist/gaia-security/hooks/session_end_hook.py +77 -0
- package/dist/gaia-security/hooks/session_start.py +81 -0
- package/dist/gaia-security/hooks/stop_hook.py +70 -0
- package/dist/gaia-security/hooks/user_prompt_submit.py +246 -0
- package/dist/gaia-security/settings.json +58 -0
- package/git-hooks/commit-msg +41 -0
- package/hooks/README.md +100 -0
- package/hooks/adapters/__init__.py +52 -0
- package/hooks/adapters/base.py +219 -0
- package/hooks/adapters/channel.py +17 -0
- package/hooks/adapters/claude_code.py +1890 -0
- package/hooks/adapters/types.py +194 -0
- package/hooks/adapters/utils.py +25 -0
- package/hooks/elicitation_result.py +179 -0
- package/hooks/hooks.json +84 -0
- package/hooks/modules/README.md +189 -0
- package/hooks/modules/__init__.py +15 -0
- package/hooks/modules/agents/__init__.py +29 -0
- package/hooks/modules/agents/contract_validator.py +647 -0
- package/hooks/modules/agents/response_contract.py +496 -0
- package/hooks/modules/agents/skill_injection_verifier.py +120 -0
- package/hooks/modules/agents/state_tracker.py +267 -0
- package/hooks/modules/agents/task_info_builder.py +74 -0
- package/hooks/modules/agents/transcript_analyzer.py +458 -0
- package/hooks/modules/agents/transcript_reader.py +152 -0
- package/hooks/modules/audit/__init__.py +28 -0
- package/hooks/modules/audit/event_detector.py +168 -0
- package/hooks/modules/audit/logger.py +131 -0
- package/hooks/modules/audit/metrics.py +134 -0
- package/hooks/modules/audit/workflow_auditor.py +611 -0
- package/hooks/modules/audit/workflow_recorder.py +296 -0
- package/hooks/modules/context/__init__.py +11 -0
- package/hooks/modules/context/agentic_loop_detector.py +165 -0
- package/hooks/modules/context/anchor_tracker.py +317 -0
- package/hooks/modules/context/compact_context_builder.py +218 -0
- package/hooks/modules/context/context_freshness.py +145 -0
- package/hooks/modules/context/context_injector.py +558 -0
- package/hooks/modules/context/context_writer.py +530 -0
- package/hooks/modules/context/contracts_loader.py +161 -0
- package/hooks/modules/core/__init__.py +40 -0
- package/hooks/modules/core/hook_entry.py +78 -0
- package/hooks/modules/core/paths.py +160 -0
- package/hooks/modules/core/plugin_mode.py +149 -0
- package/hooks/modules/core/plugin_setup.py +577 -0
- package/hooks/modules/core/state.py +179 -0
- package/hooks/modules/core/stdin.py +24 -0
- package/hooks/modules/events/__init__.py +1 -0
- package/hooks/modules/events/event_writer.py +210 -0
- package/hooks/modules/evidence/__init__.py +34 -0
- package/hooks/modules/evidence/assertions.py +137 -0
- package/hooks/modules/evidence/index_writer.py +57 -0
- package/hooks/modules/evidence/loader.py +126 -0
- package/hooks/modules/evidence/runner.py +241 -0
- package/hooks/modules/memory/__init__.py +8 -0
- package/hooks/modules/memory/episode_writer.py +216 -0
- package/hooks/modules/orchestrator/__init__.py +1 -0
- package/hooks/modules/orchestrator/delegate_mode.py +122 -0
- package/hooks/modules/scanning/__init__.py +8 -0
- package/hooks/modules/scanning/scan_trigger.py +84 -0
- package/hooks/modules/security/__init__.py +120 -0
- package/hooks/modules/security/approval_cleanup.py +87 -0
- package/hooks/modules/security/approval_constants.py +23 -0
- package/hooks/modules/security/approval_grants.py +1638 -0
- package/hooks/modules/security/approval_messages.py +71 -0
- package/hooks/modules/security/approval_scopes.py +222 -0
- package/hooks/modules/security/blocked_commands.py +595 -0
- package/hooks/modules/security/blocked_message_formatter.py +87 -0
- package/hooks/modules/security/command_semantics.py +181 -0
- package/hooks/modules/security/composition_rules.py +547 -0
- package/hooks/modules/security/flag_classifiers.py +873 -0
- package/hooks/modules/security/gitops_validator.py +179 -0
- package/hooks/modules/security/mutative_verbs.py +1131 -0
- package/hooks/modules/security/network_hosts.py +481 -0
- package/hooks/modules/security/prompt_validator.py +40 -0
- package/hooks/modules/security/shell_unwrapper.py +165 -0
- package/hooks/modules/security/tiers.py +196 -0
- package/hooks/modules/session/__init__.py +10 -0
- package/hooks/modules/session/pending_scanner.py +174 -0
- package/hooks/modules/session/session_context_writer.py +100 -0
- package/hooks/modules/session/session_event_injector.py +160 -0
- package/hooks/modules/session/session_manager.py +31 -0
- package/hooks/modules/session/session_registry.py +333 -0
- package/hooks/modules/tools/__init__.py +29 -0
- package/hooks/modules/tools/bash_validator.py +1008 -0
- package/hooks/modules/tools/cloud_pipe_validator.py +231 -0
- package/hooks/modules/tools/hook_response.py +55 -0
- package/hooks/modules/tools/shell_parser.py +227 -0
- package/hooks/modules/tools/stage_decomposer.py +315 -0
- package/hooks/modules/tools/task_validator.py +294 -0
- package/hooks/modules/validation/__init__.py +23 -0
- package/hooks/modules/validation/commit_validator.py +380 -0
- package/hooks/post_compact.py +43 -0
- package/hooks/post_tool_use.py +54 -0
- package/hooks/pre_compact.py +60 -0
- package/hooks/pre_tool_use.py +413 -0
- package/hooks/session_end_hook.py +77 -0
- package/hooks/session_start.py +81 -0
- package/hooks/stop_hook.py +70 -0
- package/hooks/subagent_start.py +71 -0
- package/hooks/subagent_stop.py +295 -0
- package/hooks/task_completed.py +70 -0
- package/hooks/user_prompt_submit.py +246 -0
- package/index.js +83 -0
- package/package.json +103 -0
- package/pyproject.toml +32 -0
- package/skills/README.md +158 -0
- package/skills/agent-creation/SKILL.md +87 -0
- package/skills/agent-creation/examples.md +170 -0
- package/skills/agent-creation/reference.md +191 -0
- package/skills/agent-protocol/SKILL.md +93 -0
- package/skills/agent-protocol/examples.md +223 -0
- package/skills/agent-response/SKILL.md +69 -0
- package/skills/agentic-loop/SKILL.md +80 -0
- package/skills/agentic-loop/reference.md +378 -0
- package/skills/blog-writing/SKILL.md +98 -0
- package/skills/blog-writing/reference.md +130 -0
- package/skills/brief-spec/SKILL.md +185 -0
- package/skills/command-execution/SKILL.md +64 -0
- package/skills/command-execution/reference.md +83 -0
- package/skills/context-updater/SKILL.md +87 -0
- package/skills/context-updater/examples.md +71 -0
- package/skills/developer-patterns/SKILL.md +50 -0
- package/skills/developer-patterns/reference.md +112 -0
- package/skills/execution/SKILL.md +99 -0
- package/skills/fast-queries/SKILL.md +43 -0
- package/skills/gaia-compact/SKILL.md +74 -0
- package/skills/gaia-patterns/SKILL.md +108 -0
- package/skills/gaia-patterns/reference.md +395 -0
- package/skills/gaia-planner/SKILL.md +37 -0
- package/skills/gaia-planner/reference.md +107 -0
- package/skills/gaia-release/SKILL.md +85 -0
- package/skills/gaia-release/reference.md +92 -0
- package/skills/gaia-self-check/SKILL.md +114 -0
- package/skills/gaia-self-check/reference.md +453 -0
- package/skills/gaia-verify/SKILL.md +77 -0
- package/skills/gaia-verify/reference.md +80 -0
- package/skills/git-conventions/SKILL.md +47 -0
- package/skills/gitops-patterns/SKILL.md +60 -0
- package/skills/gitops-patterns/reference.md +183 -0
- package/skills/gmail-policy/SKILL.md +200 -0
- package/skills/gmail-policy/reference.md +150 -0
- package/skills/gmail-triage/SKILL.md +100 -0
- package/skills/gws-setup/SKILL.md +99 -0
- package/skills/gws-setup/reference.md +73 -0
- package/skills/investigation/SKILL.md +100 -0
- package/skills/memory-curation/SKILL.md +83 -0
- package/skills/memory-search/SKILL.md +88 -0
- package/skills/orchestrator-approval/SKILL.md +160 -0
- package/skills/orchestrator-approval/reference.md +174 -0
- package/skills/pending-approvals/SKILL.md +72 -0
- package/skills/pending-approvals/reference.md +214 -0
- package/skills/readme-writing/SKILL.md +71 -0
- package/skills/readme-writing/reference.md +188 -0
- package/skills/reference.md +135 -0
- package/skills/request-approval/SKILL.md +140 -0
- package/skills/request-approval/examples.md +140 -0
- package/skills/request-approval/reference.md +57 -0
- package/skills/schedule-task/SKILL.md +64 -0
- package/skills/schedule-task/reference.md +233 -0
- package/skills/security-tiers/SKILL.md +141 -0
- package/skills/security-tiers/destructive-commands-reference.md +623 -0
- package/skills/security-tiers/reference.md +39 -0
- package/skills/session-reflection/SKILL.md +69 -0
- package/skills/skill-creation/SKILL.md +92 -0
- package/skills/skill-creation/reference.md +29 -0
- package/skills/terraform-patterns/SKILL.md +89 -0
- package/skills/terraform-patterns/reference.md +93 -0
- package/templates/README.md +69 -0
- package/templates/managed-settings.template.json +43 -0
- package/tools/__init__.py +9 -0
- package/tools/agentic-loop/decide-status.py +210 -0
- package/tools/agentic-loop/parse-metric.py +106 -0
- package/tools/agentic-loop/record-iteration.py +221 -0
- package/tools/context/README.md +132 -0
- package/tools/context/__init__.py +42 -0
- package/tools/context/_paths.py +20 -0
- package/tools/context/context_provider.py +721 -0
- package/tools/context/context_section_reader.py +342 -0
- package/tools/context/deep_merge.py +159 -0
- package/tools/context/pending_updates.py +760 -0
- package/tools/context/surface_router.py +278 -0
- package/tools/fast-queries/README.md +65 -0
- package/tools/fast-queries/__init__.py +30 -0
- package/tools/fast-queries/appservices/quicktriage_devops_developer.sh +75 -0
- package/tools/fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh +32 -0
- package/tools/fast-queries/cloud/gcp/quicktriage_gcp_troubleshooter.sh +88 -0
- package/tools/fast-queries/gitops/quicktriage_gitops_operator.sh +48 -0
- package/tools/fast-queries/run_triage.sh +59 -0
- package/tools/fast-queries/terraform/quicktriage_terraform_architect.sh +80 -0
- package/tools/gaia_simulator/__init__.py +33 -0
- package/tools/gaia_simulator/cli.py +354 -0
- package/tools/gaia_simulator/extractor.py +457 -0
- package/tools/gaia_simulator/reporter.py +258 -0
- package/tools/gaia_simulator/routing_simulator.py +334 -0
- package/tools/gaia_simulator/runner.py +539 -0
- package/tools/gaia_simulator/skills_mapper.py +264 -0
- package/tools/memory/README.md +0 -0
- package/tools/memory/__init__.py +20 -0
- package/tools/memory/backfill_fts5.py +107 -0
- package/tools/memory/conflict_detector.py +295 -0
- package/tools/memory/episodic.py +1210 -0
- package/tools/memory/git_invalidator.py +262 -0
- package/tools/memory/paths.py +102 -0
- package/tools/memory/scoring.py +193 -0
- package/tools/memory/search_store.py +375 -0
- package/tools/persist_transcript_analysis.py +85 -0
- package/tools/review/__init__.py +1 -0
- package/tools/review/review_engine.py +157 -0
- package/tools/scan/__init__.py +35 -0
- package/tools/scan/config.py +247 -0
- package/tools/scan/merge.py +212 -0
- package/tools/scan/orchestrator.py +549 -0
- package/tools/scan/registry.py +127 -0
- package/tools/scan/scanners/__init__.py +18 -0
- package/tools/scan/scanners/base.py +137 -0
- package/tools/scan/scanners/environment.py +349 -0
- package/tools/scan/scanners/git.py +570 -0
- package/tools/scan/scanners/infrastructure.py +875 -0
- package/tools/scan/scanners/orchestration.py +600 -0
- package/tools/scan/scanners/stack.py +1085 -0
- package/tools/scan/scanners/tools.py +260 -0
- package/tools/scan/setup.py +686 -0
- package/tools/scan/tests/__init__.py +1 -0
- package/tools/scan/tests/conftest.py +796 -0
- package/tools/scan/tests/test_environment.py +323 -0
- package/tools/scan/tests/test_git.py +419 -0
- package/tools/scan/tests/test_infrastructure.py +382 -0
- package/tools/scan/tests/test_integration.py +920 -0
- package/tools/scan/tests/test_merge.py +269 -0
- package/tools/scan/tests/test_orchestration.py +304 -0
- package/tools/scan/tests/test_stack.py +604 -0
- package/tools/scan/tests/test_tools.py +349 -0
- package/tools/scan/ui.py +624 -0
- package/tools/scan/verify.py +270 -0
- package/tools/scan/walk.py +118 -0
- package/tools/scan/workspace.py +85 -0
- package/tools/validation/README.md +244 -0
- package/tools/validation/__init__.py +17 -0
- package/tools/validation/approval_gate.py +321 -0
- 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.
|