agentleFS
gufrancogufranco/claude-engineering-rules/skills/ship/SKILL.md

ship

Skill3 starsChanged 31 days agoMITView on GitHub

Ship code through the full delivery pipeline, with subcommands commit, pr, release, checks, and worktree. Handles semantic commits, pull requests with CI monitoring, tagged releases, pipeline diagnosis, and parallel worktree management. Use when user says "commit", "create a PR", "push", "release", "check CI", "pipeline status", "worktree", or wants to move code from working directory to production. For code review, use /review; for running tests, use /test; for planning, use /plan.

  • Reads credentials
  • Commits and pushes

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ios-sync, open-gstack-browser and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Saqlain-811Skill

    ios-sync

    Regenerate the iOS debug bridge against the latest upstream gstack templates. (gstack)

    Also in 6 projects that use this

  • seek888Skill

    open-gstack-browser

    Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in. Opens a visible browser window where you can watch every action in real time. The sidebar shows a live activity feed and chat. Anti-bot stealth built in. Use when asked to "open gstack browser", "launch browser", "connect chrome", "open chrome", "real browser", "launch chrome", "side panel", or "control my browser". Voice triggers (speech-to-text aliases): "show me the browser".

    Also in 10 projects that use this

  • ayudaySkill

    setup-deploy

    Configure deployment settings for /land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom), production URL, health check endpoints, and deploy status commands. Writes the configuration to CLAUDE.md so all future deploys are automatic. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy with gstack", "add deploy config".

    Also in 19 projects that use this

  • ShreyRaviSkill

    landing-report

    Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots are currently claimed by open PRs, which sibling Conductor workspaces have WIP work likely to ship soon, and what slot /ship would pick next. No mutations — just a snapshot. Use when asked to "landing report", "what's in the queue", "show me open PRs", or "which version do I claim next". (gstack)

    Also in 9 projects that use this

  • zebbernSkill

    debug-fix

    Find and fix a bug or issue — from any source (GitHub issue, error message, user report, or observed behavior)

    Also in 4 projects that use this

  • ramybarsoumSkill

    document-release

    Post-ship documentation update. Reads all project docs, cross-references the diff, updates README/ARCHITECTURE/CONTRIBUTING/CLAUDE.md to match what shipped, polishes CHANGELOG voice, cleans up TODOS, and optionally bumps VERSION. Use when asked to "update the docs", "sync documentation", or "post-ship docs". Proactively suggest after a PR is merged or code is shipped.

    Also in 23 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

