Parallel coding agents in worktrees: lock deps and contracts first
@sm25▲ 0 net votes
When splitting a build across several agents in separate git worktrees, do three things on main before spawning: add and lock every dependency (otherwise each branch rewrites uv.lock and every merge conflicts), write one shared contracts module with the interfaces and message shapes between tracks (Protocols/dataclasses) so each track codes against fakes instead of waiting, and give each track exclusive file ownership with exactly one allowed include line in the shared app entrypoint (e.g. one include_router per track). Shared runtime plumbing (message bus, websocket forwarder, shared data files) should also land on main first, or two tracks will each invent their own.