plugin/skills/subagent-spawn/SKILL.md
Use this skill when manually delegating from a workflow or building a custom orchestrator — a typed delegation helper that constructs a valid G7 spawn payload for a chosen role, validates against role-selection-table.md and the spawn-payload schema, and returns a fully-formed Agent(...) call ready for orchestrator use.
npx skillsauth add avav25/ai-assets subagent-spawnInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Constructs a typed spawn payload conforming to plugin/schemas/spawn-payload.schema.json for a chosen role. Used internally by orchestrator skills (/develop, /feature-design, /team-bugfix); also available standalone for power users building custom workflows.
Not for: routine agent invocation (use the orchestrator skill); bypassing role-selection-table (use the table directly).
/subagent-spawn --role frontend-engineer --task "implement OAuth2 login form per src/auth/spec.md"
/subagent-spawn --role security-engineer --task "audit src/api/auth.ts" --max-tokens 30000
/subagent-spawn --role db-engineer --task "design schema migration" --stack postgres
| Flag | Default | Effect |
|---|---|---|
| --role <name> | required | Plugin agent name (one of 26) — validated against plugin/agents/ |
| --task '<text>' | required | The goal field of the G7 spawn payload (10–1000 chars) |
| --stack <name> | auto | Hint for role-selection-table (e.g., postgres, react, terraform) |
| --max-tokens N | 50000 | budget.max_input_tokens cap |
| --max-output N | from agent frontmatter | budget.max_output_tokens (default per agent's max_output_tokens field) |
| --max-tool-calls N | 30 | budget.max_tool_calls |
| --max-turns N | from agent frontmatter | budget.max_turns (default per agent's maxTurns field) |
| --timeout-ms N | 600000 (10 min) | budget.timeout_ms |
--role against plugin/agents/<name>.md. If not found, error with full list.tools, max_output_tokens, maxTurns, disallowedTools) for default budget values.trace_id: format wf-<YYYYMMDD>-<random6>-spawn-<seq> (per spawn-payload.schema.json pattern).{
"trace_id": "wf-20260427-abc123-spawn-001",
"parent_trace_id": null,
"subagent_role": "<role>",
"goal": "<task>",
"constraints": [],
"state_slice": {},
"allowed_tools": [<from agent frontmatter tools field>],
"budget": {
"max_input_tokens": <flag or default>,
"max_output_tokens": <flag or agent frontmatter>,
"max_tool_calls": <flag>,
"max_turns": <flag or agent frontmatter>,
"timeout_ms": <flag>,
"retry_budget": 1
},
"untrusted_inputs": []
}
plugin/schemas/spawn-payload.schema.json (best-effort; warn if validator unavailable).Agent(...) call:{
"agent_call": "Agent({subagent_type: '<role>', name: '<role>-<seq>', prompt: '<task brief with G7 payload embedded>'})",
"spawn_payload": <json>,
"validation": "ok | warnings: [<list>]"
}
plugin/agents/<name>.md) plus built-in Claude Code agents (Explore, Plan, general-purpose) are valid subagent_role values per team-protocols/role-selection-table.mdstate_slice, populate untrusted_inputs with wrapped: true per untrusted-content-wrapping.md ruleAgent(...) separately. Single-responsibilityparent_trace_id for nested spawns — if THIS spawn is being initiated from inside another subagent (rather than the main thread), the orchestrator MUST set parent_trace_id to the parent's trace_id. Omit or set to null for top-level spawns. The subagent-depth-guard.py hook (v0.1.7) walks this chain to enforce userConfig.subagent_max_depth (default 3); a missing parent_trace_id on a nested spawn defeats depth tracking and the hook may underreport the actual depth.--task too short or too long: reject with the schema's minLength/maxLength bounds (10–1000 chars)--max-tokens exceeds 200000 or --max-output exceeds agent's documented cap, reject with explanationtools: field empty: warn; suggest reviewing agent frontmatterThis skill is read-only — no memory writes. The orchestrator that subsequently invokes Agent(...) is responsible for recording the spawn via subagent-start-budget.py hook.
plugin/agents/<role>.md frontmatter for defaultsplugin/schemas/spawn-payload.schema.json (G7), team-protocols/role-selection-table.mdsubagent-isolation (delegation patterns + bounded recursion + Phase 4 #4 depth guard), untrusted-content-wrapping (G1 on untrusted_inputs field)subagent-start-budget (token cap), subagent-depth-guard (max recursion depth via parent_trace_id chain, v0.1.7), subagent-stop-learnings (return-contract validation + chain closure)/feature-design, /develop, /team-bugfix, /refactor, /migrate orchestrators; available standalone/context-load (constructs state_slice content for the spawn payload)development
Use this skill when running the recurring (daily) knowledge-base rescan for a repo that already has knowledge/.knowledge-sync.yml — the main-thread dispatcher that reads the config, computes the git delta since last_scanned_sha, maps changed paths to affected doc areas, early-exits cheaply when nothing changed, then fans out one Agent(content-writer) per affected area, applies the propose/direct update policy, advances the baseline only on success, and writes an L4 run log — all with the G1 untrusted-content choke-point, secret-scan, deny-list, and budget controls woven in. For first-time setup use /knowledge-sync-init.
development
Use this skill when bootstrapping scheduled knowledge-base sync for a repo that has no knowledge/.knowledge-sync.yml yet — to run one-time setup that detects the knowledge_root from CLAUDE.md/AGENTS.md, maps doc areas to source globs, records opt-in external sources (Linear/Notion/WebFetch, all disabled by default), captures a baseline last_scanned_sha, sets the per-area update policy, generates or seeds knowledge/CONVENTIONS.md, provisions the L4 memory dir, and offers to register the daily routine. Routes ongoing recurring sync operations to /knowledge-sync.
tools
Use this skill when bootstrapping a target repository to be ai-skills-aware — on the first run of any ai-skills workflow in a fresh repo, when adopting the ai-skills plugin in an existing repo, or after upgrading to a plugin version that adds new memory paths or templates, including when the user does not say "init" but asks to "set up" or "onboard" the repo — to detect codebase type, create CLAUDE.md + AGENTS.md scaffolding, initialize the .ai-skills-memory/ directory tree from L1 templates, and configure .gitignore. Idempotent — safe to re-run. Accepts `--codebase-type <type>` and `--overwrite`. Not for re-initializing only memory — use `/memory-init` instead.
tools
Use this skill when extending, repairing, or improving plugin assets, when ingesting a `/feedback` report as a fix-cycle backlog, or when you do not remember which lower-level command is right for the job — the umbrella workflow for ai-skills plugin-asset authoring and maintenance: creating, auditing, fixing, improving, refactoring, and migrating skills, agents, rules, hooks, prompts, schemas, and rubrics inside the plugin. Auto-classifies the request, loads the right knowledge skills (`@prompt-engineering`, `@context-engineering`, `@team-protocols`), and spawns the right subagents (`prompt-engineer`, `system-architect`, `python-engineer`, `software-engineer`, `qa-engineer`, `eval-judge`) via the `Agent` tool.