name: 19-address-pr-review description: > Works through pull request review findings one-by-one or in batches: triages GitHub review comments (including 18-pr-review output), confirms fix approach with the user, applies TDD for blockers, commits atomically, replies and resolves threads, pushes, watches CI, and offers 18-pr-review re-run. Never merges. Use when the user asks to address PR review feedback, fix review comments, or remediate findings after 18-pr-review. disable-model-invocation: true
19 — Address PR Review
On-demand Phase G follow-up to 18-pr-review: turn posted review findings into scoped fixes on the PR branch.
GitHub commands: reference.md
Preamble: pipeline-preamble.md
Cross-cutting: considerations.md, ci-after-push, bug-investigation (🔴 TDD)
State agent: workflow-state-manager — mandatory read/update
Never merge. User merges manually after re-review passes.
When to use
| Situation | Use |
|---|---|
| Fix findings after 18-pr-review posted | 19-address-pr-review |
| Triage and fix open PR review / inline comments | 19-address-pr-review |
| Post structured review to GitHub | 18-pr-review |
| Production bug without open PR | 14-hotfix |
| Keep PR merge-ready (conflicts + CI loop, less interview) | Cursor built-in babysit skill |
Prerequisites
ghCLI authenticated (gh auth status).- PR exists with review comments or a prior 18-pr-review cycle.
- Checkout access — agent can
gh pr checkoutand commit on the PR head branch. workflow-state.yamlexists — warn and proceed without state writes if missing (user may waive).
Interactive questions (required)
Every user-facing gate must use AskQuestion. Do not expect inline chat replies for gates.
| Phase | AskQuestion |
|---|---|
| 0 — Target | PR URL · PR number · current branch · list open PRs · Let me explain |
| 0 — Resume | New remediation session · Resume in-progress pr_remediation_cycles[] · Let me explain |
| 1 — Scope | Blockers only (🔴) · Blockers then advisories (🟡) · Pick specific items · Let me explain |
| 2 — Per finding | Confirm fix approach · Won't fix (reply on thread) · Defer · Let me explain |
| 2 — Post-fix | Confirm resolution before GitHub reply / thread resolve |
| 3 — Push | Push commits now? (yes / no / wait for more fixes) |
| 4 — Re-review | Run 18-pr-review on this PR now? (yes / no / later) |
First option = recommendation; last = Let me explain / provide more context.
State management
- Invoke workflow-state-manager
read_context+skill_id: 19-address-pr-review. - After Phase 0, agent
update→ newpr_remediation_cycles[]entrystatus: in_progress. - Link
linked_review_cycle_idwhen a matchingpr_review_cycles[]entry exists (same PR number). - After each finding: append to cycle
findings[]with status (fixed|deferred|wont_fix). - On completion, agent
update→status: completed, counts, head SHA after push.
Schema: reference.md §workflow-state.yaml schema.
Workflow
Phase 0 — Intake
- AskQuestion: How to identify the PR?
- Resolve metadata:
gh pr view— number, URL, head, base, checks. gh pr checkout <number>(unless already on PR head).- Fetch findings — all unresolved review input (reference.md §Fetch findings):
- Inline review comments on open threads
- Review bodies with 🔴 / 🟡 markers (including 18-pr-review posts)
- Classify each item: blocker (🔴,
REQUEST_CHANGES, or labeled blocking) vs advisory (🟡)
- AskQuestion: Resume prior cycle or start new?
- Present numbered backlog; note already-resolved threads (skip).
Phase 1 — Session scope
- AskQuestion: Blockers only · blockers then advisories · pick specific IDs.
- Default order: all blockers first, then batch advisories by file or theme (max ~5 per batch).
Phase 2 — Remediate (per item or batch)
Blockers (one at a time):
- Show finding: path, line, comment body, reviewer.
- AskQuestion: Proposed fix approach · won't fix · defer.
- If won't fix or defer → draft GitHub reply; resolve thread only when user confirms on close-out for won't-fix with rationale.
- If fix:
- TDD when finding is a defect (logic bug, regression, security issue): follow bug-investigation — repro test in
tests/bugs/, red → green, one bug per test module. - Non-defect blockers (spec/checklist/hygiene): fix in place; add/adjust tests only when behavior changed.
- TDD when finding is a defect (logic bug, regression, security issue): follow bug-investigation — repro test in
- Local checks on touched paths (reference.md §Local verification).
- Atomic commit — one finding per commit unless user approved a batch in Phase 1.
- AskQuestion: Confirm resolution matches intent?
- GitHub: reply on thread citing commit SHA; resolve thread when fix is complete (reference.md §Resolve threads).
Advisories (batched):
- Present batch (same file or theme).
- AskQuestion: Fix batch · skip batch · pick subset.
- Fix without mandatory repro tests unless behavior change warrants tests.
- One commit per approved batch; reply per thread or one summary reply if threads are linked.
Do not push until Phase 3 unless user explicitly requests push after a single finding.
Phase 3 — Push and CI
- AskQuestion: Push now?
git pushto PR head remote.- Watch CI:
bash scripts/ci/watch_github_ci.sh <head-ref>(ci-after-push). - If CI fails on changes in scope → fix in loop (AskQuestion before out-of-scope CI/workflow edits).
- Record
ci_statuson cycle.
Phase 4 — Close out
- workflow-state-manager
update— completepr_remediation_cycles[]. - Chat summary: PR URL, fixed / deferred / won't-fix counts, commit SHAs, CI status.
- AskQuestion: Run 18-pr-review now?
- Do not merge.
Severity and scope rules
| Source | In scope | Default handling |
|---|---|---|
| 🔴 / blocking inline | Yes | Phase 2 one-by-one; TDD if defect |
| 🟡 / advisory inline | Yes | After blockers; batched |
| 18-pr-review review body | Yes | Parse Findings section |
| Human / Bugbot / other bots | Yes | Same triage; validate before acting |
| Praise (🟢) | No | Acknowledge only — do not "fix" |
| Merge conflicts | Out of scope | Suggest babysit or manual merge |
| Unrelated CI on base branch | Out of scope | Report; suggest merge base or babysit |
When disagreeing with a comment: won't fix path — AskQuestion, then reply with evidence; do not resolve thread unless user treats comment as satisfied.
Output rules
| Artifact | Location |
|---|---|
| Code fixes | PR head branch commits |
| GitHub replies | PR review threads |
| State | workflow-state.yaml → pr_remediation_cycles[] |
| Bug repro (🔴 defects) | docs/bug-reports/BUG-*.md + tests/bugs/test_bug_*.py |
Anti-patterns
- Merging the PR
- Fixing without Phase 2 AskQuestion on approach
- One giant commit for unrelated findings
- Skipping CI watch after push
- Changing CI workflows to greenwash unrelated failures
- Auto-starting after 18-pr-review without user invoking 19-address-pr-review
- Resolving GitHub threads before user confirms resolution