/yka-code:team-dofrom yka-code
[yka-code] Default parallel workflow for any multi-file build, audit, refactor, review, or fix. You MUST use this whenever the task plausibly spans more than one file OR more than one concern OR benefits from parallel review / iteration — which is most tasks. Triggers on 'build', 'implement', 'add', 'ship', 'fix', 'refactor', 'audit', 'review', 'plan' when any non-trivial scope is involved. Chosen over solo Agent() fan-out by default per Anthropic's TeamCreate guidance ('when in doubt, prefer a team'). Lead coordinates via SendMessage; teammates work in parallel with handoff docs that survive compaction. Hard refusals: DEV_TEAM_WORKER=1, session already running as teammate, headless 'claude -p' mode.
Ships in yka-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Native TeamCreate / Task / SendMessage pipeline, modeled on the oh-my-claudecode staged pattern but auto-invoked from /do (no slash command).
Anthropic's official lifecycle doc: code.claude.com/docs/en/agent-teams. This skill defers to that spec. The critical rules from it:
TeamDelete refuses to proceed if any teammate is still alive — shut them all down first, then delete./resume and /rewind do not restore in-process teammates. After resuming, spawn fresh — do NOT try to message dead members from the stale config.json.~/.claude/teams/{name}/ dirs are cleaned by our session-start-team-reaper.sh hook, not by Claude.Before the opinionated stage pipeline below, the raw Anthropic model. Every rule here comes from the TeamCreate / TeamDelete / SendMessage tool schemas and code.claude.com/docs/en/agent-teams. Read this if you're about to touch any team tool.
Teams require CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in env or settings.json. Check before attempting TeamCreate — absent flag, the tool call errors. The installer here sets the flag; if a user reports "team-do won't start", check env first.
TeamCreate({team_name, description}) creates BOTH:
~/.claude/teams/{team_name}/config.json — the team registry (members, lead session ID, tmux panes)~/.claude/tasks/{team_name}/ — the shared task listYou never TaskCreate in a team session without the tasks auto-landing in the team's list. Do not create a separate task dir "for this team" — the one created by TeamCreate is it.
subagent_type by what tools it needsTeammates are spawned via Agent(subagent_type, team_name, name, prompt). The agent type determines what tools the teammate can call:
Explore, Plan) — research/search/planning ONLY. They cannot edit files. Never assign implementation work.general-purpose, code-reviewer, code-architect) — full tool access. Use for tasks that need file edits..claude/agents/ — check the agent's own tool restrictions before assigning.Name teammates with a human-readable name (e.g., explorer, architect, reviewer) — always use this for SendMessage and TaskUpdate(owner). Never use the agentId (UUID).
Every teammate spawn prompt MUST start with the worker preamble (see "Worker preamble" section below). Without it, teammates can recursively spawn their own teams.
TaskUpdate({task_id, owner: <name>}). Any agent can set or change ownership.Anthropic handles file-locking on task claims natively — no race-condition code needed.
TaskList or a mailbox.SendMessage({to: <name>, message: "..."}).to: "*" broadcasts — expensive (linear in team size), use only when everyone genuinely needs the message.{"type":"idle",...} or {"type":"task_completed",...}. Plain text only. Use TaskUpdate for status.A teammate going idle is NORMAL. It does not mean:
TaskList for that)It means: the teammate's turn ended and it's waiting for input. Sending a message to an idle teammate wakes it up. Do NOT react to idle notifications unless you want to assign more work or follow up.
Peer DM visibility — when teammate A DMs teammate B, A's idle notification to the lead includes a brief summary. Informational only; no response needed.
Read the team config directly:
Read: ~/.claude/teams/{team_name}/config.json
The members[] array holds each teammate's name (what you message by), agentId (UUID, reference only), and agentType. Use name, never agentId, for all coordination.
SendMessage({to: <name>, message: {type: "shutdown_request"}}). The teammate:
{type: "shutdown_response", request_id, approve: true} → exits{approve: false} with a reason → stays alive (rare; honor their refusal)Approving shutdown terminates the teammate process. Don't originate shutdown_request unless you're actually tearing down the team.
/resume restores the lead session but NOT the teammate processes. After resume, the lead's config.json still lists dead members — do NOT message them. Spawn fresh./rewind same behavior.tmux ls then tmux kill-session -t <session-name>.A teammate CANNOT call TeamCreate. The worker preamble below enforces this via instruction. The DEV_TEAM_WORKER=1 env var also guards the lead side of /do's classifier. Violating this fork-bombs the host.
Teams do NOT work in claude -p / SDK mode. The lead hits end_turn while teammates run as background processes — lifecycle mismatch. If you're in headless mode, do not route to team-do; fall back to Agent() fan-out.
Every TeamCreate owes a TeamDelete. One-to-one. No exceptions.
Before you call TeamCreate, commit to the teardown: you own the shutdown sequence for every team you spawn, regardless of whether the stage succeeds, fails, errors mid-flight, or gets interrupted by the user. If you can't guarantee the teardown will run, you're not ready to create the team.
At each stage's end (plan / exec / verify / fix), the BLOCKING order is:
TaskList that every team task is completed (or explicitly marked deleted if abandoned)SendMessage({to: <name>, message: {type: "shutdown_request"}})shutdown_response({approve: true}) (or an idle notification — both mean the teammate is down)TeamDelete — no params; team name comes from session context~/.claude/teams/<team_name>/ still exists, log it and proceed — the reaper hook will catch it at next session startIf ANY of steps 1–4 fails, you must still call TeamDelete unconditionally before leaving the stage — the config-dir cleanup is more important than the graceful exit. A failed TeamDelete (e.g., live teammate) is the only reason to leave team state behind, and only briefly; escalate to the user if it can't be resolved.
Never create a team in Stage N without first confirming the team from Stage N-1 is torn down. Parallel live teams violate the nested-team rule even when the outer session isn't technically a teammate.
TeamCreate, TeamDelete, SendMessage, TaskCreate, TaskUpdate, TaskList, TaskGet, TaskStop are deferred tools in CC's default tool set — they appear in the deferred tool list but their schemas are NOT loaded at session start. Calling any of them without pre-loading returns InputValidationError.
First action on every team-do invocation — load them in one ToolSearch call:
ToolSearch({
query: "select:TeamCreate,TeamDelete,SendMessage,TaskCreate,TaskUpdate,TaskList,TaskGet,TaskStop",
max_results: 10
})
This is the #1 reason team-do gets abandoned mid-Stage-1 — TeamCreate fails, classifier falls back to subagent fan-out, multi-turn coordination is lost. Don't skip the preload.
Only after the ToolSearch returns success do you move to the fork-bomb guards below.
Refuse to activate if any of the following is true:
DEV_TEAM_WORKER is set to 1. This session is already a worker inside another team — do NOT spawn a nested team.Agent(team_name=...) — you're a teammate, not a lead.If any guard trips: abort immediately, tell the caller "team-do declined (nested/small/worker)", and let the caller route to a simpler path (Task, single-shot subagent, or direct edit).
Route here when ≥2 of these are true:
Route elsewhere when:
ship-feature / fix-bug / refactor-safelyonboard-codebase, no teamFixed 4-stage flow with a bounded fix-loop. Each stage produces a handoff doc under .dev/handoffs/<stage>.md that survives compaction and TeamDelete.
Goal: decompose the task into N independent subtasks.
TeamCreate({ team_name: "plan-<shortslug>", description: "Plan <task>" })Agent(subagent_type: "code-explorer", team_name, name: "explorer") — map existing code, identify surface areaAgent(subagent_type: "code-architect", team_name, name: "architect") — propose approach + task splitSendMessage({to: "team-lead"}) on completion.dev/handoffs/plan.md:
## Decided
- <approach + rationale>
## Rejected
- <options + why not>
## Risks
- <what could break>
## Files touched
- <path:range> per subtask
## Subtasks
- [task-1] <subject> — owner: worker-1 — files: <paths>
- [task-2] …
## Remaining work
- <anything for next stage>
SendMessage shutdown_request to each teammate, wait for shutdown_response, then TeamDeleteGoal: execute the N subtasks in parallel.
TeamCreate({ team_name: "exec-<shortslug>" }).dev/handoffs/plan.md, spawn N teammates (one per subtask) using code-reviewer style agents via Agent(subagent_type: "code-reviewer", team_name, name: "worker-K"). N = subtask count, capped at 5.TaskCreate({subject, description}), then TaskUpdate({task_id, owner: "worker-K"})SendMessage lead, lead marks TaskUpdate({status: "completed"}).dev/handoffs/exec.md summarizing all diffs, per-task outcome, test-run-so-far stateTeamDeleteGoal: parallel multi-lens review of the exec output.
TeamCreate({ team_name: "verify-<shortslug>" })Agent(subagent_type: "pr-review-toolkit:code-reviewer", team_name, name: "reviewer")Agent(subagent_type: "pr-review-toolkit:silent-failure-hunter", team_name, name: "silent-failure-hunter")Agent(subagent_type: "pr-review-toolkit:pr-test-analyzer", team_name, name: "test-analyzer")SendMessage. Lead aggregates into .dev/handoffs/verify.md with severity (high/med/low).TeamDeleteOnly if Stage 3 surfaced high-severity findings.
TeamCreate({ team_name: "fix-<shortslug>-iter-<N>" })code-reviewer teammates, one per finding cluster.dev/handoffs/fix.md each iterationEvery Agent() spawn within a team MUST start its prompt with:
You are a teammate in team "<team_name>", role "<name>". HARD RULES:
- NEVER call TeamCreate, TeamDelete, or activate the team-do / do skill.
- NEVER spawn further Agent() / Task() / subagent calls.
- NEVER run orchestration, loop, or ralph-style recursion.
- Work ONLY your assigned task(s). Report completion via SendMessage to "team-lead".
- If blocked, SendMessage the lead with a clear description; do not escalate autonomously.
Your assigned work:
<task body here>
This preamble is non-negotiable — without it, a teammate can recursively spawn its own team and fork-bomb the host.
SendMessage on completion or block. Lead does NOT poll TaskList — messages arrive as conversation turns.TaskUpdate({owner}); no atomic-claim race.SendMessage({to: <name>, message: "status?"}).Agent() spawn auto-creates an internal lifecycle task with metadata._internal: true. Ignore those when checking completion state.The authoritative 5-step blocking sequence is in the Shutdown contract section near the top of this file. Every stage end runs it. No variation.
All handoffs live in .dev/handoffs/<stage>.md relative to the project root (or ~/.dev/handoffs/<session>/<stage>.md in global scope). They:
TeamDelete (team state is wiped, handoffs persist on disk)/compact (they're files, not transcript).dev/handoffs/unresolved.md, present to user.ship-feature or fix-bug. Log the failure; don't retry.TeamDelete any partial team, surface "nested team attempt from <teammate_name>" to user.Not everything that looks parallel needs a team. Teams and subagents do different jobs.
Use subagents (parallel Agent() calls in one message) when:
Use a team (this skill) when:
If the work is one-shot and parallel is enough, subagents are the right tool. If the work needs coordination that persists across turns, teams are the right tool. The classifier in /do picks based on what the work needs; this skill runs only when that's the right answer.
ship-feature / fix-bug on single-concern workAgent() fan-out (stateless, one-shot)DEV_TEAM_WORKER check/do, deliberately, to avoid the fork-bomb case that oh-my-claudecode v4.12.0 deliberately removed/do — the classifier decides team-do vs single-shot pathclaude-mem:version-bump after team-verify passes with zero high-severity findingsWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (youssefkadaouiabbassi/yka-code) — no native marketplace selected
npx claudepluginhub p/youssefkadaouiabbassi-code-tools-setup20 skills in this plugin
/audit-rigor[yka-code] Discipline for audit, review, and technology-comparison tasks. Use when the request is "audit X", "review our stack", "is this the best option", "compare alternatives", "what should we swap / add / drop", or any task that produces prioritized recommendations rather than new code. Enforces a ≥70% confidence threshold, delegate-retrieval-to-subagent pattern, inline citations with ISO dates, MCP-first sourcing, and a fixed output format (SWAP / ADD / DROP / KEEP-BUT-UPGRADE / SURPRISE). Pair with research-first (retrieval discipline) and karpathy-guidelines (surgical scope). Chained from security-audit, onboard-codebase, and any /do route that smells like "is this the best we have"./ci-hygiene[yka-code] CI/CD and DevOps hygiene enforcer. Activates when editing GitHub Actions workflows, Dockerfiles, docker-compose, justfile, deploy scripts, or any CI configuration. Enforces pinned versions, proper Claude Code invocation in CI (--bare, API key not Max sub), secret management, and reproducibility. Fills the DevOps gap — no plugin covers this in the wild./coding-style[yka-code] Enforce minimalist, self-documenting, defensively-sane coding style. Use ALWAYS when writing, editing, or reviewing ANY code in ANY language — every function, every edit, every diff, no exceptions. Covers five rules: (1) no comments unless critical (WHY only, never WHAT, never history), (2) clean + optimized (no dead code, no speculative abstractions, no stale imports, delete over deprecate), (3) self-documenting names (full words, verbs for functions, nouns for data), (4) smallest surface (one function one concern, extract only on 3rd reuse, validate only at boundaries), (5) no dead defense (no try/catch for impossible cases, no fallbacks for inputs you control, let errors bubble to the right handler). Pair with karpathy-guidelines for behavioral principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution).Other plugins' skills for the same job