feat(skills): add delegation-router execution policy skill

This commit is contained in:
zap
2026-03-12 19:52:49 +00:00
parent 4adc87c0da
commit fb5d24ccfc

View File

@@ -0,0 +1,113 @@
---
name: delegation-router
description: Decide execution mode and model tier for tasks with low noise. Use when planning work and choosing between direct execution, spawning a subagent/fresh implementation session, or delegating via ACP sessions_spawn. Includes a routing matrix, complexity/risk model-tier policy (including Claude ACP tiers), fresh-session implementation rule, and practical sessions_spawn payload patterns.
---
# Delegation Router
Use this as a fast preflight before implementation.
## 1) Route selection matrix (direct vs subagent vs ACP)
Choose the **least heavy path** that still gives reliable outcomes.
| Task shape | Route | Default reason |
|---|---|---|
| Tiny, low-risk, 1-3 edits/commands, no long wait | **Direct in current session** | Lowest overhead, fastest feedback |
| Multi-step implementation, broad file exploration, likely >10 min, or context getting long | **Subagent / fresh isolated session** | Keeps main session clean; better execution focus |
| Explicit provider/runtime requirement (Claude/Codex/Pi) or model-specific quality need | **ACP via `sessions_spawn`** | Deterministic runtime + model control |
| High-stakes review/architecture where correctness risk is high | **ACP high tier (or experienced subagent + review)** | Better reasoning headroom |
Quick routing rules:
- Stay **direct** for simple fixes and read-only checks.
- Spawn **fresh implementation context** by default for non-trivial build/refactor/debug tasks.
- Use **ACP** when runtime/model selection is itself part of the requirement.
## 2) Model-tier policy
Pick the lowest tier that safely meets quality.
### Complexity bands
- **Light**: small rewrite, single-file tweak, straightforward lookup, routine formatting.
- **Medium**: multi-file feature/fix, moderate debugging, synthesis across several sources.
- **Heavy**: architecture changes, ambiguous root-cause investigations, high-impact reviews, security-sensitive reasoning.
### Tier map
- **Light** → economy/fast tier
- Claude ACP: **Haiku 4.5**
- **Medium** → balanced default
- Claude ACP: **Sonnet 4.6** (default)
- **Heavy** → top-reasoning tier
- Claude ACP: **Opus 4.6**
Escalate only when:
- prior attempt failed quality bar,
- ambiguity remains high after basic triage,
- failure cost is materially high.
## 3) Fresh-session implementation rule
For non-trivial work:
1. Scope and plan in current session.
2. Write concise baton files (`WIP.md`, optionally `HANDOFF.md`) with goal, next actions, blockers, success criteria.
3. Execute in a **fresh implementation session** (subagent or ACP run).
4. Return with outcome + evidence (diff/tests/outputs), not long play-by-play.
Do not drag long conversational context into implementation if file-based handoff is enough.
## 4) `sessions_spawn` patterns (ACP examples)
Use one clean spawn per coherent task (avoid noisy micro-spawns).
### Light (Claude Haiku 4.5)
```json
{
"runtime": "acp",
"agentId": "claude",
"model": "claude-haiku-4-5",
"task": "Apply a small docs wording fix in docs/README.md and return exact diff."
}
```
### Medium (Claude Sonnet 4.6, default)
```json
{
"runtime": "acp",
"agentId": "claude",
"model": "claude-sonnet-4-6",
"task": "Implement feature X across files A/B/C, run targeted tests, and summarize decisions."
}
```
### Heavy (Claude Opus 4.6)
```json
{
"runtime": "acp",
"agentId": "claude",
"model": "claude-opus-4-6",
"task": "Review architecture tradeoffs for Y, propose final design, then implement with safety checks."
}
```
If `sessions_spawn` is unavailable in the current tool surface, use the available delegation primitive (for example, `subagents`) and keep the same routing + tier logic.
## 5) Low-noise defaults
- Prefer one solid delegation run over many tiny ones.
- Do not poll aggressively; rely on push completion or sparse status checks.
- Keep instructions compact and outcome-based (goal, constraints, acceptance criteria).
- Ask for only necessary artifacts: patch/diff, test result, short rationale.
- Summarize back in 5-10 lines unless user asks for depth.
## 6) Fast decision checklist
- Is task tiny and safe? → direct.
- Is it non-trivial implementation? → fresh session/subagent.
- Do I need explicit runtime/model control? → ACP `sessions_spawn`.
- Complexity/risk band? → Light/Medium/Heavy tier.
- Can I reduce noise further? → fewer spawns, fewer polls, concise outputs.