Build Features Autonomously
You run an unattended, continuous delivery loop: take work from the GitHub
issue backlog, ship it through to a reviewed PR, then either act on review
feedback or find the next thing to build — and repeat until there is genuinely
nothing left to do or you hit a real blocker.
You do not do the engineering yourself. The orchestrate skill is the
engine for every substantive phase — understanding the codebase, implementing,
testing, reviewing, simplifying, and reviewing the PR. Invoke the orchestrate
skill at the start of each of those phases and let it fan out headless workers.
Your job here is to drive the outer loop: sync, select, sequence the phases,
keep state on GitHub, and decide when to stop.
Operating principles
- Fully autonomous — never ask the human anything. If a question or
ambiguity arises, resolve it yourself, or dispatch a worker (via orchestrate)
to investigate and decide. Make reasonable, conservative assumptions and keep
moving. The whole point is that this runs unattended.
- Orchestrate is the engine. Each phase below that says "via orchestrate"
means: invoke the
orchestrate skill and have it decompose and dispatch
headless CLI workers. Don't silently substitute doing the work inline — the
user chose fan-out deliberately.
- GitHub is the source of truth. The issue backlog is the work queue and the
PR is the deliverable. Keep both updated as you go (comments, links, labels) so
the run is fully auditable after the fact. Do not maintain side files like
.unfinished_features/index.md.
- Honest reporting and honest state. Never mark an issue done, claim CI
passed, or claim a review is clean without reading the actual evidence. A green
process exit is not the same as a correct result.
- Preserve the user's work. Never discard uncommitted changes or force-push
over history you didn't create. See Phase 0.
- Document what you ship. Every PR and every non-trivial code change carries
clear comments and a description explaining the why, not just the what.
Wiring: one run dir per issue cycle
All phases of one issue share one orchestrate run dir, so later phases can
resume earlier phases' workers and the whole cycle is auditable in one place:
O=~/.claude/skills/orchestrate/scripts/orchestrator.py
RUN_DIR=".orchestrate/runs/issue-<number>" # one per issue cycle
mkdir -p "$RUN_DIR/tasks"
- Task ids carry the phase:
understand-<area>, impl-<part>,
test-<suite>, review-diff, verify-acceptance, simplify-diff,
pr-review-<n>. python3 "$O" status "$RUN_DIR" then reads as a timeline of
the cycle.
- Fix = resume, not respawn. When tests or reviews fail, resume the worker
that wrote the code:
python3 "$O" dispatch "$RUN_DIR" impl-parser-fix2 --resume-from impl-parser - <<'EOF' .... It works across phases because the
run dir is shared.
- Verify = fresh. Verifiers, reviewers, and skeptics get new task ids with
no
--resume-from — independence is the point.
- The run dir is loop-internal state only; GitHub stays the source of truth
(see operating principles). Don't commit
.orchestrate/ (add to
.git/info/exclude if the repo doesn't ignore it).
The loop
0. SYNC recover any in-flight cycle, clean worktree safely, sync main
1. SELECT fetch open issues; pick one. If none, jump to MINE (phase 9)
2. UNDERSTAND orchestrate: explore the codebase + the issue
3. BRANCH create a feature branch, comment "starting" on the issue
4. IMPLEMENT orchestrate: resolve the issue in phases / parallel
5. TEST+REVIEW orchestrate: real UI/API/integration tests + code review
6. SIMPLIFY orchestrate: verify correctness, simplify the diff
7. SHIP push branch, open PR, link issue, ensure CI/CD passes
8. PR REVIEW orchestrate: review the PR, leave a comment, act on feedback
9. MINE (only when backlog empty) find unfinished work, file issues
→ back to SYNC for the next issue
Each numbered phase is detailed below. After Phase 8 finishes for one issue,
return to Phase 0 and start the next. Keep looping until a stop condition
(see the end of this file) is met.
Phase 0 — Sync the repository
Always start a cycle from a clean, current main — but first, check whether a
previous cycle was interrupted and pick it up instead of redoing it:
- Look for in-flight state from this loop:
gh pr list --author "@me" --state open --json number,headRefName,title
git branch --list 'feat/*' 'fix/*'
ls .orchestrate/runs/ 2>/dev/null # issue-<n> dirs from prior cycles
- If an open PR from this loop exists → resume at Phase 7 step 4 (watch CI)
or Phase 8 (review), whichever it hadn't finished. If a feature branch
exists with commits but no PR → check out that branch, re-run Phase 5
validation, and continue from there. An issue with a "starting" comment but
no branch → just restart that issue from Phase 2. Use the branch name /
run-dir name to recover the issue number, and
python3 "$O" status .orchestrate/runs/issue-<n> to see how far the workers
got. When in doubt, re-validate rather than trust a stale state.
Then sync:
- Inspect the worktree:
git status --short --branch.
- If there is uncommitted or unmerged work, preserve it before switching —
never discard user changes. Pick the safest option for the state you find:
finish the in-progress operation (merge/rebase), create a safety branch, make
an explicit safety commit of your own autonomous work, or
git stash push --include-untracked for clean stashable changes.
- Switch to main:
git switch main.
- Pull latest:
git pull --ff-only origin main.
- If
main doesn't exist locally: git fetch origin main:main, then switch and
pull.
- Only proceed once
main is checked out and up to date.
Phase 1 — Select an issue
Treat open GitHub issues as the work queue.
- Fetch the full open backlog before doing anything else. Prefer the GitHub MCP
integration if available; otherwise:
gh issue list --state open --limit 200 \
--json number,title,body,labels,assignees,url,state,createdAt
- Filter to issues that represent genuine unfinished work (skip ones already
assigned to a human and clearly in progress, unless told otherwise).
- If the backlog is empty → go to Phase 9 (Mine) to generate work, then come
back here.
- Otherwise pick one issue. Prefer: explicitly prioritized labels (e.g.
priority, P0/P1), then bugs over features, then smaller well-specified
issues that can ship cleanly, then oldest. Pick something you can take all the
way to a PR in one cycle.
- Note the issue number, title, and acceptance criteria — you'll thread these
through every later phase.
Phase 2 — Understand (via orchestrate)
Invoke the orchestrate skill to build a precise understanding before
touching code. Have it fan out workers to:
- Map the parts of the codebase the issue touches (entry points, modules, data
flow, existing patterns and helpers to reuse).
- Restate the issue as concrete, testable acceptance criteria.
- Identify risks, edge cases, existing tests, and the right validation commands.
Dispatch these as one batch into the cycle's run dir (task ids
understand-<area>). Collect the workers' findings (python3 "$O" output ...)
into a short implementation plan — what changes, where, in what order, how
it'll be validated — written to $RUN_DIR/plan.md. This plan drives Phase 4.
Phase 3 — Branch
- Create a descriptively named branch off the up-to-date
main, e.g.
git switch -c feat/<issue-number>-<short-slug> (use fix/ for bugs).
- Comment on the issue that work has started, including the branch name, so the
backlog reflects in-progress state.
Phase 4 — Implement (via orchestrate)
Invoke the orchestrate skill to resolve the issue against the Phase 2 plan.
- Implement in stages (task ids
impl-<part>, same run dir); run independent
parts in parallel, dependent ones as ordered stages. Workers must run with
--cwd set to the repo on the feature branch.
- Parallel implementers share one working tree — only parallelize parts
that touch disjoint files. If parts overlap (same modules, same config,
generated files), run them as sequential stages instead. Research/read-only
workers can always run in parallel.
- Reuse existing helpers, shared modules, and established patterns — check before
adding new abstractions.
- Add clear comments for non-obvious logic explaining why, matching the
surrounding code's style and density.
- Keep the change scoped to the issue; don't fold in unrelated refactors.
Phase 5 — Test & review (via orchestrate)
Invoke the orchestrate skill to validate the change for real.
- Run real tests — UI (Playwright CLI where the project supports it), API,
and integration. No mock-only or "it should work" runs.
- Run the repo's own quality gates (lint, typecheck, targeted tests, and the
full gate when contracts/build/scripts changed). Read the project's
CLAUDE.md / AGENTS.md for the exact commands and honor them.
- Run a code review pass over the diff for correctness bugs.
- If anything fails: fix it (resume the implementing worker via
--resume-from <its task id> rather than starting cold) and re-validate. Don't advance
until tests genuinely pass — and you've read the output confirming it.
Phase 6 — Verify & simplify (via orchestrate)
Invoke the orchestrate skill to harden and tighten the diff.
- Independently verify the change actually satisfies the acceptance criteria
(use a fresh verifier worker — a worker checking its own work isn't an
independent check).
- Simplify: remove dead code, collapse duplication, prefer existing helpers,
drop needless complexity — quality only, without reopening behavior.
- Re-run the relevant validation after simplifying so cleanup didn't regress
anything.
Phase 7 — Ship the PR
- Ensure the working tree reflects the validated state, with clear,
imperative, sentence-case commit messages describing the change.
- Push the branch:
git push -u origin <branch>.
- Open the PR with
gh pr create, including:
- A summary of what changed and the why behind the approach.
- Validation performed (which tests/gates ran and their result).
Closes #<issue-number> to link and auto-close the issue on merge.
- Ensure CI/CD passes. Don't treat opening the PR as done — watch the
checks:
gh pr checks <pr-number> --watch
If a check fails, read the logs, fix the code/tests on the branch, push, and
re-watch. Repeat until checks are green. If a check is genuinely
infrastructure-flaky (not your change), note that in the PR.
- Comment on the issue with the PR link, validation results, and any remaining
risks.
Phase 8 — Review the PR & act on feedback (via orchestrate)
After the PR is open and CI is green, invoke the orchestrate skill to run a
review of the PR itself, then act on it.
- Have orchestrate dispatch reviewer worker(s) over the PR diff looking for
correctness bugs, missed acceptance criteria, security issues, and obvious
simplifications. For confidence on risky changes, use multiple independent
reviewers and weigh agreement.
- Leave the review as a comment on the PR (inline review comments where the
tooling supports it, e.g.
gh pr review/gh pr comment) so the assessment is
recorded on GitHub.
- Triage the findings:
- Major bugs or unresolved issues found → fix them on the branch and
push the changes directly to the PR (it's already your branch). Re-watch
CI, then re-review until it's clean. Resume the implementing worker for the
fixes rather than starting cold.
- No major issues → the issue is shipped. Leave a final confirming comment,
then continue the loop.
A PR is only "done" for the purpose of this loop when CI is green and the
review pass found no major bugs or pending issues.
Phase 9 — Mine the codebase for new work (only when the backlog is empty)
Reached only when Phase 1 found no open issues. The goal is to refill the queue
with real, well-scoped work, then resume the loop.
- Invoke the
orchestrate skill to explore the codebase comprehensively and
identify unimplemented features, stubs, TODO/FIXME markers, broken or missing
flows, and gaps against the product's evident intent (README, docs, configs,
half-built UI). Fan out workers across areas so coverage is broad.
- Before filing anything, fetch the current open issues again and compare to
avoid duplicates by title, scope, and user-visible behavior.
- File GitHub issues for each genuine gap:
- Group related gaps into a single issue when they form one coherent unit
of work.
- Split problems that are unrelated, or too large to finish in one cycle,
into multiple sequential issues sized to ship cleanly one at a time.
- Each issue body: goal, expected behavior, acceptance criteria, likely
touched areas, and validation notes. Add labels the repo already uses.
- If an existing issue turns out to be already implemented, comment with the
validation evidence and close it.
- Refresh the backlog, then return to Phase 1 and address the first new
issue — implement, test, review, simplify, push, PR, ensure CI passes, then
run the Phase 8 PR review and act on its feedback. The loop continues exactly
as before.
Stop conditions
Keep looping until one of these is true, then report:
- Backlog empty and mining finds nothing new for two consecutive rounds —
the project is genuinely complete for now.
- A hard blocker you cannot resolve autonomously: missing credentials/auth
for the worker CLI or
gh, a repository you lack push access to, a failing
gate that requires a human decision (e.g. an intentional contract break), or
repeated worker failures after retries.
- Repeated CI or review failures on the same PR after 2–3 honest fix attempts
— surface it rather than thrashing.
When you stop, report plainly: issues shipped (with PR links), PRs awaiting human
merge, anything skipped and why, and any blocker that needs the human. Be
specific and honest — the value of an unattended loop is a trustworthy summary at
the end.
Guardrails
- One issue in flight at a time. Finish a cycle (through Phase 8) before
starting the next, so each PR stays clean and reviewable.
- Don't merge unless told to. Open PRs and get them green and reviewed;
leave the merge decision to the human unless the user explicitly authorized
auto-merge.
- Respect the repo's rules. Read CLAUDE.md / AGENTS.md and follow its build,
test, commit, and PR conventions exactly — they override the generic commands
here.
- Never fabricate green. Read CI output and review output before claiming
either passed. If you didn't verify it, say so.
1---2name: build-features-autonomously3description: Use WHENEVER the user wants to clear a GitHub backlog, "build out the remaining features", "ship issues autonomously", "work through the issues", "keep building until there's nothing left", run an unattended dev loop, or otherwise hand off feature/bug work to run end-to-end without supervision. Trigger even if the user doesn't say "autonomously" — "knock out the open issues", "finish the app", "just keep shipping", "open PRs for the backlog" all apply.4---56# Build Features Autonomously78You run an **unattended, continuous delivery loop**: take work from the GitHub9issue backlog, ship it through to a reviewed PR, then either act on review10feedback or find the next thing to build — and repeat until there is genuinely11nothing left to do or you hit a real blocker.1213You do **not** do the engineering yourself. The **`orchestrate` skill is the14engine** for every substantive phase — understanding the codebase, implementing,15testing, reviewing, simplifying, and reviewing the PR. Invoke the `orchestrate`16skill at the start of each of those phases and let it fan out headless workers.17Your job here is to drive the *outer* loop: sync, select, sequence the phases,18keep state on GitHub, and decide when to stop.1920## Operating principles2122- **Fully autonomous — never ask the human anything.** If a question or23 ambiguity arises, resolve it yourself, or dispatch a worker (via orchestrate)24 to investigate and decide. Make reasonable, conservative assumptions and keep25 moving. The whole point is that this runs unattended.26- **Orchestrate is the engine.** Each phase below that says "via orchestrate"27 means: invoke the `orchestrate` skill and have it decompose and dispatch28 headless CLI workers. Don't silently substitute doing the work inline — the29 user chose fan-out deliberately.30- **GitHub is the source of truth.** The issue backlog is the work queue and the31 PR is the deliverable. Keep both updated as you go (comments, links, labels) so32 the run is fully auditable after the fact. Do not maintain side files like33 `.unfinished_features/index.md`.34- **Honest reporting and honest state.** Never mark an issue done, claim CI35 passed, or claim a review is clean without reading the actual evidence. A green36 process exit is not the same as a correct result.37- **Preserve the user's work.** Never discard uncommitted changes or force-push38 over history you didn't create. See Phase 0.39- **Document what you ship.** Every PR and every non-trivial code change carries40 clear comments and a description explaining the *why*, not just the *what*.4142## Wiring: one run dir per issue cycle4344All phases of one issue share **one orchestrate run dir**, so later phases can45resume earlier phases' workers and the whole cycle is auditable in one place:4647```bash48O=~/.claude/skills/orchestrate/scripts/orchestrator.py49RUN_DIR=".orchestrate/runs/issue-<number>" # one per issue cycle50mkdir -p "$RUN_DIR/tasks"51```5253- **Task ids carry the phase**: `understand-<area>`, `impl-<part>`,54 `test-<suite>`, `review-diff`, `verify-acceptance`, `simplify-diff`,55 `pr-review-<n>`. `python3 "$O" status "$RUN_DIR"` then reads as a timeline of56 the cycle.57- **Fix = resume, not respawn.** When tests or reviews fail, resume the worker58 that wrote the code: `python3 "$O" dispatch "$RUN_DIR" impl-parser-fix259 --resume-from impl-parser - <<'EOF' ...`. It works across phases because the60 run dir is shared.61- **Verify = fresh.** Verifiers, reviewers, and skeptics get new task ids with62 no `--resume-from` — independence is the point.63- The run dir is loop-internal state only; GitHub stays the source of truth64 (see operating principles). Don't commit `.orchestrate/` (add to65 `.git/info/exclude` if the repo doesn't ignore it).6667## The loop6869```700. SYNC recover any in-flight cycle, clean worktree safely, sync main711. SELECT fetch open issues; pick one. If none, jump to MINE (phase 9)722. UNDERSTAND orchestrate: explore the codebase + the issue733. BRANCH create a feature branch, comment "starting" on the issue744. IMPLEMENT orchestrate: resolve the issue in phases / parallel755. TEST+REVIEW orchestrate: real UI/API/integration tests + code review766. SIMPLIFY orchestrate: verify correctness, simplify the diff777. SHIP push branch, open PR, link issue, ensure CI/CD passes788. PR REVIEW orchestrate: review the PR, leave a comment, act on feedback799. MINE (only when backlog empty) find unfinished work, file issues80→ back to SYNC for the next issue81```8283Each numbered phase is detailed below. After Phase 8 finishes for one issue,84return to Phase 0 and start the next. Keep looping until a **stop condition**85(see the end of this file) is met.8687---8889## Phase 0 — Sync the repository9091Always start a cycle from a clean, current `main` — but first, check whether a92**previous cycle was interrupted** and pick it up instead of redoing it:93941. Look for in-flight state from this loop:95 ```bash96 gh pr list --author "@me" --state open --json number,headRefName,title97 git branch --list 'feat/*' 'fix/*'98 ls .orchestrate/runs/ 2>/dev/null # issue-<n> dirs from prior cycles99 ```1002. If an open PR from this loop exists → resume at **Phase 7 step 4** (watch CI)101 or **Phase 8** (review), whichever it hadn't finished. If a feature branch102 exists with commits but no PR → check out that branch, re-run **Phase 5**103 validation, and continue from there. An issue with a "starting" comment but104 no branch → just restart that issue from Phase 2. Use the branch name /105 run-dir name to recover the issue number, and106 `python3 "$O" status .orchestrate/runs/issue-<n>` to see how far the workers107 got. When in doubt, re-validate rather than trust a stale state.108109Then sync:1101111. Inspect the worktree: `git status --short --branch`.1122. If there is uncommitted or unmerged work, **preserve it before switching** —113 never discard user changes. Pick the safest option for the state you find:114 finish the in-progress operation (merge/rebase), create a safety branch, make115 an explicit safety commit of your own autonomous work, or116 `git stash push --include-untracked` for clean stashable changes.1173. Switch to main: `git switch main`.1184. Pull latest: `git pull --ff-only origin main`.1195. If `main` doesn't exist locally: `git fetch origin main:main`, then switch and120 pull.1216. Only proceed once `main` is checked out and up to date.122123---124125## Phase 1 — Select an issue126127Treat open GitHub issues as the work queue.1281291. Fetch the full open backlog before doing anything else. Prefer the GitHub MCP130 integration if available; otherwise:131 ```bash132 gh issue list --state open --limit 200 \133 --json number,title,body,labels,assignees,url,state,createdAt134 ```1352. Filter to issues that represent genuine unfinished work (skip ones already136 assigned to a human and clearly in progress, unless told otherwise).1373. **If the backlog is empty → go to Phase 9 (Mine)** to generate work, then come138 back here.1394. Otherwise pick **one** issue. Prefer: explicitly prioritized labels (e.g.140 `priority`, `P0`/`P1`), then bugs over features, then smaller well-specified141 issues that can ship cleanly, then oldest. Pick something you can take all the142 way to a PR in one cycle.1435. Note the issue number, title, and acceptance criteria — you'll thread these144 through every later phase.145146---147148## Phase 2 — Understand (via orchestrate)149150Invoke the **`orchestrate` skill** to build a precise understanding before151touching code. Have it fan out workers to:152- Map the parts of the codebase the issue touches (entry points, modules, data153 flow, existing patterns and helpers to reuse).154- Restate the issue as concrete, testable acceptance criteria.155- Identify risks, edge cases, existing tests, and the right validation commands.156157Dispatch these as one batch into the cycle's run dir (task ids158`understand-<area>`). Collect the workers' findings (`python3 "$O" output ...`)159into a short implementation plan — what changes, where, in what order, how160it'll be validated — written to `$RUN_DIR/plan.md`. This plan drives Phase 4.161162---163164## Phase 3 — Branch1651661. Create a descriptively named branch off the up-to-date `main`, e.g.167 `git switch -c feat/<issue-number>-<short-slug>` (use `fix/` for bugs).1682. Comment on the issue that work has started, including the branch name, so the169 backlog reflects in-progress state.170171---172173## Phase 4 — Implement (via orchestrate)174175Invoke the **`orchestrate` skill** to resolve the issue against the Phase 2 plan.176- Implement in stages (task ids `impl-<part>`, same run dir); run independent177 parts in parallel, dependent ones as ordered stages. Workers must run with178 `--cwd` set to the repo on the feature branch.179- **Parallel implementers share one working tree** — only parallelize parts180 that touch disjoint files. If parts overlap (same modules, same config,181 generated files), run them as sequential stages instead. Research/read-only182 workers can always run in parallel.183- Reuse existing helpers, shared modules, and established patterns — check before184 adding new abstractions.185- Add **clear comments** for non-obvious logic explaining *why*, matching the186 surrounding code's style and density.187- Keep the change scoped to the issue; don't fold in unrelated refactors.188189---190191## Phase 5 — Test & review (via orchestrate)192193Invoke the **`orchestrate` skill** to validate the change for real.194- Run **real** tests — UI (Playwright CLI where the project supports it), API,195 and integration. No mock-only or "it should work" runs.196- Run the repo's own quality gates (lint, typecheck, targeted tests, and the197 full gate when contracts/build/scripts changed). Read the project's198 CLAUDE.md / AGENTS.md for the exact commands and honor them.199- Run a code review pass over the diff for correctness bugs.200- If anything fails: fix it (resume the implementing worker via201 `--resume-from <its task id>` rather than starting cold) and re-validate. Don't advance202 until tests genuinely pass — and you've read the output confirming it.203204---205206## Phase 6 — Verify & simplify (via orchestrate)207208Invoke the **`orchestrate` skill** to harden and tighten the diff.209- Independently verify the change actually satisfies the acceptance criteria210 (use a **fresh** verifier worker — a worker checking its own work isn't an211 independent check).212- Simplify: remove dead code, collapse duplication, prefer existing helpers,213 drop needless complexity — quality only, without reopening behavior.214- Re-run the relevant validation after simplifying so cleanup didn't regress215 anything.216217---218219## Phase 7 — Ship the PR2202211. Ensure the working tree reflects the validated state, with clear,222 imperative, sentence-case commit messages describing the change.2232. Push the branch: `git push -u origin <branch>`.2243. Open the PR with `gh pr create`, including:225 - A summary of what changed and the **why** behind the approach.226 - Validation performed (which tests/gates ran and their result).227 - `Closes #<issue-number>` to link and auto-close the issue on merge.2284. **Ensure CI/CD passes.** Don't treat opening the PR as done — watch the229 checks:230 ```bash231 gh pr checks <pr-number> --watch232 ```233 If a check fails, read the logs, fix the code/tests on the branch, push, and234 re-watch. Repeat until checks are green. If a check is genuinely235 infrastructure-flaky (not your change), note that in the PR.2365. Comment on the issue with the PR link, validation results, and any remaining237 risks.238239---240241## Phase 8 — Review the PR & act on feedback (via orchestrate)242243After the PR is open and CI is green, invoke the **`orchestrate` skill** to run a244review *of the PR itself*, then act on it.2452461. Have orchestrate dispatch reviewer worker(s) over the PR diff looking for247 correctness bugs, missed acceptance criteria, security issues, and obvious248 simplifications. For confidence on risky changes, use multiple independent249 reviewers and weigh agreement.2502. **Leave the review as a comment on the PR** (inline review comments where the251 tooling supports it, e.g. `gh pr review`/`gh pr comment`) so the assessment is252 recorded on GitHub.2533. Triage the findings:254 - **Major bugs or unresolved issues found →** fix them on the branch and255 **push the changes directly to the PR** (it's already your branch). Re-watch256 CI, then re-review until it's clean. Resume the implementing worker for the257 fixes rather than starting cold.258 - **No major issues →** the issue is shipped. Leave a final confirming comment,259 then continue the loop.260261A PR is only "done" for the purpose of this loop when CI is green **and** the262review pass found no major bugs or pending issues.263264---265266## Phase 9 — Mine the codebase for new work (only when the backlog is empty)267268Reached only when Phase 1 found no open issues. The goal is to refill the queue269with real, well-scoped work, then resume the loop.2702711. Invoke the **`orchestrate` skill** to explore the codebase comprehensively and272 identify unimplemented features, stubs, TODO/FIXME markers, broken or missing273 flows, and gaps against the product's evident intent (README, docs, configs,274 half-built UI). Fan out workers across areas so coverage is broad.2752. Before filing anything, fetch the current open issues again and compare to276 **avoid duplicates** by title, scope, and user-visible behavior.2773. File GitHub issues for each genuine gap:278 - **Group related gaps into a single issue** when they form one coherent unit279 of work.280 - **Split** problems that are unrelated, or too large to finish in one cycle,281 into **multiple sequential issues** sized to ship cleanly one at a time.282 - Each issue body: goal, expected behavior, acceptance criteria, likely283 touched areas, and validation notes. Add labels the repo already uses.2844. If an existing issue turns out to be already implemented, comment with the285 validation evidence and close it.2865. Refresh the backlog, then **return to Phase 1** and address the first new287 issue — implement, test, review, simplify, push, PR, ensure CI passes, then288 run the Phase 8 PR review and act on its feedback. The loop continues exactly289 as before.290291---292293## Stop conditions294295Keep looping until one of these is true, then report:296297- **Backlog empty and mining finds nothing new** for two consecutive rounds —298 the project is genuinely complete for now.299- **A hard blocker** you cannot resolve autonomously: missing credentials/auth300 for the worker CLI or `gh`, a repository you lack push access to, a failing301 gate that requires a human decision (e.g. an intentional contract break), or302 repeated worker failures after retries.303- **Repeated CI or review failures** on the same PR after 2–3 honest fix attempts304 — surface it rather than thrashing.305306When you stop, report plainly: issues shipped (with PR links), PRs awaiting human307merge, anything skipped and why, and any blocker that needs the human. Be308specific and honest — the value of an unattended loop is a trustworthy summary at309the end.310311---312313## Guardrails314315- **One issue in flight at a time.** Finish a cycle (through Phase 8) before316 starting the next, so each PR stays clean and reviewable.317- **Don't merge unless told to.** Open PRs and get them green and reviewed;318 leave the merge decision to the human unless the user explicitly authorized319 auto-merge.320- **Respect the repo's rules.** Read CLAUDE.md / AGENTS.md and follow its build,321 test, commit, and PR conventions exactly — they override the generic commands322 here.323- **Never fabricate green.** Read CI output and review output before claiming324 either passed. If you didn't verify it, say so.