build-loop
Skill0 starsChanged 6 months agoMITView on GitHub
Router/dispatcher for the Semi-Autonomous Build System — runs lifecycle actions on a project's build loop
3 other projects use a version of this.
Adopted by
Most recently taken up by
- sophonfinance-wq/finance-automation-portfoliotheir own version, first seen Nov 1, 2026
- Aznatkoiny/plugin-forgetheir own version, first seen Oct 20, 2026
- justEstif/pi-shelftheir own version, first seen Oct 13, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- sophonfinance-wq/finance-automation-portfolio★ 16same name
- Aznatkoiny/plugin-forge★ 1same name
- justEstif/pi-shelf★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-loop-initSkill
- build-loop-iterateSkill
- frontend-designSkill
- handle-pr-reviewSkill
- orchestrateSkill
- phase-goal-reviewSkill
- phase-retroSkill
- regression-detectSkill
- review-prSkill
- spec-authorSkill
- test-gateSkill
- verify-gateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
31 rules. 0 are common, 7 are distinctive, and 24 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Run one iteration of the build loop, or perform a lifecycle action on a project's build loop.
- Distinctive: line 23
All file reads, writes, edits, and shell commands MUST be confined to the resolved project root, except compounding fixes approved during …
- Distinctive: line 32
Before any file write, edit, or shell write-redirect, run this check against the target path.
- Very specific: line 35
If the target starts with PROJECT_ROOT -> allowed.
- Very specific: line 36
If the target matches any path in the compounding fix allowlist -> allowed, but only during phase-retro compounding fix application.
- Very specific: line 37
If the target is the project's AGENTS.md at PROJECT_ROOT/AGENTS.md -> always allowed (project-level).
- Very specific: line 38
If the target is the workspace root AGENTS.md (outside PROJECT_ROOT) -> always rejected.
- Very specific: line 45
Before any mutating action (init, start, iterate, resume, abort, skip), check for docs/plan/.build-loop.lock.
- Very specific: line 48
On entry: Create the lock file with: session_id (unique per invocation), timestamp, action, phase (current phase name from progress.yaml, …
- Very specific: line 57
If project is provided and is an absolute path, use it directly.
- Very specific: line 58
If project is provided and is relative, resolve it against the current working directory.
- Very specific: line 59
If project is omitted: check if cwd contains a project-level AGENTS.md.
- Distinctive: line 60
If the directory does not exist:
- Very specific: line 63
If the operator confirms (or says "yes", "ok", "proceed", etc.), create the directory with mkdir -p <resolved-path>.
- Very specific: line 64
If the operator provides an alternative path, resolve that path (absolute as-is, relative against cwd), then create with mkdir -p …
- Very specific: line 65
If action is NOT init: stop and report "Project directory <path> does not exist.
- Very specific: line 76
If a phase is started without a spec-author-produced specification, the build loop still works, but the agent must write observable …
- Distinctive: line 108
Every criterion must be mechanically verifiable — not "works well" but "POST /api/x returns 201 with { id }".
- Very specific: line 109
Every criterion must be tagged with the story ID it satisfies (e.g., [US-XX]).
- Very specific: line 120
init: Read ${CLAUDE_PLUGIN_ROOT}/skills/build-loop-init/SKILL.md and follow it. - Very specific: line 130
Read progress.yaml. Verify status is paused.
- Very specific: line 140
Update progress.yaml: set status: running.
- Very specific: line 144
Note: If operator added a quality check suppression while paused, they should also pass reset_fails=true to avoid the circuit breaker …
- Very specific: line 152
Read progress.yaml. Verify status is not idle.
- Very specific: line 155
Run Phase Reconciliation Gate (defined in ${CLAUDE_PLUGIN_ROOT}/skills/build-loop-iterate/SKILL.md) on whatever was actually shipped …
- Distinctive: line 166
Read-only snapshot. No file changes.
- Very specific: line 168
Read progress.yaml, phase-goal.md, and tail of log/<phase>.yaml.
- Very specific: line 180
All commits use conventional format: feat:, fix:, chore:, docs:, test:, refactor:.
- Very specific: line 181
Story commits: use scoped format: feat(US-XX): complete <story title>.
- Distinctive: line 182
Never commit broken code (failing verify or golden principles).
- Very specific: line 185
If a task description in next-task is unclear, investigate (Branch B) to clarify before executing.
“Common” is measured: kept by at least 6 in 10 of the 3 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.
Files
<!-- version: 13 -->Run one iteration of the build loop, or perform a lifecycle action on a project's build loop.
Parameters
project— path to the project root (absolute, or relative to cwd). If omitted, inferred from cwd.action— one of:iterate(default),init,start,resume,skip,status,abortphase— phase name, required forstartgoal— phase goal text, optional forstart(if omitted, agent writes it after investigating)reset_fails— iftrue, resetconsecutive_failsto 0 (optional, only forresume)
CRITICAL: Scope restriction
All file reads, writes, edits, and shell commands MUST be confined to the resolved project root, except compounding fixes approved during phase-retro, which may target workspace-level paths listed in the allowlist below. Refuse writes outside project root AND outside the allowlist.
Compounding fix allowlist (workspace-level paths):
${CLAUDE_PLUGIN_ROOT}/skills/*/SKILL.md
Note on LEARNINGS.md: Compounding fixes that add new learnings go to the project-local docs/plan/LEARNINGS.md (created on first write if it doesn't exist). The plugin does not ship a baseline learnings file — each project accumulates its own. Skills that read learnings (phase-goal-review, spec-author) read the project-local file when present and skip gracefully if absent. Skills that write learnings (phase-retro) write only to the project-local file.
Scope-check procedure
Before any file write, edit, or shell write-redirect, run this check against the target path. This procedure is reusable — phase-retro references it for compounding fix application.
- Resolve the target to an absolute path.
- If the target starts with
PROJECT_ROOT-> allowed. - If the target matches any path in the compounding fix allowlist -> allowed, but only during phase-retro compounding fix application. During normal
iterateexecution, onlyPROJECT_ROOTpaths are allowed. - If the target is the project's
AGENTS.mdatPROJECT_ROOT/AGENTS.md-> always allowed (project-level). - If the target is the workspace root
AGENTS.md(outsidePROJECT_ROOT) -> always rejected. The root charter is immutable; no agent action may modify it. - Otherwise -> reject. Log as
fail — scope violation: <target path>. Queue a fix task to correct the path.
Concurrency guard
Before any mutating action (init, start, iterate, resume, abort, skip), check for docs/plan/.build-loop.lock.
- If lock exists: Read its content (session ID, timestamp, action, phase). If the lock is stale (>30 minutes old), warn: "Stale lock from session {session_id} (action: {action}, phase: {phase}, since {timestamp}). Delete
docs/plan/.build-loop.lockand retry." Offer to break it. If fresh, report "Build loop is locked by session {session_id} (action: {action}, phase: {phase}, since {timestamp})" and stop. - On entry: Create the lock file with:
session_id(unique per invocation),timestamp,action,phase(current phase name from progress.yaml, ornullforinit). - On exit (success or failure): Remove the lock file.
- The lock file should never be committed — add
.build-loop.lockto.gitignoreduringinitGate 7. - Locks are scoped to the project — different projects can run concurrently.
Resolve project root
- If
projectis provided and is an absolute path, use it directly. - If
projectis provided and is relative, resolve it against the current working directory. - If
projectis omitted: check if cwd contains a project-levelAGENTS.md. If yes, use cwd. If cwd has noAGENTS.md, error with "specify project=". - If the directory does not exist:
- If action is
init: The resolved path is the proposed project directory. Before creating it:- Present the resolved path to the operator: "Project will be created at:
<resolved-path>. Confirm, or provide an alternative path." - If the operator confirms (or says "yes", "ok", "proceed", etc.), create the directory with
mkdir -p <resolved-path>. Report "Created project directory at<resolved-path>." - If the operator provides an alternative path, resolve that path (absolute as-is, relative against cwd), then create with
mkdir -p <alternative-path>. Report "Created project directory at<alternative-path>." Use the alternative path as PROJECT_ROOT going forward.
- Present the resolved path to the operator: "Project will be created at:
- If action is NOT
init: stop and report "Project directory<path>does not exist. Runaction=initfirst."
- If action is
- Set
PROJECT_ROOTto the resolved (or operator-overridden) path.
Companion tool: spec-author
This build loop is one half of a delivery pair. The other half is the spec-author skill, which produces phase specifications with observable done-when criteria.
The build loop consumes what the spec-author produces. Spec-author (v4+) writes per-phase spec files to docs/product/phases/<phase-name>.md and adds a summary row to the PRD index. The build loop reads the per-phase file and transposes its done-when criteria into docs/plan/phase-goal.md using the Phase Specification Format (see below).
If a phase is started without a spec-author-produced specification, the build loop still works, but the agent must write observable done-when criteria during the start action before any execution begins.
Phase Specification Format (shared contract)
This is the format written to docs/plan/phase-goal.md. The spec-author produces it; the build loop verifies against it.
## Phase goal
<Narrative description of the phase objective.>
### Dependencies (optional)
- <phase-name that must be archived before this phase can start>
### Stories in scope
- US-XX — Story title
- US-YY — Story title
### Done-when (observable)
- [ ] Criterion 1 [US-XX] (mechanically verifiable — a specific file exists, endpoint returns a shape, test covers a case)
- [ ] Criterion 2 [US-XX]
- [ ] Criterion 3 [US-YY]
- ...
### Golden principles (phase-relevant)
- Principle text (extracted from AGENTS.md, relevant to this phase's work)
- ...Rules for done-when criteria:
- Every criterion must be mechanically verifiable — not "works well" but "POST /api/x returns 201 with { id }".
- Every criterion must be tagged with the story ID it satisfies (e.g.,
[US-XX]). This tag is how the build loop tracks per-story completion and produces story commits. Orphan criteria (not tied to a story) are tagged[phase]and need explicit justification. - Story tags
[US-XX]must appear at the end of the criterion text, before any parenthetical example. Example:- [ ] POST /api/x returns 201 with { id } [US-01] (curl or test output). - Minimum 3 criteria per phase.
- The build loop checks these literally during phase completion. If a criterion can't be checked by reading files, running tests, or inspecting output, it's not observable enough.
Action dispatch
Based on the action parameter, read the corresponding sub-skill and follow it:
init: Read${CLAUDE_PLUGIN_ROOT}/skills/build-loop-init/SKILL.mdand follow it. Or invoke/sabs:build-loop-init.start,iterate: Read${CLAUDE_PLUGIN_ROOT}/skills/build-loop-iterate/SKILL.mdand follow it. Or invoke/sabs:build-loop-iterate.skip,resume,abort,status: Handled below in this file.
Action: skip
Skips the current stuck task and re-investigates.
- Read
progress.yaml. Verifystatusispaused. - Set
next_task: null,consecutive_fails: 0,status: running. - Commit:
chore: skip stuck task, re-investigating - Enter the continuous iterate loop (read
${CLAUDE_PLUGIN_ROOT}/skills/build-loop-iterate/SKILL.md, Action:iterate, Step 1).
Action: resume
- Read
progress.yaml. Verifystatusispaused. - Update
progress.yaml: setstatus: running. Ifreset_fails=trueis passed, also setconsecutive_fails: 0. - Commit:
chore: resume build loop - Enter the continuous iterate loop (read
${CLAUDE_PLUGIN_ROOT}/skills/build-loop-iterate/SKILL.md, Action:iterate, Step 1).
Note: If operator added a quality check suppression while paused, they should also pass reset_fails=true to avoid the circuit breaker firing prematurely on the next failure.
Action: abort
Abandons the current phase without completing it. Preserves all PRD and spec content — only the build branch work is abandoned.
- Read
progress.yaml. Verifystatusis notidle. - Archive: move
log/<phase>.yamltoarchive/<phase>.yamlwith astatus: abortedfield added. - Archive
phase-goal.mdcontent toarchive/<phase>.retro.mdas context for future retro analysis. - Run Phase Reconciliation Gate (defined in
${CLAUDE_PLUGIN_ROOT}/skills/build-loop-iterate/SKILL.md) on whatever was actually shipped (partial reconciliation — only reconcile what was committed). Do NOT tag incomplete stories as[Shipped]in the PRD — only tag stories incompleted_stories. Skip user documentation reconciliation for stories that weren't completed. - Reset
progress.yamlto idle state (phase: null,status: idle,phase_complete: false,review_stage: null,review_complete: false,retro_complete: false,pr_number: null,consecutive_fails: 0,completed_stories: []). - Commit:
chore: abort <phase> phase - Report: tasks completed, stories completed (if any), reason for abort. Note that PRD stories remain in their current state — nothing is removed from the PRD.
The build branch is NOT reverted. The operator decides whether to cherry-pick partial work, revert, or start fresh.
Action: status
Read-only snapshot. No file changes.
Read progress.yaml, phase-goal.md, and tail of log/<phase>.yaml. Report: phase, status, task number, phase_complete, last result, next task, done-when checklist with met/unmet markers, last 5 log entries.
Layer rules enforcement
During all code changes (Branch A in ${CLAUDE_PLUGIN_ROOT}/skills/build-loop-iterate/SKILL.md), if AGENTS.md contains layer rules, read them before execution and verify the planned change doesn't violate any rule. If it would, queue a refactoring task instead.
Conventions
- All commits use conventional format:
feat:,fix:,chore:,docs:,test:,refactor:. - Story commits use scoped format:
feat(US-XX): complete <story title>. These are milestone markers in git history — one per user story, produced by the Story Completion Gate. - Never commit broken code (failing verify or golden principles). Only commit progress updates on failure.
- One concern per iteration.
- Tasks in
next-taskare prefixed with their target story ID:"[US-XX] <task description>". - If a task description in
next-taskis unclear, investigate (Branch B) to clarify before executing. - Timestamps via:
date -u +"%Y-%m-%dT%H:%M:%SZ"
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.

