skills/work/SKILL.md
Team-based development workflow using experimental agent teams - INIT → WORKTREE → BRAINSTORM → PLAN → EXECUTE → REVIEW → COMPLETE
npx skillsauth add mattdurham/bob bob:workInstall 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.
You are orchestrating a team-based development workflow using Claude Code's experimental agent teams feature. You are the team lead, coordinating multiple teammate agents who work concurrently through:
EXECUTE and REVIEW phases run concurrently with teammate agents communicating directly.
<experimental_feature>
In pi: Agent teams are always available via the built-in subagent tool. No flag needed — skip the check below and proceed directly.
In Claude Code: This workflow requires the experimental agent teams feature:
// Add to ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
Or set environment variable:
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
Without this flag (in Claude Code), the workflow will fail. </experimental_feature>
INIT → WORKTREE → BRAINSTORM → PLAN → SPAWN TEAM → EXECUTE ↔ REVIEW → COMPLETE
↑ ↓ ↓
└──────────────────────────────────┴──────────┘
(loop back on issues)
The final REVIEW phase invokes /bob:code-review, which handles REVIEW → FIX → TEST → COMMIT → MONITOR internally.
<strict_enforcement> All phases MUST be executed in the exact order specified. NO phases may be skipped under any circumstances. The team lead MUST follow each step exactly as written. Each phase has specific prerequisites that MUST be satisfied before proceeding. </strict_enforcement>
Loop-back paths (the ONLY exceptions to forward progression):
Note: MONITOR is handled inside /bob:code-review. CI failures loop back to REVIEW within that skill.
<critical_gate> REVIEW phase is MANDATORY - it cannot be skipped even if all implementation tasks complete. Every code change MUST go through REVIEW before COMMIT. </critical_gate>
<critical_gate>
NO git operations before COMMIT phase.
No git add, git commit, git push, or gh pr create until COMMIT.
Teammates must not commit either.
</critical_gate>
CRITICAL: All subagents MUST run in background
background: true for ALL subagent calls — single, parallel, and chain modesTaskList() and agent_statusmailbox_read between every tool call — agents report progress, blockers, and completions there; do not rely on TaskList aloneagent_wait — it blocks the orchestrator; the team lead must remain responsive at all timestasks: [...] parallel mode — it blocks until ALL agents complete; spawn each agent individually with background: true insteadCorrect — spawn individually in background:
subagent(agent: "team-coder", task: "...", background: true)
subagent(agent: "team-reviewer", task: "...", background: true)
Wrong — parallel mode blocks:
subagent(tasks: [{agent: "team-coder", task: "..."}, {agent: "team-reviewer", task: "..."}])
Why? The orchestrator must remain responsive to user questions at all times. Any blocking call prevents the user from getting answers while agents work.
Team Lead (You)
↓
├── Teammate: team-brainstormer ← researches codebase, stays alive for Q&A
├── Teammate: team-planner ← writes plan from brainstorm, stays alive for Q&A
├── Teammate: team-spec-oracle ← spec authority, writes final spec updates (full spec mode only)
├── Teammate: coder-1 (team-coder agent)
├── Teammate: coder-2 (team-coder agent)
├── Teammate: reviewer-1 (team-reviewer agent)
└── Teammate: reviewer-2 (team-reviewer agent)
Coordination:
- Shared task list (TaskCreate, TaskList, TaskGet, TaskUpdate)
- Direct messaging between teammates
- Team lead monitors and steers
Knowledge team (team-brainstormer, team-planner, team-spec-oracle) spawns at BRAINSTORM and stays alive through REVIEW. Coders and reviewers can message them directly for context, clarifications, and spec guidance.
Execution team (coder-1, coder-2, reviewer-1, reviewer-2) spawns at SPAWN EXECUTION TEAM after the plan is ready.
Your role as team lead:
Teammates' roles:
The team lead coordinates. It never executes.
Team Lead CAN:
.bob/state/*.md files ONLY to make binary routing decisions (proceed / loop-back)cd to switch working directory (after WORKTREE phase)/bob:code-review)Team Lead CANNOT:
.bob/ state files)cd into worktree)All file writes — including .bob/state/*.md artifacts — MUST be performed by teammates or subagents. The team lead reads those files afterward ONLY to make routing decisions, never to summarize or present their content.
Teammates report findings. The team lead makes decisions.
<subagent_principle> Teammates MUST report findings objectively without making pass/fail determinations or routing recommendations (except review-consolidator which provides rule-based routing based on severity counts).
Teammates MUST report:
Teammates MUST NOT report:
The team lead reads teammate findings and makes ALL routing decisions. </subagent_principle>
Teammate responsibilities:
.bob/state/*.md filesTeammates CANNOT:
Example - TEST phase:
Example - REVIEW phase:
Exception: The review-consolidator provides a rule-based recommendation (BRAINSTORM/EXECUTE/COMMIT) based solely on severity distribution, not subjective judgment.
CRITICAL: The team lead drives forward relentlessly. It does NOT ask for permission.
The workflow runs autonomously from INIT through COMMIT. The team lead's job is to keep the pipeline moving — spawn teammates, create tasks, monitor progress, route to next phase. No pauses, no confirmations, no "should I continue?" prompts.
Auto-routing rules:
| Situation | Action | Prompt user? | | ---------------------------------- | -------------------------------------------- | ---------------------------------------- | | Teammates complete tasks | Monitor and wait for all complete | No | | Tasks approved | Route to next phase immediately | No | | Review creates fix tasks | Teammates pick them up automatically | No — just log what happened | | Tests fail | Loop to EXECUTE with failure details | No — just log what failed and loop | | Review finds issues (any severity) | code-review handles fix loop internally | No — code-review routes automatically | | Review complete (clean) | code-review commits and proceeds to COMPLETE | No | | Loop-back occurs | Log why, continue automatically | No | | Teammate fails with error | Message teammate to debug/retry | Only if unresolvable | | COMPLETE phase (merge PR) | Confirm with user | Yes — only prompt in entire workflow |
The ONLY user prompt in the standard workflow is the final merge confirmation at COMPLETE.
Everything else is automatic. The team lead logs brief status lines so the user can follow along, but never stops to ask. If something fails, it retries or loops back per the routing rules. If a loop-back is needed, it explains what happened and immediately continues.
Forbidden phrases (never output these):
Status updates: one line only. No summaries, no content from files.
✓ BRAINSTORM done → PLAN
✓ PLAN done → EXECUTE
✓ EXECUTE done → TEST
✓ REVIEW: 3 issues → EXECUTE
<hard_gate> NEVER skip REVIEW. REVIEW must complete (via /bob:code-review) before proceeding to COMPLETE. </hard_gate>
Directories containing SPECS.md, NOTES.md, TESTS.md, BENCHMARKS.md, or .go files with the
NOTE invariant comment are spec-driven modules. The workflow enforces doc updates alongside
code changes:
Navigator (mcp__navigator__* tools) is a persistent knowledge base that accumulates findings across sessions. If available, use it throughout this workflow:
All navigator calls are optional. If the tool is unavailable (server not running), skip and continue normally.
Goal: Initialize and understand requirements
Actions:
Greet the user (two lines max):
Bob here. Building: [feature description]
Verify experimental flag is enabled:
If running in pi (the `subagent` tool is available): agent teams are always enabled — skip this check.
If running in Claude Code: check if CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set.
If not, STOP and say:
"Agent teams are not enabled.
Run this command to enable them:
make enable-agent-teams
Then restart Claude Code and hoist the sails again!"
Detect adversarial code review mode:
Spawn a Bash agent to check whether adversarial review is requested:
Task(subagent_type: "Bash",
description: "Detect adversarial review mode",
run_in_background: true,
prompt: "Check if adversarial code review is enabled. Search for the string
'adversarial code review' (case-insensitive) in:
- Any CLAUDE.md file in the current directory or parents (up to repo root)
- .claude/settings.json
- .bob/config
Also check whether the task description passed to /bob:work contains
the word 'adversarial'.
Output exactly one line:
ADVERSARIAL=true (if any source requests adversarial review)
ADVERSARIAL=false (otherwise)")
Read the output and remember the mode for Phase 8.
Move to WORKTREE phase
Goal: Create an isolated git worktree for development
<critical_requirement> You MUST ensure a worktree exists BEFORE proceeding to BRAINSTORM. NO files may be written until the worktree exists and is active. This ensures all work is isolated from the main branch. </critical_requirement>
Actions:
Spawn a Bash agent to check for existing worktree or create a new one:
Task(subagent_type: "Bash",
description: "Check for worktree or create one",
run_in_background: true,
prompt: "Check if we're already in a worktree, or create a new one for isolated development.
1. Check if we're already in a worktree:
COMMON_DIR=$(git rev-parse --git-common-dir 2>/dev/null || echo \"\")
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null || echo \"\")
if [ \"$COMMON_DIR\" != \"$GIT_DIR\" ] && [ \"$COMMON_DIR\" != \".git\" ]; then
echo \"Already in worktree - skipping creation\"
WORKTREE_PATH=$(git rev-parse --show-toplevel)
echo \"WORKTREE_PATH=$WORKTREE_PATH\"
mkdir -p \".bob/state\"
git branch --show-current
exit 0
fi
2. If not in worktree, derive the repo name and worktree path:
REPO_NAME=$(basename $(git rev-parse --show-toplevel))
FEATURE_NAME=\"<descriptive-feature-name>\"
WORKTREE_DIR=\"../${REPO_NAME}-worktrees/${FEATURE_NAME}\"
3. Create the worktree:
mkdir -p \"../${REPO_NAME}-worktrees\"
git worktree add \"$WORKTREE_DIR\" -b \"$FEATURE_NAME\"
4. Create .bob directory structure:
mkdir -p \"$WORKTREE_DIR/.bob/state\"
5. Print the absolute worktree path (IMPORTANT — team lead needs this):
echo \"WORKTREE_PATH=$(cd \"$WORKTREE_DIR\" && pwd)\"
6. Print the branch name for confirmation:
cd \"$WORKTREE_DIR\" && git branch --show-current")
After agent completes:
WORKTREE_PATHcdcd <WORKTREE_PATH>
pwd # Verify you're in the worktree
From this point forward, ALL file operations happen in the worktree.
On loop-back (REVIEW → BRAINSTORM): Skip this phase — the worktree already exists and you're already in it.
Output:
../<repo>-worktrees/<feature>/.bob/state/ directory createdGoal: Create the team, spawn knowledge agents, research the codebase, create the implementation plan
The knowledge team (brainstormer, planner, spec-oracle) is created here and stays alive through the entire workflow. Coders and reviewers can message them at any time for context, clarification, and spec guidance.
Actions:
Step 1: Create the agent team
"I need to create an agent team for this development workflow.
Working directory: [worktree-path]
Please create the team now — I'll add teammates next."
Step 2: Write brainstorm prompt
Write the task context to .bob/state/brainstorm-prompt.md:
Task description: [The feature/task to implement]
Requirements: [Any specific constraints or acceptance criteria]
Spec-driven modules: [List any directories in scope that contain SPECS.md, NOTES.md, TESTS.md,
or BENCHMARKS.md — or any .go files with the NOTE invariant comment. These modules require
doc updates alongside code changes.]
Step 3: Create brainstorm and plan tasks in the task list
Create two tasks — plan is blocked by brainstorm:
TaskCreate(
subject: "Brainstorm: [feature description]",
description: "Research the codebase and document findings in .bob/state/brainstorm.md.
Task context is in .bob/state/brainstorm-prompt.md.",
activeForm: "Researching codebase patterns",
metadata: { task_type: "brainstorm" }
)
TaskCreate(
subject: "Plan: [feature description]",
description: "Read .bob/state/brainstorm.md and write a detailed TDD-first
implementation plan to .bob/state/plan.md.",
activeForm: "Creating implementation plan",
metadata: { task_type: "plan" }
)
Then block the plan task on the brainstorm task:
TaskUpdate(taskId: "<plan-task-id>", addBlockedBy: ["<brainstorm-task-id>"])
Step 4: (Full spec mode only) Detect spec-driven modules
Scan for spec-driven modules that will be affected by this task:
find . -name "SPECS.md" -o -name "NOTES.md" -o -name "TESTS.md" -o -name "BENCHMARKS.md" | head -20
Note which modules are spec-driven. The team-spec-oracle will scan them fully.
Step 5: Spawn knowledge teammates
Spawn team-brainstormer:
"Spawn a teammate named 'team-brainstormer'.
Teammate prompt:
'You are team-brainstormer. Claim the brainstorm task from the task list
(metadata.task_type: brainstorm), research the codebase following your SKILL.md protocol,
write findings to .bob/state/brainstorm.md, mark the task complete, then stay alive
to answer questions from coders and reviewers about your research and approach decisions.
Working directory: [worktree-path]'"
Spawn team-planner:
"Spawn a teammate named 'team-planner'.
Teammate prompt:
'You are team-planner. Wait for the plan task to unblock (it is blocked by the brainstorm task).
Once unblocked, claim it, read .bob/state/brainstorm.md, create a detailed TDD-first plan
in .bob/state/plan.md following your SKILL.md protocol, mark the task complete, then stay alive
to answer questions from coders and reviewers about plan intent and acceptance criteria.
Working directory: [worktree-path]'"
(Full spec mode only) Spawn team-spec-oracle:
"Spawn a teammate named 'team-spec-oracle'.
Teammate prompt:
'You are team-spec-oracle. Immediately scan all directories for spec-driven modules
(SPECS.md, NOTES.md, TESTS.md, BENCHMARKS.md), read and internalize all spec docs,
write a summary to .bob/state/spec-knowledge.md, then stay alive to:
- Answer invariant questions from coders and reviewers
- Log proposed spec updates as coders notify you of changes
- Write all final spec doc updates when the team lead sends a finalization signal
Working directory: [worktree-path]'"
Step 6: Monitor until plan task is complete
Check progress with TaskList() and agent_status. Never use agent_wait — the orchestrator must remain responsive to answer questions at any time.
Poll periodically:
TaskList()
agent_status
While monitoring:
Output:
.bob/state/brainstorm.md (written by team-brainstormer).bob/state/plan.md (written by team-planner).bob/state/spec-knowledge.md (written by team-spec-oracle, full spec mode only)On loop-back (REVIEW → BRAINSTORM): The knowledge team is still alive. Message team-brainstormer with the review issues and ask it to update brainstorm.md with a new approach. Then message team-planner to update plan.md. Create new brainstorm/plan tasks if needed.
Goal: Convert plan.md into the implementation task list
Actions:
Step 1: Read plan.md
Read(file_path: ".bob/state/plan.md")
Step 2: Convert plan to task list
Analyze the plan and create tasks using TaskCreate. Break into:
Task structure guidelines:
addBlockedBy (tests depend on implementation, integration depends on components)task_type: "test"task_type: "implementation"task_type: "quality"Example task creation:
TaskCreate(
subject: "Implement user authentication function",
description: "Create authenticate() function in auth.go that:
- Takes username and password
- Validates credentials against database
- Returns JWT token on success
- Returns error on failure
Acceptance criteria:
- Function signature: func authenticate(username, password string) (string, error)
- Uses bcrypt for password comparison
- Generates JWT with 24h expiry
- Includes user ID and role in JWT claims",
activeForm: "Implementing user authentication",
metadata: {
task_type: "implementation",
file: "auth.go",
priority: "high",
estimated_minutes: 20
}
)
Create ALL tasks from the plan at once. Then set up dependencies:
TaskUpdate(taskId: "<test-task-id>", addBlockedBy: ["<implementation-task-id>"])
Output:
If looping from REVIEW: Update plan to address review findings and create new fix tasks.
Goal: Add coder and reviewer teammates to the existing team
The knowledge team is already running. Now spawn the execution team.
Actions:
Step 1: Spawn coder teammates
Spawn 2 coder teammates with clear prompts:
Coder 1:
"Spawn a teammate named 'coder-1' to implement tasks from the shared task list.
Teammate prompt:
'You are coder-1, a team-coder agent working on implementing features.
Your job:
1. Check TaskList for available tasks (pending, no blockedBy, no owner)
2. Claim a task using TaskUpdate (set status: in_progress, owner: coder-1)
3. Read task details with TaskGet
4. Implement the task following the plan in .bob/state/plan.md
5. Use TDD: write tests first if it is an implementation task
6. Mark task completed when done
7. Repeat until no more tasks available
KNOWLEDGE TEAM: You have teammates who can answer questions:
- team-brainstormer: Ask about approach rationale and codebase patterns
- team-planner: Ask for clarification on any plan step or acceptance criteria
- team-spec-oracle: Ask about spec invariants; notify when you change spec-driven modules
Quality standards:
- Keep functions small (complexity < 40)
- Handle errors properly
- Follow existing code patterns
- Write clear, idiomatic Go code
GO CODING GUIDELINES:
- Pool lifetime: release pooled objects only at true end-of-life of all derived data
- File writes: use os.CreateTemp + os.Rename, never deterministic .tmp paths
- Goroutine fan-out: always use errgroup.SetLimit or a semaphore
- Numeric sizes: validate and convert int64/uint64 to int before make() or slice index
- Store errors: only fs.ErrNotExist is a miss; propagate other errors to callers
- Tests: name must match assertion; use //go:noinline + KeepAlive for GC-dependent tests
Navigator (before coding): Attempt mcp__navigator__recall to pull proven patterns for the packages in scope. After completing all tasks, call mcp__navigator__remember to record implementation decisions. Skip if unavailable.
SPEC-DRIVEN MODULES: Before writing any code, check each target directory for
SPECS.md, NOTES.md, TESTS.md, BENCHMARKS.md, or .go files containing:
// NOTE: Any changes to this file must be reflected in the corresponding SPECS.md or NOTES.md.
If found, this is a spec-driven module. Notify team-spec-oracle of any changes you make
to spec-driven modules — it will handle the doc updates. Do NOT update spec docs yourself.
Reporting: When you complete a task, message the team lead with:
- WHAT you implemented
- WHERE the changes are (file:line)
- Any decisions or trade-offs made
Working directory: [worktree-path]'
"
Coder 2:
"Spawn a teammate named 'coder-2' to implement tasks from the shared task list.
[Same prompt as coder-1, with name changed to coder-2]"
Step 2: Spawn reviewer teammates
Spawn 2 reviewer teammates:
Reviewer 1:
"Spawn a teammate named 'reviewer-1' to review completed tasks incrementally.
Teammate prompt:
'You are reviewer-1, a team-reviewer agent working on code review.
Your job:
1. Monitor TaskList for completed, unreviewed tasks
2. Claim a completed task (set metadata.reviewing: true, reviewer: reviewer-1)
3. Read task details with TaskGet to understand what was implemented
4. Review the implementation:
- Read the changed files
- Check code quality, correctness, completeness
- Verify tests exist and pass
- Check error handling and edge cases
5. Make a decision:
- APPROVE: Update task metadata: {reviewed: true, approved: true}
- NEEDS_FIXES: Update task metadata: {reviewed: true, approved: false, needs_fix: true}
AND create a new fix task with TaskCreate describing what to fix
6. Repeat until all completed tasks are reviewed
KNOWLEDGE TEAM: You have teammates who can answer questions:
- team-brainstormer: Ask why an approach was chosen or what alternatives were considered
- team-planner: Ask whether an implementation matches the plan intent
- team-spec-oracle: Ask whether code satisfies spec invariants for the affected packages
Review criteria:
- Does implementation match task description?
- Are tests present and passing?
- Is code quality good (idiomatic Go, error handling, etc.)?
- Are edge cases handled?
- Is complexity acceptable (< 40)?
Reporting: When you complete a review, message the team lead with:
- WHAT you reviewed (task ID + summary)
- Result: APPROVED or NEEDS_FIXES
- For issues: severity (CRITICAL/HIGH/MEDIUM/LOW), WHAT the issue is, WHY it matters, WHERE (file:line)
If you find critical issues, message the team lead immediately.
Working directory: [worktree-path]'
"
Reviewer 2:
"Spawn a teammate named 'reviewer-2' to review completed tasks incrementally.
[Same prompt as reviewer-1, with name changed to reviewer-2]"
Step 3: Verify team
Check that all teammates are active:
"Show me the current team members and their status."
You should see: team-brainstormer, team-planner, team-spec-oracle (full spec mode), coder-1, coder-2, reviewer-1, reviewer-2.
Output:
Goal: Teammates work concurrently - coders implement, reviewers review
CRITICAL: You are the team lead. You NEVER write code, edit files, or fix issues yourself. Teammates do ALL the work.
EXECUTE and REVIEW happen concurrently. Coders work on implementing tasks while reviewers review completed tasks in real-time.
Your role as team lead:
Actions:
Step 1: Broadcast kickoff message
Send a broadcast to all teammates:
"Broadcast to all team members:
Let's go! The work begins.
Here are your assignments:
- Task list has [N] tasks to claim
- Coders: Claim your tasks and implement them
- Reviewers: Review completed work as it comes in
- Everyone: Flag any blockers immediately
Let's get this done."
Step 2: Monitor progress
Periodically check the task list to see progress:
TaskList()
Track:
Step 3: Handle teammate messages
As teammates work, they'll send messages:
Respond to messages as team lead:
Step 4: Facilitate teammate collaboration
If issues arise, help teammates communicate:
"Message coder-1: reviewer-1 found some issues with your implementation.
Check fix task 456 for details and address them."
Or:
"Message reviewer-2: coder-2 has a question about the validation logic.
Can you provide guidance on what level of validation is needed?"
Step 5: Decide when to proceed
Monitor until one of these conditions:
A. All tasks complete and approved:
TaskList() shows:
- 0 pending tasks
- 0 in progress tasks
- All completed tasks have metadata.reviewed: true, metadata.approved: true
→ Proceed to TEST phase
B. Teammates finish but some tasks unapproved:
TaskList() shows:
- 0 pending tasks
- 0 in progress tasks
- Some completed tasks have metadata.approved: false
Check severity of issues:
C. Teammates go idle:
If teammates finish their work but tasks remain:
Example monitoring loop:
[Initial state]
TaskList: 8 pending, 0 in progress, 0 complete
Message from coder-1: "Claimed task 1: Implement rate limiter"
TaskList: 7 pending, 1 in progress, 0 complete
Message from coder-2: "Claimed task 2: Add config"
TaskList: 6 pending, 2 in progress, 0 complete
Message from coder-1: "Completed task 1"
TaskList: 6 pending, 1 in progress, 1 complete, 0 reviewed
Message from reviewer-1: "Reviewing task 1"
TaskList: 6 pending, 1 in progress, 1 complete (reviewing)
Message from coder-1: "Claimed task 3: Implement storage"
TaskList: 5 pending, 2 in progress, 1 complete (reviewing)
Message from reviewer-1: "Approved task 1"
TaskList: 5 pending, 2 in progress, 1 complete + approved
... (continues until all complete) ...
[Final state]
TaskList: 0 pending, 0 in progress, 8 complete + approved
→ Proceed to TEST phase
Output:
Goal: Run all tests and quality checks
Actions:
Spawn workflow-tester agent (NOT a teammate, just a regular subagent):
Task(subagent_type: "workflow-tester",
description: "Run all tests and checks",
run_in_background: true,
prompt: "Run the complete test suite, quality checks, and CI pipeline locally.
IMPORTANT: Report findings objectively. Do NOT make pass/fail determinations.
Your job is to execute tests and report results - the team lead will
decide routing based on your findings.
Steps:
1. Run `make ci` — this runs the full CI pipeline locally:
- go test ./... (report all test results)
- go test -race ./... (report race conditions if found)
- go test -cover ./... (report coverage percentages)
- go fmt (report formatting issues if found)
- golangci-lint run (report lint issues if found)
- gocyclo -over 40 (report complex functions if found)
- GitHub Actions workflow commands (parsed from .github/workflows/)
2. If `make ci` is not available, run the steps individually
Report ALL results objectively in .bob/state/test-results.md.
For each finding, include WHAT, WHY, and WHERE:
- Test execution output: counts (pass/fail) + specific failures with error messages
- Race condition results: which tests, what race, stack traces
- Coverage percentages: overall + per-package breakdown
- Formatting issues: which files, what's wrong
- Lint findings: rule violated, file:line, explanation
- Complexity violations: function name, complexity score, file:line
- CI workflow results: check name, status, error output
Example test failure format:
"TestLogin (auth_test.go:42) FAILED: expected status 200, got 401. Error: 'invalid credentials'"
Do NOT include recommendations or conclusions about whether to proceed.
Just report what you found with full detail.
Working directory: [worktree-path]")
Input: Code to test
Output: .bob/state/test-results.md
Checks:
<routing_rule>
After TEST completes, read .bob/state/test-results.md and route:
Goal: Shut down team and run final comprehensive code review, fix, commit, and CI monitoring
Even though incremental reviews happened during EXECUTE, this phase does a final holistic review of the complete changeset.
Navigator (before reviewing): Attempt mcp__navigator__consult for known issues, past bugs, or quality findings in the packages being changed. After the review completes, call mcp__navigator__remember to record all high/critical findings for future sessions. If navigator tools are unavailable, skip and continue.
Actions:
Step 1: Finalize spec docs and shut down teammates
(Full spec mode only) Finalize spec updates first:
"Message team-spec-oracle: All implementation tasks are complete.
Please finalize all spec doc updates now — write to SPECS.md, NOTES.md, TESTS.md,
BENCHMARKS.md for every module in your proposed updates log. Report back when done."
Wait for team-spec-oracle to confirm completion before proceeding.
Then gracefully shut down all teammates:
"Ask team-spec-oracle teammate to shut down"
"Ask team-brainstormer teammate to shut down"
"Ask team-planner teammate to shut down"
"Ask coder-1 teammate to shut down"
"Ask coder-2 teammate to shut down"
"Ask reviewer-1 teammate to shut down"
"Ask reviewer-2 teammate to shut down"
Check agent_status until all teammates show done. Do not use agent_wait — poll with agent_status to stay responsive.
Step 2: Invoke code review (standard or adversarial)
If adversarial mode is OFF (detected in INIT):
Invoke the code-review skill:
Invoke: /bob:code-review
The code-review skill handles the complete cycle:
If adversarial mode is ON (detected in INIT):
Invoke the adversarial review skill in DIFF mode (reviews only changed files):
Invoke: /bob:adversarial-review DIFF
/bob:adversarial-review spawns 8 specialist agents against the changed files, consolidates
findings into .bob/state/review.md, and includes a routing recommendation.
Read .bob/state/review.md and route per the recommendation:
For the commit/PR/CI monitor steps after adversarial review, spawn a commit-agent directly:
Task(subagent_type: "commit-agent",
description: "Commit changes and open PR",
run_in_background: true,
prompt: "Create a commit of all staged changes and open a pull request.
Working directory: [worktree-path]")
After adversarial review + commit completes, proceed to COMPLETE.
Goal: Workflow complete
Actions:
Clean up the team:
"Clean up the agent team"
Confirm with user:
"All checks passing!
The code is tested and ready to merge.
Shall we merge this into main? [yes/no]"
If approved, merge PR:
gh pr merge --squash
Celebrate!
"Done!
All tests pass and the code looks great.
The changes are safely on the main branch.
— Bob"
Workflow state is maintained through:
Key files:
.bob/state/brainstorm.md - Research and approach.bob/state/plan.md - Implementation plan.bob/state/test-results.md - Test execution results.bob/state/review.md - Code review findingsEach phase spawns specialized agents with clear inputs/outputs:
BRAINSTORM + SPAWN KNOWLEDGE TEAM:
Team created
team-brainstormer(brainstorm-prompt.md) → .bob/state/brainstorm.md
team-planner(brainstorm.md) → .bob/state/plan.md [blocked until brainstorm done]
team-spec-oracle → .bob/state/spec-knowledge.md [full spec mode only, runs concurrently]
Team lead converts plan.md → task list (TaskCreate)
SPAWN EXECUTION TEAM:
team-coder × 2 + team-reviewer × 2 join existing team
All 7 teammates now active (full spec mode) / 6 (simple mode)
EXECUTE + REVIEW (concurrent):
team-coder teammates claim tasks → code changes
team-reviewer teammates review → approve/create fix tasks
[coders/reviewers message brainstormer/planner/spec-oracle for context]
TEST:
workflow-tester(code) → .bob/state/test-results.md
REVIEW (final):
team-spec-oracle finalizes all spec doc updates (full spec mode)
All teammates shut down
/bob:code-review → (review + fix loop + commit + CI monitor)
Good teammate prompts:
Bad teammate prompts:
As team lead, periodically:
Teammate blocked:
Message teammate: "Can you describe what's blocking you?"
Read response, provide guidance or create clarification task
Teammate idle but work remains:
Message teammate: "There are still pending tasks in the task list.
Can you claim task [ID] and continue?"
Teammates conflicting:
Message both: "You're both working on overlapping areas.
[Teammate 1]: focus on [X]
[Teammate 2]: focus on [Y]"
Always clean up properly:
Never:
Orchestration (read-only coordinator):
.bob/state/*.md files.bob/state/*.md files to make routing decisionsFlow Control:
/bob:code-review.bob/state/test-results.md before REVIEWQuality:
Remember:
Strict Enforcement (XML tags mark critical rules):
<strict_enforcement> - Phases MUST be executed in exact order, no skipping<critical_gate> - Hard gates that cannot be bypassed<hard_gate> - Specific blocking conditions<critical_requirement> - Prerequisites for phase entry<routing_rule> - Automatic routing logic with no overrideExperimental Feature Requirements:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 must be set (Claude Code only — not required in pi)Goal: Guide complete, high-quality feature development using concurrent team agents with direct communication and shared task lists — autonomously, following every step exactly as written.
Good luck! 🏴☠️
development
Implements code changes following plans and specifications
data-ai
Self-directed reviewer that claims completed tasks and reviews them incrementally
data-ai
Self-directed planner that claims a plan task (blocked by brainstorm), creates the implementation plan, and stays alive to answer questions from teammates
development
Self-directed coder that claims tasks from a shared task list and implements them