Analyze the pull request at $PR_URL and take any necessary action based on the current state of discussion.
Context
- Your GitHub Username:
$GITHUB_USERNAME (from global CLAUDE.md or prompt)
- Current Workspace: This is your fork of the original repository
- Remote Origin: Set to
$GITHUB_USERNAME/[original-repo-name]
- Target: All commits/pushes go to your fork, PR updates the existing PR
GitHub Tools
- GitHub MCP: Preferred for collaboration (PRs, issues, comments, reviews). Tool names follow
mcp__github__*.
- gh CLI: Fallback when MCP unavailable -
gh --help for commands
Steps
1. Fetch Full PR Context (GitHub MCP)
Using GitHub MCP tools, collect:
- PR title, description, base branch, head branch
- All review comments (inline code comments with threads)
- All issue comments (general discussion)
- All review submissions (approved / changes requested / commented)
- Current PR status (open / closed / merged / draft)
- CI/check statuses (passing / failing)
- List of changed files and their diffs
2. Build a Timeline
Reconstruct the full conversation in chronological order:
- Who said what, when
- Which comments are on which lines/files
- Which comments are resolved vs. unresolved
- Identify your last action (your last commit, comment, or reply) using
$GITHUB_USERNAME
3. Identify Everything That Happened After Your Last Action
Focus only on events after your last commit or comment:
- New review requests or change requests
- New inline comments on code
- Reviewer replies to your responses
- Automated bot messages (CI failures, size checks, etc.)
- Any explicit instructions or requests made to you
4. Dynamically Determine What Needs to Be Done
Do NOT use a static checklist. Instead, reason about the current situation:
- Read each unresolved comment or request carefully
- Understand the intent behind each message (not just the literal words)
- Group related requests together
- Determine which are actionable by you right now vs. waiting on someone else
- Prioritize: blocking issues first, then suggestions, then nits
Examples of things you might discover (non-exhaustive):
- A reviewer asked you to revert a specific change
- Someone requested a test be added or removed
- A CI check is failing and a fix is implied
- A reviewer approved but left a minor suggestion
- Someone asked for clarification and is waiting for your reply
- A merge conflict appeared that needs resolution
- The PR description needs to be updated
5. Present Your Action Plan
Before doing anything, clearly summarize:
- What has happened since your last action (brief timeline)
- What you believe needs to be done, and why (reasoning from the comments)
- Exact steps you plan to take (files, changes, replies, etc.)
- Anything ambiguous that you need clarification on
Wait for approval before proceeding.
6. Execute (After Approval)
Carry out each action:
- Make code changes as requested
- Run tests and verify they pass
- Commit with conventional format (fix:, revert:, test:, etc.) referencing the PR
- Push to your fork
- Use GitHub MCP to reply to reviewer comments and mark them as addressed
- If a change is reverted, explain why in the commit message and PR comment
Rules
- ALWAYS use GitHub MCP for GitHub operations (comments, replies, PR updates)
- Run commands one at a time — never chain with
&&
- Never assume intent — if a comment is ambiguous, ask
- Do not make unrelated changes while addressing feedback
- Always reply to reviewers after making their requested changes
- NO emojis in PR comments or replies - keep communication professional
- Match the communication style of existing project comments
- Be concise and technical in feedback responses
- GitHub username:
$GITHUB_USERNAME
Usage
/pr-followup PR_URL=https://github.com/microsoft/playwright/pull/39401
1---2name: pr-followup3description: Read a pull request's latest review discussion and act on the pending feedback. Use for "follow up on PR4---56Analyze the pull request at `$PR_URL` and take any necessary action based on the current state of discussion.78## Context9- **Your GitHub Username**: `$GITHUB_USERNAME` (from global CLAUDE.md or prompt)10- **Current Workspace**: This is your fork of the original repository11- **Remote Origin**: Set to `$GITHUB_USERNAME/[original-repo-name]`12- **Target**: All commits/pushes go to your fork, PR updates the existing PR1314## GitHub Tools15- **GitHub MCP**: Preferred for collaboration (PRs, issues, comments, reviews). Tool names follow `mcp__github__*`.16- **gh CLI**: Fallback when MCP unavailable - `gh --help` for commands1718## Steps1920### 1. Fetch Full PR Context (GitHub MCP)2122Using GitHub MCP tools, collect:23- PR title, description, base branch, head branch24- All **review comments** (inline code comments with threads)25- All **issue comments** (general discussion)26- All **review submissions** (approved / changes requested / commented)27- Current PR **status** (open / closed / merged / draft)28- CI/check statuses (passing / failing)29- List of **changed files** and their diffs3031### 2. Build a Timeline3233Reconstruct the full conversation in chronological order:34- Who said what, when35- Which comments are on which lines/files36- Which comments are resolved vs. unresolved37- Identify **your last action** (your last commit, comment, or reply) using `$GITHUB_USERNAME`3839### 3. Identify Everything That Happened After Your Last Action4041Focus only on events **after your last commit or comment**:42- New review requests or change requests43- New inline comments on code44- Reviewer replies to your responses45- Automated bot messages (CI failures, size checks, etc.)46- Any explicit instructions or requests made to you4748### 4. Dynamically Determine What Needs to Be Done4950Do NOT use a static checklist. Instead, reason about the current situation:5152- Read each unresolved comment or request carefully53- Understand the **intent** behind each message (not just the literal words)54- Group related requests together55- Determine which are **actionable by you right now** vs. waiting on someone else56- Prioritize: blocking issues first, then suggestions, then nits5758Examples of things you might discover (non-exhaustive):59- A reviewer asked you to revert a specific change60- Someone requested a test be added or removed61- A CI check is failing and a fix is implied62- A reviewer approved but left a minor suggestion63- Someone asked for clarification and is waiting for your reply64- A merge conflict appeared that needs resolution65- The PR description needs to be updated6667### 5. Present Your Action Plan6869Before doing anything, clearly summarize:70- What has happened since your last action (brief timeline)71- What you believe needs to be done, and **why** (reasoning from the comments)72- Exact steps you plan to take (files, changes, replies, etc.)73- Anything ambiguous that you need clarification on7475**Wait for approval before proceeding.**7677### 6. Execute (After Approval)7879Carry out each action:80- Make code changes as requested81- Run tests and verify they pass82- Commit with conventional format (fix:, revert:, test:, etc.) referencing the PR83- Push to your fork84- **Use GitHub MCP** to reply to reviewer comments and mark them as addressed85- If a change is reverted, explain why in the commit message and PR comment8687## Rules88- **ALWAYS use GitHub MCP** for GitHub operations (comments, replies, PR updates)89- Run commands one at a time — never chain with `&&`90- Never assume intent — if a comment is ambiguous, ask91- Do not make unrelated changes while addressing feedback92- Always reply to reviewers after making their requested changes93- **NO emojis in PR comments or replies** - keep communication professional94- Match the communication style of existing project comments95- Be concise and technical in feedback responses96- GitHub username: `$GITHUB_USERNAME`9798## Usage99```100/pr-followup PR_URL=https://github.com/microsoft/playwright/pull/39401101```