Batch Issue Fixing Pipeline
Arguments: $ARGUMENTS — optional space-separated issue numbers to limit the batch. Empty means all open issues.
This skill encodes the full process: triage -> parallel fixes in isolated worktrees -> merge into develop -> release -> final review -> publish. Follow the phases in order. All gh commands run from the repo root (no --repo flag needed).
Phase 0 — Preflight
git fetch originand confirm the working tree is clean (git status --short). If dirty, stop and ask the user.- Compare branches:
git rev-list --left-right --count origin/main...origin/develop.- If
developis strictly behindmain(0 unique commits), fast-forward it:git push origin origin/main:develop. - If
develophas unique commits, ask the user how to proceed before branching anything.
- If
- All fix branches are created from
origin/develop.
Phase 1 — Triage
- List issues:
gh issue list --state open --limit 100 --json number,title,labels. - Read EVERY issue in scope with comments:
gh issue view <n> --comments. Comments often contain the real root cause or a maintainer-agreed approach. - Build a summary table (number, type bug/feature, one-line problem). Explicitly check for duplicates and overlapping fixes.
- Ask the user (AskUserQuestion) before starting work:
- Scope: which issues go into this batch (call out breaking changes and pure feature requests separately).
- Whether to auto-merge fix PRs into
developor leave them open for manual review. - Anything that looks external/not-a-bug (e.g. Docker Hub rate limits): propose fix / message-only / skip-and-close options.
- Decide the version bump now (semver table in CLAUDE.md) so the release phase is mechanical. The user may override.
Phase 2 — Parallel fixes (one worktree + one agent per issue)
- Create worktrees as siblings of the repo:
Usegit worktree add ../<repo-name>-worktrees/issue-<n> -b fix/issue-<n>-<slug> origin/developfix/for bugs,feat/for features (feat!commit prefix for breaking changes). - Launch one background agent per issue, all in parallel. Each agent prompt MUST include:
- Work EXCLUSIVELY in its worktree path; never touch the main checkout.
- Work fully autonomously; never wait for user input.
- Step 1: read the issue with
gh issue view <n> --commentsand the worktree's CLAUDE.md. - Step 2: invoke the Skill tool with
feature-dev:feature-devto implement. Skip interactive steps; prefer the minimal robust fix. - Step 3: commit with a conventional-commit message.
- Step 4: invoke the Skill tool with
pr-review-toolkit:review-pron the difforigin/develop...HEAD. Fix ALL critical and important findings; ignore nitpicks. Commit fixes. - Step 5:
git push -u origin <branch>and open a PR todevelopwithgh pr create --base develop. Body in plain English: summary, what changed, verification, and the lineFixes #<n>. - Constraints: do NOT modify
CHANGELOG.mdorVERSION(prevents 7-way merge conflicts; release handles both). Verification:bash -non every changed script,cp .env.example .env(gitignored, delete after) +docker compose -p localai config --quiet,node --check welcome/app.jsif touched. Docker CLI may not be on PATH — try/usr/local/bin/docker. - Known facts from the codebase report (file, line numbers, verified behavior) — give each agent everything already learned during triage.
- Push the agent to verify root causes upstream (WebFetch the upstream repo/Dockerfile/entrypoint) rather than trusting the issue's proposed fix. Issues regularly misdiagnose (wrong mount path vs stale volume; missing tool vs wrong endpoint).
Phase 3 — Merge into develop
As each agent finishes (do not wait for all):
- Read its PR diff (
gh pr diff <pr>) and sanity-check it yourself — minimal, on-topic, matches the report. - Check mergeability:
gh pr view <pr> --json mergeable -q .mergeable.UNKNOWNright after another merge is normal — poll a few times with short sleeps. - Merge with a merge commit (repo convention):
gh pr merge <pr> --merge. Resolve conflicts manually ifCONFLICTING. - After ALL merges, validate the combined
develop: fullbash -nlist from CLAUDE.md "Testing Changes",python3 -m py_compile start_services.py,node --check welcome/app.js, compose config with a temp.env, and a repo-wide grep for anything a removal-type fix should have fully cleaned.
Phase 4 — Release on develop
- In a
developworktree: setVERSION, add theCHANGELOG.mdsection## [X.Y.Z] - <today>under[Unreleased]with Added/Changed/Removed/Fixed entries in the file's established style (one bold service name + detailed prose +(#issue)per entry). Match the file's actual conventions, not assumed ones (e.g. this changelog has never used compare links at the bottom). - Commit (
chore: release X.Y.Z), pushdevelop. - Open the release PR:
gh pr create --base main --head develop --title "Release X.Y.Z"with a per-issue summary andFixes #<n>lines for every issue in the batch (auto-close only fires when the merge reachesmain, so these lines belong HERE, not only in the fix PRs).
Phase 5 — Final integration review
The per-fix reviews cannot see interactions between fixes, so review the aggregate diff origin/main...origin/develop:
- Launch review agents in parallel (read-only, on the main checkout):
pr-review-toolkit:code-reviewer,pr-review-toolkit:comment-analyzer,pr-review-toolkit:silent-failure-hunter. Skip test/type analyzers (no test suite, no typed code here). - Point them explicitly at cross-fix interactions (e.g. does fix A's preserve/cleanup logic interact with fix B's removals? Is the update-flow ordering in
apply_update.shstill correct?), CHANGELOG factual accuracy, and paths other thanmake update(git pull+make restartis a documented user path — new secrets are NOT generated there). - Fix all critical and important findings (plus cheap correctness suggestions) directly on
develop, verify (bash -n, targeted roundtrip tests underbash -c, compose config), push. The PR updates automatically. - If an external reviewer bot (e.g. CodeRabbit) commented on the PR, fetch its findings (
gh api repos/{owner}/{repo}/pulls/<pr>/comments), verify each against the code, fix the valid ones, and reply to the inline comments with the fix commit. - Present the aggregated report (Critical / Important / Suggestions / deliberately skipped) and leave the release PR open for the user unless they said to merge it.
Phase 6 — Publish (only on explicit user go-ahead)
gh pr merge <release-pr> --merge, then tag the merge commit:git tag vX.Y.Z <sha> && git push origin vX.Y.Z(v-prefix per existing tags).gh release create vX.Y.Z --title "vX.Y.Z"— match the format of previous releases (gh release view <prev>first): changelog sections, an## Upgradeblock withmake updateplus per-service migration notes, and a**Full Changelog**compare link.- Verify the issues auto-closed, then comment on each: fixed in release (link), one-line what changed, any caveat specific to that issue, and "please update with
make update".
Cleanup
Remove worktrees and branches once merged:
git worktree remove --force ../<repo-name>-worktrees/issue-<n>
git branch -D <branch> && git push origin --delete <branch>
Hard-won rules (violating these caused real problems)
- Fix agents must never edit
CHANGELOG.md/VERSION— the release commit owns them. - Poll
mergeablewhen it reportsUNKNOWN; GitHub recomputes it after every merge to the base. Fixes #Nin a PR targetingdevelopcloses nothing — repeat the keywords in the release PR tomain.- New secrets in
03_generate_secrets.share only generated bymake update/make install; every fix that adds one needs adoctor.shcheck and, where it matters, arestart.shwarning for thegit pull+make restartpath. - When a fix removes a service, grep the whole repo for its name at the end; expect leftovers in GOST_NO_PROXY, wizard, welcome page, doctor, final report, update_preview, Caddyfile, docs, and add a one-time migration (see
cleanup_removed_*functions inscripts/utils.sh). - Never log success after a suppressed command (
|| true); branch the message on the actual result.