75 rules. 0 are common, 51 are distinctive, and 24 are very specific to this project.

  • 0

    Common

    Most of the 180 edited versions we read keep these.

  • 51

    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
  • could be automatic: a setting could enforce it
  1. Very specific:

    If no subcommand is given, default to commit.

    line 31
  2. Distinctive:

    After completing a task and ready to save progress.

    line 41
  3. Distinctive:

    When multiple unrelated changes need separate commits.

    line 42
  4. Distinctive:

    Before creating a PR, to ensure clean commit history.

    line 43
  5. Distinctive:

    No arguments: commit and ask whether to push.

    line 47
  6. Distinctive:

    Run in parallel: git status, git diff, git diff --cached, git log --oneline -10.

    line 53
  7. Distinctive:

    Run in parallel: git status, git log --oneline to verify.

    line 59
  8. Distinctive:

    No flags: ask "Want me to push to remote?"

    line 63
  9. Very specific:

    Check upstream: git rev-parse --abbrev-ref @{upstream}.

    line 64
  10. Very specific:

    Check if a PR exists for the current branch via GH_TOKEN=$(gh auth token --user <account>) gh pr view or glab mr view.

    line 66
  11. Very specific:

    If none exists, invoke the pr flow with --no-pipeline to create the PR, skipping its own monitoring loop, then continue.

    line 67
  12. Very specific:

    Follow rules/git-workflow.md.

    line 72
  13. Distinctive:

    Create or update a pull request with a structured description.

    line 78
  14. Distinctive:

    After committing to a feature branch and ready for review.

    line 82
  15. Distinctive:

    When updating an existing PR description.

    line 83
  16. Distinctive:

    When creating a draft PR for early feedback.

    line 84
  17. Distinctive:

    No arguments: create a new PR.

    line 88
  18. Very specific:

    Update from base: when the branch has never been pushed, git rebase origin/<base>.

    line 104
  19. Distinctive:

    Documentation staleness check: Read project documentation files such as README.md, CONTRIBUTING.md, and the docs/ directory, then …

    line 112
  20. Very specific:

    If stale documentation is found, list the gaps and offer to update.

    line 119
  21. Very specific:

    Do not hard-wrap the body.

    line 133
  22. Very specific:

    Create a tagged release whose notes are written for users per standards/changelog.md.

    line 139
  23. Distinctive:

    After merging all planned changes to main and ready to release.

    line 143
  24. Distinctive:

    No arguments: auto-detect next version from commit types.

    line 148
  25. Distinctive:

    When the project keeps a changelog file with an Unreleased section, the notes are those entries.

    line 158
  26. Distinctive:

    Never regenerate or rewrite existing entries in a hand-written changelog.

    line 159
  27. Very specific:

    If --dry-run, show and stop.

    line 161
  28. Very specific:

    After approval: git tag -a v<version> -m "v<version>", git push origin v<version>, GH_TOKEN=$(gh auth token --user <account>) gh release …

    line 164
  29. Distinctive:

    After pushing or creating a PR.

    line 175
  30. Distinctive:

    When a pipeline fails and you need diagnosis.

    line 176
  31. Distinctive:

    No arguments: check current branch.

    line 180
  32. Distinctive:

    Check for PR, or use provided number.

    line 186
  33. Very specific:

    Check status: GH_TOKEN=$(gh auth token --user <account>) gh pr checks or glab ci status.

    line 187
  34. Distinctive:

    If passing, report and stop.

    line 188
  35. Very specific:

    If running, poll a one-shot GH_TOKEN=$(gh auth token --user <account>) gh run view <id> --json status,conclusion every 60 seconds, at most …

    line 189
  36. Very specific:

    If failed: fetch logs, parallel with GH_TOKEN=$(gh auth token --user <account>) gh run view <id> --log-failed or glab ci trace <job-id>.

    line 190
  37. Distinctive:

    Verify: git repo, not inside worktree, get repo root and branch.

    line 211
  38. Distinctive:

    Verify inside a worktree.

    line 218
  39. Distinctive:

    Create PR using task description.

    line 222
  40. Distinctive:

    Default: remove worktrees whose branch is merged.

    line 233
  41. Very specific:

    Remove the worktree with git worktree remove <path>, delete the local branch with git branch -d <branch>, and, after asking, delete the …

    line 237
  42. Very specific:

    Every functional CI check is green, manual gates like lead-approval are excluded.

    line 245
  43. Distinctive:

    Every actionable AI-tool comment is closed, across all four comment channels, for every bot in the 6a list.

    line 246
  44. Distinctive:

    Do not declare the loop complete while either condition is open.

    line 250
  45. Very specific:

    Run in parallel: git remote get-url origin, git branch --show-current.

    line 256
  46. Very specific:

    If no PR exists and the caller invoked --pipeline, fall through to the pr flow with --no-pipeline, steps 1-13, to open one, then …

    line 258
  47. Distinctive:

    When the poll budget runs out, report and stop.

    line 264
  48. Distinctive:

    All functional checks pass: proceed to Step 6, AI comment sweep.

    line 268
  49. Distinctive:

    Stop only on user request or after the guardrail cycle limit.

    line 279
  50. Distinctive:

    After the fix is verified and pushed, or after the finding has been checked and does not hold, close the item.

    line 318
  51. Distinctive:

    After every push triggered by Step 6, return to Step 2.

    line 346
  52. Distinctive:

    Only when both conditions hold on the latest SHA:

    line 350
  53. Very specific:

    Run the Completeness Cross-Check from ../../standards/pr-comment-channels.md before exiting.

    line 355
  54. Distinctive:

    Only fix what you can confidently fix.

    line 369
  55. Very specific:

    Never skip hooks. --no-verify.

    line 371
  56. Distinctive:

    Never close an item without verifying the fix is on the pushed SHA.

    line 372
  57. Distinctive:

    Never close comments authored by humans automatically, Step 6 covers AI bots only.

    line 373
  58. Very specific:

    Never scope the sweep to inline review threads.

    line 374
  59. Very specific:

    Use ScheduleWakeup, or equivalent when waiting on CI or AI re-review to avoid burning context on tight polling loops.

    line 375
  60. Distinctive:

    Never combine unrelated changes in one commit.

    line 381
  61. Distinctive:

    Never use git add -A or git add ..

    line 382
  62. Distinctive:

    Never include files with secrets.

    line 383
  63. Distinctive:

    Always detect git platform from remote URL.

    line 384
  64. Distinctive:

    Always detect base branch dynamically.

    line 385
  65. Distinctive:

    Always check for uncommitted changes before PR operations.

    line 386
  66. Distinctive:

    Always write body to temp file for shell safety.

    line 387
  67. Distinctive:

    Never force push. Rebase only a branch that has never been pushed.

    line 388
  68. Distinctive:

    Never merge PRs. Only create or update.

    line 389
  69. Distinctive:

    Never auto-approve Terraform applies or releases without user approval.

    line 390
  70. Distinctive:

    Stop and ask the user how to proceed when the loop reaches its fifth fix-and-retry cycle.

    line 404
  71. Distinctive:

    Stop and stage file by file when the next command is git add -A or git add ..

    line 405
  72. Very specific:

    Stop and abort the rebase when git rebase origin/<base> hits conflicts, then report them.

    line 406
  73. Distinctive:

    Stop and leave the item open, then report it, when the account lacks permission to resolve or minimize a bot comment.

    line 407
  74. Distinctive:

    Stop and re-verify both exit conditions when a fix lands on a new SHA after one condition was already clean.

    line 408
  75. Very specific:

    Every gh call in the run carried an inline GH_TOKEN, and the global active account never changed.

    line 415

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

