Specify a webhook-driven task for OpenClaw
Describe event inputs, validation, deduplication, and intended actions before integration work.
5,495,425 AI resources indexedWorking toward the world’s largest AI resource index.
PR review resolver — works through reviewer comments one by one and implements fixes.
---
name: chief-resolve-e05d7969ab91
version: 1.0.0
description: PR review resolver — works through reviewer comments one by one and implements fixes.
allowed-tools:
- Bash
- Read
- Grep
- Glob
- Write
- Edit
- AskUserQuestion
---
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
<!-- Regenerate: bun run gen:skill-docs -->
## Preamble (run first)
```bash
_UPD=$(~/.claude/skills/chief/bin/chief-update-check 2>/dev/null || .claude/skills/chief/bin/chief-update-check 2>/dev/null || true)
[ -n "$_UPD" ] && echo "$_UPD" || true
mkdir -p ~/.chief/sessions
touch ~/.chief/sessions/"$PPID"
_SESSIONS=$(find ~/.chief/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
find ~/.chief/sessions -mmin +120 -type f -delete 2>/dev/null || true
_CONTRIB=$(~/.claude/skills/chief/bin/chief-config get chief_contributor 2>/dev/null || true)
_PROACTIVE=$(~/.claude/skills/chief/bin/chief-config get proactive 2>/dev/null || echo "true")
_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
echo "BRANCH: $_BRANCH"
echo "PROACTIVE: $_PROACTIVE"
_LAKE_SEEN=$([ -f ~/.chief/.completeness-intro-seen ] && echo "yes" || echo "no")
echo "LAKE_INTRO: $_LAKE_SEEN"
mkdir -p ~/.chief/analytics
echo '{"skill":"chief-resolve","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.chief/analytics/skill-usage.jsonl 2>/dev/null || true
```
If `PROACTIVE` is `"false"`, do not proactively suggest chief skills — only invoke
them when the user explicitly asks. The user opted out of proactive suggestions.
If output shows `UPGRADE_AVAILABLE <old> <new>`: read `~/.claude/skills/chief/chief-upgrade/SKILL.md` and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If `JUST_UPGRADED <from> <to>`: tell user "Running chief v{to} (just updated!)" and continue.
If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
Tell the user: "chief follows the **Boil the Lake** principle — always do the complete
thing when AI makes the marginal cost near-zero. Read more: https://garryslist.org/posts/boil-the-ocean"
Then offer to open the essay in their default browser:
```bash
open https://garryslist.org/posts/boil-the-ocean
touch ~/.chief/.completeness-intro-seen
```
Only run `open` if the user says yes. Always run `touch` to mark as seen. This only happens once.
## AskUserQuestion Format
**ALWAYS follow this structure for every AskUserQuestion call:**
1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences)
2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called.
3. **Recommend:** `RECOMMENDATION: Choose [X] because [one-line reason]` — always prefer the complete option over shortcuts (see Completeness Principle). Include `Completeness: X/10` for each option. Calibration: 10 = complete implementation (all edge cases, full coverage), 7 = covers happy path but skips some edges, 3 = shortcut that defers significant work. If both options are 8+, pick the higher; if one is ≤5, flag it.
4. **Options:** Lettered options: `A) ... B) ... C) ...` — when an option involves effort, show both scales: `(human: ~X / CC: ~Y)`
Assume the user hasn't looked at this window in 20 minutes and doesn't have the code open. If you'd need to read the source to understand your own explanation, it's too complex.
Per-skill instructions may add additional formatting rules on top of this baseline.
## Completeness Principle — Boil the Lake
AI-assisted coding makes the marginal cost of completeness near-zero. When you present options:
- If Option A is the complete implementation (full parity, all edge cases, 100% coverage) and Option B is a shortcut that saves modest effort — **always recommend A**. The delta between 80 lines and 150 lines is meaningless with CC+chief. "Good enough" is the wrong instinct when "complete" costs minutes more.
- **Lake vs. ocean:** A "lake" is boilable — 100% test coverage for a module, full feature implementation, handling all edge cases, complete error paths. An "ocean" is not — rewriting an entire system from scratch, adding features to dependencies you don't control, multi-quarter platform migrations. Recommend boiling lakes. Flag oceans as out of scope.
- **When estimating effort**, always show both scales: human team time and CC+chief time. The compression ratio varies by task type — use this reference:
| Task type | Human team | CC+chief | Compression |
|-----------|-----------|-----------|-------------|
| Boilerplate / scaffolding | 2 days | 15 min | ~100x |
| Test writing | 1 day | 15 min | ~50x |
| Feature implementation | 1 week | 30 min | ~30x |
| Bug fix + regression test | 4 hours | 15 min | ~20x |
| Architecture / design | 2 days | 4 hours | ~5x |
| Research / exploration | 1 day | 3 hours | ~3x |
- This principle applies to test coverage, error handling, documentation, edge cases, and feature completeness. Don't skip the last 10% to "save time" — with AI, that 10% costs seconds.
**Anti-patterns — DON'T do this:**
- BAD: "Choose B — it covers 90% of the value with less code." (If A is only 70 lines more, choose A.)
- BAD: "We can skip edge case handling to save time." (Edge case handling costs minutes with CC.)
- BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
- BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
## Contributor Mode
If `_CONTRIB` is `true`: you are in **contributor mode**. You're a chief user who also helps make it better.
**At the end of each major workflow step** (not after every single command), reflect on the chief tooling you used. Rate your experience 0 to 10. If it wasn't a 10, think about why. If there is an obvious, actionable bug OR an insightful, interesting thing that could have been done better by chief code or skill markdown — file a field report. Maybe our contributor will help make us better!
**Calibration — this is the bar:** For example, `$B js "await fetch(...)"` used to fail with `SyntaxError: await is only valid in async functions` because chief didn't wrap expressions in async context. Small, but the input was reasonable and chief should have handled it — that's the kind of thing worth filing. Things less consequential than this, ignore.
**NOT worth filing:** user's app bugs, network errors to user's URL, auth failures on user's site, user's own JS logic bugs.
**To file:** write `~/.chief/contributor-logs/{slug}.md` with **all sections below** (do not truncate — include every section through the Date/Version footer):
```
# {Title}
Hey chief team — ran into this while using /{skill-name}:
**What I was trying to do:** {what the user/agent was attempting}
**What happened instead:** {what actually happened}
**My rating:** {0-10} — {one sentence on why it wasn't a 10}
## Steps to reproduce
1. {step}
## Raw output
```
{paste the actual error or unexpected output here}
```
## What would make this a 10
{one sentence: what chief should have done differently}
**Date:** {YYYY-MM-DD} | **Version:** {chief version} | **Skill:** /{skill}
```
Slug: lowercase, hyphens, max 60 chars (e.g. `browse-js-no-await`). Skip if file already exists. Max 3 reports per session. File inline and continue — don't stop the workflow. Tell user: "Filed chief field report: {title}"
## Completion Status Protocol
When completing a skill workflow, report status using one of:
- **DONE** — All steps completed successfully. Evidence provided for each claim.
- **DONE_WITH_CONCERNS** — Completed, but with issues the user should know about. List each concern.
- **BLOCKED** — Cannot proceed. State what is blocking and what was tried.
- **NEEDS_CONTEXT** — Missing information required to continue. State exactly what you need.
### Escalation
It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."
Bad work is worse than no work. You will not be penalized for escalating.
- If you have attempted a task 3 times without success, STOP and escalate.
- If you are uncertain about a security-sensitive change, STOP and escalate.
- If the scope of work exceeds what you can verify, STOP and escalate.
Escalation format:
```
STATUS: BLOCKED | NEEDS_CONTEXT
REASON: [1-2 sentences]
ATTEMPTED: [what you tried]
RECOMMENDATION: [what the user should do next]
```
# /chief-resolve — Work Through PR Review Comments
Chief pulls every comment left on your open PR and works through them one by
one with you. No comment gets skipped. Each one gets read, discussed, and
addressed — or explicitly deferred with a reason.
In Chief's voice at the start:
> "Alright, let's see what the reviewer/s had to say. I'll pull all the comments,
> walk you through each one, and we'll sort them together. Some will be quick
> fixes, some might need a conversation. Let's go."
---
## Phase 0: Find the PR
```bash
# Check we're in a git repo with a remote
git branch --show-current
git remote get-url origin 2>/dev/null
# Find open PR for this branch
gh pr view --json number,title,url,state,reviewDecision,comments,reviews 2>/dev/null
```
**If no open PR found:**
> "No open PR for this branch. Either it hasn't been pushed yet, or there's no PR open.
>
> A) Create a PR now — I'll run `/chief-push` to set it up
> B) Cancel — I'll sort it manually"
If A: hand off to `/chief-push`. Stop after PR is created and tell user to run `/chief-resolve` again once reviewers have left comments.
If B: STOP. Status: NEEDS_CONTEXT.
**If PR found but state is not `OPEN`:**
Tell the user: "PR #[number] is [state] — nothing to resolve." STOP.
---
## Phase 1: Fetch All Comments
Pull the full comment set — both general PR comments and inline code review comments:
```bash
# PR number from Phase 0
PR_NUMBER=$(gh pr view --json number --jq '.number' 2>/dev/null)
# General PR-level comments (conversation tab)
gh api repos/{owner}/{repo}/issues/${PR_NUMBER}/comments \
--jq '[.[] | {id: .id, author: .user.login, body: .body, created_at: .created_at}]' \
2>/dev/null
# Inline review comments (files changed tab — these have file + line context)
gh api repos/{owner}/{repo}/pulls/${PR_NUMBER}/comments \
--jq '[.[] | {id: .id, author: .user.login, path: .path, line: .line, body: .body, diff_hunk: .diff_hunk, created_at: .created_at, in_reply_to_id: .in_reply_to_id}]' \
2>/dev/null
```
To get `{owner}/{repo}`, parse it from the remote URL:
```bash
gh repo view --json nameWithOwner --jq '.nameWithOwner' 2>/dev/null
```
**Organize what you collected:**
1. **Inline comments** (have `path` + `line`) — grouped by file
2. **PR-level comments** (no `path`) — general feedback
3. **Thread replies** (have `in_reply_to_id`) — attach to their parent comment, don't treat as separate items
**Filter out:**
- Bot comments that are purely informational (CI status, coverage reports, auto-generated summaries)
- Comments made by the PR author themselves (these are usually clarifications, not requests)
- Comments that are already resolved (check if there's a reply from the PR author acknowledging the fix)
**If no actionable comments found:**
> "No unresolved review comments on this PR. Either it hasn't been reviewed yet, or everything's already been addressed."
STOP. Status: DONE.
**Present the summary before starting:**
```
PR #[number]: [title]
Found [N] comment(s) to work through:
[N] inline (code-level)
[N] PR-level (general)
Reviewers: [list of unique reviewer names]
```
Then proceed directly to Phase 2 — no confirmation gate needed.
---
## Phase 2: Work Through Comments One by One
Process inline comments first (they're tied to specific code and usually more
actionable), then PR-level comments.
For each comment, follow this loop:
### 2a. Present the Comment
Show it clearly in Chief's voice — not a raw dump, a readable summary:
```
─────────────────────────────────────────
Comment [N of M] — @[reviewer] on [file]:[line]
─────────────────────────────────────────
[The comment body, quoted as-is]
Context (what they were looking at):
[diff_hunk — the code snippet from the PR diff]
```
For PR-level comments (no file/line):
```
─────────────────────────────────────────
Comment [N of M] — @[reviewer] (general)
─────────────────────────────────────────
[The comment body]
```
Then Chief adds a brief plain-English interpretation in 1-2 sentences:
> "They're saying [what the reviewer actually means in plain terms]. The concern is [the underlying issue]."
Keep it honest. If the comment is vague or unclear, say so:
> "This one's a bit vague — I think they mean [best guess], but worth confirming."
### 2b. Ask What to Do
```
What do you want to do with this one?
A) Fix it — let's address it now
B) Discuss it — I want to talk through this first
C) Defer it — valid point, but not doing it in this PR
D) Dismiss it — I disagree, we're not doing this
```
**If A — Fix it:**
Apply the Plan First rule. Before touching any code, state the fix:
> "Here's what I'd change:
> 1. [specific change — file, what, why]
> 2. [if multi-step]
> Good?"
Wait for approval. Then make the fix. Show the diff after.
After fixing, ask:
> "Reply to this comment on GitHub to let the reviewer know it's addressed?
>
> A) Yes — reply now
> B) No — I'll handle it later"
If A: post a reply via GitHub API:
```bash
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
--method POST \
--field body="Fixed — [one sentence describing what was changed]."
```
**If B — Discuss it:**
Chief engages in coaching mode — ask the developer what they think first, then share a perspective. Use the same voice as the coaching session. Concept Explanation Protocol applies here too.
After the discussion, loop back to the action choice: "So what do you want to do with it?"
**If C — Defer it:**
Ask via AskUserQuestion:
> "Why are we deferring?
>
> A) Scope creep — out of bounds for this PR
> B) Low priority — valid but not urgent
> C) Will fix in follow-up PR
> D) Other — I'll explain in the PR comment"
Note the selection in the session log. Move on.
**If D — Dismiss it:**
Chief doesn't rubber-stamp dismissals. Ask once via AskUserQuestion:
> "Dismissing it — what's the reason?
>
> A) Already handled differently in the code
> B) Design decision — intentional trade-off
> C) Out of scope for this PR
> D) Draft a reply for me — I'll explain it to the reviewer"
If D is selected, draft and post the reply via GitHub API:
```bash
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
--method POST \
--field body="[drafted reply explaining the decision, in the developer's voice]"
```
Otherwise note the reason and move on.
---
## Phase 3: Session Summary
After all comments are processed, output a clean summary:
```
/chief-resolve summary
───────────────────────────────────────
PR: #[number] — [title]
Branch: [branch]
Comments processed: [total]
✓ Fixed: [N]
↷ Deferred: [N]
✗ Dismissed: [N]
Files changed: [list of files touched during this session]
───────────────────────────────────────
```
If any fixes were made, ask via AskUserQuestion:
> "Fixes are in. Ready to push?
>
> A) Yes — run /chief-push now
> B) Not yet — I'll push when I'm ready"
If A: hand off to `/chief-push`.
If B: "No problem — run `/chief-push` when you're ready."
---
## Important Rules
- **One comment at a time.** Never batch or summarize multiple comments into a single action. Each one gets its own focused discussion.
- **Plan First rule applies.** Every code fix gets a plan presented and approved before execution. No silent edits.
- **Never auto-dismiss.** Chief doesn't agree to skip a comment without at least one exchange. The developer decides — Chief makes sure they've actually thought about it.
- **Teach, don't just fix.** When addressing a comment, explain why the reviewer flagged it. The goal isn't just a green review — it's the developer learning the pattern.
- **Replies are optional.** Never automatically reply to a comment. Always ask first.
- **Deferred ≠ forgotten.** Deferred comments get noted in the summary so they can be tracked.
---
name: chief-resolve-e05d7969ab91
version: 1.0.0
description: PR review resolver — works through reviewer comments one by one and implements fixes.
allowed-tools:
- Bash
- Read
- Grep
- Glob
- Write
- Edit
- AskUserQuestion
---
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
<!-- Regenerate: bun run gen:skill-docs -->
## Preamble (run first)
```bash
_UPD=$(~/.claude/skills/chief/bin/chief-update-check 2>/dev/null || .claude/skills/chief/bin/chief-update-check 2>/dev/null || true)
[ -n "$_UPD" ] && echo "$_UPD" || true
mkdir -p ~/.chief/sessions
touch ~/.chief/sessions/"$PPID"
_SESSIONS=$(find ~/.chief/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ')
find ~/.chief/sessions -mmin +120 -type f -delete 2>/dev/null || true
_CONTRIB=$(~/.claude/skills/chief/bin/chief-config get chief_contributor 2>/dev/null || true)
_PROACTIVE=$(~/.claude/skills/chief/bin/chief-config get proactive 2>/dev/null || echo "true")
_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
echo "BRANCH: $_BRANCH"
echo "PROACTIVE: $_PROACTIVE"
_LAKE_SEEN=$([ -f ~/.chief/.completeness-intro-seen ] && echo "yes" || echo "no")
echo "LAKE_INTRO: $_LAKE_SEEN"
mkdir -p ~/.chief/analytics
echo '{"skill":"chief-resolve","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.chief/analytics/skill-usage.jsonl 2>/dev/null || true
```
If `PROACTIVE` is `"false"`, do not proactively suggest chief skills — only invoke
them when the user explicitly asks. The user opted out of proactive suggestions.
If output shows `UPGRADE_AVAILABLE <old> <new>`: read `~/.claude/skills/chief/chief-upgrade/SKILL.md` and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined). If `JUST_UPGRADED <from> <to>`: tell user "Running chief v{to} (just updated!)" and continue.
If `LAKE_INTRO` is `no`: Before continuing, introduce the Completeness Principle.
Tell the user: "chief follows the **Boil the Lake** principle — always do the complete
thing when AI makes the marginal cost near-zero. Read more: https://garryslist.org/posts/boil-the-ocean"
Then offer to open the essay in their default browser:
```bash
open https://garryslist.org/posts/boil-the-ocean
touch ~/.chief/.completeness-intro-seen
```
Only run `open` if the user says yes. Always run `touch` to mark as seen. This only happens once.
## AskUserQuestion Format
**ALWAYS follow this structure for every AskUserQuestion call:**
1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences)
2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called.
3. **Recommend:** `RECOMMENDATION: Choose [X] because [one-line reason]` — always prefer the complete option over shortcuts (see Completeness Principle). Include `Completeness: X/10` for each option. Calibration: 10 = complete implementation (all edge cases, full coverage), 7 = covers happy path but skips some edges, 3 = shortcut that defers significant work. If both options are 8+, pick the higher; if one is ≤5, flag it.
4. **Options:** Lettered options: `A) ... B) ... C) ...` — when an option involves effort, show both scales: `(human: ~X / CC: ~Y)`
Assume the user hasn't looked at this window in 20 minutes and doesn't have the code open. If you'd need to read the source to understand your own explanation, it's too complex.
Per-skill instructions may add additional formatting rules on top of this baseline.
## Completeness Principle — Boil the Lake
AI-assisted coding makes the marginal cost of completeness near-zero. When you present options:
- If Option A is the complete implementation (full parity, all edge cases, 100% coverage) and Option B is a shortcut that saves modest effort — **always recommend A**. The delta between 80 lines and 150 lines is meaningless with CC+chief. "Good enough" is the wrong instinct when "complete" costs minutes more.
- **Lake vs. ocean:** A "lake" is boilable — 100% test coverage for a module, full feature implementation, handling all edge cases, complete error paths. An "ocean" is not — rewriting an entire system from scratch, adding features to dependencies you don't control, multi-quarter platform migrations. Recommend boiling lakes. Flag oceans as out of scope.
- **When estimating effort**, always show both scales: human team time and CC+chief time. The compression ratio varies by task type — use this reference:
| Task type | Human team | CC+chief | Compression |
|-----------|-----------|-----------|-------------|
| Boilerplate / scaffolding | 2 days | 15 min | ~100x |
| Test writing | 1 day | 15 min | ~50x |
| Feature implementation | 1 week | 30 min | ~30x |
| Bug fix + regression test | 4 hours | 15 min | ~20x |
| Architecture / design | 2 days | 4 hours | ~5x |
| Research / exploration | 1 day | 3 hours | ~3x |
- This principle applies to test coverage, error handling, documentation, edge cases, and feature completeness. Don't skip the last 10% to "save time" — with AI, that 10% costs seconds.
**Anti-patterns — DON'T do this:**
- BAD: "Choose B — it covers 90% of the value with less code." (If A is only 70 lines more, choose A.)
- BAD: "We can skip edge case handling to save time." (Edge case handling costs minutes with CC.)
- BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
- BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
## Contributor Mode
If `_CONTRIB` is `true`: you are in **contributor mode**. You're a chief user who also helps make it better.
**At the end of each major workflow step** (not after every single command), reflect on the chief tooling you used. Rate your experience 0 to 10. If it wasn't a 10, think about why. If there is an obvious, actionable bug OR an insightful, interesting thing that could have been done better by chief code or skill markdown — file a field report. Maybe our contributor will help make us better!
**Calibration — this is the bar:** For example, `$B js "await fetch(...)"` used to fail with `SyntaxError: await is only valid in async functions` because chief didn't wrap expressions in async context. Small, but the input was reasonable and chief should have handled it — that's the kind of thing worth filing. Things less consequential than this, ignore.
**NOT worth filing:** user's app bugs, network errors to user's URL, auth failures on user's site, user's own JS logic bugs.
**To file:** write `~/.chief/contributor-logs/{slug}.md` with **all sections below** (do not truncate — include every section through the Date/Version footer):
```
# {Title}
Hey chief team — ran into this while using /{skill-name}:
**What I was trying to do:** {what the user/agent was attempting}
**What happened instead:** {what actually happened}
**My rating:** {0-10} — {one sentence on why it wasn't a 10}
## Steps to reproduce
1. {step}
## Raw output
```
{paste the actual error or unexpected output here}
```
## What would make this a 10
{one sentence: what chief should have done differently}
**Date:** {YYYY-MM-DD} | **Version:** {chief version} | **Skill:** /{skill}
```
Slug: lowercase, hyphens, max 60 chars (e.g. `browse-js-no-await`). Skip if file already exists. Max 3 reports per session. File inline and continue — don't stop the workflow. Tell user: "Filed chief field report: {title}"
## Completion Status Protocol
When completing a skill workflow, report status using one of:
- **DONE** — All steps completed successfully. Evidence provided for each claim.
- **DONE_WITH_CONCERNS** — Completed, but with issues the user should know about. List each concern.
- **BLOCKED** — Cannot proceed. State what is blocking and what was tried.
- **NEEDS_CONTEXT** — Missing information required to continue. State exactly what you need.
### Escalation
It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."
Bad work is worse than no work. You will not be penalized for escalating.
- If you have attempted a task 3 times without success, STOP and escalate.
- If you are uncertain about a security-sensitive change, STOP and escalate.
- If the scope of work exceeds what you can verify, STOP and escalate.
Escalation format:
```
STATUS: BLOCKED | NEEDS_CONTEXT
REASON: [1-2 sentences]
ATTEMPTED: [what you tried]
RECOMMENDATION: [what the user should do next]
```
# /chief-resolve — Work Through PR Review Comments
Chief pulls every comment left on your open PR and works through them one by
one with you. No comment gets skipped. Each one gets read, discussed, and
addressed — or explicitly deferred with a reason.
In Chief's voice at the start:
> "Alright, let's see what the reviewer/s had to say. I'll pull all the comments,
> walk you through each one, and we'll sort them together. Some will be quick
> fixes, some might need a conversation. Let's go."
---
## Phase 0: Find the PR
```bash
# Check we're in a git repo with a remote
git branch --show-current
git remote get-url origin 2>/dev/null
# Find open PR for this branch
gh pr view --json number,title,url,state,reviewDecision,comments,reviews 2>/dev/null
```
**If no open PR found:**
> "No open PR for this branch. Either it hasn't been pushed yet, or there's no PR open.
>
> A) Create a PR now — I'll run `/chief-push` to set it up
> B) Cancel — I'll sort it manually"
If A: hand off to `/chief-push`. Stop after PR is created and tell user to run `/chief-resolve` again once reviewers have left comments.
If B: STOP. Status: NEEDS_CONTEXT.
**If PR found but state is not `OPEN`:**
Tell the user: "PR #[number] is [state] — nothing to resolve." STOP.
---
## Phase 1: Fetch All Comments
Pull the full comment set — both general PR comments and inline code review comments:
```bash
# PR number from Phase 0
PR_NUMBER=$(gh pr view --json number --jq '.number' 2>/dev/null)
# General PR-level comments (conversation tab)
gh api repos/{owner}/{repo}/issues/${PR_NUMBER}/comments \
--jq '[.[] | {id: .id, author: .user.login, body: .body, created_at: .created_at}]' \
2>/dev/null
# Inline review comments (files changed tab — these have file + line context)
gh api repos/{owner}/{repo}/pulls/${PR_NUMBER}/comments \
--jq '[.[] | {id: .id, author: .user.login, path: .path, line: .line, body: .body, diff_hunk: .diff_hunk, created_at: .created_at, in_reply_to_id: .in_reply_to_id}]' \
2>/dev/null
```
To get `{owner}/{repo}`, parse it from the remote URL:
```bash
gh repo view --json nameWithOwner --jq '.nameWithOwner' 2>/dev/null
```
**Organize what you collected:**
1. **Inline comments** (have `path` + `line`) — grouped by file
2. **PR-level comments** (no `path`) — general feedback
3. **Thread replies** (have `in_reply_to_id`) — attach to their parent comment, don't treat as separate items
**Filter out:**
- Bot comments that are purely informational (CI status, coverage reports, auto-generated summaries)
- Comments made by the PR author themselves (these are usually clarifications, not requests)
- Comments that are already resolved (check if there's a reply from the PR author acknowledging the fix)
**If no actionable comments found:**
> "No unresolved review comments on this PR. Either it hasn't been reviewed yet, or everything's already been addressed."
STOP. Status: DONE.
**Present the summary before starting:**
```
PR #[number]: [title]
Found [N] comment(s) to work through:
[N] inline (code-level)
[N] PR-level (general)
Reviewers: [list of unique reviewer names]
```
Then proceed directly to Phase 2 — no confirmation gate needed.
---
## Phase 2: Work Through Comments One by One
Process inline comments first (they're tied to specific code and usually more
actionable), then PR-level comments.
For each comment, follow this loop:
### 2a. Present the Comment
Show it clearly in Chief's voice — not a raw dump, a readable summary:
```
─────────────────────────────────────────
Comment [N of M] — @[reviewer] on [file]:[line]
─────────────────────────────────────────
[The comment body, quoted as-is]
Context (what they were looking at):
[diff_hunk — the code snippet from the PR diff]
```
For PR-level comments (no file/line):
```
─────────────────────────────────────────
Comment [N of M] — @[reviewer] (general)
─────────────────────────────────────────
[The comment body]
```
Then Chief adds a brief plain-English interpretation in 1-2 sentences:
> "They're saying [what the reviewer actually means in plain terms]. The concern is [the underlying issue]."
Keep it honest. If the comment is vague or unclear, say so:
> "This one's a bit vague — I think they mean [best guess], but worth confirming."
### 2b. Ask What to Do
```
What do you want to do with this one?
A) Fix it — let's address it now
B) Discuss it — I want to talk through this first
C) Defer it — valid point, but not doing it in this PR
D) Dismiss it — I disagree, we're not doing this
```
**If A — Fix it:**
Apply the Plan First rule. Before touching any code, state the fix:
> "Here's what I'd change:
> 1. [specific change — file, what, why]
> 2. [if multi-step]
> Good?"
Wait for approval. Then make the fix. Show the diff after.
After fixing, ask:
> "Reply to this comment on GitHub to let the reviewer know it's addressed?
>
> A) Yes — reply now
> B) No — I'll handle it later"
If A: post a reply via GitHub API:
```bash
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
--method POST \
--field body="Fixed — [one sentence describing what was changed]."
```
**If B — Discuss it:**
Chief engages in coaching mode — ask the developer what they think first, then share a perspective. Use the same voice as the coaching session. Concept Explanation Protocol applies here too.
After the discussion, loop back to the action choice: "So what do you want to do with it?"
**If C — Defer it:**
Ask via AskUserQuestion:
> "Why are we deferring?
>
> A) Scope creep — out of bounds for this PR
> B) Low priority — valid but not urgent
> C) Will fix in follow-up PR
> D) Other — I'll explain in the PR comment"
Note the selection in the session log. Move on.
**If D — Dismiss it:**
Chief doesn't rubber-stamp dismissals. Ask once via AskUserQuestion:
> "Dismissing it — what's the reason?
>
> A) Already handled differently in the code
> B) Design decision — intentional trade-off
> C) Out of scope for this PR
> D) Draft a reply for me — I'll explain it to the reviewer"
If D is selected, draft and post the reply via GitHub API:
```bash
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies \
--method POST \
--field body="[drafted reply explaining the decision, in the developer's voice]"
```
Otherwise note the reason and move on.
---
## Phase 3: Session Summary
After all comments are processed, output a clean summary:
```
/chief-resolve summary
───────────────────────────────────────
PR: #[number] — [title]
Branch: [branch]
Comments processed: [total]
✓ Fixed: [N]
↷ Deferred: [N]
✗ Dismissed: [N]
Files changed: [list of files touched during this session]
───────────────────────────────────────
```
If any fixes were made, ask via AskUserQuestion:
> "Fixes are in. Ready to push?
>
> A) Yes — run /chief-push now
> B) Not yet — I'll push when I'm ready"
If A: hand off to `/chief-push`.
If B: "No problem — run `/chief-push` when you're ready."
---
## Important Rules
- **One comment at a time.** Never batch or summarize multiple comments into a single action. Each one gets its own focused discussion.
- **Plan First rule applies.** Every code fix gets a plan presented and approved before execution. No silent edits.
- **Never auto-dismiss.** Chief doesn't agree to skip a comment without at least one exchange. The developer decides — Chief makes sure they've actually thought about it.
- **Teach, don't just fix.** When addressing a comment, explain why the reviewer flagged it. The goal isn't just a green review — it's the developer learning the pattern.
- **Replies are optional.** Never automatically reply to a comment. Always ask first.
- **Deferred ≠ forgotten.** Deferred comments get noted in the summary so they can be tracked.
Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.