agentleFS
mad01mad01/thismoon/skills/loom/SKILL.md

loom

Skill2 starsChanged 10 days agoBSD-3-ClauseView on GitHub

Coordinate parallel agent sessions on one repo with git worktrees. Each session claims its own worktree under ~/.worktrees and commits there directly; one weaver session rebases the finished branches and lands them on the default branch in order. Use when the user says "loom", "claim a worktree", "act as the weaver", or when several sessions would otherwise share one checkout.

10 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, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When several sessions work one repo in parallel, each gets its own git worktree and the coordination point is the merge, not the commit.

    line 7
  2. Distinctive:

    When the branch is done: run the repo's gates in the worktree, commit, then send the weaver a ready message over SendMessage.

    line 24
  3. Distinctive:

    Stop. The weaver owns the branch from here.

    line 30
  4. Very specific:

    No worktrees and no worktree-agent-* branches: say so and stop.

    line 49
  5. Very specific:

    After a branch lands, and for every worktree the survey found integrated: remove its worktree and delete the branch per loom.md Teardown, …

    line 55
  6. Distinctive:

    Never touch another session's worktree: no commits, no cleanup, no conflict resolution.

    line 71
  7. Distinctive:

    Never push the default branch on PR-only repos.

    line 74
  8. Distinctive:

    Commit messages follow conventional-commit format and carry no attribution trailers.

    line 76

“Common” is measured: kept by at least 6 in 10 of the 7 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

When several sessions work one repo in parallel, each gets its own git worktree and the coordination point is the merge, not the commit. This skill has two roles; the worktree layout, state model, and integration rules live in loom.md beside this file. Read it before acting in either role.

Pick the role from the arguments or context: claim (or a task that needs its own worktree) makes this session a worktree owner. weave (or the user saying this session integrates) makes it the weaver. status surveys the loom without taking a role.

Owner (a session with a claimed worktree)

  1. Claim: from the canonical checkout, create the worktree and branch: git worktree add ~/.worktrees/<repo>/<slug> -b <branch> (slug is the branch name with / replaced by -). One worktree per task.
  2. Work entirely inside the worktree. Commit there directly, conventional format, staging only the files you changed.
  3. When the branch is done: run the repo's gates in the worktree, commit, then send the weaver a ready message over SendMessage. It names three fields the weaver reads: files changed, gates run (command and last line), and commit range. When the owner is a subagent, belt's ledger also records its stop. With no weaver session to address, report ready to the user instead. Do not integrate the branch yourself.
  4. Stop. The weaver owns the branch from here; your worktree disappears after the branch lands.

Weaver (the one session that integrates)

  1. Survey: read the ready messages that reached you and the repo's belt-ledger entries, then git worktree list --porcelain from the canonical checkout, and classify each worktree per loom.md: in flight, ready, abandoned, or integrated. A ready message is a claim. The proof is git: git log origin/main..<branch> lists the claimed commits and git -C <worktree> status --porcelain is empty. Check integrated before ready: the branch has at least one commit beyond main, and git merge-tree --write-tree origin/main <branch> prints the tree id git rev-parse 'origin/main^{tree}' prints. A squash-merged branch passes it while its commits still read as ahead. When main has changed the branch's lines since, that check conflicts; loom.md walks main's first-parent commits for the squash instead. A clean worktree with no commits beyond main is not integrated: it is a fresh claim or a fast-forward leftover, and git cannot tell them apart. Report it. No worktrees and no worktree-agent-* branches: say so and stop.
  2. For each ready branch, in order: rebase it onto the default branch tip in its own worktree, re-run the gates, then land it by repo policy. Push + PR for PR-only repos, fast-forward merge for direct-main repos. A rebase conflict hands the branch back to its owner; it is not yours to resolve.
  3. After a branch lands, and for every worktree the survey found integrated: remove its worktree and delete the branch per loom.md Teardown, with the proof printed above the delete. A clean worktree with no commits beyond main goes only on its owner's ready message or the user's go-ahead. Then update the canonical checkout.
  4. Sweep: list the worktree-agent-* branches and .claude/worktrees/ entries the Agent tool left behind, per loom.md, and offer those with nothing beyond main or integrated. Remove them only on the user's explicit go-ahead.
  5. Report one line per worktree: branch, state, and what happened or what blocks it. Add the sweep listing.

Rules

  • The canonical checkout stays on the default branch while the loom is active; nobody edits files there. Sessions work in worktrees only.
  • Never touch another session's worktree: no commits, no cleanup, no conflict resolution. Abandoned worktrees are reported to the user, never removed on your own call.
  • Never push the default branch on PR-only repos; on direct-main repos only the weaver's fast-forward integration touches it.
  • Commit messages follow conventional-commit format and carry no attribution trailers.
  • Branch deletion is -d once the branch is integrated. -D only when -d refuses a squash-merged branch, and only after the merge-tree proof printed equal tree ids on the lines above it. The proof needs git merge-tree --write-tree, so git 2.38 or later; on an older git, keep the branch and report it. Never -D in any other case.

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.