Overview

Unified delivery skill for getting code from working directory to production.

When to Use

  • The user says "commit", "create a PR", "push", "release", "check CI", "pipeline status", or "worktree".
  • Finished work needs semantic commits, a pull request, a tagged release, or a CI diagnosis.
  • Several tasks need parallel worktrees, or a worktree's task is ready to deliver.

For reviewing a change, use /review; for running the suite, use /test; for human review comments on your own PR, use /respond; for merging and deploying, use /deploy.

Process

InvocationAction
/ship or /ship commitCreate semantic commits (default)
/ship prCreate or update a pull request
/ship releaseCreate a tagged release with changelog
/ship checksMonitor CI/CD pipeline and diagnose failures
/ship worktreeManage git worktrees for parallel development

If no subcommand is given, default to commit.


commit

Analyze all uncommitted changes and create semantic commits following the conventional commit format.

When to use

  • After completing a task and ready to save progress.
  • When multiple unrelated changes need separate commits.
  • Before creating a PR, to ensure clean commit history.

Arguments

  • No arguments: commit and ask whether to push.
  • --push: commit and push automatically.
  • --pipeline: commit, push, ensure a PR exists, open one if missing, and stay in a monitoring loop until CI is 100% green AND there are zero open AI-tool review threads. Implies push. If no PR exists on the current branch, runs the pr flow, with --no-pipeline to avoid recursion before entering Pipeline Monitoring. On CI failure, diagnoses, fixes, and re-pushes. On open AI-tool comments, CodeRabbit, Copilot, Greptile, Sourcery, etc., addresses every actionable finding, pushes the fix, and resolves the thread. The loop only exits when both conditions hold simultaneously on the latest SHA.

Steps

  1. Run in parallel: git status, git diff, git diff --cached, git log --oneline -10.
  2. Group related changes into logical units. Each group becomes one commit:
    • Same feature/module together.
    • Unrelated changes in separate commits.
    • Tests go with the code they test.
  3. For each group: stage specific files, git add <file>, never -A or ., commit with format below.
  4. Run in parallel: git status, git log --oneline to verify.
  5. Push logic:
    • --push: push immediately.
    • --pipeline without --push: ask "Push to remote and monitor pipeline?"
    • No flags: ask "Want me to push to remote?"
    • Check upstream: git rev-parse --abbrev-ref @{upstream}. Use -u origin <branch> if none.
  6. If --pipeline:
    • Check if a PR exists for the current branch via GH_TOKEN=$(gh auth token --user <account>) gh pr view or glab mr view.
    • If none exists, invoke the pr flow with --no-pipeline to create the PR, skipping its own monitoring loop, then continue.
    • Enter the Pipeline Monitoring loop (see below).

Commit Message Format

Follow rules/git-workflow.md. Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert. Subject: imperative mood, no caps, no period, max 50 chars. Body: wrap at 72, explain WHAT and WHY. Footer: BREAKING CHANGE:, Fixes #, Closes #, Refs #.


pr

Create or update a pull request with a structured description. Supports GitHub and GitLab.

