From 3983a6ba2438c6e3eca39da3f51251c6f3e35f01 Mon Sep 17 00:00:00 2001 From: Hugo Nijhuis Date: Tue, 13 Jan 2026 23:45:32 +0100 Subject: [PATCH] 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 --- agents/code-reviewer/AGENT.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/agents/code-reviewer/AGENT.md b/agents/code-reviewer/AGENT.md index 9593517..6726f7c 100644 --- a/agents/code-reviewer/AGENT.md +++ b/agents/code-reviewer/AGENT.md @@ -21,7 +21,8 @@ Review one PR completely: 2. Analyze the code changes 3. Check for quality, bugs, tests, documentation 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 @@ -32,6 +33,7 @@ You receive: You produce: - Concise review comment on PR (issues with file:line, no thanking/fluff) +- If approved: merged PR and deleted branch - Verdict for orchestrator ## Process @@ -182,7 +184,20 @@ Implementation looks solid. No blocking issues found. - 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 --style rebase +tea pulls clean +``` + +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: @@ -194,7 +209,7 @@ summary: <1-2 sentences> ``` **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 **Important:**