agentleFS
davidscotttuftsdavidscotttufts/hyvemind/skills/parallel-work/SKILL.md

parallel-work

Skill0 starsChanged 17 days agoApache-2.0View on GitHub

Safe git hygiene when several agents or sessions share one repository: branch from the remote base in your own worktree, never stash/clean/reset a shared tree, stage explicit paths, re-check branch and staged diff before every commit, and clean up only your own artifacts. Use before any multi-session or multi-agent work, or whenever another session might be editing.

  • Deletes or force-pushes
  • Commits and pushes

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never git checkout -b in the shared checkout.

    line 19
  2. Distinctive:

    If git worktree add says the branch already exists, another session has probably claimed it.

    line 21
  3. Very specific:

    Every worktree sees $(git rev-parse --git-common-dir)/hyvemind-queue.md.

    line 26
  4. Distinctive:

    Never: run git stash, git clean, git reset --hard, or delete a branch you didn't create, in a tree others use.

    line 36
  5. Distinctive:

    Before every commit, check git branch --show-current and git diff --cached.

    line 39
  6. Distinctive:

    Commit and push to a branch to preserve work.

    line 43
  7. Distinctive:

    Don't run two heavy test suites at the same time on one machine.

    line 44
  8. Very specific:

    Remove a branch or worktree only after proving it landed: after git fetch, git merge-base --is-ancestor <branch> origin/<base> exits 0, or …

    line 56

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Parallel work

Assume another session is editing this checkout right now.

Start

git fetch origin
git worktree add ../<repo>-<task> -b <branch> origin/main   # from the REMOTE base, not local main
cd ../<repo>-<task> && <install dependencies for real>        # don't symlink node_modules
  • Branch from origin/<base>. Local main falls behind constantly.
  • Never git checkout -b in the shared checkout. It moves the working tree out from under other sessions.
  • If git worktree add says the branch already exists, another session has probably claimed it. Pick a new name; don't adopt it.

Shared queue (advisory)

Every worktree sees $(git rev-parse --git-common-dir)/hyvemind-queue.md. Claim your work there in one line (branch, area, session, date); edit only your own lines.

  • Reconcile it before trusting it: git ls-remote --heads origin and PR state. A claim whose branch is merged or gone is stale.
  • It is advisory. Never impose a hold or freeze on another session; on overlap, tell the user.

While working

  • Never run git stash, git clean, git reset --hard, or delete a branch you didn't create, in a tree others use. Before discarding anything, diff it against the remote. If it differs, it is someone's unpushed work.
  • Before every commit, check git branch --show-current and git diff --cached. A parallel checkout can move you, and a parallel write can land between add and commit.
  • Stage explicit paths only.
  • Commit and push to a branch to preserve work. Don't rely on stash.
  • Don't run two heavy test suites at the same time on one machine. Worker starvation produces failures that look real and aren't.

Fan-out to subagents

  • Give each subagent its own worktree and a task with no file overlap with the others.
  • Give each one only what it needs: the spec, its task, the files, and the exit check.
  • Review each result against the spec yourself before merging it into your branch.

Finish

Remove a branch or worktree only after proving it landed: after git fetch, git merge-base --is-ancestor <branch> origin/<base> exits 0, or (for squash or rebase merges) git cherry origin/<base> <branch> shows no + lines. "The PR says merged" is not proof. Then remove your own worktrees, branches, queue lines, background processes and temp files (git worktree remove, git push origin --delete <branch>). Never remove anything you didn't create.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.