lifecycle
npx machina-cli add skill tslateman/bach/lifecycle --openclawLifecycle Orchestration
Multi-phase project execution with review gates. Wraps orchestrating-work with phase sequencing, dependency waves, and architect-led planning.
Core principle: Plan phases with an architect. Execute each phase via orchestrating-work. Gate transitions with reviewer approval.
When to Use
Use lifecycle when:
- Project has 2+ distinct phases (design → implement → integrate)
- Phases depend on each other (phase 2 needs phase 1's output)
- Quality gates matter (review before advancing)
- An architect should shape the plan
Use /orchestrate instead when:
- Single-pass decomposition suffices
- No phase dependencies
- No review gates needed
- Task completes in one wave
The Pattern
Step 1: Architect Plans Phases
Dispatch an architect worker to decompose the project into ordered phases:
Task tool (general-purpose):
description: "Architect: Plan phases for [project]"
prompt: [Use ./workers/architect-prompt.md from orchestrating-work]
The architect returns named phases with:
- Clear scope per phase
- Dependencies between phases
- Acceptance criteria for each phase gate
Step 2: Create Phase Tasks
Encode phase identity in CC task subjects and use gate tasks as barriers:
TaskCreate: "[Phase 1: Foundation] Set up project structure"
TaskCreate: "[Phase 1: Foundation] Define data models"
TaskCreate: "[Phase 1: Foundation] Write schema migrations"
TaskCreate: "[Gate] Review Phase 1: Foundation"
→ addBlockedBy: [all phase-1 task IDs]
TaskCreate: "[Phase 2: API] Implement auth endpoints"
→ addBlockedBy: [gate-task-id]
TaskCreate: "[Phase 2: API] Implement CRUD endpoints"
→ addBlockedBy: [gate-task-id]
TaskCreate: "[Gate] Review Phase 2: API"
→ addBlockedBy: [all phase-2 task IDs]
Gate tasks block subsequent phases until the reviewer approves.
Step 3: Execute Each Phase
For each phase, apply the orchestrating-work pattern:
- Build waves — Group tasks whose dependencies are satisfied
- Dispatch workers — Use coder/researcher/tester workers from
orchestrating-work - Synthesize results — Verify all phase tasks complete
Parallel tasks within a wave run concurrently. Sequential dependencies enforce ordering.
Step 4: Review Gate
When all tasks in a phase complete, the gate task activates. Dispatch a reviewer:
Task tool (general-purpose):
description: "Reviewer: Gate review for Phase N"
prompt: [Use reviewer-prompt.md with phase acceptance criteria]
Verdicts (match existing reviewer vocabulary):
| Verdict | Meaning | Action |
|---|---|---|
APPROVE | Phase meets acceptance criteria | Mark gate complete; next phase unblocks |
NEEDS_CHANGES | Fixable issues found | Create fix tasks in current phase; re-gate |
REJECT | Fundamental rework needed | Revisit architect plan for this phase |
On APPROVE, the gate task completes, unblocking all next-phase tasks via CC's addBlockedBy resolution.
On NEEDS_CHANGES, create new tasks for the fixes, add them as blockers to the gate, and re-run the phase.
Step 5: Advance or Complete
After the final phase gate approves, run a completion audit:
- Verify all phases passed their gates
- Check project-level acceptance criteria
- Report summary to user
Dependency Waves
Within each phase, build execution waves from the task dependency graph:
- Find all tasks with no unsatisfied dependencies → Wave 1
- After Wave 1 completes, find newly unblocked tasks → Wave 2
- Repeat until no pending tasks remain
See reference/dependency-waves.md for the algorithm.
Phase Gates
Gate tasks are CC tasks with a special convention:
- Subject starts with
[Gate] - Blocked by all tasks in the current phase
- Blocks all tasks in the next phase
- Completion requires reviewer approval
See reference/phase-gates.md for the gate pattern.
State
All state lives in CC's task list. No custom state files.
- Phase identity: encoded in task subject
[Phase N: Title] - Dependencies: CC's
addBlockedBy/addBlocks - Progress: CC task statuses (
pending/in_progress/completed) - Gates:
[Gate]prefix tasks
To check progress, read the task list and group by phase prefix.
Example
User: /mission Build a CLI tool with auth, config management, and plugin system
--- STEP 1: ARCHITECT ---
Architect plans:
Phase 1: Foundation — project structure, config system, CLI framework
Phase 2: Auth — login/logout, token storage, session management
Phase 3: Plugins — plugin loader, registry, lifecycle hooks
Phase 4: Integration — end-to-end flows, error handling, docs
--- STEP 2: CREATE TASKS ---
[Phase 1: Foundation] Scaffold project with TypeScript + Commander
[Phase 1: Foundation] Implement config file loading and validation
[Phase 1: Foundation] Set up test framework
[Gate] Review Phase 1: Foundation
→ blockedBy: all Phase 1 tasks
[Phase 2: Auth] Implement login flow with OAuth
→ blockedBy: gate-1
[Phase 2: Auth] Implement token storage
→ blockedBy: gate-1
[Gate] Review Phase 2: Auth
→ blockedBy: all Phase 2 tasks
... (phases 3, 4 follow same pattern)
--- STEP 3-4: EXECUTE + GATE ---
Phase 1 tasks execute via orchestrating-work (waves of coder/researcher workers)
Gate fires → reviewer approves → Phase 2 unblocks
Repeat for each phase
--- STEP 5: COMPLETE ---
All gates passed. Completion audit confirms project criteria met.
Integration
Wraps:
bach:orchestrating-work— Each phase executes using the two-tier pattern
Workers used:
architect— Plans phases (viaworkers/architect-prompt.md)coder,researcher,reviewer,tester— Execute phase tasks
Invoked by:
/missioncommand — Entry point for lifecycle projects
Overview
Lifecycle orchestrates projects that run in sequential phases with review gates. It pairs architect-led planning with orchestrating-work execution and phase-level gates to ensure dependencies and quality criteria are met before moving forward.
How This Skill Works
An architect plans the phases and dependencies; each phase's tasks are encoded with phase identity and gate blockers. For each phase, tasks are run in waves using orchestrating-work, and a reviewer gate validates phase acceptance before unlocking the next phase. A final completion audit confirms project-wide acceptance.
When to Use It
- Project has 2+ distinct phases (design → implement → integrate)
- Phases depend on each other (phase 2 needs phase 1's output)
- Quality gates matter (review before advancing)
- An architect should shape the plan
- Projects where phase gates and audits are required before completion
Quick Start
- Step 1: Architect plans phases with clear scope, dependencies, and acceptance criteria
- Step 2: Create phase tasks and gate tasks, wiring blockers to ensure proper sequencing
- Step 3: For each phase, execute Waves via orchestrating-work, run gate reviews, and perform final completion audit
Best Practices
- Have the architect plan phases with clear scope, dependencies, and acceptance criteria
- Encode phase identity in tasks and use gate tasks as blockers to enforce flow
- Execute each phase using orchestrating-work waves, dispatching workers for parallelizable tasks
- Use formal gate reviews with defined verdicts (APPROVE, NEEDS_CHANGES, REJECT) to control progression
- Perform a completion audit after the final phase gate to confirm overall readiness
Example Use Cases
- Foundation phase establishes project structure, data models, and schema migrations before API work
- Phase 2 implements authentication and CRUD endpoints with a gate review between phases
- Phase-driven execution uses waves to satisfy dependencies while parallel tasks run within each wave
- Gate reviews determine if a phase can advance or if fixes are required
- A final completion audit verifies all phases passed gates and meets acceptance criteria