fix-review-comments
БесплатноБез исполняемых скриптовНе проверенFetch unresolved GitHub PR review comments and automatically fix the code. Use when: (1) running '/fix-review-comments', (2) asked to "fix review comments"…
от abyssparanoia★ 20 звёзд на GitHubОб этом скилле
Fix Review Comments
Fetch unresolved PR review threads and fix the code automatically.
Step 1: Detect PR
# From current branch (no argument)
gh pr view --json number,url | jq -r '"#\(.number) \(.url)"'
# Or use the number passed as argument
Extract owner and repo from remote:
gh repo view --json owner,name | jq -r '"\(.owner.login) \(.name)"'
Step 2: Fetch Unresolved Review Threads (GraphQL)
gh api graphql -f query='
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
reviewThreads(first: 100) {
nodes {
id
isResolved
isOutdated
path
line
startLine
comments(first: 20) {
nodes {
body
author { login }
diffHunk
createdAt
}
}
}
}
}
}
}' -f owner=OWNER -f repo=REPO -F number=NUMBER
Filter to keep only threads where isResolved == false.
Step 3: Classify Comments
For each unresolved thread, read the first comment's body (the original review comment). Classify:
| Type | Action |
|---|---|
| Requires code change | Fix |
| Question / acknowledgment / "LGTM" / praise | Skip |
| Discussion / "let's discuss" / "not blocking" | Skip |
| Nit / style suggestion (non-blocking) | Fix unless explicitly marked optional |
Use judgment: a comment like "this looks a bit confusing, what do you think?" is discussion. A comment like "this should use nullable.Type[T] instead of a pointer" requires a fix.
Step 4: Read Files and Apply Fixes
For each thread requiring a fix:
- Read the file at
thread.path - Use
thread.line(orstartLine..linefor multi-line) to locate the relevant code - Use
diffHunkfrom the first comment for extra context about the surrounding code - Apply the fix based on the comment instruction
- Note: if
isOutdated == true, the code may have already changed — verify the issue still exists before fixing
Fix all actionable threads before running any verification.
Step 5: Update Rules
After fixing the code, evaluate whether any review comment reveals a missing or incomplete coding convention in the project rules.
When to update rules:
- The reviewer points out a pattern that is not documented in
.claude/rules/*.md - The reviewer identifies an AI anti-pattern that is not in
ai-antipatterns.md - The fix represents a recurring mistake AI models make
Rule file mapping:
| Comment topic | Target rule file |
|---|---|
| Domain model (constructor, state transition, enum) | .claude/rules/domain-model.md |
| Repository query, marshaller | .claude/rules/repository.md |
| Usecase interactor (transaction, locking, IdP sync) | .claude/rules/usecase-interactor.md |
| gRPC handler, marshaller | .claude/rules/grpc-handler.md |
| Proto definition | .claude/rules/proto-definition.md |
| Test patterns (mock, table-driven) | .claude/rules/testing.md |
| Common AI mistakes (any layer) | .claude/skills/review-diff/references/ai-antipatterns.md |
If updating ai-antipatterns.md:
- Assign the next sequential number (check current highest)
- Add a new section
### N. Descriptionwith BAD/GOOD examples and Why - Renumber
SKILL.mdpriority list andchecklists.mdif the pattern number shifts existing ones - Add the new pattern number to the
review-diff/SKILL.mdpriority patterns list - Add a checklist item to
review-diff/references/checklists.mdin the relevant section
Step 6: Verify
/usr/bin/make lint.go
Run tests if logic changed:
/usr/bin/make test
Step 7: Commit and Push
Stage all changed files and commit. If code fixes and rule updates are logically separate, consider two commits:
# Option A: single commit
git add <changed files>
git commit -m "fix: address PR review comments"
# Option B: two commits when rules were also updated
git add <code files>
git commit -m "fix: address PR review comments"
git add .claude/
git commit -m "docs: update rules based on review feedback"
git push
Step 8: Report
## Fix Review Comments Summary
PR: #NNN
### Fixed (N)
1. `path/to/file.go:line` — short description of fix
Comment: "@author: ..."
### Rules Updated (N)
1. `.claude/rules/foo.md` — added rule about X
2. `.claude/skills/review-diff/references/ai-antipatterns.md` — added anti-pattern #N: Y
### Skipped (N)
1. `path/to/file.go:line` — reason (already resolved / discussion / no code change needed)
Comment: "@author: ..."
### Verification
- [x] lint.go passes
- [x] tests pass
- [x] committed and pushed
Notes
- Do not resolve threads via the API — the user confirms fixes via GitHub UI
- If a thread's
isOutdated == trueand the problem no longer exists in current code, note it in the Skipped section with reason "already fixed (outdated t
Установить fix-review-comments в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл fix-review-comments?
Fetch unresolved GitHub PR review comments and automatically fix the code. Use when: (1) running '/fix-review-comments', (2) asked to "fix review comments", "address PR comments", "respond to review", or similar. Can target the PR for the current branch, or a specific PR number (e.g. '/fix-review-comments 123'). Skips already-resolved threads and discussion-only comments that require no code change.
Как установить скилл fix-review-comments?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл fix-review-comments запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic