Prompt #127

Back to prompts
agent-orchestrate dispatch with AP3 stages
Flow Β· claude-3.7-sonnet
5/5
Variables
{'name': 'intent', 'description': 'long-form intent'}, {'name': 'intent_short', 'description': '≀80 chars'}, {'name': 'projects', 'description': 'description of which projects'}, {'name': 'projects_comma', 'description': 'glug,rag-stack,yoga,…'}, {'name': 'role', 'description': 'agent-haiku|claude|or|codex|qwen'}, {'name': 'parallel_count', 'description': 'max parallel children'}, {'name': 'timeout_min', 'description': 'per-child timeout'}
Tags
stack-aware,orchestration,agent-orchestrate,ap3,ap4,ap50
Source
research-2026-05-01-stack-aware-handcrafted
Use count
0
Created
2026-05-01T18:30:35.938632+00:00
Updated
2026-05-01T18:30:35.938632+00:00

Content

Plan a multi-project agent dispatch via `bin/agent-orchestrate` for `{intent}` across `{projects}`.

Pre-flight (AP3 6-stage policy):
1. Stage 1 (role + risk_max): which agent role? `agent-claude` (full-tool), `agent-haiku` (fast/cheap), `agent-or` (OpenRouter), `agent-codex` (gpt-5), `agent-gemini` (quota issues today), `agent-qwen` (qwen3-coder-plus). Risk-max default 'write-local'; bump to 'write-git' or 'destructive' only with operator OK.
2. Stage 2 (data-class): scope read access β€” does the agent need RAG? .agent/projects.yaml? /var/log/orchestrator? Spec each.
3. Stage 3 (secret-scan): inputs sanitized? rag-add already does this; verify any custom code does too.
4. Stage 4 (tool-chain ledger): which tools allowed? Use `tools/AGENTS.json` as canonical list.
5. Stage 5 (sanitization): output prompt-injection-safe?
6. Stage 6 (cost circuit): max USD spend; agent-quota-status checked first.

Then orchestrate:
```bash
agent-orchestrate \
  --intent '{intent_short}' \
  --projects '{projects_comma}' \
  --child-agent '{role}' \
  --max-parallel {parallel_count} \
  --timeout-min {timeout_min} \
  [--dry-run]
```

Each child writes to `/var/log/orchestrator/<run-id>/<project>/output.txt` + state.json. Watch via `/governance/agents` (AP58 progress bars).

Quality gate: AP50.5 supervisor watches 13 drift-signals; intervention if drift_score > 0.7. AP4 flight-recorder logs every tool call (tamper-evident chain).