pr-comments
PR Review: Implement and Respond to Review Comments
Work through open PR review threads — implement valid suggestions, explain why invalid ones won't be addressed, and close the loop by resolving threads and committing with commenter credit.
Arguments
Optional PR number (e.g. 42 or #42). If omitted, detect from the current branch. The argument is the text following the skill invocation (in Claude Code: /pr-comments 42); in other assistants it may be passed differently.
If $ARGUMENTS is help, --help, -h, or ?, print usage and exit.
Strip a single leading # from $ARGUMENTS before checking whether it is a number, and pass the cleaned numeric PR number (without #) to gh pr view (so both 42 and #42 work). The cleaned value must match ^[1-9][0-9]{0,5}$ before any shell call — reject anything else with: Invalid PR number: <value>. Must be a positive integer. See Security model for the threat model behind this validation.
Auto mode is the default. The Step 7 confirmation prompt and the Step 13 push/re-request prompt are skipped automatically — the plan table is shown each iteration for observability, but no user approval is required.
Optional --manual flag restores the confirmation gates: the skill pauses at Step 7 with a Proceed? [y/N/auto] prompt before applying any changes and pauses again at Step 13 before pushing or re-requesting review. --manual is sticky — once it appears anywhere in the arguments the whole invocation is manual, regardless of token order; a later --auto does not flip it back to auto mode.
Optional --max N flag sets the maximum number of bot-review loop iterations (N, default: 10). --max is ignored when --manual is present — manual mode has no auto-loop to cap. Strip and process --max N, --auto [N], and --manual tokens before checking remaining tokens for a PR number.
The token immediately following --max is consumed as its value unless that token is itself another -- flag, so an invalid value such as --max +10 is rejected per the rule below rather than silently leaking through as a PR-number candidate. --auto's value is optional and consumed only when the next token is all digits — and because a bare PR number is also all digits, --auto 42 is ambiguous and read as --max 42, leaving no PR-number token to detect from.