一键导入
pr-comment-response
Respond to PR review comments by verifying bug reports with failing tests before fixing code — never blindly trust a reviewer
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Respond to PR review comments by verifying bug reports with failing tests before fixing code — never blindly trust a reviewer
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Write-then-verify documentation pipeline. Use when a user asks to improve comments or docs, explain algorithms or design choices, write or upgrade docstrings, or raise documentation quality for a codebase (especially Rust crates). Writes docs, then automatically verifies every claim against code reality using a fresh agent to eliminate confirmation bias.
Use when you have code review findings, PR comments, or review reports that need to be systematically addressed — especially when there are multiple findings across different files and severities
Use when creating any beads task — auto-researches the codebase, links related tasks, and produces a rich self-contained description from a structured template. Accepts minimal intent and outputs a complete task ready for agent implementation.
Use when you have code review findings, PR comments, or review reports that need to be systematically addressed — especially when there are multiple findings across different files and severities
Use when a task needs an implementation plan that is iteratively created and stress-tested through review-and-revise cycles before implementation begins — catches blind spots, incorrect codebase assumptions, unnecessary complexity, and performance pitfalls while changes are still cheap
Use when a markdown plan file exists and needs validation before implementation — catches design flaws, logic holes, footguns, unnecessary complexity, and performance concerns while changes are still cheap
| name | pr-comment-response |
| description | Respond to PR review comments by verifying bug reports with failing tests before fixing code — never blindly trust a reviewer |
Respond to pull request review comments using a test-driven, verify-first approach. Never blindly accept reviewer suggestions — prove they're right with a failing test before changing code.
/pr-comment-response <PR-number>Reviewers can be wrong. Treat every bug claim as a hypothesis, not a fact. The workflow is:
# Get all review comments on the PR
gh pr view <PR-number> --json reviews,comments
gh api repos/{owner}/{repo}/pulls/<PR-number>/comments
Collect every comment. Categorize each one:
| Category | Action |
|---|---|
| Bug report | Full verify-first workflow (Steps 2-6) |
| Style/naming suggestion | Evaluate on merit, apply if reasonable |
| Question / clarification | Reply with explanation |
| Refactor suggestion | Evaluate, apply if it improves clarity without risk |
| Nitpick | Apply if trivial and correct |
Focus the verify-first workflow on bug reports and correctness claims. These are the comments where blind trust is most dangerous.
For each comment claiming a bug or incorrect behavior:
Document your analysis before writing any test:
### Comment: [reviewer quote or summary]
- **File**: path/to/file.rs:LINE
- **Claim**: [what the reviewer says is wrong]
- **Trigger condition**: [input/state that would expose the bug]
- **Plausibility**: [high/medium/low — your initial assessment and why]
Write a test that directly targets the claimed bug. The test should:
#[test]
fn handles_empty_input_without_panic() {
let result = function_under_review(&[]);
assert!(result.is_ok(), "empty input should not panic");
}
Do NOT touch the production code yet.
cargo test <test_name> -- --nocapture
Two outcomes:
The bug is confirmed. Proceed to Step 5.
Record:
- **Verdict**: CONFIRMED — test fails with: [error message]
The code already handles this case correctly. Do not change the code.
Delete the verification test. It served its purpose — proving the reviewer's claim was wrong. Keeping it adds noise without value since it tests behavior that already works and wasn't at risk.
Record:
- **Verdict**: NOT REPRODUCED — test passes, code already handles this correctly
- **Verification test**: removed (served its diagnostic purpose)
- **Response**: [draft reply to reviewer explaining why the code is correct]
Skip to Step 6 for this comment.
Now — and only now — fix the production code:
# Confirm the fix
cargo test <test_name> -- --nocapture
# Check for regressions
cargo test
If the full suite passes, the fix is good. If new failures appear, investigate — the fix may have been too broad or revealed a deeper issue.
Draft responses for each comment:
For confirmed bugs:
Good catch! Confirmed — added a test (`test_name`) that reproduces this.
Fixed in [commit SHA]. The issue was [brief explanation].
For unconfirmed claims:
I investigated this and wrote a test targeting the scenario you described.
The test passes against the current code — [brief explanation of why the code is correct].
Let me know if I'm missing something.
For non-bug comments (style, refactor, questions): Address directly without the test workflow.
When a PR has many comments:
After processing all comments, produce a summary:
## PR Comment Response Summary — PR #<number>
### Bug Claims Investigated
| # | Comment | File | Verdict | Test | Fix |
|---|---------|------|---------|------|-----|
| 1 | [summary] | path:line | CONFIRMED | test_name (kept) | commit SHA |
| 2 | [summary] | path:line | NOT REPRODUCED | verified & removed | N/A |
### Other Changes
- [Style fix]: renamed `foo` to `bar` per reviewer suggestion
- [Refactor]: extracted helper function for clarity
- [Reply]: explained why X is intentional
### Test Results
- New tests added: N
- All tests passing: yes/no
- Regressions found: none / [details]
/test-strategy - Choose appropriate test type (unit, property, fuzz, Kani)/security-reviewer - For security-related review comments/bench-compare - If reviewer flags a performance issue