When to use

  • After committing to a feature branch and ready for review.
  • When updating an existing PR description.
  • When creating a draft PR for early feedback.

Arguments

  • No arguments: create a new PR.
  • --draft: create as draft.
  • --base <branch>: target specific base branch.
  • --reviewer <user>: request review, repeatable.
  • --assignee <user>: assign PR; defaults to @me.
  • --label <name>: add label, repeatable.
  • --no-pipeline: skip CI monitoring after creation.
  • --docs: automatically update stale documentation without asking.
  • update or a PR number: update existing PR.

Steps

  1. Gather context in parallel: git status --porcelain, git remote get-url origin, git branch --show-current. Stop if uncommitted changes or on main. Detect CLI tool, either gh or glab. Resolve account per standards/multi-account-cli.md: map the owner in the remote URL to an account and prefix every gh call with GH_TOKEN=$(gh auth token --user <account>), never switching the global active account.
  2. Check existing PR and base branch, parallel: look up existing PR, detect base branch, unless --base. If PR exists and no update flag, show URL and ask. One task gets one PR per repository: when this task already has an open PR in the repository on another branch, cherry-pick these commits onto that branch and update its title and body to name every tracker key, instead of opening a second PR. A second PR opened by mistake is closed without a comment. hooks/pr-comment-discipline.py asks before a second gh pr create in one repository and session.
  3. git fetch origin, git log --oneline origin/<base>..HEAD. Stop if no commits.
  4. Run quality gate per rules/git-workflow.md, in order: format check, lint, type check, full test suite, build. Stop if any fails.
  5. Update from base: when the branch has never been pushed, git rebase origin/<base>; if it conflicts, git rebase --abort and stop. When the branch is already on the remote, never rewrite it: merge origin/<base> only if it conflicts, per Conflict Resolution in standards/git-workflow.md.
  6. Check PR size, parallel: git diff origin/<base>...HEAD --stat and full diff. Warn at 400+ lines, confirm at 1000+.
  7. Self-review: scan for debug statements, TODO/FIXME, accidentally committed files, binaries.
  8. Extract context and capture visual evidence: check branch and commits for ticket patterns. When the diff touches a web, mobile, desktop, or terminal surface, capture Before from the base commit in a git worktree and After from the branch, same data, viewport, theme, and locale, at device scale 2 or more with the longer side at least 1600 px. Capture the full page, unclipping an inner scroll container with height: auto first, never overflow: visible; scale every image in the set to one pixel width, never pad; group desktop and mobile under their own headings, with alt text naming device and viewport, such as After: Mobile 320 px, default queue. A new page states it has no Before. Recipes per surface: "Visual Evidence In Published Text" in standards/frontend-render-gate.md. This step is never skipped; hooks/frontend-render-gate.py blocks the PR without the images.
  9. Push: re-read the pull request first, gh pr view --json state,mergedAt,headRefOid, because a teammate can merge it while the gate runs. When it is MERGED or CLOSED, stop and report who merged it and when. Use -u if no upstream. Never force push; a pushed branch was never rewritten, so a plain push always applies.
  10. Build title and description: detect PR template at .github/PULL_REQUEST_TEMPLATE.md or the GitLab equivalent. Use the What, How, Evidence, and Merge Danger structure in PR Description. Scale to PR size.
  11. Create/update: write body to temp file. GH_TOKEN=$(gh auth token --user <account>) gh pr create --body-file <file> --attach 'before.png#Before: Desktop 1440 px, <screen>' --attach 'after.png#After: Desktop 1440 px, <screen>' or glab mr create --description-file, with GitLab images uploaded first and embedded. Self-assign by default. Clean up temp file. AI reviews are requested by hooks/ai-review-request.py after gh pr create, gh pr ready and git push; read its ai-review: line and report it with the PR URL.
  12. Show PR URL. The PR is reported done only with the counted done state from "The Done State" in standards/pr-comment-discipline.md: 0 unresolved threads and 0 unminimized bot review bodies.
  13. Documentation staleness check. Read project documentation files such as README.md, CONTRIBUTING.md, and the docs/ directory, then cross-reference against the diff:
    • New features without corresponding documentation.
    • Removed features still documented.
    • Changed APIs with stale examples.
    • New environment variables not in .env.example.
    • New CLI commands or scripts not documented.
    • A specs/current/ living spec that no longer matches the change. If the plan folder carries a spec delta, remind the user to run /plan archive once the PR merges, to fold the delta into the living spec. See rules/living-specs.md. If stale documentation is found, list the gaps and offer to update. If --docs flag is passed, update automatically without asking.
  14. Enter Pipeline Monitoring loop unless --no-pipeline. The loop monitors both CI checks AND AI-tool review threads, and only exits when both are clean.

