Parallel Work Orchestration Plan
Version: 0.1.0 Last Reviewed: 2026-02-12 Status: Draft
Overview
Strategy for multi-agent parallel development using git worktrees and Hearth v0.6.0 coordination tools.
Prerequisites (Sequential, One Agent)
Parallel work is only safe after "first patterns" are established. These must be done sequentially by a single agent:
Backend API
- API project scaffold (BB-1z2s47ox) — plugin order, error handler, route registration, Zod schemas, Prisma setup
- Database schema — Prisma model conventions, relations, enums, audit fields
- Auth - email/password — first complete route (schema -> service -> route -> test), middleware pattern
- API test infrastructure (BB-jf8sv1zl) — test DB setup, fixtures, helpers
- First feature (e.g., Feedings) — establishes the repeatable feature pattern
iOS App
- iOS app shell + scaffold — MVVM pattern, Repository protocol, Network service, @Observable
- Auth flow — first complete feature (View -> ViewModel -> Repository -> Network), Keychain
- Shared iOS components — reusable LoadingButton, ErrorView, etc.
- First feature sheet (e.g., Feeding) — establishes the repeatable sheet pattern
After each "first pattern" item, the implementing agent posts a bulletin:
hearth bulletin --author "api-feedings" "Pattern established: route/schema/service/test. See src/routes/feedings.ts"
Parallel Batching Plan
Backend API (after prerequisites)
| Batch | Items | Why parallel is safe |
|---|---|---|
| A | Feedings + Diapers | Separate route/schema/service/test files |
| B | Sleep + Notes | Same isolation |
| C | Children CRUD + Share Links | Separate route files (share links uses children but doesn't modify them) |
| D | Dashboard API + Timeline API | Read-only endpoints, no schema changes |
iOS App (after prerequisites)
| Batch | Items | Why parallel is safe |
|---|---|---|
| A | Feeding sheet + Diaper sheet | Separate Feature/ directories |
| B | Sleep sheet + Notes sheet | Same isolation |
| C | Dashboard + Timeline | Touch TabView — keep as one unit |
Cross-Layer (always safe)
- 1 API agent + 1 iOS agent on different features
- 1 API agent + 1 infra agent
- API features + iOS components
Agent Limits
- 2-3 max simultaneous agents
- 2 agents on API features — each feature touches isolated files
- 1 agent on iOS features — more shared state risk (NavigationStack, TabView)
- Never 2 agents modifying the same shared file (Prisma schema, route index, TabView)
Worktree Setup
# From the main repo:
hearth worktree add ../baby-feedings bb-XXXX-feedings
hearth worktree add ../baby-diapers bb-YYYY-diapers
# Verify:
hearth worktree list
Each worktree:
- Branches from
develop - Has its own
node_modulesand.env - Runs its own test DB (unique docker-compose port)
- Shares hearth/forge data via symlinks (automatic with
hearth worktree add)
PR Merge Order
- Scaffold/pattern PRs merge first (establish conventions)
- Feature PRs merge in batch order (A before B before C)
- Within a batch, order doesn't matter
- After each merge, other branches rebase on
develop
Merge Checklist
- Tests pass on the branch
- Reviewed by at least one other agent or the user
- Rebased on latest
develop - No merge conflicts
- Bulletin posted if PR establishes or changes a pattern
Orchestration
User Role (Variable)
The user may:
- Actively monitor — watching sage status, reviewing PRs in real-time
- Periodically check in — agents work autonomously, escalating when blocked
- PR gatekeeper — agents work fully autonomously, user reviews and merges PRs
Coordinator Agent
An optional coordinator agent monitors the project and makes recommendations:
- Runs
sage status --json— current state - Checks bulletins — resolves or escalates
- Checks
gh pr list— assigns reviews - Checks
forge backlog list— recommends next items - Posts bulletins with instructions
The coordinator reads the board, makes calls, communicates. It never writes code.
Blocking Issue Resolution
When an agent discovers a blocking issue:
- Posts bulletin:
hearth bulletin --author "agent-name" "BLOCKING: [description]. Pausing BB-XXXX." - Logs it:
hearth log --tag blocked "[BB-XXXX]: Waiting on resolution of Y" - The blocking agent pauses or picks up a different unblocked item
- Resolution path:
- Another agent sees the bulletin on their next
sage statuscheck and responds via log/bulletin - The user sees the bulletin during a check-in and decides
- The coordinator agent triages and resolves
- Another agent sees the bulletin on their next
- After resolution:
hearth log --tag decision "Resolved: [description]"+ clear the bulletin
Not In Scope
- Agent-to-agent direct messaging (async via bulletins/logs is sufficient)
- Auto-spawning agents (Claude Code doesn't support nested spawning)
- Real-time conflict detection (agents check manually via git and PR reviews)