@jaguilar87/gaia 5.0.0-rc1
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 +1212 -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 +237 -0
- package/agents/gaia-planner.md +53 -0
- package/agents/gaia-system.md +70 -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 +628 -0
- package/bin/cli/history.py +305 -0
- package/bin/cli/memory.py +464 -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 +816 -0
- package/bin/pre-publish-validate.js +610 -0
- package/bin/python-detect.js +60 -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 +421 -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 +237 -0
- package/dist/gaia-ops/agents/gaia-planner.md +53 -0
- package/dist/gaia-ops/agents/gaia-system.md +70 -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 +421 -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 +163 -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 +232 -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_start.py +81 -0
- package/dist/gaia-ops/hooks/stop_hook.py +82 -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 +154 -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 +182 -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 +82 -0
- package/dist/gaia-ops/skills/gaia-release/reference.md +102 -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/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 +360 -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 +84 -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 +232 -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_start.py +81 -0
- package/dist/gaia-security/hooks/stop_hook.py +82 -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 +232 -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_start.py +81 -0
- package/hooks/stop_hook.py +82 -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 +99 -0
- package/pyproject.toml +32 -0
- package/skills/README.md +154 -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 +182 -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 +82 -0
- package/skills/gaia-release/reference.md +102 -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/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 +360 -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,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: request-approval
|
|
3
|
+
description: Use when a mutative command was blocked by the hook and you need to request user approval, or when presenting a plan for a T3 operation before executing it
|
|
4
|
+
metadata:
|
|
5
|
+
user-invocable: false
|
|
6
|
+
type: technique
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Request Approval
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
This skill does not approve anything -- it teaches the agent how to
|
|
14
|
+
**request** approval when the hook blocks a mutative command. The
|
|
15
|
+
orchestrator and the user own approval; the agent owns the request.
|
|
16
|
+
|
|
17
|
+
The core rule is **attempt first**: do not pre-ask the user for
|
|
18
|
+
permission. Attempt the T3 command, let the hook block it with an
|
|
19
|
+
`approval_id`, then emit `plan_status: "APPROVAL_REQUEST"` with the
|
|
20
|
+
captured `approval_id` in your `approval_request` object. The hook is
|
|
21
|
+
the authoritative gate; the agent only records what happened.
|
|
22
|
+
|
|
23
|
+
Asking the user before attempting produces two failure modes: the
|
|
24
|
+
agent approves itself on a speculative plan the hook would have
|
|
25
|
+
rejected anyway, or the agent blocks on a command that would have
|
|
26
|
+
passed without any friction. Both waste a turn.
|
|
27
|
+
|
|
28
|
+
## Attempt First Flow
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Agent plans a T3 command
|
|
32
|
+
|
|
|
33
|
+
Agent EXECUTES the command (does NOT pre-ask)
|
|
34
|
+
|
|
|
35
|
+
+-- hook allows -> command runs -> continue
|
|
36
|
+
|
|
|
37
|
+
+-- hook blocks with [T3_BLOCKED] + approval_id
|
|
38
|
+
|
|
|
39
|
+
Agent emits plan_status: "APPROVAL_REQUEST"
|
|
40
|
+
with approval_id in approval_request
|
|
41
|
+
|
|
|
42
|
+
Orchestrator presents plan to user
|
|
43
|
+
|
|
|
44
|
+
User approves -> grant activates -> agent retries
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Approval Request Object
|
|
48
|
+
|
|
49
|
+
Include an `approval_request` object in your `json:contract` with these 6 fields,
|
|
50
|
+
plus `approval_id` when a hook blocked the command:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
"approval_request": {
|
|
54
|
+
"operation": "verb + target",
|
|
55
|
+
"exact_content": "literal command, config, or file change",
|
|
56
|
+
"scope": "files, resources, environments affected",
|
|
57
|
+
"risk_level": "LOW | MEDIUM | HIGH | CRITICAL",
|
|
58
|
+
"rollback": "how to undo if wrong",
|
|
59
|
+
"verification": "how to confirm success after execution",
|
|
60
|
+
"approval_id": "hex from hook deny response (when blocked)"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Risk Levels
|
|
65
|
+
|
|
66
|
+
| Level | Criteria |
|
|
67
|
+
|-------|----------|
|
|
68
|
+
| LOW | Single resource, non-prod, no dependencies |
|
|
69
|
+
| MEDIUM | Multiple resources, non-prod, some dependencies |
|
|
70
|
+
| HIGH | Production, dependencies, potential downtime |
|
|
71
|
+
| CRITICAL | Irreversible, data loss possible |
|
|
72
|
+
|
|
73
|
+
## Status to Emit
|
|
74
|
+
|
|
75
|
+
Always emit `plan_status: "APPROVAL_REQUEST"`. The presence or absence
|
|
76
|
+
of `approval_id` tells the orchestrator which path to take:
|
|
77
|
+
|
|
78
|
+
- With `approval_id` -- the hook blocked; orchestrator activates the grant
|
|
79
|
+
- Without `approval_id` -- plan-first; orchestrator gates on user consent
|
|
80
|
+
|
|
81
|
+
The legacy name `REVIEW` is gone from runtime. If a doc still references
|
|
82
|
+
`REVIEW` as a plan_status literal, it is drift scheduled for cleanup.
|
|
83
|
+
|
|
84
|
+
## Hook Block Flow
|
|
85
|
+
|
|
86
|
+
When a hook blocks your command the deny response includes an
|
|
87
|
+
`approval_id` -- a one-time hex token tied to exactly this command.
|
|
88
|
+
|
|
89
|
+
The instinct is to retry. That is the wrong move: each retry generates
|
|
90
|
+
a fresh nonce, the old `approval_id` goes stale, and you enter an
|
|
91
|
+
infinite retry-block loop.
|
|
92
|
+
|
|
93
|
+
Instead: emit `APPROVAL_REQUEST` with the `approval_id` in your
|
|
94
|
+
`approval_request`, stop, and wait. When the user approves, the grant
|
|
95
|
+
activates and the orchestrator resumes you to retry.
|
|
96
|
+
|
|
97
|
+
Deny message format:
|
|
98
|
+
```
|
|
99
|
+
[T3_BLOCKED] This command requires user approval.
|
|
100
|
+
Do NOT retry this command. Report APPROVAL_REQUEST with this approval_id in your json:contract.
|
|
101
|
+
approval_id: <hex>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If you lose the `approval_id`, re-attempt the command once for a fresh one.
|
|
105
|
+
|
|
106
|
+
## Dispatch mode and foreground/background
|
|
107
|
+
|
|
108
|
+
When a subagent edits `.claude/skills/**`, `.claude/agents/**`, `.claude/commands/**`, briefs, plans, or evidence files, the orchestrator **must pass `mode: acceptEdits`** in the Agent tool dispatch. Without it, CC native intercepts with a permission prompt (foreground) or auto-denies (background).
|
|
109
|
+
|
|
110
|
+
**The `mode` is NOT inherited.** Each dispatch of the Agent tool is independent. If the orchestrator runs with `acceptEdits`, that does not flow to any subagent it invokes. The mode must be specified explicitly in every dispatch that needs it.
|
|
111
|
+
|
|
112
|
+
**The `mode` also does NOT survive a SendMessage resume.** If your original dispatch gave you `mode: bypassPermissions` and you emit APPROVAL_REQUEST mid-task, the orchestrator's SendMessage resume runs in `default`. The Gaia grant activates for the exact blocked command, but CC native re-blocks the next Edit/Write/Bash on `.claude/` because the mode is gone. Consequence for the subagent: when the task is a multi-step bundle on protected paths (e.g., mv on `.claude/**` + Edits in `.claude/project-context/**`), execute every step in the SAME turn the dispatch started. If a hook blocks a step, emit BLOCKED and stop -- do NOT emit APPROVAL_REQUEST mid-task expecting to continue after a SendMessage resume. The orchestrator will re-dispatch fresh.
|
|
113
|
+
|
|
114
|
+
**Foreground vs background is a separate axis.** It governs whether a user-facing interaction (like AskUserQuestion) can display. It does not resolve CC native permission prompts -- those are governed by `mode`.
|
|
115
|
+
|
|
116
|
+
### Combination table
|
|
117
|
+
|
|
118
|
+
| Case | mode in dispatch | Session type | Expected behavior |
|
|
119
|
+
|------|-----------------|--------------|-------------------|
|
|
120
|
+
| Subagent edits `skills/` with `acceptEdits` | `acceptEdits` | foreground | Edit passes -- no CC native prompt, user sees agent output |
|
|
121
|
+
| Subagent edits `skills/` with default mode | `default` | foreground | CC native prompts the user for consent each Edit/Write |
|
|
122
|
+
| Subagent edits `skills/` with default mode | `default` | background | CC native auto-denies -- agent gets permission error, edit never happens |
|
|
123
|
+
| Subagent edits `skills/` with `acceptEdits` | `acceptEdits` | background | Edit passes -- `mode` covers CC native; background only blocks AskUserQuestion |
|
|
124
|
+
| Subagent tries to edit `.claude/hooks/` | any | any | Gaia `_is_protected()` blocks regardless of mode; approval flow required |
|
|
125
|
+
| Orchestrator edits `skills/` directly (no subagent) | n/a (own session) | foreground | Passes if parent session has `acceptEdits` or CC auto-accepts |
|
|
126
|
+
|
|
127
|
+
The foreground/background distinction matters for approval flows: AskUserQuestion only works in foreground. In background, the orchestrator cannot present interactive prompts -- T3 operations that require user consent must be deferred or routed to a foreground session.
|
|
128
|
+
|
|
129
|
+
For the full `permissionMode` comparison, see `security-tiers/SKILL.md`.
|
|
130
|
+
|
|
131
|
+
## Anti-Patterns
|
|
132
|
+
|
|
133
|
+
- **Pre-asking the user before attempting** -- violates attempt first; the hook is the gate, not the agent's guess
|
|
134
|
+
- **Retrying after T3_BLOCKED** -- each retry generates a new nonce, making the previous approval_id stale; this loops forever
|
|
135
|
+
- **Missing fields in approval_request** -- the orchestrator presents these fields directly; missing fields mean the user approves blind
|
|
136
|
+
- **Approval fields in prose only** -- the orchestrator parses the JSON object, not your text; prose-only plans bypass the structured flow
|
|
137
|
+
- **Reusing prior approvals** -- grants are scoped to a specific nonce and command; a prior approval does not cover a new operation
|
|
138
|
+
- **Fabricating the approval_id** -- the hook validates against its nonce store; an invented token will never match
|
|
139
|
+
- **Omitting `mode: acceptEdits` from dispatch** -- subagents dispatched without it will hit CC native prompts on `.claude/` writes; in background, this auto-denies silently
|
|
140
|
+
- **Assuming `mode` survives a SendMessage resume** -- it does not; if the task depends on bypass/acceptEdits, pack all steps in one dispatch turn, or emit BLOCKED and let the orchestrator re-dispatch fresh
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Approval Request Examples
|
|
2
|
+
|
|
3
|
+
Reference examples for agents. Read on-demand when building your first plan or when unsure about format.
|
|
4
|
+
|
|
5
|
+
## Example 1: Terraform Apply (GCP)
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
## Terraform Apply Plan
|
|
9
|
+
|
|
10
|
+
### Summary
|
|
11
|
+
- Creating GCP VPC network for production cluster
|
|
12
|
+
- Adds 3 subnetworks across us-east4-a, us-east4-b, us-east4-c
|
|
13
|
+
- No existing resources affected
|
|
14
|
+
|
|
15
|
+
### Changes Proposed
|
|
16
|
+
|
|
17
|
+
**Resources to CREATE:**
|
|
18
|
+
- `google_compute_network.prod-network`: VPC in auto-subnet mode disabled
|
|
19
|
+
- `google_compute_subnetwork.prod-subnet-a`: 10.0.1.0/24 in us-east4-a
|
|
20
|
+
- `google_compute_subnetwork.prod-subnet-b`: 10.0.2.0/24 in us-east4-b
|
|
21
|
+
- `google_compute_subnetwork.prod-subnet-c`: 10.0.3.0/24 in us-east4-c
|
|
22
|
+
|
|
23
|
+
**Resources to MODIFY:** None
|
|
24
|
+
**Resources to DELETE:** None
|
|
25
|
+
|
|
26
|
+
### Validation Results
|
|
27
|
+
|
|
28
|
+
**Dry-run status:**
|
|
29
|
+
- `terragrunt plan` - No errors, 4 to add, 0 to change, 0 to destroy
|
|
30
|
+
- `terragrunt hclfmt --check` - No formatting issues
|
|
31
|
+
- `terraform validate` - Success
|
|
32
|
+
|
|
33
|
+
**Dependencies verified:**
|
|
34
|
+
- GCP project [project-id]: accessible
|
|
35
|
+
- No CIDR conflicts with existing networks
|
|
36
|
+
|
|
37
|
+
### Risk Assessment
|
|
38
|
+
|
|
39
|
+
**Risk Level:** MEDIUM
|
|
40
|
+
|
|
41
|
+
**Potential Risks:**
|
|
42
|
+
1. CIDR overlap with existing VPC networks
|
|
43
|
+
- Mitigation: Verified no overlaps via `gcloud compute networks list`
|
|
44
|
+
2. Subnet creation timeout
|
|
45
|
+
- Mitigation: Timeout set to 300s, idempotent -- safe to retry
|
|
46
|
+
|
|
47
|
+
**Rollback Plan:**
|
|
48
|
+
- If creation fails: `terragrunt destroy --terragrunt-working-dir "/abs/path/to/terraform/vpc"`
|
|
49
|
+
- Recovery time: ~5 minutes
|
|
50
|
+
|
|
51
|
+
### Execution Steps
|
|
52
|
+
|
|
53
|
+
When approved, will execute:
|
|
54
|
+
1. `git add [terraform_vpc_path]/`
|
|
55
|
+
2. `git commit -m "feat(infra): add production VPC network"`
|
|
56
|
+
3. `git push origin main`
|
|
57
|
+
4. `terragrunt apply -auto-approve --terragrunt-working-dir "/abs/path/to/terraform/vpc"`
|
|
58
|
+
|
|
59
|
+
### Verification Criteria
|
|
60
|
+
|
|
61
|
+
- `gcloud compute networks describe prod-network --project=[project-id]` -> `status: ACTIVE`
|
|
62
|
+
- `gcloud compute networks subnets list --filter="network:prod-network" --project=[project-id]` -> 3 subnets listed
|
|
63
|
+
|
|
64
|
+
### Files Affected
|
|
65
|
+
|
|
66
|
+
**Git changes:**
|
|
67
|
+
- Added: `[terraform_vpc_path]/terragrunt.hcl`
|
|
68
|
+
- Added: `[terraform_vpc_path]/main.tf`
|
|
69
|
+
|
|
70
|
+
## Approval Required
|
|
71
|
+
|
|
72
|
+
**Approval Code:** `NONCE:<hex from hook block response>`
|
|
73
|
+
**Operation:** terragrunt apply
|
|
74
|
+
**Environment:** prod
|
|
75
|
+
**Risk Level:** MEDIUM
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Example 2: GitOps Deployment
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
## GitOps Deployment Plan
|
|
82
|
+
|
|
83
|
+
### Summary
|
|
84
|
+
- Updating graphql-server image to v1.0.180
|
|
85
|
+
- No configuration changes
|
|
86
|
+
- Flux will auto-reconcile in ~1 minute
|
|
87
|
+
|
|
88
|
+
### Changes Proposed
|
|
89
|
+
|
|
90
|
+
**HelmRelease to MODIFY:**
|
|
91
|
+
- `graphql-server` in namespace `common`
|
|
92
|
+
- Image: ghcr.io/vtr/graphql-server:v1.0.176 -> v1.0.180
|
|
93
|
+
- No other changes
|
|
94
|
+
|
|
95
|
+
### Validation Results
|
|
96
|
+
|
|
97
|
+
**Dry-run status:**
|
|
98
|
+
- `kubectl apply --dry-run=client` - Valid manifest
|
|
99
|
+
- YAML syntax check - Passed
|
|
100
|
+
- Image exists in registry - Verified
|
|
101
|
+
|
|
102
|
+
### Risk Assessment
|
|
103
|
+
|
|
104
|
+
**Risk Level:** LOW
|
|
105
|
+
|
|
106
|
+
**Potential Risks:**
|
|
107
|
+
1. New image might have bugs
|
|
108
|
+
- Mitigation: Tested in dev cluster, all tests passed
|
|
109
|
+
2. Pod restart might cause brief downtime
|
|
110
|
+
- Mitigation: RollingUpdate strategy, 2 replicas ensure availability
|
|
111
|
+
|
|
112
|
+
**Rollback Plan:**
|
|
113
|
+
- If deployment fails: `git revert` + `flux reconcile`
|
|
114
|
+
- Recovery time: ~2 minutes
|
|
115
|
+
|
|
116
|
+
### Execution Steps
|
|
117
|
+
|
|
118
|
+
When approved, will execute:
|
|
119
|
+
1. `git add gitops/clusters/prod-digital-eks/common/graphql-server.yaml`
|
|
120
|
+
2. `git commit -m "chore(graphql): update to v1.0.180"`
|
|
121
|
+
3. `git push origin main`
|
|
122
|
+
4. Flux auto-reconciles in ~1 minute (or force: `flux reconcile helmrelease graphql-server -n common --timeout=90s`)
|
|
123
|
+
|
|
124
|
+
### Verification Criteria
|
|
125
|
+
|
|
126
|
+
- `kubectl get helmrelease graphql-server -n common --request-timeout=30s` -> `READY=True`, revision contains `v1.0.180`
|
|
127
|
+
- `kubectl get pods -n common -l app=graphql-server --request-timeout=30s` -> all pods `Running`
|
|
128
|
+
|
|
129
|
+
### Files Affected
|
|
130
|
+
|
|
131
|
+
**Git changes:**
|
|
132
|
+
- Modified: `gitops/clusters/prod-digital-eks/common/graphql-server.yaml`
|
|
133
|
+
|
|
134
|
+
## Approval Required
|
|
135
|
+
|
|
136
|
+
**Approval Code:** `NONCE:<hex from hook block response>`
|
|
137
|
+
**Operation:** git push + flux reconcile
|
|
138
|
+
**Environment:** prod
|
|
139
|
+
**Risk Level:** LOW
|
|
140
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Approval Request Plan Template
|
|
2
|
+
|
|
3
|
+
Use this template when requesting user approval for a T3 operation.
|
|
4
|
+
The fields below map directly to the `approval_request` object in your `json:contract` block.
|
|
5
|
+
|
|
6
|
+
```markdown
|
|
7
|
+
## Deployment Plan
|
|
8
|
+
|
|
9
|
+
### Summary (3-5 bullets)
|
|
10
|
+
- What will be changed
|
|
11
|
+
- Why this change is needed
|
|
12
|
+
- What the expected outcome is
|
|
13
|
+
|
|
14
|
+
### Changes Proposed
|
|
15
|
+
|
|
16
|
+
**Resources to CREATE:**
|
|
17
|
+
- [Resource]: [Description]
|
|
18
|
+
|
|
19
|
+
**Resources to MODIFY:**
|
|
20
|
+
- [Resource]: [What changes] (before -> after)
|
|
21
|
+
|
|
22
|
+
**Resources to DELETE:**
|
|
23
|
+
- [Resource]: [Why deletion]
|
|
24
|
+
|
|
25
|
+
### Validation Results
|
|
26
|
+
|
|
27
|
+
**Dry-run status:**
|
|
28
|
+
- `[simulation command]` - [result summary]
|
|
29
|
+
|
|
30
|
+
**Dependencies verified:**
|
|
31
|
+
- [Dependency]: Available
|
|
32
|
+
|
|
33
|
+
### approval_request fields
|
|
34
|
+
|
|
35
|
+
These 6 fields MUST appear in the `approval_request` object of your `json:contract`:
|
|
36
|
+
|
|
37
|
+
| Field | Example value |
|
|
38
|
+
|-------|---------------|
|
|
39
|
+
| `operation` | `"apply Terraform changes to dev VPC"` |
|
|
40
|
+
| `exact_content` | `"terraform -chdir=/infra/dev apply -auto-approve"` |
|
|
41
|
+
| `scope` | `"infra/dev/vpc.tf, infra/dev/subnets.tf -- dev environment only"` |
|
|
42
|
+
| `risk_level` | `"MEDIUM"` |
|
|
43
|
+
| `rollback` | `"terraform -chdir=/infra/dev apply -target=module.vpc -var='cidr=10.0.0.0/16'"` |
|
|
44
|
+
| `verification` | `"terraform -chdir=/infra/dev output vpc_id -- expect vpc-xxx"` |
|
|
45
|
+
|
|
46
|
+
When a hook blocked the command (attempt first path), also include:
|
|
47
|
+
| Field | Example value |
|
|
48
|
+
|-------|---------------|
|
|
49
|
+
| `approval_id` | `"a1b2c3d4e5f6..."` (hex from hook deny response) |
|
|
50
|
+
|
|
51
|
+
### Files Affected
|
|
52
|
+
|
|
53
|
+
**Git changes:**
|
|
54
|
+
- Modified: [files]
|
|
55
|
+
- Added: [files]
|
|
56
|
+
- Deleted: [files]
|
|
57
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: schedule-task
|
|
3
|
+
description: Reference material for dispatch parameter extraction and prompt templates. The orchestrator's dispatch execution section covers the core principles -- load this skill for detailed templates and examples.
|
|
4
|
+
metadata:
|
|
5
|
+
user-invocable: false
|
|
6
|
+
type: reference
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Schedule Task
|
|
10
|
+
|
|
11
|
+
On-demand reference for parameter extraction, prompt templates, and task
|
|
12
|
+
classification details. The orchestrator's "Dispatch execution" identity
|
|
13
|
+
section covers when and how to dispatch. Load this skill when you need
|
|
14
|
+
the exact templates or extraction patterns.
|
|
15
|
+
|
|
16
|
+
## Task classification
|
|
17
|
+
|
|
18
|
+
| Measurable? | Improvable? | Type | Action |
|
|
19
|
+
|-------------|-------------|------|--------|
|
|
20
|
+
| Yes | Yes (iterative) | agentic-loop | Build loop prompt with all params |
|
|
21
|
+
| Yes | No (pass/fail) | simple-task | Build focused prompt, no loop |
|
|
22
|
+
| Creatable | Yes | two-phase | Phase 1: create eval. Phase 2: agentic-loop |
|
|
23
|
+
| No | N/A | manual-review | Warn user, offer alternatives |
|
|
24
|
+
|
|
25
|
+
## Parameter extraction (agentic-loop only)
|
|
26
|
+
|
|
27
|
+
Required: `goal`, `eval_command`, `metric`, `direction`, `threshold`
|
|
28
|
+
Optional: `max_iterations` (default 20), `files_in_scope`, `branch` prefix
|
|
29
|
+
|
|
30
|
+
If any required param is missing -- ASK the user. Do not guess eval commands
|
|
31
|
+
or thresholds. See `reference.md` for extraction examples and confirmation
|
|
32
|
+
patterns.
|
|
33
|
+
|
|
34
|
+
## Prompt templates
|
|
35
|
+
|
|
36
|
+
For agentic-loop tasks, use the template in `reference.md`. The prompt MUST
|
|
37
|
+
include the `Carga la skill agentic-loop` header -- this triggers skill
|
|
38
|
+
injection in the agent.
|
|
39
|
+
|
|
40
|
+
For simple tasks, build a focused objective prompt without the loop header.
|
|
41
|
+
For two-phase tasks, dispatch Phase 1 first (create eval), then Phase 2 (loop).
|
|
42
|
+
|
|
43
|
+
## Scheduling with CronCreate
|
|
44
|
+
|
|
45
|
+
When the user wants recurring execution ("cada noche", "cron", "schedule"):
|
|
46
|
+
- Use `CronCreate` with the built prompt
|
|
47
|
+
- One-shot: `recurring=false`
|
|
48
|
+
- Recurring: `recurring=true` -- warn about 7-day limit
|
|
49
|
+
- See `reference.md` for cron expression examples
|
|
50
|
+
|
|
51
|
+
## Reading loop_status
|
|
52
|
+
|
|
53
|
+
When an agent returns `loop_status` in its `json:contract`:
|
|
54
|
+
- `"iterating"` -- agent still working, wait
|
|
55
|
+
- `"threshold_reached"` / `"complete"` -- present: baseline -> final in N iterations
|
|
56
|
+
- `"stopped"` -- present what was achieved + why it stopped
|
|
57
|
+
- `"blocked"` -- present blocker, ask user
|
|
58
|
+
|
|
59
|
+
## Anti-Patterns
|
|
60
|
+
|
|
61
|
+
- Dispatching a loop without `eval_command` -- the agent cannot measure progress
|
|
62
|
+
- Including loop protocol details in the dispatch prompt -- `agentic-loop` skill handles that
|
|
63
|
+
- Micromanaging the agent's iterations -- dispatch the goal, not the steps
|
|
64
|
+
- Guessing thresholds the user did not provide
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Schedule Task -- Reference
|
|
2
|
+
|
|
3
|
+
Prompt templates, parameter extraction examples, agent selection guide, and scheduling patterns. Read on-demand when dispatching tasks.
|
|
4
|
+
|
|
5
|
+
## Prompt Templates
|
|
6
|
+
|
|
7
|
+
### Agentic Loop
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
## Agentic Loop Task
|
|
11
|
+
|
|
12
|
+
Carga la skill agentic-loop y sigue su protocolo.
|
|
13
|
+
|
|
14
|
+
goal: {goal}
|
|
15
|
+
eval_command: {eval_command}
|
|
16
|
+
metric: {metric}
|
|
17
|
+
direction: {direction}
|
|
18
|
+
threshold: {threshold}
|
|
19
|
+
max_iterations: {max_iterations}
|
|
20
|
+
files_in_scope: {files}
|
|
21
|
+
branch: {branch_prefix}-{date}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The `Carga la skill agentic-loop` line triggers skill injection -- it must appear exactly as written. The agent receives the `agentic-loop` skill which governs the entire iteration protocol. Do not duplicate any loop instructions in this prompt.
|
|
25
|
+
|
|
26
|
+
### Simple Task
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
## Task
|
|
30
|
+
|
|
31
|
+
{goal}
|
|
32
|
+
|
|
33
|
+
Expected outcome: {what success looks like}
|
|
34
|
+
Files in scope: {files}
|
|
35
|
+
Verification: {how to confirm it worked -- test command, expected output, etc.}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
No loop header, no iteration parameters. The agent executes once and verifies.
|
|
39
|
+
|
|
40
|
+
### Two-Phase
|
|
41
|
+
|
|
42
|
+
**Phase 1 prompt (create eval):**
|
|
43
|
+
```
|
|
44
|
+
## Create Evaluation Script
|
|
45
|
+
|
|
46
|
+
Goal: Create a repeatable eval command for measuring {metric}.
|
|
47
|
+
The command must print a line matching: METRIC {metric_name}={number}
|
|
48
|
+
|
|
49
|
+
Context: {what the metric measures and why}
|
|
50
|
+
Files to evaluate: {files}
|
|
51
|
+
Output: A script or command that can run repeatedly and produce consistent measurements.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Phase 2 prompt (after Phase 1 completes):**
|
|
55
|
+
Use the agentic-loop template above, with `eval_command` set to whatever Phase 1 produced.
|
|
56
|
+
|
|
57
|
+
## Parameter Extraction Examples
|
|
58
|
+
|
|
59
|
+
Natural language contains the parameters -- extract them, do not invent them.
|
|
60
|
+
|
|
61
|
+
| User says | Extracted parameters |
|
|
62
|
+
|-----------|---------------------|
|
|
63
|
+
| "Mejora los tests hasta que pasen al 95%" | goal: improve test pass rate, metric: pass_rate, direction: higher, threshold: 95, eval_command: ASK |
|
|
64
|
+
| "Reduce el bundle size a menos de 200kb" | goal: reduce bundle size, metric: bundle_size_kb, direction: lower, threshold: 200, eval_command: ASK |
|
|
65
|
+
| "Optimiza el tiempo de respuesta del API" | goal: optimize API response time, metric: response_time_ms, direction: lower, threshold: ASK, eval_command: ASK |
|
|
66
|
+
| "Trabaja en esto hasta que no haya errores de lint" | goal: fix all lint errors, metric: error_count, direction: lower, threshold: 0, eval_command: ASK (likely `npm run lint`) |
|
|
67
|
+
| "Cada noche corre los tests y avísame si fallan" | type: simple-task + schedule, recurring: true, cron: nightly |
|
|
68
|
+
| "Itera sobre el CSS hasta que Lighthouse de 90+" | goal: improve Lighthouse score, metric: performance, direction: higher, threshold: 90, eval_command: ASK |
|
|
69
|
+
|
|
70
|
+
When `ASK` appears, the parameter must be confirmed with the user before dispatch.
|
|
71
|
+
|
|
72
|
+
### Confirming missing parameters
|
|
73
|
+
|
|
74
|
+
Present what you extracted and what is missing:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
Entendido -- quieres mejorar el pass rate de tests hasta 95%.
|
|
78
|
+
|
|
79
|
+
Para armar el loop necesito:
|
|
80
|
+
- eval_command: el comando que corre los tests y reporta el porcentaje
|
|
81
|
+
(e.g., `pytest tests/ --tb=short 2>&1 | python parse_results.py`)
|
|
82
|
+
- files_in_scope: que archivos puede modificar el agente?
|
|
83
|
+
|
|
84
|
+
Con eso lanzo el loop.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Agent Selection Guide
|
|
88
|
+
|
|
89
|
+
Match by the FILES the agent will modify, not by the topic of conversation.
|
|
90
|
+
|
|
91
|
+
| If the agent needs to modify... | Route to |
|
|
92
|
+
|---------------------------------|----------|
|
|
93
|
+
| `hooks/`, `modules/`, `adapters/`, `skills/`, `agents/`, `config/surface-routing.json` | gaia-system |
|
|
94
|
+
| `src/`, `lib/`, `tests/`, `package.json`, `Dockerfile`, `.github/workflows/` | developer |
|
|
95
|
+
| Kubernetes manifests, `HelmRelease`, `Kustomization`, Flux configs | gitops-operator |
|
|
96
|
+
| `.tf`, `.hcl`, `terragrunt.hcl`, Terraform modules | terraform-architect |
|
|
97
|
+
| Nothing -- inspect logs, pods, cloud resources | cloud-troubleshooter |
|
|
98
|
+
|
|
99
|
+
When files span two domains (e.g., app code + K8s manifest), dispatch to both agents in parallel with separate prompts.
|
|
100
|
+
|
|
101
|
+
## CronCreate Examples
|
|
102
|
+
|
|
103
|
+
### Nightly test run
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
CronCreate:
|
|
107
|
+
schedule: "0 3 * * *" # 3 AM daily
|
|
108
|
+
prompt: "Run pytest on /path/to/project and report results. If any tests fail, summarize the failures."
|
|
109
|
+
recurring: true
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Weekly optimization loop
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
CronCreate:
|
|
116
|
+
schedule: "0 2 * * 1" # 2 AM every Monday
|
|
117
|
+
prompt: |
|
|
118
|
+
## Agentic Loop Task
|
|
119
|
+
|
|
120
|
+
Carga la skill agentic-loop y sigue su protocolo.
|
|
121
|
+
|
|
122
|
+
goal: Improve test coverage
|
|
123
|
+
eval_command: pytest --cov=src --cov-report=term | python parse_coverage.py
|
|
124
|
+
metric: coverage_pct
|
|
125
|
+
direction: higher
|
|
126
|
+
threshold: 90
|
|
127
|
+
max_iterations: 15
|
|
128
|
+
files_in_scope: src/, tests/
|
|
129
|
+
branch: improve/coverage-{date}
|
|
130
|
+
recurring: true
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### One-shot scheduled task
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
CronCreate:
|
|
137
|
+
schedule: "30 22 * * *" # Tonight at 10:30 PM
|
|
138
|
+
prompt: "Run the full integration test suite and create a summary report."
|
|
139
|
+
recurring: false
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Common cron expressions
|
|
143
|
+
|
|
144
|
+
| Expression | Meaning |
|
|
145
|
+
|-----------|---------|
|
|
146
|
+
| `0 3 * * *` | Every day at 3 AM |
|
|
147
|
+
| `0 2 * * 1` | Every Monday at 2 AM |
|
|
148
|
+
| `0 */6 * * *` | Every 6 hours |
|
|
149
|
+
| `0 9 * * 1-5` | Weekdays at 9 AM |
|
|
150
|
+
| `0 0 1 * *` | First of each month at midnight |
|
|
151
|
+
|
|
152
|
+
**7-day limit warning:** Recurring cron jobs have a 7-day maximum lifetime. After 7 days, the schedule expires and must be recreated. Always inform the user of this constraint when setting up recurring tasks.
|
|
153
|
+
|
|
154
|
+
## Example Conversations
|
|
155
|
+
|
|
156
|
+
### Agentic loop dispatch
|
|
157
|
+
|
|
158
|
+
**User:** "Mejora la cobertura de tests hasta 90%"
|
|
159
|
+
|
|
160
|
+
**Classification:**
|
|
161
|
+
- Measurable? Yes (coverage tools exist)
|
|
162
|
+
- Improvable? Yes (can add tests iteratively)
|
|
163
|
+
- Type: agentic-loop
|
|
164
|
+
|
|
165
|
+
**Missing params:** eval_command, files_in_scope
|
|
166
|
+
|
|
167
|
+
**Orchestrator response:**
|
|
168
|
+
"Para lanzar el loop de mejora necesito saber:
|
|
169
|
+
1. El comando que mide cobertura (e.g., `pytest --cov=src`)
|
|
170
|
+
2. Que archivos puede tocar el agente?
|
|
171
|
+
Con eso arranco."
|
|
172
|
+
|
|
173
|
+
**User:** "pytest --cov=src --cov-report=term, puede tocar src/ y tests/"
|
|
174
|
+
|
|
175
|
+
**Dispatch:** Agent(developer) with agentic-loop prompt, all params filled.
|
|
176
|
+
|
|
177
|
+
### Simple task dispatch
|
|
178
|
+
|
|
179
|
+
**User:** "Corre los tests y dime si pasan"
|
|
180
|
+
|
|
181
|
+
**Classification:**
|
|
182
|
+
- Measurable? Yes
|
|
183
|
+
- Improvable? No (pass/fail, no iteration)
|
|
184
|
+
- Type: simple-task
|
|
185
|
+
|
|
186
|
+
**Dispatch:** Agent(developer) with simple-task prompt: "Run the test suite and report results."
|
|
187
|
+
|
|
188
|
+
### Two-phase dispatch
|
|
189
|
+
|
|
190
|
+
**User:** "Quiero que el API responda en menos de 200ms pero no tengo benchmarks"
|
|
191
|
+
|
|
192
|
+
**Classification:**
|
|
193
|
+
- Measurable? Creatable (need to build a benchmark first)
|
|
194
|
+
- Improvable? Yes
|
|
195
|
+
- Type: two-phase
|
|
196
|
+
|
|
197
|
+
**Phase 1 dispatch:** Agent(developer) -- "Create a benchmark script that measures API response time and outputs METRIC response_time_ms={number}"
|
|
198
|
+
|
|
199
|
+
**Phase 2 dispatch (after Phase 1):** Agent(developer) with agentic-loop prompt using the eval_command from Phase 1.
|
|
200
|
+
|
|
201
|
+
### Manual review warning
|
|
202
|
+
|
|
203
|
+
**User:** "Mejora la UX del dashboard"
|
|
204
|
+
|
|
205
|
+
**Classification:**
|
|
206
|
+
- Measurable? No (subjective, no automated metric)
|
|
207
|
+
- Type: manual-review
|
|
208
|
+
|
|
209
|
+
**Orchestrator response:**
|
|
210
|
+
"La UX no se puede medir automaticamente -- un loop no puede evaluar mejoras subjetivas. Alternativas:
|
|
211
|
+
1. Si hay metricas proxy (Lighthouse accessibility, load time), puedo iterar sobre esas
|
|
212
|
+
2. Puedo hacer cambios puntuales y presentartelos para review manual
|
|
213
|
+
3. Si defines criterios especificos (e.g., 'reduce clicks to complete X'), puedo medir eso
|
|
214
|
+
|
|
215
|
+
Cual prefieres?"
|
|
216
|
+
|
|
217
|
+
### Scheduled task
|
|
218
|
+
|
|
219
|
+
**User:** "Cada noche corre los tests y avísame si hay fallos"
|
|
220
|
+
|
|
221
|
+
**Classification:**
|
|
222
|
+
- Type: simple-task + schedule
|
|
223
|
+
- Recurring: true
|
|
224
|
+
|
|
225
|
+
**Dispatch:**
|
|
226
|
+
```
|
|
227
|
+
CronCreate:
|
|
228
|
+
schedule: "0 3 * * *"
|
|
229
|
+
prompt: "Run pytest on /path/to/project. Report any failures with file, test name, and error message."
|
|
230
|
+
recurring: true
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Orchestrator confirms:** "Listo -- programado para las 3 AM cada noche. Recuerda que los cron jobs expiran a los 7 dias y hay que renovarlos."
|