PR Title

Conventional commit style when it fits. Max 70 chars. Prefix ticket ID if available.

PR Description

  • Small PR: one paragraph, no headers, plus the Merge Danger and Evidence lines.
  • Standard PR: What, How, Evidence, Merge Danger sections. Add Breaking Changes only if applicable.
  • Evidence is a before and after: the exact test that failed and now passes, or the output that changed. "Tests are green" alone is a claim, not evidence. A visible change carries high-resolution screenshots labeled Before: and After:, attached in step 11.
  • Merge Danger states the Door and the Blast Radius. A two-way door is cheap to reverse; a one-way door is not. Always one-way: a migration that drops or rewrites data, an outbound send to users or partners, a deletion, and a public API removal. Blast radius names what breaks if the change is wrong, such as API consumers, layout on mobile, or a scheduled job. Be most suspicious of your own "two-way, small" call: a revert does not unsend an email, and a flagged rollout stays two-way only until the first write lands in the new format.
  • Concise, direct. No filler. Open questions go to the chat, never the PR body.
  • Do not hard-wrap the body. The platform renders single newlines as line breaks, so write each paragraph as one long line. The 72-column wrap is for commit bodies only. See standards/git-workflow.md "PR/MR Creation".

release

Create a tagged release whose notes are written for users per standards/changelog.md. Conventional commits pick the version bump and locate what changed; they never become the notes verbatim.

When to use

  • After merging all planned changes to main and ready to release.
  • With --dry-run to preview before creating.

Arguments

  • No arguments: auto-detect next version from commit types.
  • A version (e.g. 1.2.0): use that exact version.
  • --dry-run: show what would be released without creating anything.

Steps

  1. Gather context, parallel: git remote get-url origin, git describe --tags --abbrev=0, git status --porcelain. Detect CLI tool. Resolve account as in pr step 1. Stop if dirty.
  2. git log --oneline <last-tag>..HEAD. Stop if no commits.
  3. Determine version: parse last tag as semver. BREAKING CHANGE/! = major, feat = minor, fix/perf/refactor = patch. Only chore/docs/style/test/build/ci = no bump.
  4. Build the release notes per standards/changelog.md Release Notes:
    • When the project keeps a changelog file with an Unreleased section, the notes are those entries. Move them under the new version heading, in the heading format the file already uses, as part of the release.
    • Never regenerate or rewrite existing entries in a hand-written changelog; only move its Unreleased entries.
    • Otherwise draft from the commits in the range: one user-facing entry per change a user would notice, related commits grouped into a single entry, sections What's New, Improvements, Fixes, Breaking Changes, Deprecated, and Internal. A list of commit subjects is never release notes.
  5. If --dry-run, show and stop.
  6. Run quality gate, in order: format check, lint, type check, full test suite, build. Stop if any fails.
  7. Present the version and the release notes for approval.
  8. After approval: git tag -a v<version> -m "v<version>", git push origin v<version>, GH_TOKEN=$(gh auth token --user <account>) gh release create or glab release create with notes-file. Clean up temp file.
  9. Show release URL.

checks

Monitor CI/CD pipeline checks and diagnose failures. Diagnosis only, no auto-fix.

When to use

  • After pushing or creating a PR.
  • When a pipeline fails and you need diagnosis.

Arguments

  • No arguments: check current branch.
  • A PR number: check that specific PR.

Steps

  1. Gather context, parallel: git remote get-url origin, git branch --show-current. Detect CLI tool. Resolve account as in pr step 1.
  2. Check for PR, or use provided number. Fall back to branch pipelines.
  3. Check status: GH_TOKEN=$(gh auth token --user <account>) gh pr checks or glab ci status.
  4. If passing, report and stop.
  5. If running, poll a one-shot GH_TOKEN=$(gh auth token --user <account>) gh run view <id> --json status,conclusion every 60 seconds, at most 20 times, and every 3 minutes while the run is queued; GitLab: glab ci status -F json on the same schedule. Report and stop when the poll budget runs out.
  6. If failed: fetch logs, parallel with GH_TOKEN=$(gh auth token --user <account>) gh run view <id> --log-failed or glab ci trace <job-id>. Search for existing fixes first.
  7. Present diagnosis per failure: check name, URL, error, log excerpt.
  8. Suggest next steps but do not auto-fix.

