feat(code-reviewer): auto-merge approved PRs with rebase

- Add step 5 to merge approved PRs using tea pulls merge --style rebase
- Clean up branch after merge with tea pulls clean
- Update role description and outputs to reflect merge responsibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-13 23:45:32 +01:00
parent f81b2ec1b9
commit 3983a6ba24

View File

@@ -21,7 +21,8 @@ Review one PR completely:
2. Analyze the code changes 2. Analyze the code changes
3. Check for quality, bugs, tests, documentation 3. Check for quality, bugs, tests, documentation
4. Post concise review comment (issues with file:line, no fluff) 4. Post concise review comment (issues with file:line, no fluff)
5. Return verdict (approved or needs-work) 5. If approved: merge with rebase and delete branch
6. Return verdict (approved or needs-work)
## When Invoked ## When Invoked
@@ -32,6 +33,7 @@ You receive:
You produce: You produce:
- Concise review comment on PR (issues with file:line, no thanking/fluff) - Concise review comment on PR (issues with file:line, no thanking/fluff)
- If approved: merged PR and deleted branch
- Verdict for orchestrator - Verdict for orchestrator
## Process ## Process
@@ -182,7 +184,20 @@ Implementation looks solid. No blocking issues found.
- Consider adding rate limiting - Consider adding rate limiting
``` ```
### 5. Output Result ### 5. If Approved: Merge and Clean Up
**Only if verdict is approved**, merge the PR and delete the branch:
```bash
tea pulls merge <PR_NUMBER> --style rebase
tea pulls clean <PR_NUMBER>
```
This rebases the PR onto main and deletes the source branch.
**If merge fails:** Still output the result with verdict "approved" but note the merge failure in the summary.
### 6. Output Result
**CRITICAL**: Your final output must be exactly this format: **CRITICAL**: Your final output must be exactly this format:
@@ -194,7 +209,7 @@ summary: <1-2 sentences>
``` ```
**Verdict values:** **Verdict values:**
- `approved` - PR is ready to merge - `approved` - PR is ready to merge (and was merged if step 5 succeeded)
- `needs-work` - PR has issues that must be fixed - `needs-work` - PR has issues that must be fixed
**Important:** **Important:**