coven-parallel-work
Skill75 starsChanged 4 months agoMITView on GitHub
Coven Parallel Work Protocol — how to use it from inside an OpenClaw familiar so multiple agents (Codex, Claude Code, Nova, Hermes, etc.) can share a repo without overwrites or clashes. The protocol itself is harness-agnostic; this skill is the OpenClaw entry point.
- Deletes or force-pushes
- Commits and pushes
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/heygen-skills/CLAUDE.mdCLAUDE.md
- 1passwordSkill
- ask-curlSkill
- boardSkill
- cleanup-unused-filesSkill
- codeflow-maintainerSkill
- codex-session-managerSkill
- coven-astraSkill
- coven-board-entrySkill
- coven-charmSkill
- coven-cloud-maintainerSkill
- coven-codySkill
- coven-echoSkill
- coven-identity-canonSkill
- coven-kittySkill
- coven-sageSkill
- coven-task-managerSkill
- daily-dev-agenticSkill
- discrawlSkill
- disk-space-optimizerSkill
- epubSkill
- familiar-board-stewardshipSkill
- heygen-avatarSkill
- heygen-videoSkill
- heygen-skillsSkill
- higgsfield-generateSkill
- higgsfieldSkill
- linear-issue-managementSkill
- lit-ui-designerSkill
- lobsterSkill
- maintainer-barSkill
- memory-recallSkill
- memory-timeline-managerSkill
- ml-engineerSkill
- nodriverSkill
- ocrSkill
- openclaw-devSkill
- openclaw-trustSkill
- opencoven-designSkill
- OpenCoven Role Creation ProcessSkill
- pr-agentSkill
- project-managerSkill
- prompt-engineerSkill
- prompt-vaultSkill
- research-ingestionSkill
- ritual-dapp-frontendSkill
- rollcallSkill
- security-agentSkill
- skill-scannerSkill
- slidev-deck-pipelineSkill
- tauri-apple-releaseSkill
- threejs-animationSkill
- tinyfish-agent-runSkill
- tinyfish-browserSkill
- tinyfish-fetchSkill
- tinyfish-searchSkill
- tinyfishSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Use the protocol when:
- Distinctive: line 46
If only one agent ever touches a repo, you don't need the protocol.
- Distinctive: line 61
All three are needed for full coverage.
- Distinctive: line 113
When the branch is merged, sweep:
- Very specific: line 150
If cv-wt --install-hooks refuses because the repo has tracked hooks (core.hooksPath pointing at a versioned dir, like coven-cave's …
- Distinctive: line 165
If the canary trips, HEAD moved out from under you.
- Distinctive: line 176
If a stash auto-applied someone else's WIP into your checkout:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Coven Parallel Work Protocol — OpenClaw entry point
What this is
The Coven Parallel Work Protocol is a portable, harness-agnostic
contract for safely running multiple agents on the same git repo on the
same machine. It works for Codex, Claude Code, OpenClaw, Hermes, Nova,
and any future runtime — anyone who runs git.
This skill file is the OpenClaw familiar's entry point: it tells you when to use the protocol from inside an OpenClaw session, the local prototype tooling available, and the daily workflow.
For the full spec (harness-agnostic, no OpenClaw assumptions), read
PROTOCOL.md — that's the contract any conforming
implementation must respect.
Where this lives
- Spec:
PROTOCOL.md(in this directory; portable, will move upstream) - Reference prototype: POSIX-shell scripts in
~/.openclaw/workspace/bin/cv-wt,cv-claimand hook templates in this directory'shooks/ - Canonical implementation (target):
OpenCoven/coven— surfaced eventually ascoven wt,coven claim,coven hooks install. Not yet built. Tracked upstream in issue #167. - This skill: how an OpenClaw familiar uses the protocol day-to-day
The local prototype is intentionally a prototype. It's working code that respects the spec, sized to fit one user's setup. Once the canonical Coven implementation lands, this skill will redirect to it and the prototype scripts will become a thin shim or get retired.
When to apply
Use the protocol when:
- A repo is touched by 2+ concurrent agents (or agent + human, or long-lived background bots like release-bumpers).
- You've seen any of: HEAD reset out from under you, stash auto-applied
someone else's WIP, force-push collisions, a bot direct-merging to
mainmid-PR, untracked files leaking between sessions. - A new Coven user is setting up shared agents on one workspace.
If only one agent ever touches a repo, you don't need the protocol. Don't over-apply.
The three layers (TL;DR)
┌─ Layer 1: Worktree isolation ─────────┐ Mechanical
│ one cwd per agent, no shared dirs │
├─ Layer 2: Agent claims ───────────────┤ Logical
│ per-branch lockfile, TTL-bounded │
├─ Layer 3: Branch protection ──────────┤ Policy
│ no direct main commits/pushes │
└───────────────────────────────────────┘All three are needed for full coverage. L1 alone gets ~70% of value; L3 becomes non-negotiable once any background bot can push.
Layout
Two paths matter:
<REPO_ROOT>/ primary clone, branch=main, READ-MOSTLY
<REPO_ROOT>.wt/<branch-slug>/ one worktree per active branchThe primary clone stays on main and only fast-forwards. No agent
commits feature work there. Every feature branch is checked out in a
sibling worktree under <REPO_ROOT>.wt/. Branch slug is the branch
name with / replaced by - (so feat/foo → feat-foo).
Daily usage from an OpenClaw familiar
Starting work on a branch
# Spawn or enter the worktree for your branch
cv-wt --cd feat/my-thing
# Claim the branch for your familiar (TTL 1h by default)
cv-claim acquire feat/my-thing
cv-claim canary feat/my-thing # snapshots HEAD for the canary checkSet COVEN_AGENT_ID per familiar (e.g. nova, cody, kitty,
charm, astra, echo). For OpenClaw familiars, this should be in
your familiar's config or shell rc when multiple familiars share one
worktree. If unset, identity falls back to $USER@<worktree-slug>, so enter
the worktree before acquiring and run heartbeat/release commands there.
During long sessions
Refresh the claim periodically so it doesn't expire:
cv-claim heartbeat feat/my-thing 3600Finishing work
git push -u origin feat/my-thing
gh pr create ...
cv-claim release feat/my-thingWhen the branch is merged, sweep:
cv-wt --prune-mergedHook behavior (summary)
pre-commit refuses if:
- Branch is
main(default; configurable via$COVEN_PRIMARY_BRANCH) - Branch has an unexpired claim by a different agent
- HEAD moved out from under your session (canary tripped)
pre-push refuses if:
- Force-push to a protected branch — always blocked
- Push to
main/release/*without.git/MERGE_INTENTcontaining the canonical phrase ($COVEN_MERGE_PHRASE, defaultEnchant merge to main.)
Hooks chain to <hook>.local so they coexist with repos that already
have their own pre-commit (secret scanning, etc.).
Full refusal semantics, configuration vars, and recovery flows are in
PROTOCOL.md §4 and §5.
Per-repo setup checklist
cd <repo>
cv-wt --doctor # see what's wrong now
cv-wt --install-hooks # install pre-commit + pre-push
cv-wt --prune-merged # clean up merged worktrees
cv-wt --prune-stale 7 # remove worktrees untouched > 7 daysIf cv-wt --install-hooks refuses because the repo has tracked hooks
(core.hooksPath pointing at a versioned dir, like coven-cave's
scripts/git-hooks/), it will print two integration paths. Pick one.
The protocol does not silently rewrite tracked files.
GitHub-side branch protection complements local hooks and is strongly recommended:
- Require PR for
main+release/* - Require status checks to pass
- Disallow force pushes
- Disallow deletions
Recovering from collisions
If the canary trips, HEAD moved out from under you. Do not push.
cd <your-worktree>
git status -sb # see where HEAD is now
git reflog -10 # find the commit you expected
git reset --hard <expected-sha> # restore
rm $(git rev-parse --git-common-dir)/AGENT_HEAD_AT_START # acknowledge
cv-claim canary <your-branch> # rearm canaryIf a stash auto-applied someone else's WIP into your checkout:
git stash list # find the suspicious one
git stash show -p stash@{N} # inspect
git checkout -- <files> # discard the alien diff
git stash drop stash@{N} # remove the stashWhat this protocol does NOT solve
- Cross-repo races. Solve at the release-coordination layer.
- Long-running daemons inside worktrees. Dev servers, watchers, test runners. Each familiar owns its own background-process lifecycle.
- External state. Databases, generated files outside git, OS-level locks. Out of scope.
Migration plan to canonical Coven CLI
Tonight's prototype is option B in our June 3 design discussion:
keep the working POSIX prototype, file an issue upstream so the team
owns the design, migrate to coven wt / coven claim / coven hooks
once the Coven CLI subcommand surface stabilizes. When that lands:
- Spec stays at
PROTOCOL.md(or moves intoOpenCoven/coven/docs/) cv-wtandcv-claimbecome thin shims that execcoven wt/coven claim, with a deprecation warning- This SKILL.md updates to point at
covenas the entry point
The spec is what matters. Implementations are interchangeable as long as they conform.
See also
PROTOCOL.md— the full harness-agnostic specusing-git-worktreesskill — general git worktree patterns- AGENTS.md "Hard Rules" — repo-level merge gate phrase requirements
- Hermes Self-Evolution
PLAN.md— "All changes go through human review, never direct commit" — same principle, agent-level
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

