.claude/skills/fix-bot-reviews/SKILL.md
--- name: fix-bot-reviews description: > Fixes bot review comments on a PR by creating a worktree, applying fixes, and opening a stacked fix PR. disable-model-invocation: false allowed-tools: Bash, Edit, Glob, Grep, Read argument-hint: [--re-review] [pr-number] --- You are fixing bot review comments on a pull request. The fixes are applied in a new worktree and shipped as a stacked PR based on the original branch. Follow every step in order. ## Step 1: Determine the pull request Parse `$A
npx skillsauth add nickolashkraus/dotfiles .claude/skills/fix-bot-reviewsInstall 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.
You are fixing bot review comments on a pull request. The fixes are applied in a new worktree and shipped as a stacked PR based on the original branch. Follow every step in order.
Parse $ARGUMENTS for the --re-review flag and an optional PR number. The
--re-review flag means all bot comments should be re-reviewed, even those
already resolved or replied to. Remove the flag before continuing.
If a PR number was provided, use it. Otherwise, detect the current branch and find its open PR:
gh pr view --json number,headRefName,baseRefName \
--jq '{number, headRefName, baseRefName}'
If no PR is found, stop and tell the user.
Save the PR number, head branch name, and base branch name for later steps.
Also determine the {owner}/{repo} from the remote:
gh repo view --json nameWithOwner --jq '.nameWithOwner'
Collect bot comments from both sources:
PR review comments (inline comments on diffs):
gh api repos/{owner}/{repo}/pulls/<pr-number>/comments --paginate
Review-level comments (comments attached to reviews): List all reviews, filter for bot authors, then fetch each review's comments:
gh api repos/{owner}/{repo}/pulls/<pr-number>/reviews --paginate \
--jq '.[] | select(
.user.login == "sentry[bot]" or
.user.login == "cursor[bot]" or
.user.login == "copilot[bot]" or
.user.type == "Bot"
) | .id'
Then for each review ID:
gh api repos/{owner}/{repo}/pulls/<pr-number>/reviews/<review-id>/comments
Filter for comments left by review bots (Copilot, Cursor Bugbot, Sentry, or similar).
If --re-review was set, skip this subsection entirely. Act on all bot
comments regardless of resolution or reply status.
For each bot comment, check whether:
nickolashkraus) has already replied. Check the
comment's reply thread for any comment where
.user.login == "nickolashkraus".Skip any comment that is resolved or already has a reply from
nickolashkraus. Only act on unresolved comments with no reply.
If no actionable bot comments remain, stop and tell the user.
Create a new worktree from the PR's head branch as a peer directory with a new fix branch:
git worktree add -b <head-branch>-fixes-<number> \
../<head-branch>-fixes-<number> <head-branch>
All subsequent work (file reads, edits, CI commands) happens in the worktree
directory (../<head-branch>-fixes-<number>).
For each unresolved bot comment, assess whether it is legitimate.
Bias toward fixing. If the suggestion is plausible, fix it. Only dismiss a comment if it is clearly wrong:
For each comment:
Legitimate issue (default): Read the relevant source files in the worktree to understand context, then apply the fix directly.
Clearly illegitimate: Reply with a brief explanation of why the suggestion does not apply:
gh api repos/{owner}/{repo}/pulls/<pr-number>/comments \
-f body='<reply>' -F in_reply_to=<comment-id>
Run the project's test/lint/build commands in the worktree to verify the fixes.
Use the project configuration (e.g., Makefile, package.json,
pyproject.toml) to identify the correct commands.
If any command fails, fix the issue and re-run until all checks pass locally.
Commit all fixes in the worktree. Follow the commit rules from @~/.claude/rules/git.md:
Push the fix branch:
git push -u origin <head-branch>-fixes-<number>
Create a pull request with the original PR's head branch as the base:
gh pr create --base <head-branch> --head <head-branch>-fixes-<number> \
--title "..." --body "..."
Write the PR description following @~/.claude/rules/git.md. Include a summary of which bot comments were fixed and which were dismissed (with reasons).
Print the fix PR URL.
/fix-ciRun /fix-ci --in-place <new-pr-number> on the fix PR to handle any CI
failures and new bot comments that appear. The --in-place flag ensures
/fix-ci fixes bot comments directly on the fix branch instead of delegating
back to /fix-bot-reviews (which would cause infinite recursion).
List each bot comment and what you did: fixed, dismissed (with reason), or skipped (already resolved/replied).
If any bot comments were addressed (fixed or dismissed), post a summary comment
on the fix PR using tables. Number findings sequentially (F-01, F-02, ... for
fixed; D-01, D-02, ... for dismissed). Use each bot comment's html_url for
the link column.
gh pr comment <fix-pr-number> --body "$(cat <<'EOF'
## Bot Review Findings
### Fixed
| # | Comment | Description | Fix |
| ---- | ------------------ | ------------- | -------- |
| F-01 | [→](<comment-url>) | <description> | <commit> |
| F-02 | [→](<comment-url>) | <description> | <commit> |
### Dismissed
| # | Comment | Description | Reason |
| ---- | ------------------ | ------------- | -------- |
| D-01 | [→](<comment-url>) | <description> | <reason> |
| D-02 | [→](<comment-url>) | <description> | <reason> |
EOF
)"
Omit a section if it has no entries. If there are zero findings (nothing fixed or dismissed), post:
gh pr comment <fix-pr-number> --body '## Bot Review Findings
✅ No actionable findings.'
This summary is in addition to the individual replies already posted on each bot comment thread.
tools
Check the veracity of a claim against notes, documentation, and resources. Takes a string argument or reads from the clipboard.
development
Generates a Technical Requirements Document through structured interviews and codebase analysis.
content-media
Update a Notion page with the Markdown contents of a local file.
content-media
Update a Linear issue with the Markdown contents of a local file.