[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BR64B62B0QKW1X7AVMC685":3,"skill-same:01M7BR64B62B0QKW1X7AVMC685":52},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7BR64B62B0QKW1X7AVMC685","pr-comment-loop",null,"Use when an active branch has open PRs that may have received new comments since the last check. Auto-trigger after any `git push` to a feature branch, after merging a PR (its siblings' review threads may have moved), and any time the user asks \"is PR N ready?\" \u002F \"what's the status of PRs?\" \u002F \"manage the open PRs\" \u002F \"anything to address in PR N?\" \u002F \"review the PR comments\". Also fires **before handing over a PR on a repo no bot reviews**, where the job is to obtain a review rather than process one. Skip if no PRs are open or if the user explicitly says \"ignore the comments\".","damson\u002Fhard-won-skills","damson","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F804217?v=4","01M7BR01SMVEGA4HRD46VV1SXF","Damien D.","01M7BR01TR37MB9R73C1C0ENGG",1,"MIT","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fgit-workflow\u002Fskills\u002Fpr-comment-loop\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pr-comment-loop\ndescription: >\n  Use when an active branch has open PRs that may have received new comments since the\n  last check. Auto-trigger after any `git push` to a feature branch, after merging a PR\n  (its siblings' review threads may have moved), and any time the user asks \"is PR N\n  ready?\" \u002F \"what's the status of PRs?\" \u002F \"manage the open PRs\" \u002F \"anything to address\n  in PR N?\" \u002F \"review the PR comments\". Also fires **before handing over a PR on a\n  repo no bot reviews**, where the job is to obtain a review rather than process one.\n  Skip if no PRs are open or if the user explicitly says \"ignore the comments\".\n---\n\n# PR comment loop\n\n## Step 0: when no reviewer is coming\n\nThis loop processes findings; a repo no bot reviews produces none, and the\nfailure is a PR handed over unreviewed. Config is not evidence: hosted reviewers\nare usually free for public repos only, and their config file grants nothing\nwithout the app also having access. Ask whether one has ever run there:\n\n```bash\n#.user.type is the account's own kind: matching logins against \"bot|ai\"\n# counts a human called chair as a reviewer and misses a bot called sentry\n{ gh api \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fissues\u002F\u003Cn>\u002Fcomments\" --paginate --jq '.[]|select(.user.type==\"Bot\")|.user.login'\n  gh api \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpulls\u002F\u003Cn>\u002Freviews\"   --paginate --jq '.[]|select(.user.type==\"Bot\")|.user.login'\n} | sort -u\n```\n\nEmpty means you are the review, so get one from a **fresh context**: the value\nis in not having authored the thing. Give it what it cannot discover (what is\nvendored, what is deliberate, what is already settled), point it at the PR and\nthe checked-out branch, tell it to run the claims rather than read them, and\nrequire both an explicit \"nothing to report\" per category and a verdict. Its\nreply is not a GitHub comment, so step 2 will not find it: carry the returned\nfindings as this round's list, and re-enter at step 3 to verify each against\nthe source like any bot's. No review obtainable at all → say so and hand the PR\nback, rather than merging on your own approval.\n\n**The durable fix is repo-side:** an advisory workflow that reviews each PR and\nupserts one sticky comment. Wire it so the model has no write capability (it\nwrites a file; a plain shell step posts it) and so an empty review warns loudly,\nor a green check will mean only that the workflow ran.\n\n## Procedure\n\nFor each open PR you have touched in this session, OR all open PRs in the\ncurrent repo if no explicit list:\n\n1. **Snapshot state**:\n   ```bash\n   # reviews as well as comments: `--json` returns only what it is asked for,\n   # and step 3 reads `.reviews[].body`, where a review's own findings live\n   gh pr view \u003Cn> --json mergeable,mergeStateStatus,statusCheckRollup,comments,reviews,baseRefName\n   ```\n\n2. **Identify NEW comments** since your last reply on that PR. Your last reply\n   is the sticky comment, and the upsert in step 6 overwrites whatever selects\n   it, silently, so build the selector here, exactly as written, and reuse it\n   there:\n\n   ```bash\n   marker='\u003C!-- claude-review-response -->'\n   me=$(gh api user -q .login)\n   # REST, not `gh pr view`: its objects carry the numeric id and updated_at\n   # MY comments whose body STARTS WITH the marker. Never `contains`, never the reviewer's\n   mine=$(gh api \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fissues\u002F\u003Cn>\u002Fcomments\" --paginate \\\n     --jq \"[.[] | select(.user.login == \\\"$me\\\" and (.body | startswith(\\\"$marker\\\")))]\")\n   ```\n\n   Three traps, all hit for real:\n\n   - **Match the marker with `startswith`, never `contains`.** An automated\n     reviewer that *quotes* your marker (because it is reviewing the very diff\n     that introduced it), matches a `contains` filter, and you overwrite the\n     review.\n   - **Exclude the reviewer's own account** from the candidate set, identified by author login, so the filter can only ever select your own comment.\n   - **Count the matches here, not in step 6.** Zero is no sticky yet, so every comment is new; one is the sticky; more than one stops the loop and is surfaced to the user. Counting later lets the loop classify, edit and push before it aborts, and overwriting the wrong comment raises no error.\n\n   With exactly one, read the sticky's **last-edit time**, `jq -r '.[0].updated_at'\n   \u003C\u003C\u003C\"$mine\"`: creation time never advances once the sticky is edited in place,\n   so the edit time is when you last answered. **A comment created after it is\n   new and gets a row this round; one created before it was answered already.**\n\n3. **Verify each finding against the source, then classify it.** Start by\n   dropping the ones that are not current: a comment whose `.line` is `null` is\n   pinned to a commit the branch has moved past, and on a branch that already\n   answered a round, most of those were fixed by the commits that answered it.\n\n   ```bash\n   gh api \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpulls\u002F\u003Cn>\u002Fcomments\" \\\n     --jq '.[] | select(.subject_type == \"line\" and .line == null)\n           | {id, path, body, diff_hunk,\n              was: .original_line, from: .original_start_line,\n              at: .original_commit_id}'\n   ```\n\n   Two things that projection is doing deliberately. It keeps what verifying a\n   finding needs (the id to reply to it, the body and `diff_hunk` to read what\n   it actually said, the full commit id rather than a prefix), because a\n   dismissal you cannot re-read is indistinguishable from one you never made.\n   And it pins the filter to `subject_type == \"line\"`, since a file-level\n   comment is attached to a whole file rather than a line and is current no\n   matter what its line field says. GitHub reports `line: 1` for those today\n   (checked by posting one and reading it back), so `.line == null` alone does\n   not currently catch them; the guard is there so that a change in that\n   behaviour cannot silently turn a live finding into a dismissed one.\n\n   Stale means the line moved, not that the defect is gone, so read the current\n   file before dismissing one, but this routinely turns an alarming count into\n   none, and re-fixing what is already fixed is how a round produces a diff\n   that changes nothing.\n\n   Then, for what remains, open the cited `file:line` in the actual source.\n   Cold-read reviewers see the diff without surrounding context and are\n   confidently wrong often enough that applying findings unchecked introduces\n   bugs. The classic misses: a \"missing\" guard that exists just outside the\n   hunk, a demanded convention the repo doesn't have, a finding re-raised\n   rounds after it was applied. A finding that does not survive that check is 🚫\n   Skipped, never silenced: the step 6 table owns the rationale rules.\n\n   Then parse the comment body (`.comments[].body` and `.reviews[].body` from\n   the JSON above) for emoji headings `🔴 Critical`, `🟡 Should fix`, `🟢 Nice to\n   have`; a finding that is pure praise or explicitly requires no action\n   classifies as 💬 Acknowledgement. If the reviewer doesn't use that emoji\n   convention, split the comment into its distinct findings yourself and\n   classify each by the same rules (praise is still 💬, everything actionable\n   defaults to 🟡), marking each classification as assumed in the reply table so\n   the user can re-grade.\n\n   | Severity | Default action | Rule |\n   |---|---|---|\n   | 🔴 Critical | Apply | The one exception: paths cited fall outside `gh pr diff \u003Cn> --name-only`: then ⏳ Defer with a follow-up issue link |\n   | 🟡 Should fix | Apply | Skip if the finding is a false positive (cite the contradicting code \u002F spec line) or out of scope: the fix would touch files absent from `gh pr diff \u003Cn> --name-only` (cite which) |\n   | 🟢 Nice to have | Apply if diff ≤ 10 lines AND ≤ 1 file | Otherwise defer with a follow-up issue link |\n   | 💬 Acknowledgement | No code action | Reference in the reply table only |\n\n4. **Apply fixes** via a single commit per PR with a body that:\n   - References the AI review's structure (numbered findings)\n   - Names the non-applied findings (\"🚫 Skipped #N\"): the reply table in\n     step 6 carries the reasons\n\n5. **Push + verify** (skip both steps 4–5 when no finding produced a code\n   change: the reply in step 6 still goes out, with its `Pushed as` line\n   replaced by \"No code change this round\"):\n   ```bash\n   git push\n   gh pr view \u003Cn> --json mergeable,mergeStateStatus\n   # confirm CLEAN before reporting back\n   ```\n\n6. **Post a reply comment on the PR.** The audit trail of \"comment seen,\n   classified, addressed\" must live on GitHub: a reply in the Claude session\n   does NOT count. Use sticky-comment style (`\u003C!-- claude-review-response -->`\n   marker → upsert) so re-runs don't spam the PR: **one comment per PR, edited\n   in place across rounds, never a new one each round.**\n\n   ### Posting it\n\n   Upsert against `$mine` from step 2. Re-run that assignment first if the\n   shell has been replaced since: the cardinality rule is the same, and a\n   `$mine` that is empty because the variable was never set posts a duplicate\n   rather than editing in place.\n\n   ```bash\n   case \"$(jq length \u003C\u003C\u003C\"$mine\")\" in\n     0) gh pr comment \u003Cn> --body-file reply.md ;;\n     1) gh api -X PATCH \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fissues\u002Fcomments\u002F$(jq -r '.[0].id' \u003C\u003C\u003C\"$mine\")\" -F body=@reply.md ;;\n     *) echo \"more than one sticky match: refusing to patch\" >&2; exit 1;;\n   esac\n   ```\n\n   The marker is machine-written. Never hand-type it into a comment.\n\n   ### Verdict vocabulary: use these labels EXACTLY\n\n   | Verdict | When to use | Rationale required? |\n   |---|---|---|\n   | ✅ **Applied** | The fix landed in the same push. Cite the file + line. | No (action column shows the change) |\n   | 🚫 **Skipped** | The finding will NOT be addressed: neither now nor later. | YES: one-line reason (false positive, out of scope, intentional design, etc.) |\n   | ⏳ **Deferred** | The fix is real but not landing in this PR. | YES: link the follow-up issue \u002F PR \u002F TODO marker |\n   | 💬 **Acknowledged** | Praise \u002F \"what looks good\" notes from the reviewer. No action expected. | No |\n\n\n\n   ### Template\n\n   ```markdown\n   \u003C!-- claude-review-response -->\n   ## ✏️ AI-review response (PR #N)\n\n   | Finding | Verdict | Action \u002F rationale |\n   |---|---|---|\n   | 🟡 #1 \u003Cshort title> | ✅ Applied | \u003Cfile:line + one-line summary> |\n   | 🟡 #2 \u003Cshort title> | 🚫 Skipped | \u003Cone-line reason: false positive \u002F scope \u002F intentional> |\n   | 🟢 #3 \u003Cshort title> | ⏳ Deferred | \u003Cfollow-up reference> |\n   | 💬 #4 \u003Cshort title> | 💬 Acknowledged | No action |\n\n   Pushed as `\u003Csha>`.\n   ```\n\n   Write the body to `reply.md` and post it with the upsert above, never with a bare `gh pr comment`: that creates a second comment every round, which is the thing this whole step exists to prevent. Even when every finding is 🚫 Skipped with no code change, still post the reply.\n\n   ### Recovering a clobbered comment\n\n   If the wrong comment is overwritten anyway, GitHub retains every prior body:\n   query `userContentEdits` via GraphQL (REST does not expose it): both ids\n   come off the same REST object you clobbered (`.node_id`, `.id`):\n\n   ```bash\n   gh api graphql -f query='query { node(id: \"\u003Cnode_id>\") {\n     ... on IssueComment {\n       userContentEdits(first: 20) { nodes { editedAt editor { login } diff } }\n   } } }'\n   ```\n\n   Take the newest `diff` whose `editor` is the original author, save it as\n   the body, restore with a REST PATCH, and post your own reply as a\n   **separate** comment:\n\n   ```bash\n   gh api -X PATCH \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fissues\u002Fcomments\u002F\u003Cid>\" -F body=@restored.md\n   ```\n\n7. **Report back to the user** with a single line per PR:\n   ```\n   PR #N: \u003Cm> findings addressed, \u003Ck> skip-justified, reply posted, \u003Cstate>\n   ```\n\n## When to STOP\n\n- `gh` is unauthenticated, or posting\u002Fpatching the comment is refused. Stop and\n  hand the user the prepared reply body rather than retrying blind.\n- An 🔴 finding's fix is non-trivial AND ambiguous (would require a design call).\n- A finding contradicts an earlier decision in the session: surface the\n  contradiction before re-litigating.\n- All CI checks are red and root cause isn't obvious. Don't push speculative\n  fixes.\n- A check that was green in the previous round's step 1 snapshot is red in this\n  one: your own fix caused it; surface it before continuing.\n- A fix you applied deletes or skips a test: say so and stop, whatever the\n  finding claimed. A reviewer asking for less coverage is a finding to argue\n  with, not to apply.\n- Never close or merge the PR from this skill, that is always the user's call.\n","# PR comment loop\n\n## Step 0: when no reviewer is coming\n\nThis loop processes findings; a repo no bot reviews produces none, and the\nfailure is a PR handed over unreviewed. Config is not evidence: hosted reviewers\nare usually free for public repos only, and their config file grants nothing\nwithout the app also having access. Ask whether one has ever run there:\n\n```bash\n#.user.type is the account's own kind: matching logins against \"bot|ai\"\n# counts a human called chair as a reviewer and misses a bot called sentry\n{ gh api \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fissues\u002F\u003Cn>\u002Fcomments\" --paginate --jq '.[]|select(.user.type==\"Bot\")|.user.login'\n  gh api \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpulls\u002F\u003Cn>\u002Freviews\"   --paginate --jq '.[]|select(.user.type==\"Bot\")|.user.login'\n} | sort -u\n```\n\nEmpty means you are the review, so get one from a **fresh context**: the value\nis in not having authored the thing. Give it what it cannot discover (what is\nvendored, what is deliberate, what is already settled), point it at the PR and\nthe checked-out branch, tell it to run the claims rather than read them, and\nrequire both an explicit \"nothing to report\" per category and a verdict. Its\nreply is not a GitHub comment, so step 2 will not find it: carry the returned\nfindings as this round's list, and re-enter at step 3 to verify each against\nthe source like any bot's. No review obtainable at all → say so and hand the PR\nback, rather than merging on your own approval.\n\n**The durable fix is repo-side:** an advisory workflow that reviews each PR and\nupserts one sticky comment. Wire it so the model has no write capability (it\nwrites a file; a plain shell step posts it) and so an empty review warns loudly,\nor a green check will mean only that the workflow ran.\n\n## Procedure\n\nFor each open PR you have touched in this session, OR all open PRs in the\ncurrent repo if no explicit list:\n\n1. **Snapshot state**:\n   ```bash\n   # reviews as well as comments: `--json` returns only what it is asked for,\n   # and step 3 reads `.reviews[].body`, where a review's own findings live\n   gh pr view \u003Cn> --json mergeable,mergeStateStatus,statusCheckRollup,comments,reviews,baseRefName\n   ```\n\n2. **Identify NEW comments** since your last reply on that PR. Your last reply\n   is the sticky comment, and the upsert in step 6 overwrites whatever selects\n   it, silently, so build the selector here, exactly as written, and reuse it\n   there:\n\n   ```bash\n   marker='\u003C!-- claude-review-response -->'\n   me=$(gh api user -q .login)\n   # REST, not `gh pr view`: its objects carry the numeric id and updated_at\n   # MY comments whose body STARTS WITH the marker. Never `contains`, never the reviewer's\n   mine=$(gh api \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fissues\u002F\u003Cn>\u002Fcomments\" --paginate \\\n     --jq \"[.[] | select(.user.login == \\\"$me\\\" and (.body | startswith(\\\"$marker\\\")))]\")\n   ```\n\n   Three traps, all hit for real:\n\n   - **Match the marker with `startswith`, never `contains`.** An automated\n     reviewer that *quotes* your marker (because it is reviewing the very diff\n     that introduced it), matches a `contains` filter, and you overwrite the\n     review.\n   - **Exclude the reviewer's own account** from the candidate set, identified by author login, so the filter can only ever select your own comment.\n   - **Count the matches here, not in step 6.** Zero is no sticky yet, so every comment is new; one is the sticky; more than one stops the loop and is surfaced to the user. Counting later lets the loop classify, edit and push before it aborts, and overwriting the wrong comment raises no error.\n\n   With exactly one, read the sticky's **last-edit time**, `jq -r '.[0].updated_at'\n   \u003C\u003C\u003C\"$mine\"`: creation time never advances once the sticky is edited in place,\n   so the edit time is when you last answered. **A comment created after it is\n   new and gets a row this round; one created before it was answered already.**\n\n3. **Verify each finding against the source, then classify it.** Start by\n   dropping the ones that are not current: a comment whose `.line` is `null` is\n   pinned to a commit the branch has moved past, and on a branch that already\n   answered a round, most of those were fixed by the commits that answered it.\n\n   ```bash\n   gh api \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fpulls\u002F\u003Cn>\u002Fcomments\" \\\n     --jq '.[] | select(.subject_type == \"line\" and .line == null)\n           | {id, path, body, diff_hunk,\n              was: .original_line, from: .original_start_line,\n              at: .original_commit_id}'\n   ```\n\n   Two things that projection is doing deliberately. It keeps what verifying a\n   finding needs (the id to reply to it, the body and `diff_hunk` to read what\n   it actually said, the full commit id rather than a prefix), because a\n   dismissal you cannot re-read is indistinguishable from one you never made.\n   And it pins the filter to `subject_type == \"line\"`, since a file-level\n   comment is attached to a whole file rather than a line and is current no\n   matter what its line field says. GitHub reports `line: 1` for those today\n   (checked by posting one and reading it back), so `.line == null` alone does\n   not currently catch them; the guard is there so that a change in that\n   behaviour cannot silently turn a live finding into a dismissed one.\n\n   Stale means the line moved, not that the defect is gone, so read the current\n   file before dismissing one, but this routinely turns an alarming count into\n   none, and re-fixing what is already fixed is how a round produces a diff\n   that changes nothing.\n\n   Then, for what remains, open the cited `file:line` in the actual source.\n   Cold-read reviewers see the diff without surrounding context and are\n   confidently wrong often enough that applying findings unchecked introduces\n   bugs. The classic misses: a \"missing\" guard that exists just outside the\n   hunk, a demanded convention the repo doesn't have, a finding re-raised\n   rounds after it was applied. A finding that does not survive that check is 🚫\n   Skipped, never silenced: the step 6 table owns the rationale rules.\n\n   Then parse the comment body (`.comments[].body` and `.reviews[].body` from\n   the JSON above) for emoji headings `🔴 Critical`, `🟡 Should fix`, `🟢 Nice to\n   have`; a finding that is pure praise or explicitly requires no action\n   classifies as 💬 Acknowledgement. If the reviewer doesn't use that emoji\n   convention, split the comment into its distinct findings yourself and\n   classify each by the same rules (praise is still 💬, everything actionable\n   defaults to 🟡), marking each classification as assumed in the reply table so\n   the user can re-grade.\n\n   | Severity | Default action | Rule |\n   |---|---|---|\n   | 🔴 Critical | Apply | The one exception: paths cited fall outside `gh pr diff \u003Cn> --name-only`: then ⏳ Defer with a follow-up issue link |\n   | 🟡 Should fix | Apply | Skip if the finding is a false positive (cite the contradicting code \u002F spec line) or out of scope: the fix would touch files absent from `gh pr diff \u003Cn> --name-only` (cite which) |\n   | 🟢 Nice to have | Apply if diff ≤ 10 lines AND ≤ 1 file | Otherwise defer with a follow-up issue link |\n   | 💬 Acknowledgement | No code action | Reference in the reply table only |\n\n4. **Apply fixes** via a single commit per PR with a body that:\n   - References the AI review's structure (numbered findings)\n   - Names the non-applied findings (\"🚫 Skipped #N\"): the reply table in\n     step 6 carries the reasons\n\n5. **Push + verify** (skip both steps 4–5 when no finding produced a code\n   change: the reply in step 6 still goes out, with its `Pushed as` line\n   replaced by \"No code change this round\"):\n   ```bash\n   git push\n   gh pr view \u003Cn> --json mergeable,mergeStateStatus\n   # confirm CLEAN before reporting back\n   ```\n\n6. **Post a reply comment on the PR.** The audit trail of \"comment seen,\n   classified, addressed\" must live on GitHub: a reply in the Claude session\n   does NOT count. Use sticky-comment style (`\u003C!-- claude-review-response -->`\n   marker → upsert) so re-runs don't spam the PR: **one comment per PR, edited\n   in place across rounds, never a new one each round.**\n\n   ### Posting it\n\n   Upsert against `$mine` from step 2. Re-run that assignment first if the\n   shell has been replaced since: the cardinality rule is the same, and a\n   `$mine` that is empty because the variable was never set posts a duplicate\n   rather than editing in place.\n\n   ```bash\n   case \"$(jq length \u003C\u003C\u003C\"$mine\")\" in\n     0) gh pr comment \u003Cn> --body-file reply.md ;;\n     1) gh api -X PATCH \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fissues\u002Fcomments\u002F$(jq -r '.[0].id' \u003C\u003C\u003C\"$mine\")\" -F body=@reply.md ;;\n     *) echo \"more than one sticky match: refusing to patch\" >&2; exit 1;;\n   esac\n   ```\n\n   The marker is machine-written. Never hand-type it into a comment.\n\n   ### Verdict vocabulary: use these labels EXACTLY\n\n   | Verdict | When to use | Rationale required? |\n   |---|---|---|\n   | ✅ **Applied** | The fix landed in the same push. Cite the file + line. | No (action column shows the change) |\n   | 🚫 **Skipped** | The finding will NOT be addressed: neither now nor later. | YES: one-line reason (false positive, out of scope, intentional design, etc.) |\n   | ⏳ **Deferred** | The fix is real but not landing in this PR. | YES: link the follow-up issue \u002F PR \u002F TODO marker |\n   | 💬 **Acknowledged** | Praise \u002F \"what looks good\" notes from the reviewer. No action expected. | No |\n\n\n\n   ### Template\n\n   ```markdown\n   \u003C!-- claude-review-response -->\n   ## ✏️ AI-review response (PR #N)\n\n   | Finding | Verdict | Action \u002F rationale |\n   |---|---|---|\n   | 🟡 #1 \u003Cshort title> | ✅ Applied | \u003Cfile:line + one-line summary> |\n   | 🟡 #2 \u003Cshort title> | 🚫 Skipped | \u003Cone-line reason: false positive \u002F scope \u002F intentional> |\n   | 🟢 #3 \u003Cshort title> | ⏳ Deferred | \u003Cfollow-up reference> |\n   | 💬 #4 \u003Cshort title> | 💬 Acknowledged | No action |\n\n   Pushed as `\u003Csha>`.\n   ```\n\n   Write the body to `reply.md` and post it with the upsert above, never with a bare `gh pr comment`: that creates a second comment every round, which is the thing this whole step exists to prevent. Even when every finding is 🚫 Skipped with no code change, still post the reply.\n\n   ### Recovering a clobbered comment\n\n   If the wrong comment is overwritten anyway, GitHub retains every prior body:\n   query `userContentEdits` via GraphQL (REST does not expose it): both ids\n   come off the same REST object you clobbered (`.node_id`, `.id`):\n\n   ```bash\n   gh api graphql -f query='query { node(id: \"\u003Cnode_id>\") {\n     ... on IssueComment {\n       userContentEdits(first: 20) { nodes { editedAt editor { login } diff } }\n   } } }'\n   ```\n\n   Take the newest `diff` whose `editor` is the original author, save it as\n   the body, restore with a REST PATCH, and post your own reply as a\n   **separate** comment:\n\n   ```bash\n   gh api -X PATCH \"repos\u002F\u003Cowner>\u002F\u003Crepo>\u002Fissues\u002Fcomments\u002F\u003Cid>\" -F body=@restored.md\n   ```\n\n7. **Report back to the user** with a single line per PR:\n   ```\n   PR #N: \u003Cm> findings addressed, \u003Ck> skip-justified, reply posted, \u003Cstate>\n   ```\n\n## When to STOP\n\n- `gh` is unauthenticated, or posting\u002Fpatching the comment is refused. Stop and\n  hand the user the prepared reply body rather than retrying blind.\n- An 🔴 finding's fix is non-trivial AND ambiguous (would require a design call).\n- A finding contradicts an earlier decision in the session: surface the\n  contradiction before re-litigating.\n- All CI checks are red and root cause isn't obvious. Don't push speculative\n  fixes.\n- A check that was green in the previous round's step 1 snapshot is red in this\n  one: your own fix caused it; surface it before continuing.\n- A fix you applied deletes or skips a test: say so and stop, whatever the\n  finding claimed. A reviewer asking for less coverage is a finding to argue\n  with, not to apply.\n- Never close or merge the PR from this skill, that is always the user's call.\n",{"name":5,"description":7},"main","9435f9fa04b69d2217f8cab3c817dd5c3c1d1021","plugins\u002Fgit-workflow\u002Fskills\u002Fpr-comment-loop",0,"https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills","https:\u002F\u002Fgithub.com\u002Fdamson","http:\u002F\u002Fgoo.gl\u002F3UwFRt","2026-11-14 14:28:11",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add damson\u002Fhard-won-skills --skill pr-comment-loop",{"tool":38,"command":39},"bunx","bunx skills add damson\u002Fhard-won-skills --skill pr-comment-loop",{"tool":41,"command":42},"pnpm","pnpm dlx skills add damson\u002Fhard-won-skills --skill pr-comment-loop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fgit-workflow\u002Fskills\u002Fpr-comment-loop\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"README.md","REFERENCE","参考文档",3168,"https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fgit-workflow\u002Fskills\u002Fpr-comment-loop\u002FREADME.md",[53,60,66,71,76,81],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7BRCESR9BRFAH87J2ZQY5T2","skill-two","Fixture skill","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fwrong_welcome_total\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-two\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7BRCDPHEPZES71BYBRTZ1G3","skill-one","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fwrong_welcome_total\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-one\u002FSKILL.md",[],[],{"skillNo":67,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7BRCCHHB3Q07BR0QN339D3F","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fwrong_table_count\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-two\u002FSKILL.md",[],[],{"skillNo":72,"name":62,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7BRC9J97QKZHGKVXMER5ZEE","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fwrong_table_count\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-one\u002FSKILL.md",[],[],{"skillNo":77,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7BRC8C39NM8VVAQ3TKP0CRS","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fvalid_marketplace\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-two\u002FSKILL.md",[],[],{"skillNo":82,"name":62,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7BRC75THG394KDGYV35ET19","https:\u002F\u002Fgithub.com\u002Fdamson\u002Fhard-won-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fvalid_marketplace\u002Fplugins\u002Falpha\u002Fskills\u002Fskill-one\u002FSKILL.md",[],[]]