self-review
Review the current branch's PR diff using a separate Claude Code agent and post inline comments via GitHub API. Optionally auto-fix findings.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Review the current branch's PR diff using a separate Claude Code agent and post inline comments via GitHub API. Optionally auto-fix findings.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Set up Cloudflare Turnstile end-to-end in a project — scan the codebase, create the widget via the Cloudflare API, deploy the managed siteverify Worker, write the frontend snippets, validate, and persist the skill. Load this when a user asks to add Turnstile, set up CAPTCHA, protect a form from bots, or fix a Turnstile integration. Mirrors developers.cloudflare.com/turnstile/spin.
Address code review comments from Copilot and other bots on the current branch's PR. Implements fixes if needed, commits, pushes, and replies to each comment.
Bundle dependabot PRs into a single PR and create a PR to master.
Generate commit message in Japanese from git diff.
Generate commit message in English from git diff.
Generate daily report from claude
| name | self-review |
| description | Review the current branch's PR diff using a separate Claude Code agent and post inline comments via GitHub API. Optionally auto-fix findings. |
Use a separate Claude Code agent (in a worktree) to review the current branch's PR diff, then post inline review comments to the PR via gh api. This serves as a Copilot-independent code review that respects project-specific CLAUDE.md rules.
<pr-number> - PR number (default: current branch's PR)--fix - After posting review comments, automatically implement fixes, commit, and push--loop - After fixing, re-review and repeat until zero actionable findings (max 5 iterations)Examples:
/self-review - Review current branch's PR and post comments/self-review 42 - Review PR #42/self-review --fix - Review and auto-fix all findings/self-review --fix --loop - Review, fix, re-review until cleangit branch --show-current
gh pr view --json number,url,headRefName,baseRefName
gh repo view --json nameWithOwner -q .nameWithOwner
If no PR exists, inform the user and exit.
Get the full diff:
gh pr diff {pr_number}
Get the list of changed files:
gh pr diff {pr_number} --name-only
Spawn an Agent with subagent_type: "general-purpose" and isolation: "worktree" (read-only — the reviewer must NOT edit files).
The reviewer agent's prompt must include:
Tell the reviewer agent to check for:
Tell the reviewer agent to NOT flag:
Tell the reviewer agent to return ONLY a JSON array (no markdown, no preamble):
[
{
"path": "internal/service/foo.go",
"line": 42,
"severity": "error|warning|suggestion",
"message": "Short description of the issue",
"suggestion": "Optional: what the code should look like instead"
}
]
If there are no findings, return an empty array: []
The line must refer to a line number in the NEW version of the file (right side of the diff). The reviewer agent must read the actual file (not just the diff) to get accurate line numbers.
Parse the JSON array from the reviewer agent's response. If the response is not valid JSON or is empty, report "No issues found" and exit.
Categorize findings by severity:
Present the findings to the user:
## Self-Review Findings
### Errors (X)
1. [path:line] message
### Warnings (X)
1. [path:line] message
### Suggestions (X)
1. [path:line] message
For each finding, post an inline review comment using the GitHub API.
First, get the HEAD commit SHA of the PR:
gh pr view {pr_number} --json headRefOid -q .headRefOid
Then post each comment:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
-f body="$(cat <<'EOF'
**[{severity}]** {message}
{suggestion if present, formatted as a code suggestion block}
EOF
)" \
-f commit_id="{head_commit_sha}" \
-f path="{path}" \
-F line={line} \
-f side="RIGHT"
Important: The line parameter must be a line that appears in the diff. If a finding refers to a line outside the diff hunk, post it as a PR-level comment instead:
gh pr comment {pr_number} --body "**[{severity}]** \`{path}:{line}\` — {message}"
--fix specified)If --fix is specified, for each error and warning finding:
make build-check or equivalent)Then commit and push:
git add <modified-files>
git diff --cached --stat
git commit -m "fix: address self-review findings
<bullet list of fixes>"
git push
After pushing, reply to each comment that was fixed:
COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_SHORT=$(git rev-parse --short HEAD)
FILE_HASH=$(echo -n "{path}" | shasum -a 256 | cut -d' ' -f1)
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
-f body="Fixed in ${COMMIT_SHORT}.
→ [View diff](https://github.com/{owner}/{repo}/commit/${COMMIT_SHA}#diff-${FILE_HASH})"
--loop specified)Requires --fix. After fixing and pushing:
Exit conditions:
Display final summary:
## Self-Review Complete
**Iterations:** 2
**Total findings posted:** 8
**Findings fixed:** 6
**Remaining suggestions:** 2
**Files modified:** file1.go, file2.go
**PR:** <link>
In zsh, != gets escaped to \!=, causing jq parse errors. Always use the | not pattern:
# BAD — breaks in zsh
jq 'select(.body != null)'
# GOOD — safe in zsh
jq 'select(.body | . == null | not)'
gh is not authenticated, inform the user to run gh auth login--fix: NEVER commit or pushgh is authenticated as)**[error]**, **[warning]**, **[suggestion]**/address-review — use /self-review to find issues, then /address-review to handle external reviewer feedback