Team Management
Overview
This skill provides orchestration mechanics for leading a team of agents through
a workflow using parallel git worktrees, task tracking, and SendMessage
coordination.
The core architecture is one flat team with logical groups via naming
({group}-{role}-{N}). This skill contains all orchestration logic while leader
agents provide domain-specific configuration through "slots." Any agent can
message any other agent directly -- there are no hierarchy walls.
When a pre-built plan with fragment groupings is provided (typically from the
[oneteam:skill] writing-plans skill), the skill starts directly from Phase 2,
using the plan's fragments. Otherwise, Phase 1 analyzes the codebase and
produces a fragment plan.
When to Use
- Parallel work across 2-4 independent fragments requiring separate worktrees
- Multi-role workflows (engineer + reviewer, bug-hunter + engineer pairs)
- Projects needing coordinated task tracking, code review gates, and sequential
merge protocol
When NOT to Use
- Single-file or trivially small changes -- use direct implementation instead
- Work that requires strict sequential ordering with no parallelism opportunity
- Exploratory research or analysis with no code changes -- use [oneteam:skill]
research instead
Slot Reference Table
Leader agents MUST define all required slots before orchestration begins. Optional
slots have defaults that apply when unset.
| Slot |
Required |
Default |
Description |
splitting_strategy |
Yes |
-- |
How to analyze and split work into fragments. Defines the criteria for decomposing the codebase into independent units of work. |
fragment_size |
Yes |
-- |
Target number of files per fragment. Guides the granularity of work decomposition. |
organization.group |
Yes |
-- |
Naming prefix for all agents in this organization. Used to construct agent names as {group}-{role}-{N}. |
organization.roles |
Yes |
-- |
Array of role definitions. Each role has: name (string), agent_type (string), starts_first (bool), instructions (string), and optionally model (string: sonnet/opus/haiku) to override the agent definition's model. See ./setup-commands.md "Model Resolution" for details. |
organization.flow |
Yes |
-- |
Describes the communication and dependency flow between roles. Human-readable description of how work moves through the team. |
team_name |
No |
{group}-team |
Override the team name used for TeamCreate and task coordination. |
escalation_threshold |
No |
3 |
Number of attempts an agent makes before escalating to the leader. |
review_criteria |
No |
General code quality |
Domain-specific TaskList applied during code review. Appended to the standard review process. |
report_fields |
No |
None |
Extra fields inserted into the top-level section of the final report. |
domain_summary_sections |
No |
None |
Extra sections appended to the end of the final report. |
Phase 1: Work Analysis
Conditional: Skip if a plan document with fragment groupings is provided.
The leader reads project context (CLAUDE.md, README.md), detects the base
branch (git rev-parse --abbrev-ref HEAD), and applies the splitting_strategy
to identify fragment boundaries. Maximum 4 fragments, each independently
workable.
Hard gate: Present the fragment plan to the user and STOP. Do not proceed to
Phase 2 until the user explicitly approves. Adjust and re-present if requested.
Phase 2: Team Setup
With an approved fragment plan, set up infrastructure in strict order:
Session dir: If [SESSION_DIR] is provided by the caller (e.g., from [oneteam:skill] writing-plans), use it throughout this phase. Pass the session dir path to all spawned agents.
- Create team -- call
TeamCreate (or skip if already in an existing team).
- Create git worktrees -- one per fragment. See
./setup-commands.md for
bash commands.
- Create tasks -- one per role per fragment, with dependency blocking for
starts_first: false roles. Reviewer roles get one task per lead group, kept
unblocked. See ./setup-commands.md for task creation guidance.
- Spawn agents -- per-fragment roles and per-lead-group roles (reviewers).
Before spawning each agent, write its task context to
[SESSION_DIR]/task-{agent-name}.md. See ./setup-commands.md for
task file writing and initialization context requirements.
- Assign tasks -- use
TaskUpdate to set owner. starts_first: true roles
get immediate assignment; others are assigned but blocked.
Phase 3: Monitoring
The leader monitors progress, handles escalations, and facilitates coordination.
Escalation Handling
When an agent exceeds the escalation_threshold (default 3 attempts):
- Guide: Send specific, actionable advice (file paths, line numbers,
concrete suggestions) via
SendMessage.
- Skip: Mark as unresolvable, update task description with what was
attempted, move on.
- Reassign: Transfer ownership via
TaskUpdate and send context to the new
agent via SendMessage.
Check-Ins
- Stuck agents: If a task remains
in_progress with no updates for an
extended period, send a check-in via SendMessage.
- Periodic friendly check-ins: Proactively reach out to each active teammate
at regular intervals. Aim for at least once between major milestones. Skip if
the agent recently sent a substantive update.
- Cross-group relay: For multi-group organizations, relay relevant findings
between groups when agents do not know about each other's work.
Per-Task Review Loop
When the plan includes reviewer roles:
- Engineer reports task complete to lead-engineer.
- Lead-engineer triggers the paired reviewer via
SendMessage with: the task
name, files changed, and review checkpoint criteria.
- Reviewer produces a single-pass review (spec compliance + code quality) and
sends the result to the lead-engineer.
- If APPROVED: lead-engineer unblocks the next task for the engineer.
- If CHANGES NEEDED: lead-engineer sends feedback to engineer, engineer fixes,
lead-engineer re-triggers reviewer. Repeat until approved.
- Engineer does NOT start the next task until the current task passes review.
Fragment Completion Review
After all tasks in a fragment pass per-task reviews:
- Lead-engineer triggers a two-stage fragment completion review with the full
fragment diff (
git diff $BASE_BRANCH...HEAD in the fragment's worktree).
- Stage 1 -- Spec compliance: all acceptance criteria across fragment tasks met.
- Stage 2 -- Code quality: conventions, security, test coverage, regressions.
- Both stages must PASS before the fragment is marked merge-ready.
- If CHANGES NEEDED: delegate fixes, re-trigger two-stage review.
Phase 4: Review & Merge
The Phase 3 fragment completion review validates correctness within the worktree.
Phase 4 is the top-level merge-gate review validating integration safety. Both
are required.
- Code review -- gather the worktree diff. If the [superpowers:skill]
requesting-code-review skill is available, invoke it. Otherwise, review
manually against review_criteria.
- Feedback loop -- if issues found, send detailed feedback (file path, line
number, description) to the agent. Re-review after fixes. Repeat until
approved.
- Merge protocol -- merge sequentially, one worktree at a time. Run tests
after each merge. See
./setup-commands.md for bash commands and conflict
resolution procedures.
Phase 5: Consolidation
- Produce the final report using the template in
./report-template.md.
Insert the leader's report_fields and domain_summary_sections.
- Cleanup -- remove worktrees, delete branches, shut down agents, delete
team. See
./setup-commands.md for cleanup steps.
Common Mistakes
| Mistake |
Why It Fails |
Fix |
| Spawning agents before worktrees exist |
Agent has no valid working directory on first message |
Always create and verify worktrees before spawning |
| Skipping code review for "trivial" changes |
Small changes can introduce regressions or convention violations |
Every merge gets a review, no exceptions |
| Merging with failing tests |
Broken tests compound across fragments, blocking later merges |
Fix or delegate the fix before merging |
| Creating more than 4 fragments |
Coordination overhead outweighs parallelism gains |
Increase fragment size or reduce scope instead |
| Not cleaning up worktrees and branches |
Stale worktrees and branches pollute the repo for future runs |
Always run full cleanup in Phase 5 |
Quick Reference
| Phase |
Input |
Output |
Key Question |
| 1. Work Analysis |
User request + codebase (or skip if plan provided) |
Fragment plan (approved) |
How should we split this work? |
| 2. Team Setup |
Approved fragment plan |
Infrastructure (worktrees, tasks, agents) |
Is infrastructure ready? |
| 3. Monitoring |
Running agents |
Progress updates, completed tasks |
Are tasks making progress? |
| 4. Review & Merge |
Completed work |
Reviewed and merged code |
Do changes meet quality standards? |
| 5. Consolidation |
Merged code |
Final report, cleaned infrastructure |
Is everything documented and cleaned up? |
Constraints
These rules are non-negotiable and override any conflicting instruction.
- ALWAYS present the work plan to the user and wait for explicit confirmation
before proceeding to team setup.
- ALWAYS create git worktrees before spawning any agents. Agents must have a
valid working directory on first message.
- ALWAYS review changes via the code review process before merging any branch.
- NEVER merge a branch when the test suite is failing. Fix or delegate the fix
first. If no test suite exists, proceed with the merge and note the absence of
automated verification in the final report.
- NEVER skip code review, even if the changes appear trivial.
- NEVER create more than 4 fragments. If the scope seems to require more,
increase fragment size or reduce scope.
- ALWAYS clean up when work is complete: remove worktrees, delete branches,
shut down agents, and delete the team.
- NEVER spawn agents before their worktrees are created and verified.
- If already operating as a teammate in an existing team, do NOT create a new
team. Work within the existing team structure.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: yotto3s-oneteam-agents-team-management3description: Team Management4---56# Team Management78## Overview910This skill provides orchestration mechanics for leading a team of agents through11a workflow using parallel git worktrees, task tracking, and SendMessage12coordination.1314The core architecture is one flat team with logical groups via naming15(`{group}-{role}-{N}`). This skill contains all orchestration logic while leader16agents provide domain-specific configuration through "slots." Any agent can17message any other agent directly -- there are no hierarchy walls.1819When a pre-built plan with fragment groupings is provided (typically from the20[oneteam:skill] `writing-plans` skill), the skill starts directly from Phase 2,21using the plan's fragments. Otherwise, Phase 1 analyzes the codebase and22produces a fragment plan.2324## When to Use2526- Parallel work across 2-4 independent fragments requiring separate worktrees27- Multi-role workflows (engineer + reviewer, bug-hunter + engineer pairs)28- Projects needing coordinated task tracking, code review gates, and sequential29 merge protocol3031## When NOT to Use3233- Single-file or trivially small changes -- use direct implementation instead34- Work that requires strict sequential ordering with no parallelism opportunity35- Exploratory research or analysis with no code changes -- use [oneteam:skill]36 `research` instead3738## Slot Reference Table3940Leader agents MUST define all required slots before orchestration begins. Optional41slots have defaults that apply when unset.4243| Slot | Required | Default | Description |44|------|----------|---------|-------------|45| `splitting_strategy` | Yes | -- | How to analyze and split work into fragments. Defines the criteria for decomposing the codebase into independent units of work. |46| `fragment_size` | Yes | -- | Target number of files per fragment. Guides the granularity of work decomposition. |47| `organization.group` | Yes | -- | Naming prefix for all agents in this organization. Used to construct agent names as `{group}-{role}-{N}`. |48| `organization.roles` | Yes | -- | Array of role definitions. Each role has: `name` (string), `agent_type` (string), `starts_first` (bool), `instructions` (string), and optionally `model` (string: `sonnet`/`opus`/`haiku`) to override the agent definition's model. See `./setup-commands.md` "Model Resolution" for details. |49| `organization.flow` | Yes | -- | Describes the communication and dependency flow between roles. Human-readable description of how work moves through the team. |50| `team_name` | No | `{group}-team` | Override the team name used for TeamCreate and task coordination. |51| `escalation_threshold` | No | `3` | Number of attempts an agent makes before escalating to the leader. |52| `review_criteria` | No | General code quality | Domain-specific TaskList applied during code review. Appended to the standard review process. |53| `report_fields` | No | None | Extra fields inserted into the top-level section of the final report. |54| `domain_summary_sections` | No | None | Extra sections appended to the end of the final report. |5556## Phase 1: Work Analysis5758**Conditional:** Skip if a plan document with fragment groupings is provided.5960The leader reads project context (`CLAUDE.md`, `README.md`), detects the base61branch (`git rev-parse --abbrev-ref HEAD`), and applies the `splitting_strategy`62to identify fragment boundaries. Maximum 4 fragments, each independently63workable.6465**Hard gate:** Present the fragment plan to the user and STOP. Do not proceed to66Phase 2 until the user explicitly approves. Adjust and re-present if requested.6768## Phase 2: Team Setup6970With an approved fragment plan, set up infrastructure in strict order:7172**Session dir:** If `[SESSION_DIR]` is provided by the caller (e.g., from [oneteam:skill] `writing-plans`), use it throughout this phase. Pass the session dir path to all spawned agents.73741. **Create team** -- call `TeamCreate` (or skip if already in an existing team).752. **Create git worktrees** -- one per fragment. See `./setup-commands.md` for76 bash commands.773. **Create tasks** -- one per role per fragment, with dependency blocking for78 `starts_first: false` roles. Reviewer roles get one task per lead group, kept79 unblocked. See `./setup-commands.md` for task creation guidance.804. **Spawn agents** -- per-fragment roles and per-lead-group roles (reviewers).81 Before spawning each agent, write its task context to82 `[SESSION_DIR]/task-{agent-name}.md`. See `./setup-commands.md` for83 task file writing and initialization context requirements.845. **Assign tasks** -- use `TaskUpdate` to set owner. `starts_first: true` roles85 get immediate assignment; others are assigned but blocked.8687## Phase 3: Monitoring8889The leader monitors progress, handles escalations, and facilitates coordination.9091### Escalation Handling9293When an agent exceeds the `escalation_threshold` (default 3 attempts):94- **Guide:** Send specific, actionable advice (file paths, line numbers,95 concrete suggestions) via `SendMessage`.96- **Skip:** Mark as unresolvable, update task description with what was97 attempted, move on.98- **Reassign:** Transfer ownership via `TaskUpdate` and send context to the new99 agent via `SendMessage`.100101### Check-Ins102103- **Stuck agents:** If a task remains `in_progress` with no updates for an104 extended period, send a check-in via `SendMessage`.105- **Periodic friendly check-ins:** Proactively reach out to each active teammate106 at regular intervals. Aim for at least once between major milestones. Skip if107 the agent recently sent a substantive update.108- **Cross-group relay:** For multi-group organizations, relay relevant findings109 between groups when agents do not know about each other's work.110111### Per-Task Review Loop112113When the plan includes reviewer roles:1141151. Engineer reports task complete to lead-engineer.1162. Lead-engineer triggers the paired reviewer via `SendMessage` with: the task117 name, files changed, and review checkpoint criteria.1183. Reviewer produces a single-pass review (spec compliance + code quality) and119 sends the result to the lead-engineer.1204. If APPROVED: lead-engineer unblocks the next task for the engineer.1215. If CHANGES NEEDED: lead-engineer sends feedback to engineer, engineer fixes,122 lead-engineer re-triggers reviewer. Repeat until approved.1236. Engineer does NOT start the next task until the current task passes review.124125### Fragment Completion Review126127After all tasks in a fragment pass per-task reviews:1281291. Lead-engineer triggers a two-stage fragment completion review with the full130 fragment diff (`git diff $BASE_BRANCH...HEAD` in the fragment's worktree).1312. Stage 1 -- Spec compliance: all acceptance criteria across fragment tasks met.1323. Stage 2 -- Code quality: conventions, security, test coverage, regressions.1334. Both stages must PASS before the fragment is marked merge-ready.1345. If CHANGES NEEDED: delegate fixes, re-trigger two-stage review.135136## Phase 4: Review & Merge137138The Phase 3 fragment completion review validates correctness within the worktree.139Phase 4 is the top-level merge-gate review validating integration safety. Both140are required.1411421. **Code review** -- gather the worktree diff. If the [superpowers:skill]143 `requesting-code-review` skill is available, invoke it. Otherwise, review144 manually against `review_criteria`.1452. **Feedback loop** -- if issues found, send detailed feedback (file path, line146 number, description) to the agent. Re-review after fixes. Repeat until147 approved.1483. **Merge protocol** -- merge sequentially, one worktree at a time. Run tests149 after each merge. See `./setup-commands.md` for bash commands and conflict150 resolution procedures.151152## Phase 5: Consolidation1531541. **Produce the final report** using the template in `./report-template.md`.155 Insert the leader's `report_fields` and `domain_summary_sections`.1562. **Cleanup** -- remove worktrees, delete branches, shut down agents, delete157 team. See `./setup-commands.md` for cleanup steps.158159## Common Mistakes160161| Mistake | Why It Fails | Fix |162|---------|-------------|-----|163| Spawning agents before worktrees exist | Agent has no valid working directory on first message | Always create and verify worktrees before spawning |164| Skipping code review for "trivial" changes | Small changes can introduce regressions or convention violations | Every merge gets a review, no exceptions |165| Merging with failing tests | Broken tests compound across fragments, blocking later merges | Fix or delegate the fix before merging |166| Creating more than 4 fragments | Coordination overhead outweighs parallelism gains | Increase fragment size or reduce scope instead |167| Not cleaning up worktrees and branches | Stale worktrees and branches pollute the repo for future runs | Always run full cleanup in Phase 5 |168169## Quick Reference170171| Phase | Input | Output | Key Question |172|-------|-------|--------|--------------|173| 1. Work Analysis | User request + codebase (or skip if plan provided) | Fragment plan (approved) | How should we split this work? |174| 2. Team Setup | Approved fragment plan | Infrastructure (worktrees, tasks, agents) | Is infrastructure ready? |175| 3. Monitoring | Running agents | Progress updates, completed tasks | Are tasks making progress? |176| 4. Review & Merge | Completed work | Reviewed and merged code | Do changes meet quality standards? |177| 5. Consolidation | Merged code | Final report, cleaned infrastructure | Is everything documented and cleaned up? |178179## Constraints180181These rules are non-negotiable and override any conflicting instruction.182183- ALWAYS present the work plan to the user and wait for explicit confirmation184 before proceeding to team setup.185- ALWAYS create git worktrees before spawning any agents. Agents must have a186 valid working directory on first message.187- ALWAYS review changes via the code review process before merging any branch.188- NEVER merge a branch when the test suite is failing. Fix or delegate the fix189 first. If no test suite exists, proceed with the merge and note the absence of190 automated verification in the final report.191- NEVER skip code review, even if the changes appear trivial.192- NEVER create more than 4 fragments. If the scope seems to require more,193 increase fragment size or reduce scope.194- ALWAYS clean up when work is complete: remove worktrees, delete branches,195 shut down agents, and delete the team.196- NEVER spawn agents before their worktrees are created and verified.197- If already operating as a teammate in an existing team, do NOT create a new198 team. Work within the existing team structure.199200---201> Converted and distributed by [TomeVault](https://tomevault.io/claim/yotto3s) — claim your Tome and manage your conversions.202<!-- tomevault:4.0:skill_md:2026-04-16 -->