Skip to content

Commit b60a2ac

Browse files
fix(pull-request): add perfect mode with CodeRabbit auto-trigger strategy
Add section 7 (perfect mode) consistent with Vue skill. CodeRabbit auto-triggers on push — manual ping only after 5 min timeout. Add CodeRabbit wait polling to monitoring.md reference.
1 parent f8b7b56 commit b60a2ac

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

.claude/skills/pull-request/SKILL.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,25 @@ gh pr view "$PR" --json reviewDecision,mergeable | jq '{reviewDecision, mergeabl
208208

209209
**Safety limit:** 10 iterations max — report to user if still unresolved.
210210

211-
## 7. Conflict resolution
211+
## 7. Perfect mode (`--perfect`)
212+
213+
When invoked with `--perfect`, run an outer convergence loop after the standard monitor loop (section 6) completes:
214+
215+
```text
216+
REPEAT:
217+
1. Wait for CodeRabbit → CodeRabbit auto-triggers on every push. Poll for up to 5 min.
218+
ONLY if no review appears after 5 min, post:
219+
`@coderabbitai full review` as PR comment, then wait (see monitoring.md)
220+
2. Run monitor loop (section 6) → fix all comments, resolve all threads, CI green
221+
3. Run diff audit → audit `git diff master...HEAD` for security, logic bugs,
222+
data integrity, API design, performance issues
223+
4. If audit has findings → fix all, commit, push, GOTO 1
224+
5. If 0 CodeRabbit comments AND 0 audit findings → STOP ✓
225+
```
226+
227+
**Safety limit:** 5 outer iterations max — report to user if still not converged.
228+
229+
## 8. Conflict resolution
212230

213231
```bash
214232
git fetch origin && git rebase origin/HEAD

.claude/skills/pull-request/references/monitoring.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,23 @@ gh pr view $PR --json reviewDecision,mergeable \
110110
gh pr view $PR --json statusCheckRollup,reviews,reviewRequests | jq .
111111
```
112112

113+
## Wait for CodeRabbit after re-trigger
114+
115+
When you post `@coderabbitai full review`, CodeRabbit replies "Full review triggered" immediately — but the actual review has **not started yet**. The `CodeRabbit: pass` status check is **stale** from the previous review. You must wait for the new review summary comment before declaring clean:
116+
117+
```bash
118+
# Poll until CodeRabbit posts its new review summary (contains "Actionable comments")
119+
for i in $(seq 1 20); do
120+
LATEST=$(gh api repos/$OWNER/$REPO/issues/$PR/comments \
121+
--jq '[.[] | select(.user.login=="coderabbitai")] | sort_by(.created_at) | last | .body[0:200]')
122+
if echo "$LATEST" | grep -qiE "actionable|no issues found|walkthrough"; then
123+
echo "CodeRabbit review posted" && break
124+
fi
125+
sleep 30
126+
done
127+
```
128+
129+
Only after this should you check for unresolved threads and declare clean.
130+
113131
> **Never post `@copilot review` as a PR comment** — this invokes the Copilot coding agent
114132
> (which can open PRs and issues), not the code reviewer.

0 commit comments

Comments
 (0)