Lifecycle Management
Purpose: Read this when executing Rally's 7-phase lifecycle, handling teammate failures, or shutting the team down safely.
Table of Contents
- Phase Summary
- Phase Details
- Error Scenarios
Phase Summary
| Phase | Goal | Mandatory action |
|---|---|---|
ASSESS |
decide whether Rally is appropriate | reject false parallelism early |
DESIGN |
choose team pattern and ownership | present design through ON_TEAM_DESIGN when needed |
SPAWN |
create the team and teammates | TeamCreate before any Agent spawn |
ASSIGN |
create tasks and dependencies | set owner, status, and addBlockedBy correctly |
MONITOR |
supervise progress | poll TaskList, respond to failures, and interpret idle correctly |
SYNTHESIZE |
merge results and verify quality | trigger ON_RESULT_CONFLICT if outputs collide |
CLEANUP |
end the session safely | shutdown_request each teammate, then TeamDelete |
Phase Details
ASSESS
Use Rally only when:
2+independent units exist, or- staged parallelism is possible through
blockedBy, and - parallel gain is likely to exceed coordination cost.
Reject Rally when all work writes the same files, only one task exists, or the task is investigation-only.
DESIGN
- Select a pattern from
reference/team-design-patterns.md. - Choose teammate names,
subagent_type, model, and mode. - Declare ownership via
reference/file-ownership-protocol.md. - Ask through
ON_TEAM_DESIGNwhen design approval is required.
SPAWN
- Run
TeamCreate. - Spawn teammates via
Agentwithrun_in_background: true. Optionally useisolation: "worktree"for file-overlap scenarios. - Teammates can self-discover other members by reading
~/.claude/teams/{team-name}/config.json. - Confirm the prompt includes:
team name and role, task,
exclusive_writeandshared_read, conventions, dependencies, completion criteria, andTaskUpdateinstructions.
ASSIGN
- Create tasks with
TaskCreate. - Wire dependencies through
TaskUpdate.addBlockedBy. - Set the owner and move the task to
in_progress. - DM the owner when blockers are cleared.
MONITOR
Use this loop until all tasks finish:
completed-> prepare for synthesisin_progress-> normal; process idle notificationspending+ unblocked -> assign or nudge the ownerblocked-> resolve the blocker or re-sequence work
idle means waiting. It does not mean done.
When multiple tasks are available for a teammate, prefer claiming by task ID order (lowest ID first) to prevent starvation.
SYNTHESIZE
- Collect completed tasks and
files_changed. - Check the ownership map.
- Verify build, tests, and lint or type checks.
- Fire
ON_RESULT_CONFLICTif same-file edits or incompatible outputs appear.
CLEANUP
- Confirm all tasks are complete.
- Send
shutdown_requestto each teammate. - Wait for
approve: true. - Run
TeamDelete. - Report team composition, completed tasks, changed files, verification results, and remaining risks.
Error Scenarios
Teammate Hang
Symptom: still in_progress, no progress, no meaningful replies.
Response:
- DM a status check up to
2times. - If still no response, send
shutdown_request. - If shutdown still fails, stop the task and replace the teammate.
- Reassign the task.
Teammate Failure
Symptom: task reports failure or becomes blocked with an error.
Response:
- Confirm next action via
ON_TEAMMATE_FAILUREwhen needed. - Retry with more context.
- Retry with reduced scope.
- Replace the teammate.
- Skip and report if replacement is not justified.
All Teammates Failed
Response:
- Send
shutdown_requestto all teammates. - Run
TeamDelete. - Report alternatives: sequential fallback, reduced scope, or prerequisite review.
Shutdown Rejected
Response:
- Check the rejection reason.
- Wait if tasks remain.
- Report to the user if the reason is unclear or unresolved.