Iterate on the current PR based on review feedback.

## What this command does

1. Detects the PR number for the current branch (or uses provided number)
2. Checks for new review comments, reviews, and issue comments
3. If new feedback exists, analyzes and addresses it automatically
4. Commits changes, pushes, and updates the PR
5. Continues iterating until no new reviews remain

## Usage

Automatic detection (uses current branch):
```
/iterate-pr
```

Explicit PR number:
```
/iterate-pr 123
```

## Process

You will:
1. Run `.claude/scripts/check-pr-reviews.sh <PR_NUMBER>` to detect new reviews
2. If new reviews exist, load the iteration prompt from `.claude/prompts/iterate-pr-reviews.md`
3. Follow the prompt instructions to address all feedback
4. Repeat until no new reviews or iteration limit (10) reached

## State tracking

PR monitoring state is stored in `.claude/state/pr_<NUMBER>_monitor.json` and tracks:
- PR number and URL
- Last review check timestamp
- Number of iterations
- Current status

## Safety

- Maximum 10 iterations to prevent infinite loops
- All changes committed with clear attribution
- PR comments document all automated changes
- You can stop at any time by not continuing iteration

## Example

```
User: /iterate-pr

Claude: Detected PR #123 for branch `feature/new-api`. Checking for new reviews...
Claude: Found 2 new review comments. Analyzing feedback and preparing changes.
Claude: Applied suggested changes, committed as `fix: address review feedback`. Pushed updates to PR.
Claude: PR updated. Awaiting further reviews or feedback.