Standardize SKILL.md subagent spawn instructions for cross-provider compatibility#3386
Merged
Trecek merged 5 commits intoMay 31, 2026
Conversation
…"sonnet") Replace ~45 ambiguous (Task tool, model: sonnet) prose patterns across 24 SKILL.md files with unambiguous backtick-wrapped Agent(model="sonnet") Python-call syntax. This prevents non-Anthropic providers from misinterpreting "sonnet" as subagent_type rather than model. Adds regression test test_no_ambiguous_spawn_model_parameter to prevent reintroduction. Fixes #3367 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…") syntax
Two existing tests asserted the old prose patterns ('model: "sonnet"' and
'Task tool') that were intentionally replaced by the spawn syntax
standardization commit. Updated assertions to match the new
Agent(model="sonnet") syntax.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ves to Agent(model="sonnet") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…et directive Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ta and setup-environment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a597e5c to
1cbeff9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update ~45 ambiguous subagent spawn instruction lines across 24 SKILL.md files to use unambiguous
Agent(model="sonnet")Python-call syntax. This eliminates the(Task tool, model: sonnet)prose pattern that MiniMax-M2.7-highspeed misinterpreted assubagent_type="sonnet", wasting one API round-trip. Adds a regression test to prevent reintroduction. Documents REQ-SPW-2 audit findings (additional ambiguous patterns in ~55+ files) for follow-up.Root cause: The Claude Code
Agenttool has separatesubagent_typeandmodelparameters. SKILL.md files used prose like(Task tool, model: sonnet)that conflates them — non-Anthropic providers interpret "sonnet" as the agent type rather than the model.Target syntax: Replace all ambiguous patterns with backtick-wrapped Python-call form
Agent(model="sonnet")— matching the established Form A convention already used byaudit-impl/SKILL.md,make-plan/SKILL.md, andrectify/SKILL.mdfor theirAgent(subagent_type=...)calls.Requirements
Problem
SKILL.md files use an ambiguous prose pattern for subagent spawn instructions —
(Task tool, model: sonnet)— that Anthropic models interpret correctly but MiniMax-M2.7-highspeed misreads assubagent_type="sonnet", causing an immediate error followed by self-correction.Observed Failure
In the remediation pipeline run on 2026-05-30 (kitchen
7b421c49, session4b142a26), theprepare_prstep (routed to MiniMax viastep_overrides) hit this sequence:Spawn a subagent (Task tool, model: sonnet)Agent(subagent_type="sonnet")— conflatingmodel:withsubagent_type:Agent type 'sonnet' not found(is_error: true)Agent(subagent_type="general-purpose", model="sonnet")module-dependance(caught and silently corrected by MiniMax's thinking block)Cost: One wasted API round-trip (~5 seconds). No data loss or downstream impact — fully self-healed.
Root Cause
The Claude Code
Agenttool has two separate parameters:subagent_type— which agent type to spawn (e.g.,"general-purpose","Explore")model— which LLM model to use (e.g.,"sonnet","opus","haiku")The phrasing
(Task tool, model: sonnet)is ambiguous prose that can be parsed as either:Scope of the Gap
The ambiguous pattern appears in ~20 spawn instruction lines across 10 SKILL.md files — plus 12 additional files discovered during adversarial review.
Historical Context
PR #1971 (2026-05-05) introduced MiniMax routing for
prepare_pr,compose_pr, anddiagnose_ci. It acknowledged MiniMax's "thoughtful disobedience" pattern and applied mitigations (directive descriptions, step renumbering) but did not audit spawn instruction phrasing. This is the first observed instance of thesubagent_type="sonnet"misfire.MiniMax Routing Config
From
~/.autoskillit/config.yaml:Any step in this list that contains the ambiguous phrasing and spawns subagents is at risk.
Requirements
RE-1: Standardize spawn instruction syntax
Update all SKILL.md files that use the ambiguous
(Task tool, model: sonnet)pattern to use the unambiguous form that explicitly separatessubagent_typefrommodel.Target phrasing:
Spawn a subagent (Agent tool, subagent_type: "general-purpose", model: "sonnet")— or equivalent unambiguous syntax that makes the parameter separation explicit.Scope: ~20 lines across 10 files listed in the tables above.
RE-2: Verify no other ambiguous parameter patterns
Audit all SKILL.md files for other Agent tool parameter patterns that could confuse non-Anthropic providers — not just
model:vssubagent_type:, but any parameter phrased as prose that a model could misparse as a tool parameter value (e.g.,"Explore"used as a type name in prose without explicitsubagent_type:annotation).Architecture Impact
Operational Lens Diagram
%%{init: {'flowchart': {'nodeSpacing': 50, 'rankSpacing': 60, 'curve': 'basis'}}}%% flowchart TB classDef cli fill:#1a237e,stroke:#7986cb,stroke-width:2px,color:#fff; classDef stateNode fill:#004d40,stroke:#4db6ac,stroke-width:2px,color:#fff; classDef handler fill:#e65100,stroke:#ffb74d,stroke-width:2px,color:#fff; classDef phase fill:#6a1b9a,stroke:#ba68c8,stroke-width:2px,color:#fff; classDef newComponent fill:#2e7d32,stroke:#81c784,stroke-width:2px,color:#fff; classDef output fill:#00695c,stroke:#4db6ac,stroke-width:2px,color:#fff; classDef detector fill:#b71c1c,stroke:#ef5350,stroke-width:2px,color:#fff; classDef gap fill:#ff6f00,stroke:#ffa726,stroke-width:2px,color:#000; subgraph SkillLayer ["SKILL.MD INSTRUCTION LAYER"] direction TB SKILL["● SKILL.md Files<br/>━━━━━━━━━━<br/>20 src/ + 4 .claude/<br/>Spawn instructions"] SPAWN["● Spawn Instructions<br/>━━━━━━━━━━<br/>Parenthetical params<br/>e.g. (Task tool, model: sonnet)"] end subgraph Interpretation ["MODEL INTERPRETATION"] direction TB CLAUDE["Anthropic Models<br/>━━━━━━━━━━<br/>Correct parse:<br/>model='sonnet'"] MINIMAX["Non-Anthropic Models<br/>━━━━━━━━━━<br/>Misparse:<br/>subagent_type='sonnet'"] end subgraph Fix ["★ STANDARDIZED SYNTAX"] direction TB NEWFORM["★ Agent(model=sonnet)<br/>━━━━━━━━━━<br/>Python-call syntax<br/>Explicit named param"] REGTEST["★ Regression Test<br/>━━━━━━━━━━<br/>test_skill_md_spawn_syntax<br/>4-pattern scanner"] end subgraph Execution ["AGENT TOOL EXECUTION"] direction TB AGENT["Agent Tool<br/>━━━━━━━━━━<br/>subagent_type: general-purpose<br/>model: sonnet"] end SKILL --> SPAWN SPAWN -->|"ambiguous"| CLAUDE SPAWN -->|"ambiguous"| MINIMAX CLAUDE -->|"correct"| AGENT MINIMAX -->|"subagent_type=sonnet ERROR"| AGENT NEWFORM -->|"unambiguous"| AGENT REGTEST -->|"prevents regression"| SKILL class SKILL,SPAWN phase; class CLAUDE stateNode; class MINIMAX gap; class NEWFORM,REGTEST newComponent; class AGENT handler;Color Legend:
Lens Used: Operational — the changes affect how SKILL.md operational instructions are parsed and dispatched by models invoking the Agent tool.
Closes #3367
Implementation Plan
Plan file:
.autoskillit/temp/make-plan/standardize_skill_md_spawn_syntax_plan_2026-05-30_195500.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown