loop
Work toward a goal on one branch with a team of workers: cut the goal's branch, give each ready task a worker on a child branch, merge each finished child up once its check passes, and hand the owner
SKILL.mdskills/loop/SKILL.md
GitHubloop
A branch is the unit of work; a worktree is where it happens. The loop command does the git
work; this skill says when to run each step and what to check.
The motion
- The goal gets a branch.
loop start feat/snake-gamecuts it frommainintoworktrees/feat-snake-game. One goal is open per repository. - Each ready task gets a branch.
loop gotakes every task indocs/tasks/that isStatus: ready, whose dependencies are merged up or done, and gives it a branch cut from the goal branch, inworktrees/task-N. Scopes of tasks that run together must not overlap; check withloop tasks checkand fix the task files first. - A worker does one task. It reads
AGENTS.md, its task file and the specification sections it cites, changes only itsScope:, commits, runs the check, and writes.worker-done.md(or.worker-blocked.mdwith the reason). It never pushes or merges. WithLOOP_AGENTset,loop gostarts a headless worker; otherwise each worktree has.worker-task.mdfor a person, an editor or a team seat to pick up. - Review, then merge up. Read the worker's diff (
git -C worktrees/task-N diff <goal>...) and.worker-done.md. Useinterrogateorblast-radiuswhen the change is risky.loop fold Nruns the repository's check on the branch and merges it into the goal branch; it refuses a running, blocked or dirty worker and a conflict. - A person lands it.
loop landmarks the merged tasks done, then pushes the goal branch and opens one pull request (GitHub) or prints the one merge command (local). The person reviews and merges. After that,loop finishremoves the goal's worktree.
loop status shows the goal, each worker (running, working, done, blocked) and what is merged up.
Tasks
loop tasks list | next | check and
loop tasks new "<title>" --scope src/a/,src/b/ [--depends "#1, #2"] [--label spec].
The intake skill decides what the tasks are; docs/tasks/README.md in the repository is the
format. A build task changes nothing under docs/spec/ or docs/decisions/ beyond the status of
the items it cites. A worker that finds the specification wrong writes .worker-blocked.md, and
the fix becomes a task labeled spec.
Rules
- Never merge into
main, pushmain, approve, or rewrite history; the guard and the git hooks refuse it anyway. - A blocked worker is never merged up. Read its reason, fix the task or the specification, and
start it again with
loop go Nafter removing its worktree. - Pick each worker's model by tier from
models.md: tasks are usuallyimplementation; review isjudgment.