@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,214 @@
|
|
|
1
|
+
# Pending Approvals — Reference
|
|
2
|
+
|
|
3
|
+
Read on-demand when processing approval requests.
|
|
4
|
+
|
|
5
|
+
## Pending JSON Schema
|
|
6
|
+
|
|
7
|
+
File: `.claude/cache/approvals/pending-{nonce}.json`
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"nonce": "8072af8044f0da0571c348041ad2cef6",
|
|
12
|
+
"session_id": "abc123",
|
|
13
|
+
"command": "kubectl apply -f manifest.yaml",
|
|
14
|
+
"danger_verb": "apply",
|
|
15
|
+
"danger_category": "MUTATIVE",
|
|
16
|
+
"scope_type": "semantic_signature",
|
|
17
|
+
"scope_signature": {
|
|
18
|
+
"base_cmd": "kubectl",
|
|
19
|
+
"cli_family": "k8s",
|
|
20
|
+
"verb": "apply",
|
|
21
|
+
"semantic_tokens": ["kubectl", "apply", "manifest.yaml"],
|
|
22
|
+
"normalized_flags": ["-f"]
|
|
23
|
+
},
|
|
24
|
+
"timestamp": 1775843292.4328,
|
|
25
|
+
"ttl_minutes": 5,
|
|
26
|
+
"context": {
|
|
27
|
+
"scope": "k8s cluster — dev namespace",
|
|
28
|
+
"rollback": "kubectl delete -f manifest.yaml",
|
|
29
|
+
"risk": "MEDIUM"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The `context` field is optional. When absent, derive scope/rollback/risk from `scope_signature` and `danger_category`.
|
|
35
|
+
|
|
36
|
+
## Nonce Prefix Matching
|
|
37
|
+
|
|
38
|
+
User references "P-8072af8" → match against nonces starting with "8072af8".
|
|
39
|
+
Minimum 4 characters. If multiple nonces share the same prefix, ask user to be more specific.
|
|
40
|
+
|
|
41
|
+
## Summary Format (SessionStart injection)
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Tienes N aprobaciones pendientes:
|
|
45
|
+
|
|
46
|
+
P-{nonce[0:8]} {command} [{danger_verb}] hace {age}
|
|
47
|
+
P-{nonce[0:8]} {command} [{danger_verb}] hace {age}
|
|
48
|
+
|
|
49
|
+
Di "ver P-XXXX" para detalles o "aprobar P-XXXX" para ejecutar.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Detail View Format
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
P-{nonce[0:8]} — Detalle
|
|
56
|
+
|
|
57
|
+
COMANDO: {command}
|
|
58
|
+
OPERACION: {danger_verb} en {base_cmd}
|
|
59
|
+
CATEGORIA: {danger_category}
|
|
60
|
+
SCOPE: {scope}
|
|
61
|
+
ROLLBACK: {rollback}
|
|
62
|
+
CREADO: {timestamp as readable datetime}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## AskUserQuestion Template
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
AskUserQuestion(
|
|
69
|
+
question=(
|
|
70
|
+
"APPROVAL REQUIRED\n\n"
|
|
71
|
+
f"OPERACION: {danger_verb} on {base_cmd}\n"
|
|
72
|
+
f"COMANDO: {command}\n" # verbatim, never paraphrased
|
|
73
|
+
f"SCOPE: {scope}\n"
|
|
74
|
+
f"RIESGO: {danger_category}\n"
|
|
75
|
+
f"ROLLBACK: {rollback}"
|
|
76
|
+
),
|
|
77
|
+
options=[f"Approve -- {danger_verb} {base_cmd} {target} [P-{nonce[:8]}]", "Reject"]
|
|
78
|
+
# Option label MUST name the specific action, e.g.:
|
|
79
|
+
# "Approve -- kubectl apply -f manifest.yaml [P-8072af80]"
|
|
80
|
+
# NEVER: "Approve", "Approve -- proceed", "Approve -- aplicar cambios"
|
|
81
|
+
)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The PostToolUse hook checks `answer.lower().startswith("approve")` to activate the grant.
|
|
85
|
+
"Reject" (or any non-"Approve" answer) does NOT activate the grant.
|
|
86
|
+
|
|
87
|
+
## Post-Approval Dispatch Template
|
|
88
|
+
|
|
89
|
+
After AskUserQuestion returns "Approve", check whether the pending file belongs to the current session. Both dispatch paths use the same smart prompt structure -- the only difference is whether the nonce is included.
|
|
90
|
+
|
|
91
|
+
### Dispatch prompt structure
|
|
92
|
+
|
|
93
|
+
The dispatch prompt tells the agent three things: what to run, where to run it, and how to handle failure. This replaces fire-and-forget dispatch, which reports failure without attempting recovery.
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Ejecuta este comando aprobado por el usuario. No requiere confirmacion adicional.
|
|
97
|
+
{Nonce: {nonce} -- only for same-session dispatch}
|
|
98
|
+
Comando: {command}
|
|
99
|
+
Directorio: {cwd}
|
|
100
|
+
|
|
101
|
+
PREFLIGHT: Before executing, verify preconditions still hold.
|
|
102
|
+
- For git push: fetch and check if the local branch is ahead of remote.
|
|
103
|
+
- For kubectl/helm apply: confirm the target resource exists and is not mid-rollout.
|
|
104
|
+
- For terraform apply: run a quick plan to confirm no unexpected drift.
|
|
105
|
+
- General: if the command depends on state that may have changed, check that state first.
|
|
106
|
+
If a precondition fails, report what changed and do NOT execute.
|
|
107
|
+
|
|
108
|
+
RECOVERY: If the command fails with a recoverable error, attempt ONE standard local recovery, then retry.
|
|
109
|
+
- git push (non-fast-forward): pull --rebase, then retry push.
|
|
110
|
+
- terraform apply (state conflict): refresh state, then retry apply.
|
|
111
|
+
- kubectl apply (conflict): re-fetch the resource, re-apply.
|
|
112
|
+
- General: if the error message suggests a local fix (rebase, refresh, retry), do that fix ONCE.
|
|
113
|
+
Do NOT attempt remote-mutating recovery (force push, remote delete, taint, import).
|
|
114
|
+
Do NOT retry more than once -- if recovery + retry fails, report the error.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The `cwd` field may be present in the pending JSON. When present, include it in the dispatch as `Directorio:`. When absent, omit the line.
|
|
118
|
+
|
|
119
|
+
### Dispatch `mode` for post-approval execution
|
|
120
|
+
|
|
121
|
+
The Gaia grant activates on the blocked command signature -- that covers the Gaia hook, but CC native is a separate gate. Pick `mode` based on the command target:
|
|
122
|
+
|
|
123
|
+
| Approved command targets... | mode | session | Why |
|
|
124
|
+
|-----------------------------|------|---------|-----|
|
|
125
|
+
| Normal paths (src/, infra/, /tmp/) | `default` | foreground | CC native does not protect these; no mode needed |
|
|
126
|
+
| `.claude/` writes only (Edit/Write on skills, agents, briefs) | `acceptEdits` | foreground | CC native prompts on `.claude/` writes; `acceptEdits` satisfies it |
|
|
127
|
+
| Bash mutativo sobre `.claude/` (rm, mv, mkdir) | `bypassPermissions` | foreground | CC native intercepts `.claude/` destructive ops regardless of verb; bypass satisfies it |
|
|
128
|
+
| Bundle: Bash on `.claude/` + Edits on `.claude/` | `bypassPermissions` | foreground | The bundle needs one mode that covers both layers; pack all steps in one dispatch turn |
|
|
129
|
+
|
|
130
|
+
The dispatch is single-turn and cannot split: if the bundle emits APPROVAL_REQUEST mid-execution, the orchestrator must re-dispatch fresh with the same mode, not SendMessage resume -- mode does not survive resume.
|
|
131
|
+
|
|
132
|
+
### Same-session dispatch
|
|
133
|
+
|
|
134
|
+
When `pending.session_id == CLAUDE_SESSION_ID` -- pass the nonce:
|
|
135
|
+
|
|
136
|
+
1. Build the dispatch prompt with nonce, command, and cwd (if available)
|
|
137
|
+
2. Dispatch the one-shot agent
|
|
138
|
+
3. The hook finds the nonce, activates the grant, and allows the T3 operation through
|
|
139
|
+
|
|
140
|
+
### Cross-session dispatch
|
|
141
|
+
|
|
142
|
+
When `pending.session_id != CLAUDE_SESSION_ID` -- the nonce is stale:
|
|
143
|
+
|
|
144
|
+
1. The PostToolUse hook will have already activated the grant under the current session
|
|
145
|
+
2. Build the dispatch prompt with command and cwd (if available), no nonce
|
|
146
|
+
3. Dispatch the one-shot agent
|
|
147
|
+
4. The hook finds the pre-activated grant (by command signature) and allows the T3 operation through
|
|
148
|
+
|
|
149
|
+
### Recovery scope guardrail
|
|
150
|
+
|
|
151
|
+
Recovery actions must only modify LOCAL state. The agent should never attempt:
|
|
152
|
+
- `git push --force` or `git push --force-with-lease` (remote-mutating)
|
|
153
|
+
- `terraform state rm` or `terraform import` (state-mutating beyond refresh)
|
|
154
|
+
- `kubectl delete` followed by re-create (destructive recovery)
|
|
155
|
+
- Any action that would require its own T3 approval
|
|
156
|
+
|
|
157
|
+
If the only path forward requires remote mutation, the agent reports the failure and lets the user decide.
|
|
158
|
+
|
|
159
|
+
## Complete Flow Example
|
|
160
|
+
|
|
161
|
+
### Same-session path
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
SessionStart
|
|
165
|
+
→ scans .claude/cache/approvals/pending-*.json
|
|
166
|
+
→ injects summary into additionalContext
|
|
167
|
+
|
|
168
|
+
User sees:
|
|
169
|
+
"Tienes 1 aprobación pendiente:
|
|
170
|
+
P-8072af8 kubectl apply -f manifest.yaml [apply] hace 2 min"
|
|
171
|
+
|
|
172
|
+
User: "ver P-8072af8"
|
|
173
|
+
→ orchestrator reads pending-8072af8044f0da0571c348041ad2cef6.json
|
|
174
|
+
→ presents detail view
|
|
175
|
+
|
|
176
|
+
User: "aprobar P-8072af8"
|
|
177
|
+
→ orchestrator calls AskUserQuestion with all 5 fields visible
|
|
178
|
+
→ user selects "Approve -- kubectl apply -f manifest.yaml [P-8072af80]"
|
|
179
|
+
→ PostToolUse hook extracts nonce from label, activates grant for nonce 8072af8044f0da0571c348041ad2cef6
|
|
180
|
+
→ orchestrator dispatches one-shot agent with nonce + command
|
|
181
|
+
→ agent runs command; hook validates nonce and allows T3 through
|
|
182
|
+
→ agent returns COMPLETE; pending file deleted
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Cross-session path
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
SessionStart (new session)
|
|
189
|
+
→ scans .claude/cache/approvals/pending-*.json
|
|
190
|
+
→ pending-8072af8044f0da0571c348041ad2cef6.json has session_id = "prior-session"
|
|
191
|
+
→ scanner annotates entry with [session anterior]
|
|
192
|
+
→ injects summary into additionalContext
|
|
193
|
+
|
|
194
|
+
User sees:
|
|
195
|
+
"Tienes 1 aprobación pendiente:
|
|
196
|
+
P-8072af8 kubectl apply -f manifest.yaml [apply] hace 5 min [session anterior]"
|
|
197
|
+
|
|
198
|
+
User: "aprobar P-8072af8"
|
|
199
|
+
→ orchestrator calls AskUserQuestion with all 5 fields visible
|
|
200
|
+
→ user selects "Approve -- kubectl apply -f manifest.yaml [P-8072af80]"
|
|
201
|
+
→ orchestrator detects pending.session_id != CLAUDE_SESSION_ID
|
|
202
|
+
→ calls activate_cross_session_pending(pending_data) — grant created in current session
|
|
203
|
+
→ deletes old pending file
|
|
204
|
+
→ dispatches one-shot agent with command only (no nonce)
|
|
205
|
+
→ agent runs command; hook finds pre-activated grant and allows T3 through
|
|
206
|
+
→ agent returns COMPLETE
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Pending File Location
|
|
210
|
+
|
|
211
|
+
All pending files: `.claude/cache/approvals/pending-{nonce}.json`
|
|
212
|
+
Index file (per-session): `.claude/cache/approvals/pending-index-{session_id}.json`
|
|
213
|
+
|
|
214
|
+
Use glob `pending-*.json` to find all pending files. Skip files starting with `pending-index-`.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: readme-writing
|
|
3
|
+
description: Use when writing or updating a README for a Gaia component folder (agents/, skills/, hooks/, commands/, config/, bin/, tests/, build/, templates/, or the repo root)
|
|
4
|
+
metadata:
|
|
5
|
+
user-invocable: false
|
|
6
|
+
type: technique
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# README Writing
|
|
10
|
+
|
|
11
|
+
A folder README is not a table of contents. It is the mental model a developer or agent needs before touching anything in that folder. A README that only lists files is worse than none -- it creates the impression the folder is understood when it is not.
|
|
12
|
+
|
|
13
|
+
Gaia is event-driven. Every component has a trigger: a hook fires, a skill is injected, a command is dispatched, a config file is loaded. A README that does not explain WHEN and HOW a component activates leaves the reader guessing the most important thing.
|
|
14
|
+
|
|
15
|
+
## Step 1: Choose your target
|
|
16
|
+
|
|
17
|
+
Write or update a README when:
|
|
18
|
+
- A new folder is created (agents/, skills/<name>/, hooks/, etc.)
|
|
19
|
+
- You add a file that changes what the folder does or when it activates
|
|
20
|
+
- A drift report in `cross_layer_impacts` flags a README as stale
|
|
21
|
+
|
|
22
|
+
## Step 2: Write the 5 sections in order
|
|
23
|
+
|
|
24
|
+
Every README uses this structure. Order is not optional -- a reader skimming top-to-bottom should understand activation before they see a file tree.
|
|
25
|
+
|
|
26
|
+
**Section 1: Intro narrative** (2-4 paragraphs, no bullets, conversational)
|
|
27
|
+
- One sentence on what lives here
|
|
28
|
+
- Why this folder exists separately (the conceptual contract)
|
|
29
|
+
- How to think about this folder (mental model or analogy)
|
|
30
|
+
- Who touches it: developer, agent at runtime, CI, admin
|
|
31
|
+
|
|
32
|
+
**Section 2: When activated** (the core -- do not skip)
|
|
33
|
+
- The concrete trigger: what event, condition, or code path fires this
|
|
34
|
+
- ASCII diagram if more than 2 steps chain together
|
|
35
|
+
- Step-by-step list as complement when the diagram is not enough
|
|
36
|
+
- What happens if this folder is absent or broken
|
|
37
|
+
|
|
38
|
+
**Section 3: What's here** (annotated tree)
|
|
39
|
+
- One-line comment per file or subdirectory
|
|
40
|
+
- Mark generated files so they are not edited by hand
|
|
41
|
+
|
|
42
|
+
**Section 4: Conventions** (concrete rules, not aspirations)
|
|
43
|
+
- How to name new files
|
|
44
|
+
- What internal structure new files must follow
|
|
45
|
+
- What to update elsewhere when adding something here
|
|
46
|
+
- What validation runs against this folder
|
|
47
|
+
|
|
48
|
+
**Section 5: See also** (relative links with reason)
|
|
49
|
+
- Adjacent components with a one-line reason per link
|
|
50
|
+
|
|
51
|
+
## Step 3: Write the activation section for judgment
|
|
52
|
+
|
|
53
|
+
The activation section fails when it describes intent ("skills are injected at startup") without describing mechanism ("the pre_tool_use hook reads `skills:` from agent frontmatter, then calls `skill_injection.py`, which reads each SKILL.md and prepends it to the agent context").
|
|
54
|
+
|
|
55
|
+
Concrete mechanism is the test. If the description would be true for any event-driven system, it is not concrete enough.
|
|
56
|
+
|
|
57
|
+
## Step 4: Integration points
|
|
58
|
+
|
|
59
|
+
**With skill-creation:** When completing a new skill, update the `skills/` README to reflect the new entry. This is the last step of the skill-creation workflow, not optional cleanup.
|
|
60
|
+
|
|
61
|
+
**With gaia-patterns (Documentation Drift Awareness):** When an agent adds a file to `agents/`, `skills/`, `hooks/`, or any top-level folder, it must include the relevant README in `cross_layer_impacts` if the README no longer accurately describes the folder. The orchestrator dispatches a readme-writing task from that signal. The agent that added the file does NOT update the README itself -- it reports drift and stops.
|
|
62
|
+
|
|
63
|
+
**With test_directory_structure.py:** The system test verifies README existence for all key folders. Adding a new top-level folder without a README will cause a test failure. See `tests/system/test_directory_structure.py`.
|
|
64
|
+
|
|
65
|
+
## Anti-Patterns
|
|
66
|
+
|
|
67
|
+
- **Activation section describes intent, not mechanism** -- "agents use skills" is intent; "pre_tool_use.py reads frontmatter and calls skill_injection.py" is mechanism.
|
|
68
|
+
- **File tree without comments** -- a bare tree adds no value over `ls`; every entry needs a reason.
|
|
69
|
+
- **Conventions that are aspirational** -- "files should be well-named" is not a convention; "skill folders use kebab-case matching the `name:` field in frontmatter" is.
|
|
70
|
+
- **See also without reasons** -- a link list without context shifts the burden to the reader.
|
|
71
|
+
- **Updating README inline during feature work** -- drift reporting exists so README updates happen as deliberate tasks, not rushed afterthoughts mid-feature.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# README Writing Reference
|
|
2
|
+
|
|
3
|
+
Extended examples for the readme-writing skill. Load this file when you need a filled-in template to work from.
|
|
4
|
+
|
|
5
|
+
## Canonical filled example: skills/
|
|
6
|
+
|
|
7
|
+
The example below is the README for the `skills/` top-level folder. Use it as the gold standard for voice, section depth, and activation detail.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
# Skills
|
|
13
|
+
|
|
14
|
+
Las skills son conocimiento procedimental inyectado en los agentes. No son código que se ejecuta -- son texto que el agente recibe y sigue. Piénsalas como el manual de procedimientos que le das a un contractor: le dices cómo clasificar riesgos, cómo reportar resultados, cómo ejecutar comandos. El agente trae su identidad (qué es, qué puede hacer); la skill trae el proceso (cómo lo hace).
|
|
15
|
+
|
|
16
|
+
Esta carpeta existe separada de `agents/` porque el mismo procedimiento aplica a múltiples agentes. `security-tiers` la siguen seis agentes distintos. Si esa lógica viviera inline en cada `.md`, tendríamos seis copias divergiendo. Una skill es la SSOT del proceso.
|
|
17
|
+
|
|
18
|
+
Mental model: una skill es como un módulo importable, pero para texto. El agente la "importa" en startup (si está en su frontmatter) o la "requiere" en runtime (si la lee bajo demanda con el Read tool).
|
|
19
|
+
|
|
20
|
+
Las skills las toca el developer cuando crea o refina procedimientos, y el agente en runtime cuando las lee on-demand. El hook layer nunca las lee directamente.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Cuándo se activa
|
|
25
|
+
|
|
26
|
+
Hay dos rutas de activación:
|
|
27
|
+
|
|
28
|
+
**RUTA 1 -- Startup injection (frontmatter)**
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Agent .md frontmatter
|
|
32
|
+
skills:
|
|
33
|
+
- agent-protocol
|
|
34
|
+
- security-tiers
|
|
35
|
+
|
|
|
36
|
+
v
|
|
37
|
+
pre_tool_use.py fires on agent start
|
|
38
|
+
|
|
|
39
|
+
v
|
|
40
|
+
adapters/claude_code.py -> modules/agents/skill_injection.py
|
|
41
|
+
|
|
|
42
|
+
v
|
|
43
|
+
Reads each SKILL.md from disk
|
|
44
|
+
Prepends content to agent system prompt
|
|
45
|
+
|
|
|
46
|
+
v
|
|
47
|
+
Agent receives process knowledge before first tool call
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Skills listed in frontmatter load unconditionally on every call. Keep this list short (< 5 skills, < 100 lines each) -- everything here costs tokens on every invocation.
|
|
51
|
+
|
|
52
|
+
**RUTA 2 -- On-demand (workflow skills)**
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Agent encounters task that needs a process
|
|
56
|
+
|
|
|
57
|
+
v
|
|
58
|
+
Agent reads SKILL.md directly via Read tool
|
|
59
|
+
|
|
|
60
|
+
v
|
|
61
|
+
Agent follows the process inline
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Workflow skills (approval, execution, investigation) are read on-demand because they are only needed for specific task types. Listing them in frontmatter would waste tokens on every agent call.
|
|
65
|
+
|
|
66
|
+
**What breaks if skills/ is missing or corrupted:**
|
|
67
|
+
- Startup-injected skills: agent proceeds without process knowledge, silently. No error. Wrong behavior.
|
|
68
|
+
- On-demand skills: agent gets a file-not-found error and must improvise or halt. Improvising produces inconsistent results across agents.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Qué hay aquí
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
skills/
|
|
76
|
+
├── README.md <- este archivo
|
|
77
|
+
├── reference.md <- índice de skills con tipo y descripción
|
|
78
|
+
├── agent-protocol/
|
|
79
|
+
│ ├── SKILL.md <- protocol: response contract, state machine
|
|
80
|
+
│ └── examples.md <- filled json:contract examples
|
|
81
|
+
├── security-tiers/
|
|
82
|
+
│ ├── SKILL.md <- reference: T0-T3 tier definitions
|
|
83
|
+
│ └── reference.md <- cloud CLI examples, conditional commands
|
|
84
|
+
├── skill-creation/
|
|
85
|
+
│ ├── SKILL.md <- technique: how to build a skill
|
|
86
|
+
│ └── reference.md <- tone guide by skill type
|
|
87
|
+
├── command-execution/
|
|
88
|
+
│ ├── SKILL.md <- discipline: no pipes, one command per step
|
|
89
|
+
│ └── reference.md <- cloud CLI mutation examples
|
|
90
|
+
└── ... (one folder per skill)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Convenciones
|
|
96
|
+
|
|
97
|
+
- Folder name = `name:` field in SKILL.md frontmatter, kebab-case
|
|
98
|
+
- Every skill folder contains at minimum `SKILL.md`
|
|
99
|
+
- `SKILL.md` must have valid frontmatter: `name:`, `description:`, `metadata.type:`
|
|
100
|
+
- `description:` contains triggering conditions only -- not process summary
|
|
101
|
+
- `SKILL.md` < 150 lines; heavy content goes to `reference.md`
|
|
102
|
+
- After creating a new skill, update this README's "Qué hay aquí" section
|
|
103
|
+
- After creating a new skill, update `skills/reference.md` index table
|
|
104
|
+
|
|
105
|
+
Validation: `tests/system/test_directory_structure.py` verifies all skill folders have a `SKILL.md`.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Ver también
|
|
110
|
+
|
|
111
|
+
- `agents/` -- agent definitions that consume skills via frontmatter
|
|
112
|
+
- `hooks/modules/agents/skill_injection.py` -- runtime that reads and injects skill content
|
|
113
|
+
- `skills/skill-creation/SKILL.md` -- how to build a new skill (type selection, line budget, description rules)
|
|
114
|
+
- `tests/system/test_directory_structure.py` -- verifies README and SKILL.md existence
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Template (blank)
|
|
120
|
+
|
|
121
|
+
Copy this when writing a README from scratch. Fill every section -- do not delete sections that seem inapplicable, as the absence of a section signals the folder was not fully analyzed.
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
# <Folder Name>
|
|
125
|
+
|
|
126
|
+
<Intro paragraph 1: one sentence on what lives here>
|
|
127
|
+
|
|
128
|
+
<Intro paragraph 2: why this folder exists separately -- the conceptual contract>
|
|
129
|
+
|
|
130
|
+
<Intro paragraph 3: how to think about this folder -- mental model or analogy>
|
|
131
|
+
|
|
132
|
+
<Intro paragraph 4: who touches it: developer / agent at runtime / CI / admin>
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Cuándo se activa
|
|
137
|
+
|
|
138
|
+
<Concrete trigger: what event, condition, or code path fires this>
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
<ASCII diagram if > 2 steps chain>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
<Step-by-step list as complement>
|
|
145
|
+
|
|
146
|
+
<What breaks if this folder is absent or broken>
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Qué hay aquí
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
<folder>/
|
|
154
|
+
├── <file> <- <one-line comment>
|
|
155
|
+
└── <subdir>/ <- <one-line comment>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Convenciones
|
|
161
|
+
|
|
162
|
+
- <Naming rule for new files>
|
|
163
|
+
- <Required internal structure>
|
|
164
|
+
- <What to update elsewhere when adding something here>
|
|
165
|
+
- <Validation that runs against this folder>
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Ver también
|
|
170
|
+
|
|
171
|
+
- `<path>` -- <one-line reason>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Section depth guide by folder type
|
|
177
|
+
|
|
178
|
+
| Folder | Activation complexity | Typical diagram? |
|
|
179
|
+
|--------|----------------------|-----------------|
|
|
180
|
+
| `hooks/` | High -- event-driven, multi-module | Yes |
|
|
181
|
+
| `agents/` | Medium -- routing dispatch | Optional |
|
|
182
|
+
| `skills/` | Medium -- two injection paths | Yes |
|
|
183
|
+
| `commands/` | Low -- user-invoked slash commands | No |
|
|
184
|
+
| `config/` | Low -- read at startup or on-demand | No |
|
|
185
|
+
| `bin/` | Low -- CLI tools, user-invoked | No |
|
|
186
|
+
| `tests/` | Low -- run by CI or developer | No |
|
|
187
|
+
| `build/` | Medium -- triggered by npm run build | Optional |
|
|
188
|
+
| `templates/` | Low -- read by build scripts | No |
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Agent Reference
|
|
2
|
+
|
|
3
|
+
> **Legacy reference.** Current patterns and the full component inventory are in `gaia-patterns/reference.md`. This file is retained for historical context and the agent template below.
|
|
4
|
+
|
|
5
|
+
## Agent Template
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
---
|
|
9
|
+
name: agent-name
|
|
10
|
+
description: One-line description of what this agent does
|
|
11
|
+
tools: Tool1, Tool2, Tool3
|
|
12
|
+
model: inherit
|
|
13
|
+
permissionMode: acceptEdits # standard for most agents; omit for orchestrator and read-only agents
|
|
14
|
+
skills:
|
|
15
|
+
- security-tiers
|
|
16
|
+
- agent-protocol
|
|
17
|
+
- context-updater
|
|
18
|
+
- investigation
|
|
19
|
+
- command-execution
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## TL;DR
|
|
23
|
+
|
|
24
|
+
**Purpose:** [What this agent does]
|
|
25
|
+
**Input:** [What context it needs]
|
|
26
|
+
**Output:** [What it produces]
|
|
27
|
+
**Tier:** [T0-T2 or T0-T3]
|
|
28
|
+
|
|
29
|
+
For T3 approval/execution workflows, read `.claude/skills/request-approval/SKILL.md` and `.claude/skills/execution/SKILL.md`.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Core Identity
|
|
34
|
+
|
|
35
|
+
[What makes this agent unique - 2-3 paragraphs max]
|
|
36
|
+
|
|
37
|
+
### Code-First Protocol
|
|
38
|
+
|
|
39
|
+
1. **Trust the Contract** - [Key contract field]
|
|
40
|
+
2. **Analyze Before Generating** - Follow `investigation` skill
|
|
41
|
+
3. **Pattern-Aware Generation** - [Domain-specific generation rules]
|
|
42
|
+
4. **Validate** - [Domain-specific validation]
|
|
43
|
+
5. **Output is a Realization Package** - [What the package contains]
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 4-Phase Workflow
|
|
48
|
+
|
|
49
|
+
### Phase 1: Investigation
|
|
50
|
+
Follow `investigation` skill protocol. Then: [domain-specific steps]
|
|
51
|
+
|
|
52
|
+
### Phase 2: Present
|
|
53
|
+
[What to show user]
|
|
54
|
+
|
|
55
|
+
### Phase 3: Confirm
|
|
56
|
+
[Approval requirements]
|
|
57
|
+
|
|
58
|
+
### Phase 4: Execute
|
|
59
|
+
[Execution steps]
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Scope
|
|
64
|
+
|
|
65
|
+
### CAN DO
|
|
66
|
+
- [List capabilities]
|
|
67
|
+
|
|
68
|
+
### CANNOT DO
|
|
69
|
+
- [List restrictions with delegation targets]
|
|
70
|
+
|
|
71
|
+
### DELEGATE
|
|
72
|
+
[When to recommend other agents]
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Error Handling
|
|
77
|
+
|
|
78
|
+
| Error | Detection | Recovery |
|
|
79
|
+
|-------|-----------|----------|
|
|
80
|
+
| [error] | [how detected] | [how to recover] |
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Release Checklist
|
|
84
|
+
|
|
85
|
+
When publishing a new version:
|
|
86
|
+
|
|
87
|
+
1. Read `package.json` for current version
|
|
88
|
+
2. Review changes (`git log`, CHANGELOG.md)
|
|
89
|
+
3. Determine version bump (patch/minor/major)
|
|
90
|
+
4. Update CHANGELOG.md with changes
|
|
91
|
+
5. Test symlinks work in consuming project:
|
|
92
|
+
```bash
|
|
93
|
+
# In consuming project
|
|
94
|
+
ls -la .claude/ # Should point to node_modules/@jaguilar87/gaia/
|
|
95
|
+
```
|
|
96
|
+
6. Bump version:
|
|
97
|
+
```bash
|
|
98
|
+
npm version [patch|minor|major]
|
|
99
|
+
```
|
|
100
|
+
7. Publish:
|
|
101
|
+
```bash
|
|
102
|
+
npm publish --access public
|
|
103
|
+
```
|
|
104
|
+
8. Verify:
|
|
105
|
+
```bash
|
|
106
|
+
npm info @jaguilar87/gaia version
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Documentation Template
|
|
110
|
+
|
|
111
|
+
```markdown
|
|
112
|
+
# Component Name
|
|
113
|
+
|
|
114
|
+
Brief description of what this does and why it exists.
|
|
115
|
+
Written like you're explaining to a colleague.
|
|
116
|
+
|
|
117
|
+
## Where This Fits
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
User request → Orchestrator → **This Tool** → Agent receives context
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Quick Start
|
|
124
|
+
|
|
125
|
+
\`\`\`bash
|
|
126
|
+
python3 tool.py --help
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
## Examples
|
|
130
|
+
|
|
131
|
+
\`\`\`bash
|
|
132
|
+
python3 tool.py "example input"
|
|
133
|
+
# Output: example output
|
|
134
|
+
\`\`\`
|
|
135
|
+
```
|