iterate-pr
Skill233 starsChanged 3 months agoApache-2.0View on GitHub
Iterate on a PR until CI passes. Optionally merge or merge and publish a release of the repo. Automates the feedback-fix-push-wait cycle.
- Commits and pushes
10 other projects use a version of this, 6 of them edited.
Adopted by
Most recently taken up by
- taskless/cliedited, first seen Oct 19, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- layer5io/sistentedited, first seen Oct 9, 2026
- meshery/schemasedited, first seen Oct 9, 2026
- salesforce/cloudsplainingedited, first seen Oct 8, 2026
- meshery/mesheryedited, first seen Oct 8, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 6
- meshery/meshery★ 12k52% same
- salesforce/cloudsplaining★ 2.3k13% same
- getsentry/skills★ 1.2k13% same
- layer5io/sistent★ 14052% same
- taskless/cli★ 12612% same
- meshery/schemas★ 8552% same
Wrote their own version · 4
- kumaran-is/claude-code-onboarding★ 35same name
- xfstudio/skills★ 9same name
- ai4brands-design/claude-skills★ 2same name
- StillScripts/cursor-agents-manager★ 1same 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 repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- chrome-devtools-axiSkill
- gh-axiSkill
- iterate-prSkill
- lavishSkill
- quota-axiSkill
- agent-md-refactorSkill
- command-creatorSkill
- cut-releaseSkill
- database-schema-designerSkill
- find-skillsSkill
- gepettoSkill
- qa-test-plannerSkill
- reducing-entropySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
46 rules. 1 is common, 28 are distinctive, and 17 are very specific to this project.
1
Common
Most of the 10 edited versions we read keep these.
28
Distinctive
This author's own choices. Worth a look.
17
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
- Very specific: line 18
Important: Run scripts from the repository root directory (where .git is located).
- Distinctive: line 22
Every script below accepts either runner - they only use the standard library, so no dependency installation is needed either way:
- Very specific: line 28
Before running any script command shown in this skill, check for uv first and prefer it.
- Distinctive: line 55
Use this deterministic precedence:
- Very specific: line 57
If hints include --release or terms like release, publish, ship → run release mode.
- Distinctive: line 61
Do not fail because hints are missing or unrecognized.
- Common: line 134
Stop if no PR exists for the current branch.
- Very specific: line 138
Run python3 .claude/skills/iterate-pr/scripts/fetch_pr_feedback.py to get categorized feedback already posted on the PR.
- Distinctive: line 172
If justified, implement the change
- Distinctive: line 173
If not justified, reject it with a concise technical reason
- Distinctive: line 174
Never leave an item without an explicit decision
- Distinctive: line 176
When fixing feedback (all modes):
- Distinctive: line 178
Check for similar issues in nearby code or related files
- Distinctive: line 184
Never silently ignore review bot feedback — always verify the finding
- Distinctive: line 188
After processing feedback, reply to PR comments/threads to acknowledge the action taken.
- Very specific: line 191
Default mode: reply to high/medium.
- Very specific: line 195
If thread_id exists (inline review thread), use python3 .claude/skills/iterate-pr/scripts/reply_to_thread.py
- Very specific: line 196
If no thread_id exists, post a PR comment with gh pr comment <PR_NUMBER> --body "..."
- Distinctive: line 209
Never add a signature, attribution line, tag, or vendor/model mention in replies
- Distinctive: line 210
Keep replies tool-agnostic and identity-free
- Distinctive: line 211
If the script fails, log and continue — do not block the workflow
- Very specific: line 215
Run python3 .claude/skills/iterate-pr/scripts/fetch_pr_checks.py to get structured failure data.
- Distinctive: line 217
Wait if pending: If review bot checks (sentry, warden, cursor, bugbot, seer, codeql) are still running, wait before proceeding—they post …
- Very specific: line 222
Read the log_snippet and trace backwards from the error to understand WHY it failed — not just what failed
- Distinctive: line 223
Read the relevant code and check for related issues (e.g., if a type error in one call site, check other call sites)
- Distinctive: line 227
Do NOT assume what failed based on check name alone—always read the logs.
- Distinctive: line 231
Before committing, verify your fixes locally:
- Distinctive: line 232
If you fixed a test failure: re-run that specific test locally
- Distinctive: line 233
If you fixed a lint/type error: re-run the linter or type checker on affected files
- Distinctive: line 236
If local verification fails, fix before proceeding — do not push known-broken code.
- Distinctive: line 245
Always add exactly one sign-off to each commit for the active authenticated GitHub user.
- Very specific: line 251
Run python3 .claude/skills/iterate-pr/scripts/fetch_pr_checks.py to get current CI status
- Distinctive: line 252
If all checks passed → proceed to exit conditions
- Distinctive: line 253
If any checks failed (none pending) → return to step 5
- Very specific: line 254
If checks are still pending: a.
- Very specific: line 257
Default mode: new high/medium
- Very specific: line 261
Prefer Gemini review command (/gemini review) when available
- Very specific: line 264
After all checks pass, do a final feedback check: sleep 10, then run python3 .claude/skills/iterate-pr/scripts/fetch_pr_feedback.py.
- Very specific: line 265
Default mode: address any new high/medium feedback.
- Distinctive: line 270
If step 7 required code changes (from new feedback after CI passed), return to step 2 for a fresh cycle.
- Distinctive: line 274
No new non-resolved feedback is returned after the latest review request
- Distinctive: line 278
Default mode: stop after success conditions are met (do not merge automatically)
- Distinctive: line 309
Success (default): All checks pass, post-CI feedback re-check is clean (no new unaddressed high/medium feedback including review bot …
- Very specific: line 311
Success (
full): All checks pass, no new non-resolved feedback remains after the latest review request, every feedback item has a reply, … - Distinctive: line 317
Stop: No PR exists, branch needs rebase.
- Very specific: line 321
If scripts fail, use gh CLI directly:
“Common” is measured: kept by at least 6 in 10 of the 10 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
Iterate on PR Until CI Passes
Continuously iterate on the current branch until all CI checks pass and review feedback is addressed.
Requires: GitHub CLI (gh) authenticated.
Requires: Python 3.9+.
Important: Run scripts from the repository root directory (where .git is located).
Running the Bundled Scripts
Every script below accepts either runner - they only use the standard library, so no dependency installation is needed either way:
- Preferred:
uv-uv run <script>. Faster startup, isolated from system Python. - Fallback:
python3 <script>- used automatically whenuvis not onPATH.
Before running any script command shown in this skill, check for uv first and prefer it;
fall back to python3 only if uv is unavailable:
if command -v uv >/dev/null 2>&1; then
uv run .claude/skills/iterate-pr/scripts/<script>.py [args]
else
python3 .claude/skills/iterate-pr/scripts/<script>.py [args]
fiThe rest of this document shows invocations in the shorter python3 <script> form for
readability - substitute uv run per the rule above whenever uv is available.
Invocation and Modes
Invoke as:
/iterate-pr/iterate-pr --full/iterate-pr --release/iterate-pr --full --release
In Claude Desktop, arguments are hints, not strict CLI parsing. Treat whatever follows /iterate-pr as a mode hint string.
Argument Hint Interpretation (Claude Desktop)
Use this deterministic precedence:
- If hints include
--releaseor terms likerelease,publish,ship→ run release mode. - Else if hints include
--fullor terms likefull,autonomous,merge→ run full mode. - Else run default mode.
Do not fail because hints are missing or unrecognized; default safely.
| Mode | Behavior |
Default (/iterate-pr) | Iterates on CI + high/medium feedback, asks user about low-priority items, then exits without merging. |
--full | Fully autonomous: handles every non-resolved feedback item, replies to every item, re-requests review (Gemini or Copilot) after each push, iterates until no new feedback and CI is green, then administratively merges the PR without waiting for a required-approval status. |
--release | Does everything in --full, then cuts/publishes a release for the repository. |
Bundled Scripts
scripts/fetch_pr_checks.py
Fetches CI check status and extracts failure snippets from logs.
python3 .claude/skills/iterate-pr/scripts/fetch_pr_checks.py [--pr NUMBER]Returns JSON:
{
"pr": {"number": 123, "branch": "feat/foo"},
"summary": {"total": 5, "passed": 3, "failed": 2, "pending": 0},
"checks": [
{"name": "tests", "status": "fail", "log_snippet": "...", "run_id": 123},
{"name": "lint", "status": "pass"}
]
}scripts/fetch_pr_feedback.py
Fetches and categorizes PR review feedback using the LOGAF scale.
python3 .claude/skills/iterate-pr/scripts/fetch_pr_feedback.py [--pr NUMBER]Returns JSON with feedback categorized as:
high- Must address before merge (h:, blocker, changes requested)medium- Should address (m:, standard feedback)low- Optional (l:, nit, style, suggestion)bot- Informational automated comments (Codecov, Dependabot, etc.)resolved- Already resolved threads
Review bot feedback (from Sentry, Warden, Cursor, Bugbot, CodeQL, etc.) appears in high/medium/low with review_bot: true — it is NOT placed in the bot bucket.
Each feedback item may also include:
thread_id- GraphQL node ID for inline review comments (used for replies viareply_to_thread.py)
scripts/reply_to_thread.py
Replies to PR review threads. Batches multiple replies into a single GraphQL call.
python3 .claude/skills/iterate-pr/scripts/reply_to_thread.py THREAD_ID "body" [THREAD_ID "body" ...]Arguments are alternating (thread_id, body) pairs. The script sends the reply body without adding signatures, attribution, or sign-off text. Example:
python3 .claude/skills/iterate-pr/scripts/reply_to_thread.py \
PRRT_abc "Fixed the null check." \
PRRT_def "Replaced with path-segment counting."Workflow
1. Identify PR
gh pr view --json number,url,headRefNameStop if no PR exists for the current branch.
2. Gather Review Feedback
Run python3 .claude/skills/iterate-pr/scripts/fetch_pr_feedback.py to get categorized feedback already posted on the PR.
3. Handle Feedback by Priority and Mode
Determine mode from invocation (/iterate-pr, /iterate-pr --full, /iterate-pr --release).
Default mode (/iterate-pr)
Auto-fix (no prompt):
high- must address (blockers, security, changes requested)medium- should address (standard feedback)
Prompt user for selection:
low- present numbered list and ask which to address:
Found 3 low-priority suggestions:
1. [l] "Consider renaming this variable" - @reviewer in api.py:42
2. [nit] "Could use a list comprehension" - @reviewer in utils.py:18
3. [style] "Add a docstring" - @reviewer in models.py:55
Which would you like to address? (e.g., "1,3" or "all" or "none")Skip silently:
resolvedthreadsbotcomments (informational only — Codecov, Dependabot, etc.)
Full modes (/iterate-pr --full, /iterate-pr --full --release)
Operate autonomously. Process every non-resolved feedback item returned by fetch_pr_feedback.py (high, medium, low, and bot).
For each item:
- Decide whether the feedback is justified
- If justified, implement the change
- If not justified, reject it with a concise technical reason
- Never leave an item without an explicit decision
When fixing feedback (all modes):
- Understand the root cause, not just the surface symptom
- Check for similar issues in nearby code or related files
- Fix all instances, not just the one mentioned
This includes review bot feedback (items with review_bot: true). Treat it the same as human feedback:
- Real issue found → fix it
- False positive → reject with explanation
- Never silently ignore review bot feedback — always verify the finding
Replying to Comments
After processing feedback, reply to PR comments/threads to acknowledge the action taken.
Scope by mode:
- Default mode: reply to
high/medium; reply tolowonly when fixed or declined by the user - Full modes: reply to every non-resolved feedback item, including informational bot feedback
How to reply:
- If
thread_idexists (inline review thread), usepython3 .claude/skills/iterate-pr/scripts/reply_to_thread.py - If no
thread_idexists, post a PR comment withgh pr comment <PR_NUMBER> --body "..." - In full modes, a feedback round is incomplete until every item has a corresponding reply
Batch inline replies for a round into a single call:
python3 .claude/skills/iterate-pr/scripts/reply_to_thread.py \
PRRT_abc "Fixed — description of change." \
PRRT_def "Not applicable — reason."Reply format:
- 1-2 sentences: what was changed, why it's not an issue, or acknowledgment of declined items
- Never add a signature, attribution line, tag, or vendor/model mention in replies
- Keep replies tool-agnostic and identity-free
- If the script fails, log and continue — do not block the workflow
4. Check CI Status
Run python3 .claude/skills/iterate-pr/scripts/fetch_pr_checks.py to get structured failure data.
Wait if pending: If review bot checks (sentry, warden, cursor, bugbot, seer, codeql) are still running, wait before proceeding—they post actionable feedback that must be evaluated. Informational bots (codecov) are not worth waiting for.
5. Fix CI Failures
For each failure in the script output:
- Read the
log_snippetand trace backwards from the error to understand WHY it failed — not just what failed - Read the relevant code and check for related issues (e.g., if a type error in one call site, check other call sites)
- Fix the root cause with minimal, targeted changes
- Find existing tests for the affected code and run them. If the fix introduces behavior not covered by existing tests, extend them to cover it (add a test case, not a whole new test file)
Do NOT assume what failed based on check name alone—always read the logs. Do NOT "quick fix and hope" — understand the failure thoroughly before changing code.
6. Verify Locally, Then Commit and Push
Before committing, verify your fixes locally:
- If you fixed a test failure: re-run that specific test locally
- If you fixed a lint/type error: re-run the linter or type checker on affected files
- For any code fix: run existing tests covering the changed code
If local verification fails, fix before proceeding — do not push known-broken code.
git add <files>
gh auth status -a
git commit --signoff -m "fix: <descriptive message>"
git pushAlways add exactly one sign-off to each commit for the active authenticated GitHub user. Check gh auth status -a before committing to confirm the active account, use git commit --signoff, and do not add any other trailers, signatures, or tool attribution to commits or PR comments.
7. Monitor CI and Address Feedback
Poll CI status and review feedback in a loop instead of blocking:
- Run
python3 .claude/skills/iterate-pr/scripts/fetch_pr_checks.pyto get current CI status - If all checks passed → proceed to exit conditions
- If any checks failed (none pending) → return to step 5
- If checks are still pending:
a. Run
python3 .claude/skills/iterate-pr/scripts/fetch_pr_feedback.pyfor new review feedback b. Address feedback based on mode:- Default mode: new
high/medium - Full modes: every new non-resolved item (
high/medium/low/bot) and reply to each item c. If changes were needed, commit and push (this restarts CI) d. In full modes, after each push, explicitly re-request review: - Prefer Gemini review command (
/gemini review) when available - Otherwise request Copilot review by commenting
@copilot reviewon the PR e. Sleep 30 seconds (don't increase on subsequent iterations), then repeat from sub-step 1
- Default mode: new
- After all checks pass, do a final feedback check:
sleep 10, then runpython3 .claude/skills/iterate-pr/scripts/fetch_pr_feedback.py.- Default mode: address any new
high/mediumfeedback; if changes are needed, return to step 6 - Full modes: address any new non-resolved item; if changes are needed, return to step 6 and re-request review
- Default mode: address any new
8. Repeat
If step 7 required code changes (from new feedback after CI passed), return to step 2 for a fresh cycle. CI failures during monitoring are already handled within step 7's polling loop.
In full modes, continue looping until both conditions are true:
- CI checks are green
- No new non-resolved feedback is returned after the latest review request
9. Finish by Mode
- Default mode: stop after success conditions are met (do not merge automatically)
full: once CI is green and no new feedback remains, merge administratively - do not wait for a required-approval status to clear:
gh pr merge <PR_NUMBER> --admin --delete-branch--admin uses the authenticated account's admin/maintainer permissions to bypass the
required-approving-review branch-protection rule; it does not bypass or skip the CI-green
and feedback-resolved checks this skill already enforces in steps 4-7, and it never fabricates
or requests an approving review from another account. If the command fails (e.g. the
authenticated account lacks admin/maintainer rights on the repo, or a check can't be
bypassed), stop and surface the gh error to the user - do not retry under a different
identity and do not fall back silently.
--release: complete--fullmode merge, then cut a release:- Find the draft release tag:
gh release list --repo layer5io/meshery-cloud --json tagName,isDraft --jq '.[] | select(.isDraft) | .tagName' - Review draft notes:
gh release view vX.Y.Z --repo layer5io/meshery-cloud - Publish the release:
gh release edit vX.Y.Z --repo layer5io/meshery-cloud --draft=false --latest
- Find the draft release tag:
Exit Conditions
Success (default): All checks pass, post-CI feedback re-check is clean (no new unaddressed high/medium feedback including review bot findings), user has decided on low-priority items.
Success (full): All checks pass, no new non-resolved feedback remains after the latest review request, every feedback item has a reply, and the PR is administratively merged (no wait on a required-approval status).
Success (--release): --full success criteria are met and the draft GitHub release has been published.
Ask for help: Same failure after 2 attempts, feedback needs clarification, infrastructure issues, or gh pr merge --admin fails (insufficient permissions or an unbypassable check) - surface the error rather than retrying under a different identity or falling back silently.
Stop: No PR exists, branch needs rebase.
Fallback
If scripts fail, use gh CLI directly:
gh pr checks --json name,state,bucket,linkgh run view <run-id> --log-failedgh api repos/{owner}/{repo}/pulls/{number}/comments
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.

