返回 CodeWhale
SKILL.md
根目录 / crates / skills / assets / skills / delegate / SKILL.md
1 ---
2 name: delegate
3 description: Strategic delegation for multi-step coding, research, or verification work. Use when a task can be split into parent reasoning plus focused sub-agent execution through the agent tool.
4 metadata:
5 short-description: Delegate focused work to sub-agents
6 ---
7
8 # Delegate
9
10 Use sub-agents when they can do focused work in parallel while the parent keeps architectural judgment, integration, and the final review.
11
12 ## Keep vs Delegate
13
14 Keep in the parent:
15
16 - Understanding the user's actual request and constraints
17 - Architecture, security, product, and release-risk decisions
18 - Cross-module integration
19 - Final review, test interpretation, and user-facing summary
20
21 Delegate to sub-agents:
22
23 - Read-only exploration over a bounded file set
24 - Mechanical edits with a clear file ownership boundary
25 - Focused test or lint runs
26 - Boilerplate generation from an explicit spec
27 - Independent checks that can run while parent work continues
28
29 Do not delegate tiny one-step tasks, ambiguous product decisions, or destructive operations without a clear acceptance criterion.
30
31 ## Launch Focused Work
32
33 Use `agent` for a focused child run. Launch independent children together so they can run in parallel.
34
35 Give each child a concrete outcome and acceptance criteria. Let it continue until the work is complete or it needs input. Do not invent time, turn or token budgets, or tell it to stop early because a percentage of a budget has elapsed. The runtime carries any limits explicitly configured by the owner.
36
37 Prefer provider-neutral `model_strength` over hardcoded model ids. Children inherit the active model by default (`model_strength: "same"`), including `type: "explore"`, so pass `model_strength: "faster"` explicitly to get the cheaper same-family sibling for read-only exploration:
38
39 ```json
40 {
41 "name": "config_audit",
42 "prompt": "Inspect crates/tui/src/config.rs and crates/tui/src/settings.rs for duplicate model-default logic. Return file/line findings only; do not edit files.",
43 "type": "explore",
44 "model_strength": "faster",
45 "cwd": "."
46 }
47 ```
48
49 For code changes, give the child a precise write boundary and tell it not to revert unrelated edits. Keep implementation children capable with `model_strength: "same"`:
50
51 ```json
52 {
53 "name": "docs_patch",
54 "prompt": "Update only docs/configuration.md to document the new [statusline] keys. Match the surrounding style. Do not edit other files.",
55 "type": "implement",
56 "model_strength": "same",
57 "cwd": "."
58 }
59 ```
60
61 Use `fork_context: true` only when the child genuinely needs the current conversation prefix. Leave it omitted for fresh, narrower context.
62
63 ## Route the Work
64
65 Routes are optional: a child inherits a working route by default. To choose one, `agent(action:"roster")` (no provider request) lists each role's resolved route and the models you may pick.
66
67 - `thinking` overrides a saved tier on any role. Dial: `off low medium high xhigh max ultra`, plus `inherit` (role default, then session effort) and `auto`.
68 - `model` and `model_strength` apply to unpinned routes only. A pinned profile refuses a conflicting model; to choose a model, start an unpinned role such as `general`. `model_strength: "faster"` is the same-family faster sibling, `"same"` the session model.
69 - Read the receipt, not your request: `child_route` shows the provider, model and route source, and `requested_reasoning` vs `effective_reasoning` shows what the route actually ran.
70 - Route by stakes. Mechanical work: the cheapest sufficient route with `thinking: "off"` or `"low"`. Implementation: a capable route at `medium` or above. Review and verification: a strong route at `high`, on a different route than the author when independence matters.
71
72 ## Evaluate and Verify
73
74 Sub-agent outputs are self-reports. Re-check material claims before relying on them:
75
76 - Read changed files directly.
77 - Run the relevant tests locally.
78 - Inspect unexpected diffs before committing.
79 - Verify externally visible or destructive claims against source data.
80
81 ## Prompt Shape
82
83 A good delegation prompt includes:
84
85 - The exact task
86 - Files or modules owned by the child
87 - Files or behavior the child must not touch
88 - Expected output format
89 - Acceptance criteria
90
91 Weak prompt:
92
93 ```text
94 Fix the settings bug.
95 ```
96
97 Strong prompt:
98
99 ```text
100 Own only crates/tui/src/settings.rs and its tests. Preserve existing config key names. Verify with the existing checks that provider-specific API key changes do not restart provider onboarding. Return the changed paths and test command output.
101 ```
102
102 lines MARKDOWN