skills/pr-fix-loop/SKILL.md
Systematic PR fix loop — checks feedback from all channels (conversation, inline, reviews), fixes code, posts fix reports, and loops until no new feedback remains. All operations through provided scripts.
npx skillsauth add aivokone/ak-skills-ops pr-fix-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.
Systematic workflow for checking, responding to, and reporting on PR feedback from any source — human reviewers, review bots (CodeRabbit, Gemini, Codex, Snyk, etc.), or AI agents.
Requirements: GitHub repository with GitHub CLI (gh) installed and authenticated.
Key insight: PR feedback arrives through three different channels (conversation comments, inline threads, review submissions). Missing any channel means missing feedback. This skill ensures all channels are checked systematically.
| Mode | When | What happens | |------|------|--------------| | loop (default) | No mode specified | Full fix-review cycle: check → fix → report → re-invoke → repeat until done (max 5 rounds) | | check | "check", "status" | Show current feedback from all channels, then stop | | invoke | "invoke", "invoke gemini" | Invoke review agents (all or named), then stop | | single-pass | "single-pass", "once" | Check → fix → report once, no re-invoke or looping |
Invocation examples:
/pr-fix-loop → loop mode (default)/pr-fix-loop check → just show feedback/pr-fix-loop invoke → invoke all review agents/pr-fix-loop invoke gemini,codex → invoke specific agents/pr-fix-loop single-pass → one round of fixes, no loopALL operations MUST go through the provided scripts. Never run raw git, gh, date, or bash heredocs (cat > file << 'EOF') when a script or agent tool covers the same operation.
| Instead of (prohibited) | Use |
|---|---|
| git status, git branch, gh pr view, gh repo view | get-context.sh |
| git add, git commit, git push | commit-and-push.sh |
| git checkout -b, git switch -c | open-branch.sh |
| gh pr create | create-pr.sh |
| gh api repos/.../comments, gh pr view --json | check-pr-feedback.sh |
| gh api ... -f body= (posting comments) | post-fix-report.sh or reply-to-inline.sh |
| date -u +%Y-%m-%dT%H:%M:%SZ | get-context.sh (outputs timestamp: field) |
| cat > file.md << 'EOF' (bash heredoc) | Agent's native Write tool to .agents/scratch/, then pass file path to script |
| echo "..." \| script.sh (piped stdin) | Script's direct flag: -m, --body, or file-path argument |
Entry point: Always start with get-context.sh to detect current state. Use its output to decide next steps via the Decision Tree below.
File creation: When a script accepts a file path (e.g., create-pr.sh --body, post-fix-report.sh), write the file to .agents/scratch/ using the agent's native Write tool, then pass the path to the script. Never use bash heredocs to create temp files.
.agents/scratch/ — inside the repo, avoids out-of-tree write permission promptsmkdir -p .agents/scratch before the first write if it doesn't exist.agents/ is in the project's .gitignoreAcceptable raw commands: Project-specific test/build commands (npm test, npm run <script>, pytest, make build, etc.) are fine — these are not PR workflow operations. For creating test fixtures, use the agent's native Write tool (write to .agents/scratch/) instead of printf or echo redirects. Avoid echo ... | command — piped commands trigger permission prompts in sandboxed environments.
Always start with get-context.sh to detect current state. Then select the mode from the user's prompt (see Modes above) and follow the matching workflow below.
get-context.sh — detect PR numbercheck-pr-feedback.sh — show all feedback from all channelsget-context.sh — detect PR numberinvoke-review-agents.sh [with --agents if user named specific agents]get-context.sh — detect statecheck-pr-feedback.sh — get all feedbackcommit-and-push.sh -m "fix: address review feedback"reply-to-inline.sh for each addressed inline commentpost-fix-report.shget-context.sh — detect stateBased on get-context.sh output, ensure a branch and PR exist before proceeding:
| on_default | has_changes | pr_number | Action sequence |
|---|---|---|---|
| true | true | empty | open-branch.sh → commit-and-push.sh → create-pr.sh --invoke --title "..." |
| true | false | empty | Ask user what to do (no changes to work with) |
| false | any | has number | Continue (PR exists) |
| false | true | empty | commit-and-push.sh → create-pr.sh --invoke --title "..." |
| false | false | empty | create-pr.sh --invoke --title "..." (branch exists, already pushed) |
Script path resolution: Before running any script, determine the correct base path. Check in this order:
~/.claude/skills/pr-fix-loop/scripts/ — global install for Claude CodeUse whichever path exists. Script paths below use the global form; substitute accordingly for your agent or install method.
~/.claude/skills/pr-fix-loop/scripts/get-context.sh
Outputs key-value pairs: branch, on_default, has_changes, change_summary, pr_number, pr_url, pr_state, timestamp, repo. Use timestamp for wait-for-reviews.sh --since. Gracefully handles missing gh (empty PR/repo fields). Exits 1 only on detached HEAD or not in a git repo.
~/.claude/skills/pr-fix-loop/scripts/open-branch.sh [BRANCH_NAME]
If already on a non-main/master branch, prints branch name and exits. If on main/master, creates branch, switches, and pushes with -u. Default name: review-loop-YYYYMMDD-HHMMSS.
~/.claude/skills/pr-fix-loop/scripts/check-pr-feedback.sh [PR_NUMBER]
Checks all three channels: conversation comments, inline comments, reviews.
If no PR number provided, detects current PR from branch.
~/.claude/skills/pr-fix-loop/scripts/reply-to-inline.sh <COMMENT_ID> "Your message"
~/.claude/skills/pr-fix-loop/scripts/reply-to-inline.sh <COMMENT_ID> .agents/scratch/reply.md
Replies in-thread to inline comments. Accepts message as inline text or a file path (auto-detects). Use file path when message contains ${...} or other shell-sensitive syntax to avoid permission prompts. Uses -F flag (not --raw-field) which properly handles numeric ID conversion in gh CLI.
Must be run from repository root with an active PR branch.
Important: Always sign inline replies with your agent identity (e.g., —Claude Sonnet 4.5, —GPT-4, —Custom Agent) to distinguish agent responses from human responses in the GitHub UI.
~/.claude/skills/pr-fix-loop/scripts/invoke-review-agents.sh [--agents SLUG,...] [--format-only] [PR_NUMBER]
Posts trigger comments to start agent reviews. Without --agents, invokes all known agents (Codex, Gemini, CodeRabbit). Use --list to see available agents. Use --format-only to print trigger text to stdout without posting (for embedding in PR body).
~/.claude/skills/pr-fix-loop/scripts/post-fix-report.sh [PR_NUMBER] .agents/scratch/fix-report.md
~/.claude/skills/pr-fix-loop/scripts/create-pr.sh --title "PR title" --body .agents/scratch/pr-body.md [--invoke]
Or body as inline text:
~/.claude/skills/pr-fix-loop/scripts/create-pr.sh --title "PR title" --body "Short description"
--body auto-detects: if the value is a readable file, reads from it; otherwise treats as text. Idempotent: if a PR already exists, outputs its info. Refuses to run on main/master. Pushes branch if not yet pushed.
--invoke appends review agent trigger text to the PR body (via invoke-review-agents.sh --format-only), avoiding a separate trigger comment that causes double-invocations when auto-review is enabled.
Output prefixes (machine-parseable):
EXISTS: <url> — PR already existed for this branchCREATED: <url> — new PR was created~/.claude/skills/pr-fix-loop/scripts/commit-and-push.sh -m "fix: address review feedback"
Stages all changes, commits, and pushes. Refuses to run on main/master. Never force-pushes. Outputs commit hash and branch.
~/.claude/skills/pr-fix-loop/scripts/wait-for-reviews.sh [PR_NUMBER] --since TIMESTAMP [--timeout 600] [--interval 30]
Polls all three feedback channels for new comments posted after TIMESTAMP by non-self users. Exits 0 when new feedback detected, exits 1 on timeout. Default: 10 min timeout, 30s interval.
~/.claude/skills/pr-fix-loop/scripts/check-new-feedback.sh [PR_NUMBER] --since TIMESTAMP
Like check-pr-feedback.sh but only shows feedback created after TIMESTAMP, excluding self-posted comments. Use in loop mode to distinguish new from already-addressed feedback. Ends with a summary line: Summary: N conversation, M inline, K reviews.
Always use commit-and-push.sh for committing. It stages all changes, commits, pushes, and enforces branch safety (refuses main/master, never force-pushes).
~/.claude/skills/pr-fix-loop/scripts/commit-and-push.sh -m "<type>: <outcome>"
Types: feat, fix, refactor, docs, chore, test
Before committing, verify:
npm test, pytest, etc.) if modifying working codecheck-pr-feedback.sh to catch any new commentsCreate .github/pull_request_template.md:
## Summary
-
## How to test
-
## Notes
- Review feedback may arrive in conversation comments, inline threads, or review submissions. Check all channels.
Or copy from assets/pr_template.md.
Fill Summary, How to test, and Notes sections.
| Channel | Reviewer Type | Format | |---------|---------------|--------| | Conversation | AI agents, humans | Top-level comments | | Inline | Review bots (CodeRabbit, Gemini, Codex, Snyk, etc.), humans | File/line threads | | Reviews | Humans, some bots | Approve/Request Changes + optional body |
~/.claude/skills/pr-fix-loop/scripts/check-pr-feedback.sh
Why: Different reviewers post in different channels. Missing any channel = missing feedback.
Three channels:
Never trust review feedback at face value. Before acting on any comment — whether from a human reviewer, review bot, or AI agent — critically evaluate it:
If a review comment is incorrect, respond with a clear explanation of why rather than applying a bad fix. Use WONTFIX status with reasoning in the Fix Report.
# Short messages — inline text:
~/.claude/skills/pr-fix-loop/scripts/reply-to-inline.sh <COMMENT_ID> "Fixed @ abc123. [details] —[Your Agent Name]"
# Messages with ${...} or shell-sensitive syntax — write to file first, pass path:
~/.claude/skills/pr-fix-loop/scripts/reply-to-inline.sh <COMMENT_ID> .agents/scratch/reply.md
Run invoke-review-agents.sh when check-pr-feedback.sh returns empty output from all three channels — no feedback means no agents have reviewed yet.
# No feedback on the PR? Invoke all agents:
~/.claude/skills/pr-fix-loop/scripts/invoke-review-agents.sh
# User mentioned specific agents (e.g., "ask Gemini and Codex to review"):
~/.claude/skills/pr-fix-loop/scripts/invoke-review-agents.sh --agents gemini,codex
Agent selection from prompt: If the user's prompt names specific agents (e.g., "have Codex review this"), use --agents with the matching slug(s). Otherwise invoke all.
Embedding in PR body: When creating a new PR with create-pr.sh --invoke, trigger text is appended to the PR body automatically (via --format-only). This avoids a separate trigger comment that would cause double-invocations when auto-review is enabled. Only use invoke-review-agents.sh directly when the PR already exists.
After invoking: Inform the user that trigger comments were posted and suggest running check-pr-feedback.sh again once agents have had time to respond (typically a few minutes).
See references/review-agents.md for the full agent registry and instructions for adding new agents.
After addressing feedback, always post ONE conversation comment (Fix Report). This is separate from requesting re-review — the Fix Report documents what was done, even if no re-review is needed.
Write the report with the agent's Write tool (e.g., to .agents/scratch/fix-report.md), then post it:
~/.claude/skills/pr-fix-loop/scripts/post-fix-report.sh .agents/scratch/fix-report.md
Fix Report format:
### Fix Report
- [file.ext:L10 Symbol]: FIXED @ abc123 — verified: `npm test` passes
- [file.ext:L42 fn]: WONTFIX — reason: intentional per AGENTS.md
- [file.ext:L100 class]: DEFERRED — tracking: #123
- [file.ext:L200 method]: QUESTION — Should this handle X?
Optionally, if re-review is needed, add @reviewer-username please re-review. at the end of the body.
| Status | Required Info | |--------|---------------| | FIXED | Commit hash + verification command/result | | WONTFIX | Reason (cite docs if applicable) | | DEFERRED | Issue/ticket link | | QUESTION | Specific question to unblock |
See references/fix-report-examples.md for real-world examples.
Use assets/fix-report-template.md as starting point.
Agent-reviewers MUST post ONE top-level conversation comment:
### Review - Actionable Findings
**Blocking**
- path/file.ext:L10-L15 (Symbol): Issue → Fix → Verify: `command`
**Optional**
- path/file.ext:L100 (class): Improvement → Fix
Rules:
file:line + symbol anchorDo NOT:
Why: Inline comments harder to retrieve. Conversation comments deterministic.
After Fix Report:
@reviewer please re-review. See Fix Report.Loop mode is the default. Run the full review-fix-review cycle autonomously until no new feedback remains.
Default max rounds: 5. Override with user instruction if needed.
Loop workflow:
open-branch.sh (idempotent — creates branch if on main/master)create-pr.sh --invoke --title "..." --body <path> — write body with agent Write tool, pass path. Capture output prefix (CREATED: / EXISTS:)CREATED:, skip (triggers in PR body). If EXISTS:, run invoke-review-agents.sh. Rounds 2+: agents triggered by @-mentions in previous Fix Report footer (no separate invoke step)wait-for-reviews.sh --since <timestamp> — use timestamp from get-context.sh (run after last commit, or after step 1 for round 1). Polls until new feedback or timeoutcheck-pr-feedback.sh (ALL feedback, all channels)commit-and-push.sh -m "fix: address review feedback round N"get-context.sh (capture timestamp for next wait step)reply-to-inline.sh for each addressed inline comment; sign with agent identity; tag the reviewer's @github-userpost-fix-report.sh <PR> <path>
@coderabbitai review on its own lineROUND < MAX_ROUNDS, go to step 3Why full check instead of differential: Using check-new-feedback.sh --since in the check step risks missing feedback that arrives during the fix phase (e.g., Gemini posts while agent is fixing Codex's comments). The full check + Fix Report comparison approach is gap-free.
Termination conditions (any):
wait-for-reviews.sh times out (no new feedback after invocation)Final round Fix Report footer:
Max review rounds (N) reached. Remaining items addressed above. Manual re-review recommended.
Inline reply tagging: When replying to a bot/agent inline comment, include the reviewer's GitHub username in the reply (e.g., —Claude Sonnet 4.6 | addressed @gemini-code-assist feedback).
See references/fix-report-examples.md Examples 7–8 for loop-mode Fix Reports.
If multiple reviewers flag the same issue:
- [file.php:L42 (ALL flagged)]: FIXED @ abc123 — verified: `npm test` passes
- Gemini: "use const"
- Codex: "prefer immutable"
- Claude: "const prevents reassignment"
- [file.php:L100]: QUESTION — Gemini suggests pattern A, Codex suggests pattern B. Which aligns with project conventions? See AGENTS.md.
Use check-pr-feedback.sh — its output already includes [user.login] for every comment across all three channels. Filter the output for the reviewer you need:
~/.claude/skills/pr-fix-loop/scripts/check-pr-feedback.sh | grep "coderabbitai"
"Can't find review comments"
→ Check all three channels. Use ~/.claude/skills/pr-fix-loop/scripts/check-pr-feedback.sh, not just gh pr view.
"Reviewer posted inline, should I reply inline?" → Yes, always. Reply inline with a brief ack so the comment can be resolved in GitHub UI. Also include in Fix Report.
"Multiple reviewers flagged same issue" → Fix once, report once (note all sources), tag all reviewers.
"Conflicting suggestions" → Mark QUESTION, check project docs, cite specific suggestions.
"Script can't detect PR" → Run from repository root. Must be on branch with open PR.
"Reply script fails with HTTP 422"
→ Use -F in_reply_to=ID not --raw-field. The -F flag works correctly with gh CLI for numeric IDs.
"Review suggestion broke working code" → Never trust suggestions blindly. Verify the issue exists, evaluate the fix, and test before committing. Review bots frequently hallucinate problems or suggest incorrect fixes.
"No feedback on PR — all three channels empty"
→ Agents haven't reviewed yet. Run ~/.claude/skills/pr-fix-loop/scripts/invoke-review-agents.sh to trigger them, then wait and re-check.
"Committed before checking latest feedback" → Run feedback check script immediately before declaring PR "ready" or "complete."
Key principles:
Most common mistakes:
❌ Only checking conversation or gh pr view
✅ Always run ~/.claude/skills/pr-fix-loop/scripts/check-pr-feedback.sh
❌ Blindly applying review suggestions without verifying the issue exists ✅ Read the actual code, confirm the problem, test the fix
tools
Create, edit, and debug SwiftBar menu bar plugins for macOS. ALWAYS use this skill when the user wants to put anything in the macOS menu bar — whether they say "menu bar plugin", "status bar widget", "menu bar item", or just want to show live data, counters, status indicators, or monitoring info in the macOS top bar. Also triggers for SwiftBar, BitBar, xbar by name, editing or debugging existing menu bar plugin scripts (.sh/.py with | parameters and --- separators), or any request to build a script that outputs formatted lines for a menu bar app. This is the go-to skill whenever macOS menu bar customization is involved, even if the user doesn't mention SwiftBar specifically — if they want a script-based menu bar item on macOS, this skill applies.
tools
Use this skill FIRST for any Seravo-hosted WordPress task. Trigger when the user mentions Seravo, production/shadow, deploy, Git-based deploys, SSH, DDEV, DB sync/import/export, or Seravo custom wp-* commands (wp-backup*, wp-purge-cache, wp-list-env). Start by identifying the environment (production vs shadow vs local) and enforce safety: agents must not run destructive or state-changing commands on production. When production write is needed, provide exact copy-paste commands for the user. Use Seravo-specific CLI and workflows instead of generic WP guidance to avoid wrong commands and risky prod changes.
development
Local docs cache for the project. Always check docs/reference/ before fetching externally. Use for init (set up cache), update (refresh docs), lookup (local-first search), and save (persist fetched docs). If external docs are fetched (Context7/web), save a tailored topic file to docs/reference/ and add a verbal pointer in AGENTS.md.
tools
Query any Google Ads account via GAQL. Use when the user asks about Google Ads campaigns, conversions, keywords, ad performance, or bidding. Triggered by: Google Ads, campaign, conversion, PPC, CPC, keyword, click, impression, ROAS, CPA.