[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BV33WTKB3JVPKAK143FJMV":3,"skill-same:01M6BV33WTKB3JVPKAK143FJMV":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M6BV33WTKB3JVPKAK143FJMV","rereview-loop",null,"Iteratively run \u002Frereview, fix the findings, and loop until reviewers approve clean. Use for iterative automated review, when you want \u002Frereview to loop until clean, or for a paranoid pre-merge review that auto-addresses every blocker.","drn\u002Fdots","drn","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F885841?v=4","01M6BTZJR7B1RVQRJKP0S70DQS","Darren Cheng","01M6BTZJWXCK41P3Z50BV8KWD9",23,"MIT","https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots\u002Fblob\u002Fmaster\u002Fagents\u002Fskills\u002Frereview-loop\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"loop","rereview loop","rereview","auto","when","approve","for","merge review","pre-merge","addresses","you","clean","review","use","fix","run","merge","2026-11-10 10:12:30",false,"---\nname: rereview-loop\ndescription: \"Iteratively run \u002Frereview, fix the findings, and loop until reviewers approve clean. Use for iterative automated review, when you want \u002Frereview to loop until clean, or for a paranoid pre-merge review that auto-addresses every blocker.\"\n---\n\n# Re-Review Loop\n\nRun `\u002Frereview` repeatedly: review → fix the findings → re-review → repeat. Stop when all three reviewers approve with zero BLOCKING and zero WARNING findings, when the iteration cap is hit, or when an iteration makes no progress.\n\n## Arguments\n\n- `$ARGUMENTS` - Optional. Forms:\n  - `\u003Cbranch-or-range>` - passed through to `\u002Frereview` as its scope\n  - `max=\u003CN>` - cap the number of review→fix iterations (default 5)\n  - `severity=blocking` - only auto-fix BLOCKING findings (default fixes BLOCKING + WARNING)\n  - `severity=all` - auto-fix BLOCKING + WARNING + INFO\n  - `push` - after each iteration commit, and push the branch with `git push -u origin HEAD` (opt-in; the same applies if the user explicitly asks mid-run to update the PR between loops)\n  - Any combination, space-separated. Example: `\u002Frereview-loop max=3 severity=blocking`\n\n## Context\n\n- Current branch: !`git branch --show-current`\n- Base ref: !`git branch -r 2>\u002Fdev\u002Fnull | grep -oE 'origin\u002F(main|master)' | head -1`\n- Git status: !`git status --short`\n- Commits vs main: !`git log origin\u002Fmain..HEAD --oneline 2>\u002Fdev\u002Fnull | head -20`\n- Commits vs master: !`git log origin\u002Fmaster..HEAD --oneline 2>\u002Fdev\u002Fnull | head -20`\n\n## Overview\n\nYou are the **lead coordinator** for an iterative re-review loop. Your job is to drive findings to zero by alternating between review (delegated to `\u002Frereview`) and fixes (applied here).\n\n**Core principle:** trust the reviewers. Fix what they flag, do not argue with the verdict to escape the loop. The loop exits when reviewers say it's clean -- not when you decide it's clean.\n\n**Hard rules:**\n\n- NEVER skip, weaken, or reword reviewer findings to make them \"easier to satisfy.\"\n- NEVER mark a finding addressed without making (or consciously rejecting) a code change.\n- NEVER cap the loop early just because the remaining findings look minor -- run to the cap or to clean.\n- NEVER fix a finding by deleting the test that catches it.\n\n---\n\n## Phase 0: Parse arguments and initialize state\n\nParse `$ARGUMENTS`:\n\n```\nmax_iterations = 5             (override with max=\u003CN>)\nseverity_filter = \"blocking+warning\"   (override with severity=blocking | severity=all)\nrereview_scope = \"\"            (any non-key=value token; passed to \u002Frereview verbatim)\niteration = 0\nprior_blocking_count = -1      (B count from previous iteration; -1 = no prior)\nprior_warning_count = -1       (W count from previous iteration; -1 = no prior)\nprior_info_count = -1          (I count from previous iteration; -1 = no prior)\nlast_iteration_committed = false   (did the previous iteration produce a commit?)\ntotal_pushbacks = 0            (cumulative judgment-call pushbacks across all iterations)\ntotal_verified_false_positives = 0   (cumulative findings disproven by an actually-executed command, not judgment)\ntotal_findings_addressed = 0   (cumulative findings touched, for the pushback rate)\npush_each_iteration = false    (override with push)\naccepted_limits = []           (running list of accepted limits and pushed-back findings, with file:line and one-line rationale)\nstashed = false                (set true if Phase 0 stashes unrelated work)\n```\n\n**Preflight:**\n\n1. **Detached HEAD guard.** Run `git symbolic-ref --short HEAD` (or `git branch --show-current`). If empty, exit immediately: \"Cannot run \u002Frereview-loop in detached HEAD state -- check out a named branch first.\" Do not proceed.\n\n2. **No-changes guard.** If there are no commits ahead of the base branch and no uncommitted changes, tell the user \"Nothing to re-review -- branch has no changes vs base.\" and stop.\n\n3. **Stash unrelated work.** If `git status --short` shows uncommitted changes that are NOT part of the work being reviewed (i.e., the user has unrelated dirty files), run `git stash push -u -m \"rereview-loop pre-loop\"` and set `stashed = true`. Tell the user you stashed. The stash MUST be popped on every exit path -- see Phase 4 and the failure-handling table.\n\nAnnounce the run:\n\n```\n## Re-review loop starting\n\n**Scope:** {rereview_scope or \"current branch vs default\"}\n**Max iterations:** {max_iterations}\n**Auto-fix severity:** {severity_filter}\n```\n\n---\n\n## Phase 1: Run \u002Frereview\n\nInvoke the `\u002Frereview` skill via the Skill tool, passing `rereview_scope` as its argument (empty string if no scope was given). **Pass the current `accepted_limits` list along** (state it in the invocation so `\u002Frereview` includes it in the reviewer briefing under ACCEPTED LIMITS); without it reviewers re-flag settled items every round. Wait for it to complete and capture the full final report.\n\n`\u002Frereview` will:\n1. Gather all changed files and dependents\n2. Run the test + lint baseline\n3. Launch 3 independent reviewers in parallel\n4. Synthesize a final verdict\n\nYou will receive a markdown report with: a final verdict, a per-reviewer agreement table, and consolidated lists of Blocking Issues, Warnings, Suggestions, Disagreements, and Missing Test Coverage.\n\nIf `\u002Frereview` reports \"no changes to review,\" the loop is trivially clean -- exit with the success summary in Phase 4.\n\n---\n\n## Phase 2: Decide whether to exit\n\nRead the final verdict and the agreement table. Record this iteration's `B` (blocking), `W` (warning), and `I` (info) counts from the consolidated report.\n\nThe exit condition depends on `severity_filter`:\n\n| `severity_filter`     | \"Clean\" means          |\n|-----------------------|------------------------|\n| `blocking`            | B == 0                 |\n| `blocking+warning`    | B == 0 AND W == 0      |\n| `all`                 | B == 0 AND W == 0 AND I == 0 |\n\n```\nIF this iteration's counts meet the \"clean\" condition for severity_filter:\n  → EXIT. Go to Phase 4 with status = CLEAN.\n  (If severity_filter == \"blocking\" and W > 0, status = APPROVED_WITH_WARNINGS_IGNORED.)\n\nIF iteration >= max_iterations:\n  → EXIT (cap hit). Go to Phase 4 with status = MAX_ITERATIONS.\n\nOTHERWISE:\n  → Continue to Phase 3 to address findings.\n```\n\n**Cap semantics.** `iteration` counts completed fix rounds, and Phase 1 reviews before every check. With max=N the loop runs at most N fix rounds and therefore at most N+1 reviews: the cap check fires only after a review, so every fix round is always followed by a review. When the cap fires, that final review's findings are reported but not fixed. State this plainly in Phase 4 (for example: \"cap hit after N fix rounds; the final review's M findings were not addressed\").\n\n### Stuck-state detection\n\nAfter Phase 3 commits the iteration's fixes, the next iteration's Phase 2 must check whether progress was actually made. Use a hard counter, not a paraphrased-text signature:\n\n```\nIF iteration > 0 AND last_iteration_committed == true AND\n   B >= prior_blocking_count AND\n   W >= prior_warning_count AND\n   I >= prior_info_count:\n  → Apparent no-progress. The fix did not reduce the finding counts.\n    Re-read the report carefully:\n      - If the SAME items are flagged at the SAME file:line, try a\n        different approach to those specific findings in this iteration.\n      - If this is the second consecutive iteration with no progress,\n        EXIT with status = STUCK after applying best-effort fixes once more.\n\n    **Second-order findings are progress.** New findings caused by the\n    previous fix (a fix surfaces a follow-on issue at a different file:line\n    or a different aspect of the same code) count as progress even when the\n    B\u002FW\u002FI counts do not fall. Only treat the loop as stuck when the SAME\n    findings recur at the same location after a fix attempt. Note\n    second-order findings in the heartbeat as \"new, caused by iter {N} fix\".\n\n    A finding resolved as a **verified false positive** (Phase 3(b)) counts as\n    genuine progress even though no code changed. Note it explicitly as\n    \"resolved via verification\" in the heartbeat so it does not read as an\n    unaddressed repeat finding if a later reviewer re-flags the same code\n    with different wording -- that re-flag should be checked against the\n    same verification evidence, not treated as a fresh unconfirmed claim.\n\nIF iteration > 0 AND last_iteration_committed == false:\n  → The previous iteration applied no fixes (everything was pushed back\n    or deferred). Counts may legitimately be unchanged. Do NOT treat as\n    stuck on this basis alone -- continue with the loop.\n```\n\nSave the current B\u002FW\u002FI counts as `prior_blocking_count`, `prior_warning_count`, `prior_info_count` for the next iteration's comparison. Reset `last_iteration_committed` to `false` -- Phase 3 sets it back to `true` if a commit lands.\n\n---\n\n## Phase 3: Address findings\n\nBuild the worklist from the consolidated report based on `severity_filter`:\n\n| `severity_filter`     | Includes                          |\n|-----------------------|-----------------------------------|\n| `blocking`            | BLOCKING only                     |\n| `blocking+warning`    | BLOCKING + WARNING (default)      |\n| `all`                 | BLOCKING + WARNING + INFO         |\n\nAlways include items in this order: BLOCKING first, then WARNING, then INFO. Within a tier, group by file so related fixes can share a single read of that file.\n\nFor each finding:\n\n1. **Read the cited file fully** (and any caller\u002Fdependent the reviewers referenced). Do not work from the snippet alone.\n\n2. **Classify the finding into one of three buckets:**\n\n   - **(a) Apply the fix.** The reviewer is correct. Make the minimal code change that resolves the issue. If the fix changes behavior, add or update a test that covers the new behavior. If the finding is \"missing test coverage,\" add the test.\n\n   - **(b) Push back with a recorded justification.** The reviewer is wrong, or the change conflicts with intentional design. **This is a high bar.** Document:\n     - Why the existing code is correct\n     - What evidence convinced you (link to existing test, prior decision, code that shows the invariant)\n     - Note this in the iteration summary so the user can sanity-check\n     - Add the finding (file:line, one-line rationale) to `accepted_limits` so later reviewers are told it is settled\n\n     **Distinguish two kinds of pushback:**\n     - **Verified false positive.** The finding made a mechanically-checkable claim (compiles, a test passes or fails, a command produces some output) and you actually ran that command in this worktree and it contradicts the claim. Record the exact command and its real output in the iteration summary. Increment `total_verified_false_positives`, not `total_pushbacks` -- this is empirical, not a judgment call, and is exempt from the pushback ceiling below.\n     - **Judgment-call pushback.** You disagree with the reviewer's assessment without a mechanical way to prove it wrong (design intent, an accepted tradeoff, and similar). This counts toward the ceiling below.\n\n     Track judgment-call pushbacks at two levels:\n     - **Per-iteration:** if you push back on more than 25% of findings in this iteration, STOP and ask the user before continuing.\n     - **Cumulative:** increment `total_pushbacks` and `total_findings_addressed` after each finding is processed. If `total_pushbacks \u002F total_findings_addressed > 0.25` once at least 4 findings have been processed total, STOP and ask the user. Per-iteration framing alone allows systematic 1-of-4 pushbacks to compound to 100% across iterations without ever tripping a single-iteration ceiling.\n\n     **Count each distinct finding once.** Keep a record of every judgment-call pushback and every deferral with its justification. When a later reviewer re-flags the same issue, even reworded, check it against that record: if nothing new was raised, reuse the recorded response and do NOT increment `total_pushbacks` or `total_findings_addressed` again. Only a genuinely new argument or evidence makes it a new finding. This mirrors the verified-false-positive re-flag rule in Phase 2.\n\n     Pushing back on a quarter of an independent panel's findings -- in any single iteration or cumulatively -- usually means you're rationalizing rather than reviewing. Verified false positives do not count toward this ceiling because they are proven with a command's real output, not argued.\n\n   - **(c) Defer to user.** The finding requires a product decision, scope expansion, or knowledge you don't have (e.g., \"the new SLA isn't documented\"). Do NOT silently skip. Surface it in the iteration summary and continue. Do not add it to `accepted_limits` (the user has not accepted it), so the loop may re-flag it next iteration; that is correct behavior. Record the deferral; a re-flag of an already-deferred item is not a new finding and does not add to `total_findings_addressed`.\n\n3. **After all findings in this iteration are processed:**\n\n   - Re-run the project's test suite (same command `\u002Frereview` detected).\n   - Re-run the linter.\n   - If tests now fail that previously passed -- that is a regression you introduced. Fix it before continuing. Do NOT proceed to commit.\n\n4. **Commit the iteration's fixes** as a single commit per iteration. List the changed paths explicitly -- never use `git add -A` (the Phase 0 stash already moved unrelated work aside, but explicit paths are still the safe default):\n\n   ```\n   git add path\u002Fto\u002Fchanged-file-1 path\u002Fto\u002Fchanged-file-2 ...\n   git commit -m \"rereview-loop iter {N}: address {M} findings\n\n   {bulleted list of finding summaries with file:line, prefixed by [BLOCKING] \u002F [WARNING] \u002F [INFO]}\"\n   ```\n\n   Set `last_iteration_committed = true` once the commit succeeds. If `push_each_iteration` is true, run `git push -u origin HEAD` now (never a bare `git push`). If no findings led to code changes in this iteration (everything was pushed back or deferred), do NOT create an empty commit -- leave `last_iteration_committed = false`.\n\n5. **Heartbeat.** Output the per-iteration summary defined below before looping back.\n\n6. Increment `iteration`. Loop back to **Phase 1**.\n\n### Iteration heartbeat (output at end of every Phase 3 cycle)\n\n```\n## Iteration {N} complete\n\n**Verdict from \u002Frereview:** {verdict}\n**Findings this iteration:** {B} blocking, {W} warning, {I} info\n**Applied fixes:** {count}\n**Verified false positives:** {count} (disproven by an actually-executed command, see summary for evidence)\n**Pushed back:** {count} this iteration, {total_pushbacks} cumulative ({rate}% of {total_findings_addressed})\n**Deferred:** {count}\n**Tests after fixes:** {PASS \u002F FAIL}\n**Lint after fixes:** {CLEAN \u002F WARNINGS \u002F ERRORS}\n\nNext: running \u002Frereview again (iteration {N+1} of {max_iterations}).\n```\n\nIf there are pushback or deferred items, list them under the heartbeat with file:line + one-sentence reason.\n\n### What NOT to do in Phase 3\n\n- Do not amend prior commits -- each iteration gets its own commit so the audit trail is clear.\n- Do not delete or skip tests to make findings go away. If a test is genuinely wrong, replace it; explain in the commit message.\n- Do not introduce new abstractions, refactors, or \"while I'm here\" cleanups. The loop fixes findings, nothing else.\n- Do not push to remote unless `push` was passed or the user explicitly asked for a push. Otherwise pushing is the user's call.\n\n---\n\n## Phase 4: Final report\n\n**Stash pop guard.** Every exit path (CLEAN, APPROVED_WITH_WARNINGS_IGNORED, MAX_ITERATIONS, STUCK, ERROR, and any early exit from Phase 0 after the stash was pushed) MUST run `git stash pop` if `stashed == true` before printing the final report. The user's unrelated work-in-progress is not the loop's to discard.\n\nIf the stash pop reports conflicts, surface them to the user verbatim and stop -- do NOT attempt to resolve unrelated conflicts.\n\nWhen the loop exits, output:\n\n```\n# Re-review loop finished\n\n**Status:** {CLEAN \u002F APPROVED_WITH_WARNINGS_IGNORED \u002F MAX_ITERATIONS \u002F STUCK}\n**Iterations run:** {N} of {max_iterations}\n**Total findings addressed:** {count} (B: {x}, W: {y}, I: {z})\n**Total verified false positives:** {count} (disproven by real command output, not judgment)\n**Total findings pushed back:** {count} (judgment calls; excludes verified false positives)\n**Total findings deferred:** {count}\n**Final verdict from \u002Frereview:** {verdict}\n**Final regression risk:** {LOW \u002F MEDIUM \u002F HIGH}\n\n## Commits added by this loop\n{git log --oneline of commits made during the loop}\n\n## Outstanding items (deferred or pushed back)\n{numbered list, or \"None.\"}\n\n## Accepted limits fed to reviewers\n{the accepted_limits list, or \"None.\"}\n\n## Recommendation\n{One of:\n  - \"Clean — safe to push and merge.\" (if `push` was passed: \"Clean — already pushed; safe to merge.\")\n  - \"Warnings remain (ignored per `severity=blocking`). Review the warnings list before merging.\"\n  - \"Iteration cap hit with findings still open. Re-run \u002Frereview-loop, raise max=, or address remaining items manually.\"\n  - \"Loop is stuck — reviewers re-flagged the same findings after a fix attempt. Manual investigation needed.\"}\n```\n\nDo NOT push the branch unless `push` was passed or the user asked for it (use `git push -u origin HEAD`). Do NOT open a PR. The loop's job is to drive findings to zero; merging is the user's decision.\n\n---\n\n## Failure handling\n\n| Failure | Action |\n|---------|--------|\n| `\u002Frereview` errors out or returns no report | Retry once. If still failing, exit with status = ERROR and surface the message. |\n| Test suite breaks mid-loop and you can't fix it | Stop. Do NOT commit broken tests. Report the failing test and last attempted fix. |\n| A finding is unclear or contradictory across reviewers | Apply the most conservative interpretation. Note the ambiguity in the iteration heartbeat. |\n| Same findings re-appear after a fix attempt (stuck) | One more attempt with a different approach, then exit with status = STUCK and surface the diff of the failed fix. |\n| Reviewers disagree sharply (e.g., one APPROVE, one REJECT) | Trust the strictest. Address the REJECT findings in this iteration. |\n| User has uncommitted unrelated changes | Stash them up front in Phase 0 (`git stash push -u -m \"rereview-loop pre-loop\"`) and pop on every exit path -- see Phase 4's stash-pop guard. |\n\n---\n\n## Design notes\n\n- Each iteration commits independently so a future `git log` shows exactly what the loop changed and why.\n- The B\u002FW\u002FI count comparison in Phase 2 exists to catch the bad-fix → re-flag → bad-fix cycle. A count-based check (instead of paraphrased text matching) is robust against reviewer agents wording the same finding differently across iterations.\n- The 25% pushback ceiling -- both per-iteration and cumulative -- exists because once you start rejecting a quarter of an independent panel's findings, the failure mode is almost always rationalization, not the reviewers being wrong. The cumulative bound prevents systematic 1-of-4 pushbacks from compounding. Each distinct finding counts once so that reviewers re-raising the same settled judgment call cannot trip the ceiling without a new disagreement.\n- This skill does not push (unless `push` is passed or the user asks) or open a PR -- that is the user's call. Pair with `\u002Fpr` after a clean exit.\n- The accepted_limits list exists because reviewers are independent and stateless: without it they re-flag settled items every round and the loop never converges.\n","# Re-Review Loop\n\nRun `\u002Frereview` repeatedly: review → fix the findings → re-review → repeat. Stop when all three reviewers approve with zero BLOCKING and zero WARNING findings, when the iteration cap is hit, or when an iteration makes no progress.\n\n## Arguments\n\n- `$ARGUMENTS` - Optional. Forms:\n  - `\u003Cbranch-or-range>` - passed through to `\u002Frereview` as its scope\n  - `max=\u003CN>` - cap the number of review→fix iterations (default 5)\n  - `severity=blocking` - only auto-fix BLOCKING findings (default fixes BLOCKING + WARNING)\n  - `severity=all` - auto-fix BLOCKING + WARNING + INFO\n  - `push` - after each iteration commit, and push the branch with `git push -u origin HEAD` (opt-in; the same applies if the user explicitly asks mid-run to update the PR between loops)\n  - Any combination, space-separated. Example: `\u002Frereview-loop max=3 severity=blocking`\n\n## Context\n\n- Current branch: !`git branch --show-current`\n- Base ref: !`git branch -r 2>\u002Fdev\u002Fnull | grep -oE 'origin\u002F(main|master)' | head -1`\n- Git status: !`git status --short`\n- Commits vs main: !`git log origin\u002Fmain..HEAD --oneline 2>\u002Fdev\u002Fnull | head -20`\n- Commits vs master: !`git log origin\u002Fmaster..HEAD --oneline 2>\u002Fdev\u002Fnull | head -20`\n\n## Overview\n\nYou are the **lead coordinator** for an iterative re-review loop. Your job is to drive findings to zero by alternating between review (delegated to `\u002Frereview`) and fixes (applied here).\n\n**Core principle:** trust the reviewers. Fix what they flag, do not argue with the verdict to escape the loop. The loop exits when reviewers say it's clean -- not when you decide it's clean.\n\n**Hard rules:**\n\n- NEVER skip, weaken, or reword reviewer findings to make them \"easier to satisfy.\"\n- NEVER mark a finding addressed without making (or consciously rejecting) a code change.\n- NEVER cap the loop early just because the remaining findings look minor -- run to the cap or to clean.\n- NEVER fix a finding by deleting the test that catches it.\n\n---\n\n## Phase 0: Parse arguments and initialize state\n\nParse `$ARGUMENTS`:\n\n```\nmax_iterations = 5             (override with max=\u003CN>)\nseverity_filter = \"blocking+warning\"   (override with severity=blocking | severity=all)\nrereview_scope = \"\"            (any non-key=value token; passed to \u002Frereview verbatim)\niteration = 0\nprior_blocking_count = -1      (B count from previous iteration; -1 = no prior)\nprior_warning_count = -1       (W count from previous iteration; -1 = no prior)\nprior_info_count = -1          (I count from previous iteration; -1 = no prior)\nlast_iteration_committed = false   (did the previous iteration produce a commit?)\ntotal_pushbacks = 0            (cumulative judgment-call pushbacks across all iterations)\ntotal_verified_false_positives = 0   (cumulative findings disproven by an actually-executed command, not judgment)\ntotal_findings_addressed = 0   (cumulative findings touched, for the pushback rate)\npush_each_iteration = false    (override with push)\naccepted_limits = []           (running list of accepted limits and pushed-back findings, with file:line and one-line rationale)\nstashed = false                (set true if Phase 0 stashes unrelated work)\n```\n\n**Preflight:**\n\n1. **Detached HEAD guard.** Run `git symbolic-ref --short HEAD` (or `git branch --show-current`). If empty, exit immediately: \"Cannot run \u002Frereview-loop in detached HEAD state -- check out a named branch first.\" Do not proceed.\n\n2. **No-changes guard.** If there are no commits ahead of the base branch and no uncommitted changes, tell the user \"Nothing to re-review -- branch has no changes vs base.\" and stop.\n\n3. **Stash unrelated work.** If `git status --short` shows uncommitted changes that are NOT part of the work being reviewed (i.e., the user has unrelated dirty files), run `git stash push -u -m \"rereview-loop pre-loop\"` and set `stashed = true`. Tell the user you stashed. The stash MUST be popped on every exit path -- see Phase 4 and the failure-handling table.\n\nAnnounce the run:\n\n```\n## Re-review loop starting\n\n**Scope:** {rereview_scope or \"current branch vs default\"}\n**Max iterations:** {max_iterations}\n**Auto-fix severity:** {severity_filter}\n```\n\n---\n\n## Phase 1: Run \u002Frereview\n\nInvoke the `\u002Frereview` skill via the Skill tool, passing `rereview_scope` as its argument (empty string if no scope was given). **Pass the current `accepted_limits` list along** (state it in the invocation so `\u002Frereview` includes it in the reviewer briefing under ACCEPTED LIMITS); without it reviewers re-flag settled items every round. Wait for it to complete and capture the full final report.\n\n`\u002Frereview` will:\n1. Gather all changed files and dependents\n2. Run the test + lint baseline\n3. Launch 3 independent reviewers in parallel\n4. Synthesize a final verdict\n\nYou will receive a markdown report with: a final verdict, a per-reviewer agreement table, and consolidated lists of Blocking Issues, Warnings, Suggestions, Disagreements, and Missing Test Coverage.\n\nIf `\u002Frereview` reports \"no changes to review,\" the loop is trivially clean -- exit with the success summary in Phase 4.\n\n---\n\n## Phase 2: Decide whether to exit\n\nRead the final verdict and the agreement table. Record this iteration's `B` (blocking), `W` (warning), and `I` (info) counts from the consolidated report.\n\nThe exit condition depends on `severity_filter`:\n\n| `severity_filter`     | \"Clean\" means          |\n|-----------------------|------------------------|\n| `blocking`            | B == 0                 |\n| `blocking+warning`    | B == 0 AND W == 0      |\n| `all`                 | B == 0 AND W == 0 AND I == 0 |\n\n```\nIF this iteration's counts meet the \"clean\" condition for severity_filter:\n  → EXIT. Go to Phase 4 with status = CLEAN.\n  (If severity_filter == \"blocking\" and W > 0, status = APPROVED_WITH_WARNINGS_IGNORED.)\n\nIF iteration >= max_iterations:\n  → EXIT (cap hit). Go to Phase 4 with status = MAX_ITERATIONS.\n\nOTHERWISE:\n  → Continue to Phase 3 to address findings.\n```\n\n**Cap semantics.** `iteration` counts completed fix rounds, and Phase 1 reviews before every check. With max=N the loop runs at most N fix rounds and therefore at most N+1 reviews: the cap check fires only after a review, so every fix round is always followed by a review. When the cap fires, that final review's findings are reported but not fixed. State this plainly in Phase 4 (for example: \"cap hit after N fix rounds; the final review's M findings were not addressed\").\n\n### Stuck-state detection\n\nAfter Phase 3 commits the iteration's fixes, the next iteration's Phase 2 must check whether progress was actually made. Use a hard counter, not a paraphrased-text signature:\n\n```\nIF iteration > 0 AND last_iteration_committed == true AND\n   B >= prior_blocking_count AND\n   W >= prior_warning_count AND\n   I >= prior_info_count:\n  → Apparent no-progress. The fix did not reduce the finding counts.\n    Re-read the report carefully:\n      - If the SAME items are flagged at the SAME file:line, try a\n        different approach to those specific findings in this iteration.\n      - If this is the second consecutive iteration with no progress,\n        EXIT with status = STUCK after applying best-effort fixes once more.\n\n    **Second-order findings are progress.** New findings caused by the\n    previous fix (a fix surfaces a follow-on issue at a different file:line\n    or a different aspect of the same code) count as progress even when the\n    B\u002FW\u002FI counts do not fall. Only treat the loop as stuck when the SAME\n    findings recur at the same location after a fix attempt. Note\n    second-order findings in the heartbeat as \"new, caused by iter {N} fix\".\n\n    A finding resolved as a **verified false positive** (Phase 3(b)) counts as\n    genuine progress even though no code changed. Note it explicitly as\n    \"resolved via verification\" in the heartbeat so it does not read as an\n    unaddressed repeat finding if a later reviewer re-flags the same code\n    with different wording -- that re-flag should be checked against the\n    same verification evidence, not treated as a fresh unconfirmed claim.\n\nIF iteration > 0 AND last_iteration_committed == false:\n  → The previous iteration applied no fixes (everything was pushed back\n    or deferred). Counts may legitimately be unchanged. Do NOT treat as\n    stuck on this basis alone -- continue with the loop.\n```\n\nSave the current B\u002FW\u002FI counts as `prior_blocking_count`, `prior_warning_count`, `prior_info_count` for the next iteration's comparison. Reset `last_iteration_committed` to `false` -- Phase 3 sets it back to `true` if a commit lands.\n\n---\n\n## Phase 3: Address findings\n\nBuild the worklist from the consolidated report based on `severity_filter`:\n\n| `severity_filter`     | Includes                          |\n|-----------------------|-----------------------------------|\n| `blocking`            | BLOCKING only                     |\n| `blocking+warning`    | BLOCKING + WARNING (default)      |\n| `all`                 | BLOCKING + WARNING + INFO         |\n\nAlways include items in this order: BLOCKING first, then WARNING, then INFO. Within a tier, group by file so related fixes can share a single read of that file.\n\nFor each finding:\n\n1. **Read the cited file fully** (and any caller\u002Fdependent the reviewers referenced). Do not work from the snippet alone.\n\n2. **Classify the finding into one of three buckets:**\n\n   - **(a) Apply the fix.** The reviewer is correct. Make the minimal code change that resolves the issue. If the fix changes behavior, add or update a test that covers the new behavior. If the finding is \"missing test coverage,\" add the test.\n\n   - **(b) Push back with a recorded justification.** The reviewer is wrong, or the change conflicts with intentional design. **This is a high bar.** Document:\n     - Why the existing code is correct\n     - What evidence convinced you (link to existing test, prior decision, code that shows the invariant)\n     - Note this in the iteration summary so the user can sanity-check\n     - Add the finding (file:line, one-line rationale) to `accepted_limits` so later reviewers are told it is settled\n\n     **Distinguish two kinds of pushback:**\n     - **Verified false positive.** The finding made a mechanically-checkable claim (compiles, a test passes or fails, a command produces some output) and you actually ran that command in this worktree and it contradicts the claim. Record the exact command and its real output in the iteration summary. Increment `total_verified_false_positives`, not `total_pushbacks` -- this is empirical, not a judgment call, and is exempt from the pushback ceiling below.\n     - **Judgment-call pushback.** You disagree with the reviewer's assessment without a mechanical way to prove it wrong (design intent, an accepted tradeoff, and similar). This counts toward the ceiling below.\n\n     Track judgment-call pushbacks at two levels:\n     - **Per-iteration:** if you push back on more than 25% of findings in this iteration, STOP and ask the user before continuing.\n     - **Cumulative:** increment `total_pushbacks` and `total_findings_addressed` after each finding is processed. If `total_pushbacks \u002F total_findings_addressed > 0.25` once at least 4 findings have been processed total, STOP and ask the user. Per-iteration framing alone allows systematic 1-of-4 pushbacks to compound to 100% across iterations without ever tripping a single-iteration ceiling.\n\n     **Count each distinct finding once.** Keep a record of every judgment-call pushback and every deferral with its justification. When a later reviewer re-flags the same issue, even reworded, check it against that record: if nothing new was raised, reuse the recorded response and do NOT increment `total_pushbacks` or `total_findings_addressed` again. Only a genuinely new argument or evidence makes it a new finding. This mirrors the verified-false-positive re-flag rule in Phase 2.\n\n     Pushing back on a quarter of an independent panel's findings -- in any single iteration or cumulatively -- usually means you're rationalizing rather than reviewing. Verified false positives do not count toward this ceiling because they are proven with a command's real output, not argued.\n\n   - **(c) Defer to user.** The finding requires a product decision, scope expansion, or knowledge you don't have (e.g., \"the new SLA isn't documented\"). Do NOT silently skip. Surface it in the iteration summary and continue. Do not add it to `accepted_limits` (the user has not accepted it), so the loop may re-flag it next iteration; that is correct behavior. Record the deferral; a re-flag of an already-deferred item is not a new finding and does not add to `total_findings_addressed`.\n\n3. **After all findings in this iteration are processed:**\n\n   - Re-run the project's test suite (same command `\u002Frereview` detected).\n   - Re-run the linter.\n   - If tests now fail that previously passed -- that is a regression you introduced. Fix it before continuing. Do NOT proceed to commit.\n\n4. **Commit the iteration's fixes** as a single commit per iteration. List the changed paths explicitly -- never use `git add -A` (the Phase 0 stash already moved unrelated work aside, but explicit paths are still the safe default):\n\n   ```\n   git add path\u002Fto\u002Fchanged-file-1 path\u002Fto\u002Fchanged-file-2 ...\n   git commit -m \"rereview-loop iter {N}: address {M} findings\n\n   {bulleted list of finding summaries with file:line, prefixed by [BLOCKING] \u002F [WARNING] \u002F [INFO]}\"\n   ```\n\n   Set `last_iteration_committed = true` once the commit succeeds. If `push_each_iteration` is true, run `git push -u origin HEAD` now (never a bare `git push`). If no findings led to code changes in this iteration (everything was pushed back or deferred), do NOT create an empty commit -- leave `last_iteration_committed = false`.\n\n5. **Heartbeat.** Output the per-iteration summary defined below before looping back.\n\n6. Increment `iteration`. Loop back to **Phase 1**.\n\n### Iteration heartbeat (output at end of every Phase 3 cycle)\n\n```\n## Iteration {N} complete\n\n**Verdict from \u002Frereview:** {verdict}\n**Findings this iteration:** {B} blocking, {W} warning, {I} info\n**Applied fixes:** {count}\n**Verified false positives:** {count} (disproven by an actually-executed command, see summary for evidence)\n**Pushed back:** {count} this iteration, {total_pushbacks} cumulative ({rate}% of {total_findings_addressed})\n**Deferred:** {count}\n**Tests after fixes:** {PASS \u002F FAIL}\n**Lint after fixes:** {CLEAN \u002F WARNINGS \u002F ERRORS}\n\nNext: running \u002Frereview again (iteration {N+1} of {max_iterations}).\n```\n\nIf there are pushback or deferred items, list them under the heartbeat with file:line + one-sentence reason.\n\n### What NOT to do in Phase 3\n\n- Do not amend prior commits -- each iteration gets its own commit so the audit trail is clear.\n- Do not delete or skip tests to make findings go away. If a test is genuinely wrong, replace it; explain in the commit message.\n- Do not introduce new abstractions, refactors, or \"while I'm here\" cleanups. The loop fixes findings, nothing else.\n- Do not push to remote unless `push` was passed or the user explicitly asked for a push. Otherwise pushing is the user's call.\n\n---\n\n## Phase 4: Final report\n\n**Stash pop guard.** Every exit path (CLEAN, APPROVED_WITH_WARNINGS_IGNORED, MAX_ITERATIONS, STUCK, ERROR, and any early exit from Phase 0 after the stash was pushed) MUST run `git stash pop` if `stashed == true` before printing the final report. The user's unrelated work-in-progress is not the loop's to discard.\n\nIf the stash pop reports conflicts, surface them to the user verbatim and stop -- do NOT attempt to resolve unrelated conflicts.\n\nWhen the loop exits, output:\n\n```\n# Re-review loop finished\n\n**Status:** {CLEAN \u002F APPROVED_WITH_WARNINGS_IGNORED \u002F MAX_ITERATIONS \u002F STUCK}\n**Iterations run:** {N} of {max_iterations}\n**Total findings addressed:** {count} (B: {x}, W: {y}, I: {z})\n**Total verified false positives:** {count} (disproven by real command output, not judgment)\n**Total findings pushed back:** {count} (judgment calls; excludes verified false positives)\n**Total findings deferred:** {count}\n**Final verdict from \u002Frereview:** {verdict}\n**Final regression risk:** {LOW \u002F MEDIUM \u002F HIGH}\n\n## Commits added by this loop\n{git log --oneline of commits made during the loop}\n\n## Outstanding items (deferred or pushed back)\n{numbered list, or \"None.\"}\n\n## Accepted limits fed to reviewers\n{the accepted_limits list, or \"None.\"}\n\n## Recommendation\n{One of:\n  - \"Clean — safe to push and merge.\" (if `push` was passed: \"Clean — already pushed; safe to merge.\")\n  - \"Warnings remain (ignored per `severity=blocking`). Review the warnings list before merging.\"\n  - \"Iteration cap hit with findings still open. Re-run \u002Frereview-loop, raise max=, or address remaining items manually.\"\n  - \"Loop is stuck — reviewers re-flagged the same findings after a fix attempt. Manual investigation needed.\"}\n```\n\nDo NOT push the branch unless `push` was passed or the user asked for it (use `git push -u origin HEAD`). Do NOT open a PR. The loop's job is to drive findings to zero; merging is the user's decision.\n\n---\n\n## Failure handling\n\n| Failure | Action |\n|---------|--------|\n| `\u002Frereview` errors out or returns no report | Retry once. If still failing, exit with status = ERROR and surface the message. |\n| Test suite breaks mid-loop and you can't fix it | Stop. Do NOT commit broken tests. Report the failing test and last attempted fix. |\n| A finding is unclear or contradictory across reviewers | Apply the most conservative interpretation. Note the ambiguity in the iteration heartbeat. |\n| Same findings re-appear after a fix attempt (stuck) | One more attempt with a different approach, then exit with status = STUCK and surface the diff of the failed fix. |\n| Reviewers disagree sharply (e.g., one APPROVE, one REJECT) | Trust the strictest. Address the REJECT findings in this iteration. |\n| User has uncommitted unrelated changes | Stash them up front in Phase 0 (`git stash push -u -m \"rereview-loop pre-loop\"`) and pop on every exit path -- see Phase 4's stash-pop guard. |\n\n---\n\n## Design notes\n\n- Each iteration commits independently so a future `git log` shows exactly what the loop changed and why.\n- The B\u002FW\u002FI count comparison in Phase 2 exists to catch the bad-fix → re-flag → bad-fix cycle. A count-based check (instead of paraphrased text matching) is robust against reviewer agents wording the same finding differently across iterations.\n- The 25% pushback ceiling -- both per-iteration and cumulative -- exists because once you start rejecting a quarter of an independent panel's findings, the failure mode is almost always rationalization, not the reviewers being wrong. The cumulative bound prevents systematic 1-of-4 pushbacks from compounding. Each distinct finding counts once so that reviewers re-raising the same settled judgment call cannot trip the ceiling without a new disagreement.\n- This skill does not push (unless `push` is passed or the user asks) or open a PR -- that is the user's call. Pair with `\u002Fpr` after a clean exit.\n- The accepted_limits list exists because reviewers are independent and stateless: without it they re-flag settled items every round and the loop never converges.\n",{"name":5,"description":7},"master","427f62a9fc82624977516767979411f885161ac5","agents\u002Fskills\u002Frereview-loop",4,"https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots","https:\u002F\u002Fgithub.com\u002Fdrn","https:\u002F\u002Fdrn.dev","CTO & Co-Founder @thanx","2026-11-12 16:13:13",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add drn\u002Fdots --skill rereview-loop",{"tool":56,"command":57},"bunx","bunx skills add drn\u002Fdots --skill rereview-loop",{"tool":59,"command":60},"pnpm","pnpm dlx skills add drn\u002Fdots --skill rereview-loop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots\u002Fblob\u002Fmaster\u002Fagents\u002Fskills\u002Frereview-loop\u002FSKILL.md",true,[],[65,95,115,127,151,169],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":76,"publishedAt":36},"01M70KJSG2P5Y3N95MGSGKJ8VA","batch-pr-review","Review a batch of pull requests together, describe every change in plain language, and build a private Claude artifact that eases human review, with a severity-tagged and verified findings list. Use when asked to review several PRs, a stack of PRs, PRs listed in a Slack thread or message, or to summarize a batch of PRs for a reviewer.","https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots\u002Fblob\u002Fmaster\u002Fagents\u002Fskills\u002Fbatch-pr-review\u002FSKILL.md",[71],{"categoryNo":72,"categoryName":73,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000005","邮件与沟通","SCENARIO","使用场景",[77,78,79,80,31,81,23,82,83,84,85,86,87,88,89,90,91,92,93,94],"batch pr review","batch","pr","pr review","reviewer","parse","scripts","human","artifact","message","write","read","stack","gh pr","Bash","change","pull requests","slack",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":104,"publishedAt":36},"01M6BV2G3ZAS76C40S3YBY6R61","plannotator-setup-goal","Create reviewed Codex goal setup packages for long-running \u002Fgoal work. Use when the user wants to turn an idea, backlog, project mission, or vague objective into durable goal files under a project goals slug folder, with Plannotator review gates for brief, narrative plan with acceptance criteria, verification, blockers, and the final \u002Fgoal prompt.","https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots\u002Fblob\u002Fmaster\u002Fagents\u002Fskills\u002Fplannotator-setup-goal\u002FSKILL.md",[101],{"categoryNo":102,"categoryName":103,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000023","Skill与智能体开发",[105,106,107,108,109,110,111,112,113,114,31],"plannotator setup goal","setup","verification","plan","plannotator review","brief","acceptance","create","packages","codex",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":36},"01M6BV26Y6GTDMQZYXFRWKEC08","plannotator-annotate","Open Plannotator's annotation UI for a markdown file, converted HTML file, URL, or folder and then respond to the returned annotations.","https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots\u002Fblob\u002Fmaster\u002Fagents\u002Fskills\u002Fplannotator-annotate\u002FSKILL.md",[],[122,123,124,125,126],"plannotator annotate","markdown","open","ui","file",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":134,"publishedAt":36},"01M6BV44RGGTRRFGWMYCR3BQ1P","write-skill","Create or improve a Claude Code skill\u002Fslash command with best practices for structure, dynamic context, and safety. Use for creating new skills, improving existing ones, or learning skill authoring.","https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots\u002Fblob\u002Fmaster\u002Fagents\u002Fskills\u002Fwrite-skill\u002FSKILL.md",[133],{"categoryNo":102,"categoryName":103,"taxonomyType":74,"taxonomyTypeDesc":75},[87,135,136,137,138,139,25,140,141,32,142,143,144,145,146,147,148,149,150,112],"write skill","with","authoring","code skill","code","structure","claude code skill","context","command","improve","learning","Safety","best practices","Existing","new","skill authoring",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":36},"01M6BV4390BFK30F1T51SAJPAV","wrapup","End-of-session checklist that detects loose ends — uncommitted changes, unmerged branches, learnings to capture, handoffs needed — and routes to the right skills. Use for session closeout, wrapping up, end of day, or \"anything else to capture\".","https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots\u002Fblob\u002Fmaster\u002Fagents\u002Fskills\u002Fwrapup\u002FSKILL.md",[],[153,158,159,160,25,161,162,163,164,165,32,166,167,168],"session closeout","up","changes","end of day","end","branches","learnings","checklist","session","closeout","capture",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":36},"01M6BV41ZZ051JX2B3CB5WARZM","tts","Read text aloud using text-to-speech. Use when the user says \"speak to me\", \"read to me\", \"read this aloud\", \"say this\", \"speak the summary\", or asks to hear something spoken.","https:\u002F\u002Fgithub.com\u002Fdrn\u002Fdots\u002Fblob\u002Fmaster\u002Fagents\u002Fskills\u002Ftts\u002FSKILL.md",[],[171,32,176,88,177,178,179,180,23,181,182,183],"user","speak","text","speech","say","text-to-speech","me","summary"]