subagent-tracelisted
Install: claude install-skill Kucell/cortex-agent
# subagent-trace (L1 — fan-out 接收器)
> Hosts (Claude Code / Cursor / Codex) that fan out sub-agents in
> response to "fan out subagents" / "分发子任务" / "并行 3 个 agent"
> should call this skill to record each sub-agent's lifecycle.
> Framework is **passive**: it only receives events, never spawns.
> Source of truth: `templates/{zh,en}/.agent/agent-protocols/subagent-fanout.md`
> and `../scripts/match-trigger.js` (the helper that decides whether a
> user prompt is even a fan-out). This file is the CLI / SKILL
> surface; do NOT redefine the protocol here.
## When to Use
- After the parent agent decides to fan out, **immediately** call
`emit --event subagent_spawned` for each sub-agent with role + task.
- During the sub-agent's life, optionally emit `--event subagent_progress`
to update the dashboard percent.
- When the sub-agent finishes, **immediately** emit
`--event subagent_completed --status success|partial|failed`.
`--status failed` with `--notify-on-fail` will also write an inbox
message to the parent run so the parent agent knows.
- If the user cancels mid-task, emit `--event subagent_cancelled --reason ...`.
## Commands
```bash
# 1. Mark a new sub-agent as spawned (parent_run_id is auto-discovered
# from .agent/runs/ if not passed).
node .agent/skills/subagent-trace/scripts/index.js emit \
--event subagent_spawned \
--subagent-id sub-exp-001 --subagent-role explore \
--task-description "find usages of normalize-token-usage across L1" \
--gate agent