|
1 | 1 | --- |
2 | 2 | name: pull-request |
3 | | -description: Full PR lifecycle — branch, commit, issue, draft PR, CI, ready, autonomous monitor loop (fix comments, resolve threads, iterate until CI green and zero actionable threads). |
| 3 | +description: Full PR lifecycle — branch, commit, issue, draft PR, CI, ready, autonomous monitor loop (fix comments, resolve threads, iterate until CI green and zero open threads). |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # Pull Request Skill |
@@ -121,13 +121,19 @@ After `gh pr ready`, enter an autonomous polling loop. Do not wait for the user |
121 | 121 | ### Loop procedure |
122 | 122 |
|
123 | 123 | ```text |
| 124 | +consecutive_zero = 0 |
| 125 | +
|
124 | 126 | REPEAT: |
125 | | - 1. Wait for CI → sleep 30 then gh pr checks <number> --watch |
126 | | - 2. If CI fails → fix, /verify, commit, push, GOTO 1 |
127 | | - 3. Grace period → sleep 180 + adaptive check (see 6b) |
128 | | - 4. Read all feedback → unresolved threads only (see 6b) |
129 | | - 5. If actionable comments → fix all, /verify, commit, push, reply, resolve, GOTO 1 |
130 | | - 6. If zero new actionable → check branch protection (see 6f), then STOP ✓ |
| 127 | + 1. Wait for CI → sleep 30 then gh pr checks <number> --watch |
| 128 | + 2. If CI fails → fix, /verify, commit, push, consecutive_zero=0, GOTO 1 |
| 129 | + 3. Grace period → sleep 180 + adaptive check (see 6b) |
| 130 | + 4. Re-check pending review checks → gh pr checks <number> — if any still pending, GOTO 3 |
| 131 | + 5. Read all feedback → unresolved threads only (see 6b) |
| 132 | + 6. If actionable comments → fix all, /verify, commit, push, reply, resolve, consecutive_zero=0, GOTO 1 |
| 133 | + 7. If non-actionable unresolved → reply all explaining why, resolve all, consecutive_zero=0, GOTO 5 |
| 134 | + 8. If zero unresolved threads → consecutive_zero++ |
| 135 | + if consecutive_zero >= 2 → check branch protection (see 6f), then STOP ✓ |
| 136 | + else GOTO 3 |
131 | 137 | ``` |
132 | 138 |
|
133 | 139 | ### 6a. Wait for CI |
@@ -200,7 +206,9 @@ gh api repos/$OWNER/$REPO/issues/$PR/comments --paginate | jq 'map({id, user: .u |
200 | 206 |
|
201 | 207 | **Actionable** (must fix): change requests, bug reports, missing tests, security issues, code suggestions. |
202 | 208 |
|
203 | | -**Informational** (skip): "LGTM", approvals, "coverage up from X% to Y%", "no issues found", style preferences without a change request. |
| 209 | +**Informational** (no code change needed, but must still be addressed): "LGTM", approvals, "coverage up from X% to Y%", "no issues found", style preferences without a change request, false positives (e.g. bot references a file that doesn't exist). |
| 210 | +- If the comment is an unresolved **review thread**: reply briefly explaining why no action is needed, then resolve via GraphQL (see `references/monitoring.md`). |
| 211 | +- If the comment is a **PR-level or issue comment** (e.g. codecov report, approval message): reply if useful, but these cannot be resolved via GitHub's thread API — they do not count as open threads. |
204 | 212 |
|
205 | 213 | ### 6c. Fix all actionable comments from this pass |
206 | 214 |
|
@@ -237,7 +245,7 @@ Loop back to step 6a. Do not attempt to trigger reviewers — reviews arrive on |
237 | 245 |
|
238 | 246 | ### 6f. Stop condition |
239 | 247 |
|
240 | | -All CI checks pass **and** a complete polling pass (after the grace period) produces **zero unresolved actionable threads**. |
| 248 | +All CI checks pass **and** 2 consecutive polling passes (each after a full grace period) both produce **zero unresolved threads** — this double-pass ensures slow review bots have had time to post before the loop exits. |
241 | 249 |
|
242 | 250 | Before declaring done, check branch protection: |
243 | 251 |
|
|
0 commit comments