address-review
Address feedback on a pull request: fetch human and bot review comments (CodeRabbit, codex review), classify, fix in code, regenerate generated files, verify with build/test, push, resolve threads, optionally request re-review. Use when reviewers or bots have left comments to apply, or after seeing 'changes requested' on a PR.
What this skill does
# Address PR Review Comments
## Output Durability
Replies to review comments and any new commit messages describe what behavior changed and why, not file paths or line numbers. A reviewer reading the reply six months later, after the file in question has moved, must still understand what was fixed.
**If `$ARGUMENTS` is empty or not provided:**
Auto-detect PR from current branch:
```bash
gh pr view --json number --jq '.number' 2>/dev/null
```
If no PR found, display usage and ask:
**Usage:** `/address-review [PR-number] [--no-watch]`
**Example:** `/address-review 123` or just `/address-review` on a PR branch. Add `--no-watch` to exit after one fix cycle instead of watching for bot re-reviews.
Ask the user: "No PR found for current branch. What PR number would you like to address?"
---
**If PR number is available (from `$ARGUMENTS` or auto-detected):**
## Parse Arguments
```bash
WATCH_MODE=true
PR_ARG=""
for arg in $ARGUMENTS; do
case "$arg" in
--no-watch) WATCH_MODE=false ;;
*) PR_ARG="$arg" ;;
esac
done
echo "WATCH_MODE=$WATCH_MODE PR_ARG=$PR_ARG"
```
## Security Validation
!if [ -n "$PR_ARG" ] && ! echo "$PR_ARG" | grep -qE '^[0-9]+$'; then echo "Error: PR number must be numeric"; exit 1; fi
## Resolve PR Number
```bash
RESOLVED_PR="${PR_ARG:-$(gh pr view --json number --jq '.number' 2>/dev/null || echo 'auto')}"
echo "Resolved PR: $RESOLVED_PR"
```
## Loop Initialization & Re-entry
Read `loop-management.md` for loop setup and phase re-entry logic. Key behavior:
- If resuming `watching` phase in watch mode → skip to Step 12 (watch loop)
- If resuming `watching` phase in no-watch mode → clear phase, run full fix cycle
- Otherwise → continue normally
## Context & Bot Discovery
Read `setup-and-discovery.md` for PR context gathering, mode banner display, and bot discovery via GraphQL. Match discovered authors against `bot-registry.md`.
---
## Step 1: Checkout PR Branch and Rebase
Read `checkout-rebase.md` for the full procedure: checkout via `gh pr checkout`, detect base remote, check if behind, rebase + force-push if needed, wait for CI after rebase.
## Step 2: Fetch All Review Feedback
Read `fetch-feedback.md` for GraphQL queries to fetch review threads (line-specific, auto-resolvable) and pending reviews (CHANGES_REQUESTED).
## Steps 3-9: Fix Cycle
Read `fix-cycle.md` for the complete fix cycle:
- **Step 3:** Categorize comments into Group A (resolvable threads) and Group B (pending reviews)
- **Step 4:** Address each comment — parallel dispatch for 3+ comments on different files, sequential otherwise. Understand request, locate code, make minimal fix, validate against feedback
- **Step 4.5:** Generate tests for testable fixes (read `test-generation.md`)
- **Step 5:** Verify locally — `go build`, `go test`, `golangci-lint`
- **Step 6:** Commit and push, capture `BOT_REVIEW_BASELINE` timestamp
- **Step 7:** Watch CI — retry up to 3x if no checks reported
- **Step 8:** Reply to each comment
- **Step 9:** Resolve review threads via GraphQL (Group A only)
## Step 10: Request Re-review
Read `bot-registry.md` for the full re-review procedure (Steps 10a-10e) including bot detection, opt-out checks, and data-driven re-review triggering.
## Step 11: Verify Completion
Confirm all resolvable threads are resolved and CI is passing:
```bash
OWNER=$(gh repo view --json owner --jq '.owner.login')
REPO=$(gh repo view --json name --jq '.name')
gh api graphql -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pr) {
reviewThreads(first: 100) {
nodes { isResolved }
}
}
}
}
' -f owner="$OWNER" -f repo="$REPO" -F pr="$PR_NUM" | jq '.data.repository.pullRequest.reviewThreads.nodes | map(select(.isResolved == false)) | length'
```
Confirm CI: `gh pr checks "$PR_NUM"`
## Step 12: Watch for Bot Re-review
**Skip if `WATCH_MODE` is `false` or no review bots were detected.**
Read `watch-loop.md` for Phase Transition logic, bot polling, quiet period detection, timeout handling, and re-trigger procedures.
---
## Completion Criteria
### With `--no-watch`:
Output `<done>COMPLETE</done>` when: branch rebased, all feedback addressed, fixes validated, local verification passes, changes pushed, CI green, replies posted, threads resolved, re-review requested.
### Default (watch mode):
All above, PLUS all detected review bots signaled approval per `bot-registry.md`.
**When ALL criteria are met, output exactly:** `<done>COMPLETE</done>`
**Safety:** If 15+ iterations without success, document blockers and ask user.
## Supporting Files
- `bot-registry.md` — Bot registry table, detection logic, and Step 10 re-review procedures
- `test-generation.md` — Step 4.5 test generation guidelines and testability rules
- `watch-loop.md` — Phase Transition logic and Step 12 watch loop procedures
- `loop-management.md` — Loop initialization and re-entry check logic
- `setup-and-discovery.md` — PR context gathering, mode banner, and bot discovery
- `checkout-rebase.md` — Step 1 checkout and rebase procedure
- `fetch-feedback.md` — Step 2 GraphQL queries for review feedback
- `fix-cycle.md` — Steps 3-9 categorize, fix, verify, commit, CI, reply, resolve
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.