.claude/skills/pr-loop/SKILL.md
Review, commit, create PR, then auto-address review comments in a loop.
npx skillsauth add elie222/inbox-zero pr-loopInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review code, create PR, then automatically address review comments.
Parse $ARGUMENTS for options:
--wait N → seconds between checks (default: 300)--max N → max review-loop iterations (default: 5)Important: All gh CLI commands require required_permissions: ['all'] due to TLS certificate issues in sandboxed mode.
NEVER include PII in commits, PR titles/descriptions, branch names, or code comments. PII includes: names, email addresses, phone numbers, addresses, usernames, account IDs, API keys, tokens, passwords, or any sensitive personal data. Commit messages describe the type of change, not specific data. Use generic terms like "user", "email", "record".
──────────
Append these to the existing task list (do NOT replace tasks already there from earlier work):
──────────
Use the Task tool to spin up a review subagent:
Task tool call:
subagent_type: "general-purpose"
description: "Review code changes"
prompt: <see below>
Subagent prompt must include:
git diff HEAD (or git diff --cached if there are staged changes).claude/skills/review/SKILL.md (categories, severity guide, project-specific checks)──────────
Read the subagent's output. For each finding:
If the subagent already auto-fixed [AUTO] items, verify they were applied.
──────────
Follow the .claude/skills/create-pr/SKILL.md workflow:
Check state:
git branch --show-current && git status -s && git diff HEAD --stat
Create branch if on main:
git checkout -b feat/<description> # or fix/ or chore/
Stage specific files (NOT git add .), commit, push:
git add <file1> <file2> ... && git commit -m "<generic message>" && git push -u origin <branch>
Create PR:
gh pr create --title "<feature_area>: <Title>" --body "<TLDR + bullets>"
Display the PR URL as [PR #<number>](<url>) and the branch name.
──────────
Repeat up to --max iterations (default 5):
sleep <wait-seconds>
Default: 300 seconds (5 minutes).
Fetch all comments and check reviewer status:
PR_NUM=$(gh pr view --json number --jq .number)
REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
# Fetch code review comments
gh api "repos/$REPO/pulls/$PR_NUM/comments" --jq '.[] | {id, body: .body[0:200], author: .user.login, created_at}'
# Fetch conversation comments
gh pr view --json comments --jq '.comments[] | {id, body, author: .author.login}'
# Check if reviewer checks are still running
gh pr checks $PR_NUM
Exit conditions — only exit if ALL are true:
gh pr checks and verify no reviewer checks (e.g. "Baz Reviewer", "cubic · AI code reviewer") are pending or in_progress. If any reviewer check is still running, they haven't finished posting comments yet — wait for the next iteration.If any condition is false, continue the loop.
Fetch code review comments:
.claude/skills/scripts/get-pr-review-comments.sh
Fetch conversation comments:
gh pr view --json comments --jq '.comments[] | {id, body, author: .author.login}'
For each comment:
# Reply to code review comment
gh api repos/$REPO/pulls/$PR_NUM/comments/$COMMENT_ID/replies -f body="<reply>"
# Reply to conversation comment
gh pr comment $PR_NUM --body "<reply>" --reply-to $COMMENT_ID
Critical rules:
After addressing all comments in this iteration:
git add <changed-files> && git commit -m "<generic message about addressing review feedback>" && git push
Go back to step 5a. Exit when:
tools
Use the Inbox Zero API CLI to inspect the live API schema, list and manage automation rules, and read inbox analytics through the public API. Use this when a task involves Inbox Zero rules, stats, or API-driven automation and can be solved through the CLI instead of browser interaction.
tools
Write focused unit tests for backend and utility logic
testing
Pause execution for a user-specified duration
testing
Update workspace packages while respecting the repo's pinned package list in .ncurc.cjs. Use when the user asks to update dependencies or refresh package versions.