ワンクリックで
agent-delegation
// Use when orchestrating complex tasks across specialized agents with proper context handoff
// Use when orchestrating complex tasks across specialized agents with proper context handoff
Three-layer bootstrap flow, dotbot patterns, and deployment order for Win dotfiles. Use when editing bootstrap.ps1, install.conf.yaml, or Setup-Dotfiles.ps1.
Use when working on PowerShell scripts, registry tweaks, or dotfile deployment in the Win repo. Covers conventions, Common.ps1 helpers, and path rules.
Use when validating changes in the Win repo. Per-change-type checks for PowerShell, dotbot, autounattend.xml, and guidance files.
Use to run the mandatory end-of-session workflow — file issues, run quality gates, push to remote, verify clean state, hand off context.
Use when configuring or troubleshooting MCP servers for OpenCode/Kilo environments
Use when migrating AI assistant configurations from Claude Code, Cursor, and other tools to OpenCode/Kilo
| name | agent-delegation |
| description | Use when orchestrating complex tasks across specialized agents with proper context handoff |
| compatibility | opencode |
Use this skill when a task is too large for a single agent or requires cross-domain expertise. Covers task decomposition, wave planning, context passing, permission boundaries, and recovery from subagent failures.
Delegate when any of the following are true:
windows-system-agent, powershell-expert)Break work by function rather than by file:
Break work by system layer:
bootstrap.ps1, install.conf.yaml)Scripts/**/*.ps1)user/.dotfiles/config/).github/, .kilo/, AGENTS.md)Order subtasks by dependency:
Scripts/Common.ps1)Use parallel delegation when subtasks are independent:
Wave 1 (parallel):
- Agent A: Research registry keys for gaming tweak
- Agent B: Research winget package IDs for new tools
- Agent C: Draft README update
Wave 2 (sequential after Wave 1):
- Agent D: Implement script using findings from A and B
- Agent E: Validate README accuracy against C's draft
Rules for parallel waves:
Use sequential delegation when subtasks depend on prior output:
Wave 1: Research agent → returns registry paths and values
Wave 2: PowerShell expert → writes `Set-MyTweak.ps1` using Wave 1 output
Wave 3: Validation agent → runs ScriptAnalyzer and tests
Always validate the output of Wave N before starting Wave N+1.
Never forward raw conversation logs. Extract the minimum viable context:
## Handoff from <Agent-Name>
### Decisions
- Using `Set-RegistryValue` helper from Common.ps1
- Target: `HKCU\Software\MyTweak`, value `Enable` = 1
### Findings
- GPU registry paths: `HKLM:\SYSTEM\...\0000` and `0001`
- Requires admin elevation
### Files Touched
- `Scripts/MyTweak.ps1` (new, lines 1-45)
- `Scripts/Common.ps1` (no changes)
### Next Steps
- Add `SupportsShouldProcess` to new script
- Run ScriptAnalyzer
When a subagent may need to resume later (multi-wave tasks), use persistent sessions:
task_id when continuingtask_budget in opencode.json to prevent infinite delegation loopsMatch the agent's permissions to the work:
| Agent Type | Tools | File Access | Safe For |
|---|---|---|---|
| Researcher | read-only (webfetch, MCP) | read-only | Docs lookup, API research |
| Coder | write, bash | full | Implementation, refactoring |
| Reviewer | read-only, git | read-only | PR review, lint, audit |
| Scribe | write (docs only) | limited | README, comments, guides |
| System | write, bash, registry | full | OS tweaks, service changes |
{
"agent": {
"reviewer": {
"permissions": {
"read": true,
"write": false,
"bash": false,
"tools": {
"github*": true,
"webfetch": true
}
}
}
}
}
Never give an agent broader permissions than its task requires.
| Mode | Signal | Response |
|---|---|---|
| Timeout | No response within limit | Retry once with narrower scope; if still failing, split task smaller |
| Error | Subagent reports error | Capture error message, fix root cause, re-delegate only the failing slice |
| Wrong output | Result does not match spec | Send correction prompt with explicit delta; do not restart from scratch |
| Loop | Subagent delegates back infinitely | Check task_budget and level_limit in config; cap depth |
If a specialist agent fails and no narrower scope is possible, the parent agent should:
task_budget and level_limit to prevent.mcp-server-management — scoping MCP tools per agentwindows-dotfiles — repo-specific agent types for this project