# Agent Workflow Patterns

## Source: @elvissun (Feb 23, 2026) - 4M views
"The One-Person Million-Dollar Company" workflow

### Key Patterns to Adopt

1. **Git Worktree Isolation** - Each feature gets its own worktree so agents don't conflict
   - `git worktree add ../feat-name -b feat/name origin/main`
   - Agents work in isolated directories, can run in parallel

2. **Agent Tracking Manifests** - JSON files tracking each spawned agent:
   ```json
   {
     "id": "feat-custom-templates",
     "agent": "codex",
     "branch": "feat/custom-templates",
     "status": "running",
     "notifyOnComplete": true
   }
   ```

3. **Dual Review Gates** - Before merge, run BOTH Claude + Gemini review
   - Catches different types of issues
   - Both must pass before merge

4. **The Ralph Loop** - Supervision cycle:
   - Plan (human) → Execute (agent) → Review (different agent) → Merge or redirect

5. **Right Agent for Right Job**
   - Planning/architecture: stronger model (Opus)
   - Execution/coding: coding-optimised model (Claude Code, Codex)
   - Review: different model than author (cross-pollination)

### How We Adapt This
- We already use sub-agents via OpenClaw sessions_spawn
- Add: worktree isolation for parallel coding tasks
- Add: structured agent tracking (currently ad-hoc in memory files)
- Add: dual-model review before deploying (Claude Code builds, Gemini reviews or vice versa)
- Our equivalent of tmux sessions = OpenClaw background sub-agents
