.codex/skills/review-and-merge-pr/SKILL.md
Review an open GitHub pull request, inspect feedback from Cursor Bugbot, CodeRabbit, CI, and human reviewers, decide which findings are valid, implement fixes on the PR branch, merge the PR into master when it is ready, and finalize any linked GitHub issue so it matches the make-closed-issue workflow after merge. Use when the user says "check the PR", "address bugbot comments", "handle CodeRabbit feedback", "review PR feedback", or "merge this PR".
npx skillsauth add bitsocialnet/seedit review-and-merge-prInstall 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.
Use this skill after a feature branch already has an open PR into master.
Stay on the PR branch, treat review bots as input rather than authority, and only merge once the branch is verified and the remaining comments are either fixed, explicitly deferred, or explicitly declined with a reason.
Do not let repeated nitpicks, speculative future-work comments, or low-value bot suggestions keep the PR open once they have been triaged as non-blocking.
Finish the workflow by cleaning up local git state yourself; do not assume GitHub, gh pr merge --delete-branch, or GitHub Desktop removed the local feature branch or any local pr/<number> alias.
Prefer the PR for the current branch when the branch is not master.
If the current branch is master, inspect open PRs and choose the one that matches the user request.
If there is no open PR yet, stop and use make-closed-issue first.
Useful commands:
gh pr status
gh pr list --repo bitsocialnet/seedit --state open
gh pr view <pr-number> --repo bitsocialnet/seedit --json number,title,url,headRefName,baseRefName,isDraft,reviewDecision,mergeStateStatus
Read the PR state, checks, issue comments, review summaries, and inline review comments before deciding what to change. Do not merge based only on the top-level review verdict.
Useful commands:
gh pr view <pr-number> --repo bitsocialnet/seedit --json number,title,url,headRefName,baseRefName,isDraft,reviewDecision,mergeStateStatus
gh pr checks <pr-number>
gh api "repos/bitsocialnet/seedit/issues/<pr-number>/comments?per_page=100"
gh api "repos/bitsocialnet/seedit/pulls/<pr-number>/reviews?per_page=100"
gh api "repos/bitsocialnet/seedit/pulls/<pr-number>/comments?per_page=100"
Focus on comments from:
Sort feedback into these buckets:
must-fix: correctness bugs, broken behavior, crashes, security issues, test failures, reproducible regressionsshould-fix: clear maintainability or edge-case issues with concrete evidencedefer: real but non-blocking follow-up work that can land later without making this PR unsafe to mergedecline: false positives, stale comments, duplicate findings, speculative style-only suggestions, feedback already addressed in newer commits, or nitpicks that are not worth blocking mergeRules:
must-fix findings.should-fix and defer findings are not merge blockers by default; use judgment and prefer merging once the branch is safe, verified, and the remaining comments are low-value or future work.defer or decline, do not keep reopening the same discussion unless new evidence appears or the user explicitly asks for a follow-up pass.Switch to the PR branch if needed, apply the valid fixes, and push new commits to the same branch. Do not open a replacement PR unless the user explicitly asks for that.
Useful commands:
git switch <head-branch>
git fetch origin <head-branch>
git status --short --branch
git add <files>
git commit -m "fix(scope): address review feedback"
git push
After code changes, follow repo verification rules from AGENTS.md:
yarn build, yarn lint, and yarn type-checkyarn test after adding or changing testsplaywright-cli for UI/visual changes across chrome, firefox, and webkit, plus a mobile viewport flow in each engine when relevantSummarize what was fixed, what was deferred, and what was declined.
Use gh pr comment for a concise PR update when the branch changed because of review feedback.
Example:
gh pr comment <pr-number> --repo bitsocialnet/seedit --body "Addressed the valid review findings in the latest commit. Remaining bot comments were triaged as stale, low-value, or follow-up work that does not block this merge."
Merge only if all of these are true:
mastermust-fix reviewer findings remainshould-fix, defer, or decline items were consciously triaged and are not worth blocking mergePreferred merge command:
gh pr merge <pr-number> --repo bitsocialnet/seedit --squash --delete-branch
make-closed-issueAfter merge, inspect the PR's linked closing issues.
For every linked issue, bring it into the same final state expected from make-closed-issue:
seedit project if missingDoneBefore editing issue assignees, determine the current contributor's GitHub username from the authenticated gh session.
If gh is not signed in or cannot resolve the login, stop and ask the contributor for their GitHub username before proceeding.
If the PR has no linked issue, explicitly tell the user that there was no associated issue to finalize.
Useful commands:
GH_LOGIN=$(gh api user --jq '.login' 2>/dev/null || true)
if [ -z "$GH_LOGIN" ]; then
echo "GitHub username could not be determined from gh auth. Ask the contributor for their GitHub username before proceeding."
exit 1
fi
ISSUE_NUMBERS=$(gh pr view <pr-number> --repo bitsocialnet/seedit --json closingIssuesReferences --jq '.closingIssuesReferences[].number')
if [ -n "$ISSUE_NUMBERS" ]; then
FIELD_JSON=$(gh project field-list 1 --owner bitsocialnet --format json)
STATUS_FIELD_ID=$(echo "$FIELD_JSON" | jq -r '.fields[] | select(.name=="Status") | .id')
DONE_OPTION_ID=$(echo "$FIELD_JSON" | jq -r '.fields[] | select(.name=="Status") | .options[] | select(.name=="Done") | .id')
for ISSUE_NUMBER in $ISSUE_NUMBERS; do
ISSUE_STATE=$(gh issue view "$ISSUE_NUMBER" --repo bitsocialnet/seedit --json state --jq '.state')
if [ "$ISSUE_STATE" != "CLOSED" ]; then
gh issue close "$ISSUE_NUMBER" --repo bitsocialnet/seedit
fi
if ! gh issue view "$ISSUE_NUMBER" --repo bitsocialnet/seedit --json assignees --jq '.assignees[].login' | grep -qx "$GH_LOGIN"; then
gh issue edit "$ISSUE_NUMBER" --repo bitsocialnet/seedit --add-assignee "$GH_LOGIN"
fi
ITEM_ID=$(gh project item-list 1 --owner bitsocialnet --limit 1000 --format json --jq ".items[] | select(.content.number == $ISSUE_NUMBER) | .id" | head -n1)
if [ -z "$ITEM_ID" ]; then
ITEM_JSON=$(gh project item-add 1 --owner bitsocialnet --url "https://github.com/bitsocialnet/seedit/issues/$ISSUE_NUMBER" --format json)
ITEM_ID=$(echo "$ITEM_JSON" | jq -r '.id')
fi
gh project item-edit --id "$ITEM_ID" --project-id PVT_kwDODohK7M4BM4wg --field-id "$STATUS_FIELD_ID" --single-select-option-id "$DONE_OPTION_ID"
done
fi
After the PR is merged:
git switch master
git fetch origin --prune
git pull --ff-only
git branch -D <head-branch> 2>/dev/null || true
git branch -D "pr/<pr-number>" 2>/dev/null || true
This cleanup is required even when the remote branch was deleted automatically or the merge happened in GitHub Desktop or the GitHub web UI.
Remote deletion only removes the remote branch; it does not remove the local feature branch, the local pr/<number> checkout alias, or stale remote-tracking refs in your clone.
Use -D rather than -d here because squash merges usually leave the local branch looking unmerged by ancestry even when the PR is already merged and safe to remove.
If the PR branch lived in a dedicated worktree, remove that worktree after leaving it:
git worktree list
git worktree remove /path/to/worktree
Tell the user:
Donepr/<number> alias, and any worktree were cleaned updevelopment
Perform a refactor pass focused on simplicity after recent changes. Use when the user asks for a refactor/cleanup pass, simplification, dead-code removal, or says "refactor pass".
devops
When the user wants to create or update a README.md file for a project. Also use when the user says "write readme," "create readme," "document this project," "project documentation," or asks for help with README.md. This skill creates absurdly thorough documentation covering local setup, architecture, and deployment.
tools
Profile app performance while browsing, collecting Web Vitals and React rerender data via react-scan. Orchestrates parallel profiler subagents via playwright-cli to capture navigation timing, long tasks, layout shifts, LCP, React commit counts, render bursts, and per-component render data. Use when profiling browsing performance, finding bottlenecks, diagnosing excessive rerenders, or auditing page performance.
tools
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.