docs(dispatching-parallel-agents): rewrite for current Agent tool semantics#1611
docs(dispatching-parallel-agents): rewrite for current Agent tool semantics#1611dotcomjack wants to merge 1 commit into
Conversation
…antics The skill was teaching obsolete tool names (Task) and missing the core mechanic that makes parallel dispatch work (one message, multiple tool_use blocks). A baseline probe with a fresh subagent reached for "TaskCreate", invented a separate "EnterWorktree" step (worktree is an Agent parameter, not a tool), and misunderstood foreground/background semantics. This rewrite addresses all three. Changes: - Replace Task(...) with Agent throughout; call out Task/TaskCreate as an explicit anti-pattern. - State the single-assistant-message rule as a hard rule with positive and negative examples (subsumes the additive change in obra#1470, which targets main). - Add full top-level Agent argument schema (description, prompt, subagent_type, isolation, run_in_background, model, name). - Add subagent_type selection table (Explore, general-purpose, Plan, feature-dev:code-architect, code-reviewer, code-explorer, posthog:error-analyzer). - Document isolation="worktree" as default-on for any parallel dispatch that touches files. - Document run_in_background semantics (foreground blocks; background notifies). - Add "never delegate understanding" principle: synthesis stays with the dispatcher. - Rebuild verification around "read the diff, not the summary" (agent summaries describe intent, not action) and "spot-check assertions" (agents sometimes weaken tests to pass). - Remove the dated 2025-10-03 narrative example (writing-skills flags narrative examples as an anti-pattern). Net: 83 additions, 141 deletions. Word count drops from 950 to 897 while adding substantive new content.
|
Closing — this is a wholesale rewrite (83 insertions / 141 deletions) of a carefully-tuned skill, and the new content is very Claude-Code-specific (the
The empirical RED probe in the PR body is appreciated, but a RED probe isn't a GREEN — there's no adversarial pressure-test showing the rewritten skill actually produces better behavior across multiple sessions on multiple harnesses. If you want to pursue this, please:
|
What problem are you trying to solve?
The current skill teaches Claude Code agent dispatch using:
Task(...)as the tool name — obsolete; the actual tool isAgent.subagent_typeguidance — Claude Code now has specialized subagent types (Explore,general-purpose,Plan,feature-dev:code-architect,feature-dev:code-reviewer,feature-dev:code-explorer,posthog:error-analyzer, etc.), and picking the right one matters more than prompt wording in many cases.isolation: \"worktree\",run_in_background,modeloverride,name+SendMessagecontinuation.Empirical baseline (RED)
I ran a baseline probe before writing the rewrite. Prompt to a fresh subagent (no skill loaded): "Imagine you are the main Claude Code assistant. The user says 'three test files are failing for independent reasons: src/abort.test.ts, src/batch.test.ts, src/race.test.ts. Dispatch parallel agents to fix them.' Sketch the exact tool calls you'd make."
The subagent:
TaskCreate).EnterWorktreeper agent first") rather than an Agent parameter.TaskCreateis already async/non-blocking from my POV; I await all three results in the next turn").So even a fresh model with no skill loaded reaches for the obsolete pattern.
What does this PR change?
Rewrites
skills/dispatching-parallel-agents/SKILL.md. 83 insertions, 141 deletions; word count drops from 950 to 897 while adding substantive new content (subagent_type table, full Agent argument schema, options section, "never delegate understanding", "read the diff not the summary", Red Flags section). Removes a dated 2025-10-03 narrative example becausewriting-skillsexplicitly flags narrative examples as an anti-pattern.Is this change appropriate for the core library?
Yes. The skill being modified is already in the core library and applies to every Claude Code user dispatching parallel agents. The rewrite is generic to Claude Code's Agent tool, not specific to any project, team, or third-party integration. The subagent_type table mentions plugin-provided types (
feature-dev:*,posthog:error-analyzer) as examples of what might be available; the table is framed around job → type, not specific plugins.What alternatives did you consider?
agent-tool-reference). Pro: zero risk to the current skill. Con: discovery suffers (two skills overlap on the same trigger); description CSO conflict.main(v5.1.0 release) and is intentionally additive/no-removal — the author was conservative. Expanding scope in-place would change the contract of that PR.Landing #1470 first and then this rewrite is fine (small rebase, no substance loss). Landing this rewrite supersedes #1470's content (the one-message rule is even more prominent here).
Does this PR contain multiple unrelated changes?
No. Single file, single skill, single concern (modernizing the Agent dispatch guidance).
Existing PRs
main. Substantial overlap on that one point; this PR subsumes it.Environment tested
claude-opus-4-7[1m]New harness support (required if this PR adds a new harness)
Not applicable — no harness changes.
Evaluation
superpowers:dispatching-parallel-agentsand determine if it's outdated or lacking quality." The agent identified the gaps above through analysis of the skill text against the live Claude Code Agent tool definition.general-purposesubagent (no skill loaded) with the parallel-test-fix scenario. Outcome documented in "Empirical baseline (RED)" above. The transcript explicitly usedTaskCreate, inventedEnterWorktreeas a separate step, and gotrun_in_backgroundsemantics wrong.general-purposesubagent with explicit instructions to read the rewritten SKILL.md and apply it to the same scenario. Outcome: subagent usedAgent(called outTask/TaskCreateas wrong), batched in one assistant message, pickedsubagent_type=general-purposewith reasoning, appliedisolation: \"worktree\", planned verification as "read each diff (not the summary), grep for overlapping edits, run the FULL suite, spot-check that no assertions were weakened." Caught all RED failures.Task(...)is in the old code blocks).Acknowledged limit: only one GREEN session. The maintainer's bar may be higher; happy to run additional adversarial scenarios if requested.
Rigor
superpowers:writing-skillsand completed adversarial pressure testing (RED/GREEN documented above)writing-skillsrecommendation). The narrative "Real Example from Session" with date 2025-10-03 was removed becausewriting-skillsexplicitly lists narrative examples as an anti-pattern.Human review
Human review confirmed; marking ready.
🤖 Generated with Claude Code