worktree

Manage git worktrees for parallel development.

Subcommands

InvocationAction
/ship worktree init <task1> | <task2>Create worktrees from pipe-separated tasks
/ship worktree deliverCommit, push, and create PR from worktree
/ship worktree checkShow status of all worktrees
/ship worktree cleanupRemove worktrees for merged branches

init

  1. Verify: git repo, not inside worktree, get repo root and branch.
  2. Parse tasks on |. Each segment becomes a worktree.
  3. For each: branch wt/<kebab-case>, path <root>/.worktrees/<name>, git worktree add -b <branch> <path>. Write .worktree-task.md. Ask about package install.
  4. Present table: path, branch, task.

deliver

  1. Verify inside a worktree.
  2. Gather state, parallel: status, commits, task file, remote, branch. Resolve account as in pr step 1.
  3. Stage and commit, worktrees are task-scoped. Remove .worktree-task.md from staging.
  4. Push with -u.
  5. Create PR using task description. Follow PR conventions.
  6. Show PR URL.

check

  1. git worktree list --porcelain.
  2. For each, parallel: branch, commit count, uncommitted changes, task file.
  3. Present as table.

cleanup

  • Default: remove worktrees whose branch is merged.
  • --all: all wt/* worktrees, warn about unmerged work.
  • --branch <name>: specific worktree.
  • --dry-run: show what would be removed.
  • Remove the worktree with git worktree remove <path>, delete the local branch with git branch -d <branch>, and, after asking, delete the remote branch with git push origin --delete <branch>. Run git worktree prune.

Pipeline Monitoring (shared by commit and pr)

The monitoring loop has two parallel exit conditions that must BOTH hold on the latest pushed SHA:

  1. Every functional CI check is green, manual gates like lead-approval are excluded.
  2. Every actionable AI-tool comment is closed, across all four comment channels, for every bot in the 6a list.

Condition 2 spans every channel in ../../standards/pr-comment-channels.md, not just inline review threads. A bot summary posted as a review body or a PR-level comment holds the loop open exactly like an inline thread does.

Do not declare the loop complete while either condition is open. If a fix is pushed for one condition, both conditions must be re-verified on the new SHA before exiting.

Human-authored comments are out of scope of this loop. They require judgment per comment and are handled by /respond, which owns the only reply surface. When a human reviewer comments during pipeline monitoring, this loop ignores it; the author runs /respond separately to triage and reply. The loop still reports the count of open human comments per channel on exit, so a human concern is never silently buried by a green pipeline.

Step 1: Detect platform and locate checks

Run in parallel: git remote get-url origin, git branch --show-current. Detect CLI tool. Resolve account as in pr step 1. Check if PR exists.

If no PR exists and the caller invoked --pipeline, fall through to the pr flow with --no-pipeline, steps 1-13, to open one, then re-evaluate. Many CI configs only fire on pull_request events; without a PR there is nothing to monitor.

Step 2: Wait for CI checks

  • With PR: read the run IDs from GH_TOKEN=$(gh auth token --user <account>) gh pr checks, then poll a one-shot GH_TOKEN=$(gh auth token --user <account>) gh run view <id> --json status,conclusion every 60 seconds, at most 20 times, and every 3 minutes while the run is queued; GitLab: glab ci status -F json on the same schedule.
  • Without PR, only when CI fires on push, e.g. branch protections or scheduled workflows: the same bounded poll on the run ID from GH_TOKEN=$(gh auth token --user <account>) gh run list --branch <branch> --limit 1.
  • When the poll budget runs out, report and stop. Schedule a wakeup and re-poll if the loop is still active.

Step 3: Evaluate CI

  • All functional checks pass: proceed to Step 6, AI comment sweep. Do NOT exit yet.
  • Any functional check fails: proceed to Step 4.

Step 4: Diagnose CI failure

Fetch failed logs, parallel. Search for existing fixes first. Present diagnosis per failure.

Step 5: Fix CI failure

  • Apply fix, stage specific files, commit, its own commit, conventional format, push.
  • Return to Step 2 on the new SHA.
  • Stop only on user request or after the guardrail cycle limit.

Step 6: AI-tool comment sweep

Fetch every open comment authored by AI bots, across every channel, and close them all. This step is mandatory in --pipeline mode and runs every time CI is green, including after a CI fix push.

Optional delegation to /respond. When the environment variable RESPOND_DRIVES_PIPELINE=1 is set, this step delegates to /respond --auto --include-bots instead of running the inline sweep below. The delegated workflow gives unified vocabulary and unified bot triage with the human-thread flow, and routes through the same hooks. To take effect, the user must also set RESPOND_AUTO_ACK=1 since /respond --auto requires the second lock. The default behavior, when the env var is unset, is the inline sweep documented in 6a through 6e.

The delegation is opt-in to preserve backward compatibility. Existing --pipeline invocations continue to work without changes.

6a: Fetch open AI-tool comments across every channel

Read ../../standards/pr-comment-channels.md and use its canonical fetch. Inline review threads are one channel of four. AI reviewers post their summary and often their highest-severity findings as a review body or a PR-level conversation comment, neither of which appears in reviewThreads. Sweeping only inline threads lets a bot's blocking finding through while the loop reports the PR as clean.

The four GitHub channels are reviewThreads, reviews, comments, and timelineItems filtered to PULL_REQUEST_COMMIT_COMMENT_THREAD. The standard carries the exact query. Do not hand-roll a narrower one.

Filter the result to comments that are non-terminal per the standard's Terminal States table, then keep those whose author login matches the AI-bot list. The match is a case-insensitive substring match on the login, with or without a [bot] suffix, since the GraphQL API omits it, and includes, non-exhaustive: coderabbit, copilot, greptile, sourcery, korbit, bito, qodo, codium, cursor, tabnine, gemini-code-assist, chatgpt-codex-connector, claude. A login outside the list that still looks automated is reported, never treated as human by default.

Two filters that look right and are not: isResolved == false alone misses the three channels that have no isResolved field, and isOutdated == true is not a terminal state.

6b: Triage each finding

For every open item, read the full comment body for the unabridged text, then classify. Inline thread comments come from GH_TOKEN=$(gh auth token --user <account>) gh api repos/<owner>/<repo>/pulls/comments/<databaseId> --jq '.body'. Review bodies, PR-level comments, and commit comments already arrive in full from the canonical fetch.

ClassificationAction
Actionable + validApply the fix. Each fix becomes its own commit.
Already resolved by prior codeVerify the current code resolves the issue, then close the thread.
False positiveClose the thread.
Out of scopeFix it anyway when it is small, then close the thread. When it is genuinely blocked outside this change, close the thread and name the blocker in the pull-request description.

This loop handles bot findings, and a bot thread receives no reply, per ../../rules/pr-comment-discipline.md. Close it by resolving where the channel allows and by minimizing where it does not. Never close a thread without either fixing the issue or verifying that the finding does not hold.

6c: Apply fixes

Group related fixes per file when possible. Run formatter, linter, typechecker, tests, and build locally before committing. Push once per logical fix group.

6d: Close each item

After the fix is verified and pushed, or after the finding has been checked and does not hold, close the item. How to close depends on the channel, per the standard's "Answering Each Channel" table.

Inline review threads resolve through GraphQL:

GH_TOKEN=$(gh auth token --user <account>) gh api graphql -f query='mutation($threadId: ID!) {
  resolveReviewThread(input: { threadId: $threadId }) {
    thread { id isResolved }
  }
}' -F threadId=<thread-node-id>

Review bodies, PR-level comments, and commit comments have no resolve action, and a bot receives no reply, so minimizing is the close action:

GH_TOKEN=$(gh auth token --user <account>) gh api graphql -f query='mutation($id: ID!) {
  minimizeComment(input: { subjectId: $id, classifier: RESOLVED }) {
    minimizedComment { isMinimized minimizedReason }
  }
}' -F id=<comment-node-id>

The evidence a finding was considered is the commit that answers it, or the absence of one plus a minimized thread. Both are visible on the pull request and both outlast a comment. When the account lacks permission to minimize, leave the item open and report it rather than posting a comment to mark it handled.

GitLab uses glab api with the discussion resolve endpoint. Bitbucket Cloud resolves via POST .../comments/<cid>/resolve.

6e: Loop back

After every push triggered by Step 6, return to Step 2. New AI tools often re-review the new SHA and may post fresh threads. The loop is not complete until a full pass finds zero open AI threads AND CI is green on the same SHA.

Step 7: Final verification and exit

Only when both conditions hold on the latest SHA:

  • GH_TOKEN=$(gh auth token --user <account>) gh pr checks <pr> shows every functional check as pass, manual gates excluded.
  • The canonical four-channel fetch returns zero non-terminal AI-bot comments, across reviewThreads, reviews, comments, and commit-comment threads.

Run the Completeness Cross-Check from ../../standards/pr-comment-channels.md before exiting.

Report per-channel counts, never a single total. A bare "0 open threads" cannot distinguish "all four channels are clean" from "only one channel was queried", which is the ambiguity that let a blocking comment through in the first place.

PR #1234  SHA a1b2c3d
CI: 12/12 functional checks passed
AI comments closed:  inline 3 resolved | review bodies 1 minimized | PR-level 2 minimized | commit 0
Human comments open: inline 0 | review bodies 0 | PR-level 1 | commit 0  -> run /respond

Guardrails

  • Max 5 fix-and-retry cycles per loop run. Above the limit, stop and ask the user how to proceed.
  • Only fix what you can confidently fix. When a finding does not survive the failure-scenario gate, close it without writing anything; when you cannot tell, leave it open and report it.
  • Each fix is its own commit with a conventional-commit message.
  • Never skip hooks. --no-verify.
  • Never close an item without verifying the fix is on the pushed SHA.
  • Never close comments authored by humans automatically, Step 6 covers AI bots only.
  • Never scope the sweep to inline review threads. All four channels in ../../standards/pr-comment-channels.md are in scope every pass.
  • Use ScheduleWakeup, or equivalent when waiting on CI or AI re-review to avoid burning context on tight polling loops.

Rules

  • Never combine unrelated changes in one commit.
  • Never use git add -A or git add ..
  • Never include files with secrets.
  • Always detect git platform from remote URL. Never assume GitHub or GitLab.
  • Always detect base branch dynamically.
  • Always check for uncommitted changes before PR operations.
  • Always write body to temp file for shell safety.
  • Never force push. Rebase only a branch that has never been pushed; resolve conflicts on a pushed branch with a merge.
  • Never merge PRs. Only create or update.
  • Never auto-approve Terraform applies or releases without user approval.
  • Prefix every gh call with an inline GH_TOKEN for the account matched from the remote, per standards/multi-account-cli.md. Never switch the global active account.
  • --pipeline and any pr flow that opens a PR must run the full Pipeline Monitoring loop. The loop only exits when CI is 100% green AND every AI-tool comment across all four channels is closed on the latest pushed SHA. Resolving partial state, CI green but comments open, or comments closed but CI red is not "done".

Common Rationalizations

  • "The checks rollup is green, so the loop is done": a green rollup can mean CI never ran on the head SHA. Confirm the functional checks ran on the latest pushed SHA, then sweep all four comment channels.
  • "No open review threads, so no bot comments": inline threads are one channel of four. Bots post blocking findings as review bodies and PR-level comments too.
  • "The changes are small, so one commit is fine": unrelated changes go in separate commits whatever their size.
  • "A reply tells the bot the finding was handled": a bot thread gets no reply. The fix commit, or a resolved or minimized thread, is the record.
  • "The rebase was clean, so a force push is safe": a pushed branch is never rebased, so no push of it ever needs force. Merge the base instead.

Red Flags

  • Stop and ask the user how to proceed when the loop reaches its fifth fix-and-retry cycle.
  • Stop and stage file by file when the next command is git add -A or git add ..
  • Stop and abort the rebase when git rebase origin/<base> hits conflicts, then report them.
  • Stop and leave the item open, then report it, when the account lacks permission to resolve or minimize a bot comment.
  • Stop and re-verify both exit conditions when a fix lands on a new SHA after one condition was already clean.

Verification

  • git status shows no staged leftovers, and each commit subject matches <type>(<scope>): <subject> within 50 characters.
  • The final report prints per-channel counts for AI and human comments on the latest SHA, never a single total.
  • GH_TOKEN=$(gh auth token --user <account>) gh pr checks <pr> shows every functional check as pass on that same SHA.
  • Every gh call in the run carried an inline GH_TOKEN, and the global active account never changed.
  • Temp files for PR bodies and release notes are deleted.

Related skills

  • /review -- Review code before or after creating a PR.
  • /respond -- Address incoming human review comments on a PR you authored. Complements this skill's AI-bot loop with a workflow for the human-thread side.
  • /test -- Run tests before shipping.
  • /infra -- Manage Docker/DB before shipping.
  • /deploy -- Merge and deploy after the PR is approved.

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.