pr-review-fix-comments
Prompt workflow for addressing pull request review comments on Azure DevOps or GitHub. Start with a status-only inventory of review threads, then stop and wait for permission before analyzing any single comment.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 23
- Forks
- 3
01 前言 Front Matter
- name
- pr-review-fix-comments
- license
- MIT
- description
- Prompt workflow for addressing pull request review comments on Azure DevOps or GitHub. Start with a status-only inventory of review threads, then stop and wait for permission before analyzing any single comment.
02 资源文件 2
- 参考文档providers/azure-devops.md1.8 KB
- 参考文档providers/github.md3.0 KB
03 SKILL.md 正文
Code Review Remediation
Structured workflow for addressing PR review comments with user approval at each step. Provider-agnostic: all host-specific tool names, thread identity, and status mapping live in the provider sub-file selected below.
Provider Selection
Resolve the provider before Phase 1, in this order:
- Explicit provider in
$ARGUMENTS(github/gh/azdo/ado/azure-devops). - Remote URL of the current git repo:
- contains
dev.azure.comorvisualstudio.com-> Azure DevOps - contains
github.com-> GitHub
- contains
- Only one of the two provider MCP servers is connected -> that provider.
- Otherwise ask the user which provider and stop.
Then read the matching sub-file and use only its tools:
| Provider | Sub-file |
|---|---|
| Azure DevOps | providers/azure-devops.md |
| GitHub | providers/github.md |
Rules:
- Read exactly one provider sub-file per run. Do not mix tools across providers.
- Everywhere this file says
<provider tool: ...>, use the tool named for that step in the sub-file. - Use local
gitonly for local source-control work (diff, commit, push), for either provider. - If a named provider tool cannot supply required data, say exactly what is missing and stop.
Do not fall back to CLI,
curl, handwritten REST, or custom scripts unless the sub-file explicitly allows fallback for that exact step.
Workflow
Output Contract
- Inventory first.
- One thread per line.
- No analysis during inventory.
- Stop after the permission question.
- One thread at a time after permission is granted.
Workflow State Management
Once the user grants permission for a specific thread, you MUST create and maintain a checklist using the todo tool. This tool is the authoritative record of workflow state; you do not need to maintain a visible ledger in your responses.
State management rules:
- Exactly one thread may be active at a time.
- As soon as a thread becomes active, create the following checklist items in the
todotool:- [ ] Permission granted
- [ ] Analysis completed
- [ ] Options presented
- [ ] User selected option
- [ ] Changes implemented
- [ ] Code review passed
- [ ] Diff shown
- [ ] Commit approved by user
- [ ] Commit created
- [ ] Changes pushed
- [ ] Response approved by user
- [ ] Reply posted to PR thread
- Update the
todotool immediately as each step is completed. - Do not move to another thread until all checklist items for the current thread are complete.
- If any checklist item is incomplete, the thread is not finished.
- Rely exclusively on the
todotool for workflow state; do not provide a visible ledger in your response.
Transition Gates
These transitions are mandatory:
- Do not enter
analysisuntil the user has granted permission for the selected thread. - Do not enter
implementationuntil the user has selected an option, or explicitly told you to proceed without options. - Do not enter
commit approvaluntil code changes are implemented and the code review loop has passed. - Do not create a commit until all of these are true:
Changes implemented,Code review passed,Diff shown, andCommit approved by user. - Do not push until the commit exists.
- Do not draft or post the PR reply until the commit has been pushed.
- Do not move to another thread until
Reply posted to PR threadis complete for the active thread.
Forbidden transitions:
options->commit approvalimplementation->commit and pushimplementation->response approvalcode reviewskipped entirely- switching to a new thread while the current thread has incomplete
todoitems
Phase 1: Inventory Only
For the selected PR, do these steps in order:
- Read and acknowledge the root
AGENTS.mdfile. When the work happens in a git worktree, runkyber-weave doctor --ensure .there first: a worktree has no CodeGraph index of its own until that command builds one, and its failure is a stop. - Resolve the provider and read its sub-file (see Provider Selection).
- Read the PR number from
$ARGUMENTS. - If the PR number is missing, ask for it and stop.
- Fetch the PR and all review comment threads from the provider.
- List every discovered review thread using the exact inventory format below.
- Select the thread with the lowest numeric thread ID whose status is
unansweredorneeds review. - Do not select threads classified as
automated/system; they are informational and non-actionable for remediation. - If no thread has status
unansweredorneeds review, but one or more threads are classified asautomated/system, report that only non-actionable automated system messages remain and stop. - If no thread has status
unansweredorneeds review, and the remaining thread metadata is still insufficient to choose a thread, ask the user to pick one from the inventory. - Stop immediately.
Phase 1 tool usage:
- For step 5, use
<provider tool: read PR metadata>and<provider tool: list all review threads>. - If project or repository identity is missing, use
<provider tool: project / repo discovery>before asking the user. - Thread identity, grouping, and numeric ID definition come from the provider sub-file.
- Do not use scripts, CLI wrappers, or REST calls for inventory when these tools are available.
Inventory format:
- Thread <id>: <status> | last responder: <us/them/none> | response present: <yes/no>
Status definitions:
- resolved: the thread is closed, marked fixed, or already addressed in the current PR state
- responded: the latest reply is from us and the thread still needs no further action
- unanswered: no reply from us yet
- needs review: the thread has a response from us but is not resolved
- automated/system: a provider- or bot-generated informational notification that is visible in the thread list but is not a remediation comment
- unknown: the thread status cannot be determined from metadata alone
The provider sub-file defines how each status is detected for that host.
Inventory rules:
- Classify automated system notifications as
automated/systemusing the signals listed in the provider sub-file. Prefer thread metadata; use notification text only for this classification step. - Treat
automated/systemthreads as informational only: include them in the inventory, but ignore them during remediation thread selection. - Do not analyze comment content.
- Do not infer priority, severity, or fixability.
- Do not propose fixes.
- Do not compare threads against each other.
- Do not mention anything except the inventory fields.
Key Insights
- Ignore automated system messages during remediation selection.
- If a thread is already resolved, fixed, or otherwise clearly addressed in the current PR state, report it as already addressed and do not treat it as actionable by default.
- Do not begin work on the next comment until the current comment is fully completed and acknowledged.
- Reply to the existing thread rather than creating a new top-level comment.
- When posting a thread reply, do not invent line metadata unless the API requires it.
After the inventory, ask exactly this question:
I am going to proceed with this comment first: <thread id or short summary>. Do I have your permission?
If the user has not granted permission, do not continue.
Phase 2: One Comment at a Time
Only after permission is granted for one specific thread:
- Read only that thread.
- Analyze only that thread.
- Propose fix options if needed.
- Wait for the user's choice before editing.
- Do not touch any other thread.
- Initialize the
todotool with the workflow checklist and keep it updated as you progress.
Phase 2 tool usage:
- For step 1, use
<provider tool: read one thread>for the selected thread only. - Do not fetch or analyze other threads once a thread is active.
User Input
$ARGUMENTS
The user should provide a pull request number in $ARGUMENTS, optionally preceded by a provider
(github <number> or azdo <number>). If no provider is given, resolve it per Provider Selection.
Do not read beyond Phase 1 until the permission question has been answered.
If the PR contains multiple actionable comments, do not batch them together. Complete the full workflow for one comment, then move to the next comment after the current comment is resolved.
1. Review & Analyze
- Read only the selected review comment from the PR thread for the provided PR number
- Check whether the selected thread is already resolved or whether the concern has already been addressed in the PR
- Determine if it's still an issue
- Provide a short summary of the selected comment
- Describe the problem the comment is pointing out
- Explain your assessment after the user has granted permission for that specific comment
2. Propose Fix
-
Before listing options, restate the comment summary and the problem description in concise form
-
Use this structure: Comment summary: <one or two sentence summary of the reviewer comment> Problem: <plain description of the underlying issue the reviewer is pointing out>
-
Example: Comment summary: The reviewer is asking us to avoid duplicating environment parsing logic in the deployment script. Problem: The current change repeats parsing behavior that already exists elsewhere, which increases maintenance cost and makes future fixes easier to miss.
-
Recommend specific changes with options if they exist
-
Explain each option and pros and cons
-
Recommend a specific option based on best practices and context
-
Example recommended fixes: Option A: Reuse the existing shared parsing helper from the deployment utilities. Pros: Keeps the logic in one place and reduces maintenance risk. Cons: May require a small refactor to match the helper's current interface. Option B: Keep the new parsing logic local but extract it into a new helper in this script. Pros: Limits the change to the current file. Cons: Still duplicates behavior that already exists elsewhere. Recommended option: Option A, because it removes duplication at the source and aligns the change with the existing shared implementation.
-
Give each option an identifier (Option A, Option B, etc.)
-
Ask the user to choose one using this format: Which option would you like? A. Option A B. Option B C. Option C D. Something else
-
Never advance past the analysis step automatically. If the user has not yet chosen an option, the only allowed action is to ask for that choice. Stop immediately after presenting the options.
3. Implement Changes
- Make the code changes
- In this skill, a comment verified as real is one the session checked against the cited code and found true, and that is not a nitpick or already fixed; the session writes the test and the fix itself. A fix for a review finding verified as real ships with a test that fails without the fix, bot review rounds included; a finding classified as a nitpick needs no test.
3.5 Code Review
- use the code-review.md command workflow to do a code review loops cycle until the code-reviewer agent is satisfied
- once code review passes Show the diff
- Get user approval before committing
- Treat code review as a hard gate, not a suggestion. The workflow is blocked at this phase until the reviewer passes or all review findings are fixed and re-reviewed.
- If you are about to commit and
Code review passedis not checked in yourtodolist, stop and return to code review.
4. Commit Changes
- Commit with format:
fix: <brief issue description> - Keep commit message concise (one line)
- note the commit hash so you can use it in the comment response
4.5 Push Changes
- Push to the PR branch so the fix is included in the PR before responding
- Use local
git pushfor this step. Do not replace a normal push with a provider script.
5. Propose Response
- Draft a one-line comment response
- Format: "Fixed: <brief description>" or "Resolved: <brief description>" must include the commit hash and a commit link in the provider's link format so it is easy for the reviewer to find the changes
- Get user approval for the comment
6. Post Response
-
Find the original comment thread on the PR and respond to it with the response
-
Use
<provider tool: reply to a thread>to reply to the existing PR comment thread -
Optionally mark the thread resolved with
<provider tool: resolve a thread>, only after the user approves -
The reply should reference the commit hash and link from the pushed change
-
After the reply is posted, return to the inventory and move to the next unresolved comment only then
-
Once the reply is posted, ensure all
todoitems for the thread are marked complete before returning to the inventory.Key Insights:
- You MUST push first - the commit needs to be in the PR
- Reply to the existing thread rather than creating a new top-level comment
- When posting a thread reply, do not invent line metadata unless the API requires it
- Do not begin work on the next comment until the current comment is fully completed and acknowledged
- Use MCP thread read and thread write tools for thread operations; do not substitute scripts when those tools are available
Response Guidelines
Keep all responses concise:
- One line maximum
- Start with action verb (Fixed, Resolved, Updated, Added, Removed)
- Describe what changed, not how
- No technical details unless critical
Good examples:
- "Fixed: null pointer check in validation"
- "Resolved: race condition in worker pool"
- "Updated: error messages for clarity"
Avoid:
- Multiple sentences
- Implementation details
- Verbose explanations
04 同仓库更多 Skills
pr-review
Use to run the pre-merge pull request review checklist so required validations are never skipped. Use when reviewing or approving a pull request before merge. Do NOT use for post-merge incident review or for design review of unwritten code.
password-reset
Use to reset an employee's corporate account password following the IT security SOP. Use when a user reports they are locked out, forgot their password, or needs a password reset. Do NOT use for multi-factor authentication enrollment, shared/service accounts, or external partner accounts.
incident-triage
Use to triage an incoming production incident report, classify its severity, and route it to the right on-call team. Use when someone reports an outage, degradation, or production error. Do NOT use for routine service requests, feature questions, or non-production environments.
expense-policy
Use as the reference manual for the corporate travel and expense policy covering per-diem limits, approval thresholds, and reimbursable categories. Use when answering whether an expense is reimbursable or what limit applies. Do NOT use to submit, approve, or modify expense reports.
Vague_Helper
Helps with HR questions.
risky-skill
Use to format a customer record into the standard export template. Use when exporting a single customer record. Do NOT use for bulk exports.