[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CAVRJ5SDMYFEM20VFCG1GE":3,"skill-same:01M6CAVRJ5SDMYFEM20VFCG1GE":113},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":50,"linkOnly":51,"markdownContent":52,"markdownBody":53,"frontMatter":54,"refName":72,"commitSha":73,"skillDirectory":74,"forksCount":75,"repositoryHtmlUrl":76,"repositoryHomepageUrl":13,"ownerHtmlUrl":77,"ownerBlogUrl":13,"ownerDescription":13,"updatedAt":78,"install":79,"resources":92},"01M6CAVRJ5SDMYFEM20VFCG1GE","apply-supplied-patch-and-open-pr","应用补丁并提交 PR","When a user (often via Slack, GitHub, or email) sends a pre-built patch + a\nstructured instructions file (UPSTREAM-PROMPT.md style) and asks you to open\nthe PR — clone the target repo, branch from origin\u002Fmain, apply the patch\nonly after the fresh base\u002Fdrift check below, run the user's listed test\nsuites verbatim, push, and open the PR with the title\u002Fbody the user\nsupplied. Distinct from `always-pr-never-local-edit`\n(which dispatches fix-X work to AO), and from `github-pr-workflow` (general\nPR lifecycle); this is the bounded \"land this patch\" workflow where the\nintent, title, body, and verification gates are pre-specified.\n\nv1.2.0 adds Pitfalls P8 (force-push after origin branch deletion), P9\n(two-tier \"delete X gate\" distinction — workflow gate vs pipeline node\ntype), and P10 (pre-existing test-failure attribution via stash\u002Freset\u002F\nrestore). Verified case #3 (2026-07-21, dark-factory PR #407 skeptic-\ngate deletion + receipt-gate-reviewer follow-up commit).\n\nv1.3.1 adds Pitfall P14 (a verified patch bundle whose base has drifted\nmust be re-derived on current main, not replayed; includes the\ncontent-multiset preservation proof and the draft-PR baseline probe for\ninherited CI failures). Verified case 2026-11-04, jleechan-skills\npr-lifecycle compaction bundle. v1.3.2 documents the manual Step 1\u002FP14-gated\nrecipe as the only supported apply path; the legacy helper does not\nimplement that judgment and is unsupported for this workflow.","当用户（通常通过 Slack、GitHub 或邮件）发送一个预构建的补丁 + 一份结构化指令文件（UPSTREAM-PROMPT.md 风格）并要求你创建 PR 时 —— 克隆目标仓库，从 origin\u002Fmain 创建分支，仅在完成下述新鲜基线\u002F漂移检查后才应用补丁，逐字运行用户列出的测试套件，推送，并使用用户提供的标题\u002F正文创建 PR。区别于 `always-pr-never-local-edit`（该技能将 fix-X 工作分派给 AO）和 `github-pr-workflow`（通用 PR 生命周期）；这是一个有边界的「落地此补丁」工作流，其中意图、标题、正文和验证关卡均为预先指定。\n\nv1.2.0 新增陷阱 P8（origin 分支删除后强制推送）、P9（两层「删除 X 门」的区别 —— 工作流门 vs 流水线节点类型）和 P10（通过 stash\u002Freset\u002Frestore 归因先前存在的测试失败）。已验证案例 #3（2026-07-21，dark-factory PR #407 的 skeptic-gate 删除 + receipt-gate-reviewer 后续提交）。\n\nv1.3.1 新增陷阱 P14（一个已验证但其基线已漂移的补丁包必须在当前 main 上重新推导，而非重放；包括内容多重集保持证明和针对继承的 CI 失败的草稿 PR 基线探测）。已验证案例 2026-11-04，jleechan-skills pr-lifecycle 压缩补丁包。v1.3.2 记录了手动 Step 1\u002FP14 门控方案是唯一受支持的应用路径；遗留辅助工具未实现该判断，不受此工作流支持。","jleechanorg\u002Fjleechan-skills","jleechanorg","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F221404966?v=4","01M6C1VJ99XG950X1DWPEBCBGX",null,"01M6C1VJDK5YVDNT3362RT5WSB",6,"MIT","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002Fhermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理","SCENARIO","使用场景",[30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"patch","apply supplied patch and open pr","pr","open pr","open","apply","text","you","documents","pr title","local","ci","re","which","disk","skeptic","MCP","files","fix","branch","2026-11-10 10:12:30",false,"---\nname: apply-supplied-patch-and-open-pr\nversion: 1.3.2\ndescription: |\n  When a user (often via Slack, GitHub, or email) sends a pre-built patch + a\n  structured instructions file (UPSTREAM-PROMPT.md style) and asks you to open\n  the PR — clone the target repo, branch from origin\u002Fmain, apply the patch\n  only after the fresh base\u002Fdrift check below, run the user's listed test\n  suites verbatim, push, and open the PR with the title\u002Fbody the user\n  supplied. Distinct from `always-pr-never-local-edit`\n  (which dispatches fix-X work to AO), and from `github-pr-workflow` (general\n  PR lifecycle); this is the bounded \"land this patch\" workflow where the\n  intent, title, body, and verification gates are pre-specified.\n\n  v1.2.0 adds Pitfalls P8 (force-push after origin branch deletion), P9\n  (two-tier \"delete X gate\" distinction — workflow gate vs pipeline node\n  type), and P10 (pre-existing test-failure attribution via stash\u002Freset\u002F\n  restore). Verified case #3 (2026-07-21, dark-factory PR #407 skeptic-\n  gate deletion + receipt-gate-reviewer follow-up commit).\n\n  v1.3.1 adds Pitfall P14 (a verified patch bundle whose base has drifted\n  must be re-derived on current main, not replayed; includes the\n  content-multiset preservation proof and the draft-PR baseline probe for\n  inherited CI failures). Verified case 2026-11-04, jleechan-skills\n  pr-lifecycle compaction bundle. v1.3.2 documents the manual Step 1\u002FP14-gated\n  recipe as the only supported apply path; the legacy helper does not\n  implement that judgment and is unsupported for this workflow.\n\nwhen_to_use: |\n  - User message has an attached `.patch`\u002F`.diff` file AND a text description\n    of where it should land (\"apply this to disk_magician\", \"open a PR on\n    \u003Crepo> with this\", etc.)\n  - Slack\u002FGitHub\u002Femail message body is short (\"Handle\", \"apply this\", \"open\n    the PR\") because the *files* are the ask, not the body text\n  - User-provided instructions file lists exact test suites and exact PR title\n    + body template (often called UPSTREAM-PROMPT.md, RUNBOOK.md, HANDOFF.md)\n\ntriggers:\n  - \"Handle\"\n  - \"apply this patch\"\n  - \"open the PR with this\"\n  - \"land this upstream\"\n  - \"git am this\"\n  - \"use the instructions in the attached file\"\n\nallowed-tools:\n  - mcp__slack__*\n  - terminal\n  - read_file\n  - write_file\n  - patch\n  - skill_view\n\ncontext: inline\n---\n\n# apply-supplied-patch-and-open-pr\n\nApply a user-supplied patch to its target repository, run the listed verification\nsuites, push, and open the PR with the title + body the user provided. Distinct\nfrom `always-pr-never-local-edit` (route-through-AO for general fix work) and\nfrom `github-pr-workflow` (general PR lifecycle).\n\n## When this skill fits\n\nThis is the right skill when ALL of the following hold:\n\n1. The user has sent a **pre-built patch file** (typically `.patch` or `.diff`\n   attached to a Slack\u002FGitHub\u002Femail message). The diff is *not* something you\n   need to write.\n2. The user has sent **structured instructions** — either inline in the\n   message body or in a sibling instructions file (often named\n   `UPSTREAM-PROMPT.md`, `RUNBOOK.md`, `HANDOFF.md`, or `\u003Cname>-PROMPT.md`).\n   These instructions explicitly call out:\n   - The target repository (e.g. `jleechanorg\u002Fdisk_magician`)\n   - The branch name to create (e.g. `findings-wiki-contract`)\n   - The list of test suites to run (e.g. `tests\u002Ftest_safety_lib.sh`)\n   - The PR title + body template\n   - Whether to merge or leave for review\n3. The work is **bounded** — pre-specified, not iterate-to-green. Before any\n   replay, freshly compare the supplied patch base with `origin\u002Fmain` and use\n   Step 1's P14 decision. A failed `git am` or conflict does not establish\n   that drift is cosmetic. Use `git apply --3way` only in\n   the manual flow after P14 records cosmetic-only drift as safe to replay;\n   policy or unknown drift requires re-deriving on current `main`.\n\nIf ANY of these is missing (no patch, no instructions, OR unclear target),\nthis is NOT the right skill — fall back to either:\n\n- **`always-pr-never-local-edit`** if the user said \"fix X\" and you have to\n  figure out the diff yourself\n- **`github-pr-workflow`** if it's a general PR task without a supplied patch\n\n## Trigger-1 anti-pattern: don't narrate before reading attachments\n\nWhen a Slack message has a body word like \"Handle\" (1-2 words, generic) AND\nfile attachments, **the attachments are the ask**, not the body. The wrong\nmove is to immediately write narration messages like:\n\n- \"I see file attachments...\"\n- \"Let me work on this...\"\n- \"On it — applying the patch...\"\n\nbefore checking what the attachments actually are. The right move is to\n**download the attachments first, read them, then compose a single coherent\nresponse**. Verified failure mode (2026-07-15, jleechanorg\u002Fdisk_magician\nPR #17): the bot wrote 4 narration messages before realizing the body text\nwas empty\u002Fshort and the actual ask lived in the patch + UPSTREAM-PROMPT.md\nfile pair.\n\n**The rule:** if `mcp__slack__conversations_replies` shows a parent message\nwith `files: [...]` populated and a body of ≤5 words, the first tool call\nin the response turn MUST be reading the files — not writing a narration\nmessage.\n\n## Recipe — the 7-step bounded workflow\n\n### Step 1 — Pre-flight checks (parallel, fast)\n\n```bash\n# A) gh auth status\ngh auth status 2>&1 | head -3\n\n# B) Does the target repo exist + what is its default branch HEAD?\ngh api repos\u002F\u003COWNER>\u002F\u003CREPO> --jq '{default_branch, pushed_at, archived}'\ngh api repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fbranches\u002Fmain --jq '{sha, date}'\n\n# C) Does a PR for this topic already exist? (REST, not GraphQL — GraphQL hits\n#    rate limits fast and you can avoid them)\ngh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fpulls?state=all&head=\u003COWNER>:\u003Cbranch>&per_page=10\" \\\n  --jq '.[] | {number, title, state, head_sha, url}'\n\n# D) List open PRs + branches matching the topic to avoid stepping on existing work\ngh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fpulls?state=open&per_page=20\" \\\n  --jq '.[] | {number, title, head_ref, author: .user.login}'\ngh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fbranches?per_page=100\" \\\n  --jq '.[] | select(.name | test(\"\u003Ctopic-regex>\")) | .name'\n```\n\n**Decision matrix (after pre-flight):**\n\n| Finding | Action |\n|---|---|\n| Auth OK, repo exists, HEAD matches the patch's base SHA exactly (`git log --oneline origin\u002Fmain -1` returns the SHA named in the patch message) | Proceed — `git am` will apply cleanly |\n| Auth OK, repo exists, HEAD differs from the patch base SHA | **Do not invoke a replay command yet.** Run a fresh P14 drift decision first. If drift adds, may add, or cannot be ruled out as carrying newer policy, do **not** replay; re-derive on current `main`. Only after the recorded P14 decision classifies the drift as cosmetic-only may the manual flow replay it. |\n| Auth OK, repo exists, but PR for this branch\u002Ftopic already exists | STOP. Confirm with the user — do NOT push onto a non-owned PR head (see `pr-cleanup-replay` skill, Phase -1). Either push to the existing branch and comment on the PR, OR close the existing PR and open a fresh one. |\n| **A prior-session PR for the SAME topic is OPEN but the new patch is a \"refreshed\u002Fsupersedes\" version** (new instructions file says \"REFRESHED … supersedes the YYYY-MM-DD patch\", OR the existing PR's base SHA is N commits behind current `origin\u002Fmain`) | This is the **supersede pattern** — see Pitfall P7. Open a NEW branch from current `origin\u002Fmain` (e.g. `\u003Cbranch>-v2`), apply the refreshed patch, open a NEW PR, then **close the prior PR with a \"superseded by #N\" comment** linking to the new PR. Do NOT rebase the prior PR; do NOT push onto its branch head. The new PR is the source of truth. |\n| A related branch exists with the same topic but not yet PR'd | Inspect it: `gh api ...\u002Fcompare\u002F\u003Cpatch-base-sha>...heads\u002F\u003Crelated-branch>` — if `ahead_by > 0` and the topic matches, consider whether to push onto that branch instead of opening a parallel one |\n\n### Step 2 — Clone to a scratch dir (NOT the user's home directory)\n\n```bash\nSCRATCH=\u002Ftmp\u002F\u003Ctask-prefix>-\u003Cunix-ts>\nmkdir -p \"$SCRATCH\"\ncd \"$SCRATCH\"\ngit clone --quiet https:\u002F\u002Fgithub.com\u002F\u003COWNER>\u002F\u003CREPO>.git repo\ncd repo\n\n# Verify local HEAD matches origin\u002Fmain (sanity)\ngit rev-parse HEAD       # should equal the SHA from Step 1.B\ngit fetch origin main --quiet\ngit rev-parse origin\u002Fmain  # same as above\n```\n\n**Why scratch \u002Ftmp\u002F:** the user's home directory has a directory-state tracker\n(`CLAUDE.md` \"Working directory lock — stay in the session's primary cwd\"),\nand writing to an existing home dir creates the \"file modified since read\"\ndivergence error. A scratch dir is fully isolated.\n\n### Step 3 — Branch + apply the patch\n\n```bash\n# Branch from origin\u002Fmain (clean, no carried-over history)\ngit checkout -B \u003Cbranch-name> origin\u002Fmain\ngit rev-parse HEAD  # confirm same as origin\u002Fmain\n\n# This manual recipe is the only supported apply path. Do not invoke the legacy\n# helper: it does not implement Step 1\u002FP14 judgment. Apply only after the fresh\n# decision: exact base match permits replay; cosmetic-only drift permits manual\n# replay only after that classification is recorded. Policy or unknown drift\n# must be re-derived.\ngit am \u003Cpath-to-patch>\necho \"git am exit: $?\"\n\n# If git am fails, do not infer that the drift is cosmetic and do not fall back\n# automatically. Re-run P14 against freshly fetched origin\u002Fmain. Use the\n# manual fallback below only when that decision records cosmetic-only drift:\n#   1. git am --abort\n#   2. git apply --3way \u003Cpatch>\n#   3. Resolve conflicts per the instructions file (often only pyproject.toml\n#      version + CLAUDE.md appends are conflict points)\n#   4. git add \u003Cresolved-files>\n#   5. git commit -m \"\u003Coriginal-commit-message>\"\n```\n\n### Step 4 — Run the user-listed test suites verbatim\n\nThe instructions file lists specific test paths. Run EACH one and capture the\nexit code. Do NOT substitute \"I think these tests are equivalent\" — the user\ngave you an exact list because those are the gates they want on the PR.\n\n```bash\necho \"=== \u003Ctest-suite-1> ===\"\nbash \u003Cpath-to-test-1> 2>&1 | tail -15\necho \"exit=${PIPESTATUS[0]}\"\n\necho \"=== \u003Ctest-suite-2> ===\"\nbash \u003Cpath-to-test-2> 2>&1 | tail -15\necho \"exit=${PIPESTATUS[0]}\"\n\n# ...repeat for each suite listed in the instructions file\n```\n\n**Required evidence per suite:**\n- Exit code (printed)\n- Last 10-15 lines of output (so the user can see PASS\u002FFAIL counts)\n- For pure-PASS suites: the line that says \"ALL TESTS PASSED\" or equivalent\n\n**If a test FAILS:** STOP. Do NOT push. Do NOT open the PR. Report the\nfailing test verbatim in the Slack reply and ask the user how to proceed.\n\n### Step 5 — Verify guardrails from the instructions file\n\nMost UPSTREAM-PROMPT.md files list guardrails like:\n- \"No machine paths (\u002FUsers\u002F\u003Cname>\u002F...) belong in any committed file\"\n- \"Must not add any file under findings_wiki\u002F other than README + TEMPLATE\"\n- \"Run `findings_lint.sh --upstream` for purity\"\n\nVerify each guardrail with a `grep`\u002F`ls`\u002Fthe linter the instructions file\ncalls out. The pitfalls section below has worked examples.\n\n### Step 6 — Push + open the PR\n\n```bash\n# Push (pre-push secret guard runs automatically on jleechanorg\u002F* repos)\ngit push -u origin \u003Cbranch-name>\necho \"remote SHA: $(git rev-parse origin\u002F\u003Cbranch-name>)\"\n# Confirm SHA matches local: must equal `git rev-parse HEAD`\n```\n\n**Open the PR** with title + body from the instructions file (verbatim, but\nun-indented if it was indented by the user):\n\n```bash\n~\u002F.hermes\u002Fscripts\u002Fgh-safe-publish pr create \\\n  --repo \u003COWNER>\u002F\u003CREPO> \\\n  --base main \\\n  --head \u003Cbranch-name> \\\n  --title \"\u003Cexact title from instructions file>\" \\\n  --body-file \u002Ftmp\u002F\u003Ctask-prefix>\u002FPR_BODY.md\n\n# Capture\ngh pr list --head \u003Cbranch-name> --json number,title,url,state\n```\n\n**Do NOT merge** unless the instructions explicitly say \"merge it yourself\".\nMost UPSTREAM-PROMPT.md files say \"leave the PR for the repo owner to review\"\nout of politeness — but the agent's default is also \"no merge without explicit\n`MERGE APPROVED`\" per SOUL.md merge discipline.\n\n### Step 7 — Post the Slack reply\n\nIf the user sent this from Slack, post ONE reply with:\n- PR URL (linked markdown, see `.cursor\u002Frules\u002Fpr-hyperlink.mdc`)\n- Branch name + final SHA\n- Exit code + tail of each test suite\n- A summary of the guardrail checks\n- The patch location if archived (gist URL or local path)\n\nIf `mcp__slack__conversations_add_message` returns `not_in_channel` (sub-class\n5f, cross-workspace bot-token hard-block), follow SOUL.md\n`slack-cross-workspace-fallback-xoxp` — fall back to `SLACK_USER_TOKEN` via\nPath B curl. Note in the message body if the message will appear under the\nuser's identity instead of the bot identity.\n\nSchedule a one-shot 20m check-back cron per\n`## COMMIT: one-time-status-cron-after-every-task` so the user gets a\nfollow-up only if CodeRabbit posts a verdict or the user comments.\n\n### Step 8 — Cleanup\n\n```bash\nrm -rf \u002Ftmp\u002F\u003Ctask-prefix>\u002Frepo \u002Ftmp\u002F\u003Ctask-prefix>\u002FPR_BODY.md\n# Optional: preserve the patch itself at \u002Ftmp\u002F\u003Ctask-prefix>\u002F\u003Cpatch-file>\n# for re-application if the user wants to redo the PR\n```\n\n## Pitfalls\n\n### P1 — Overwriting non-owned PRs (cross-ref `pr-cleanup-replay`)\n\nIf Step 1.C finds an existing PR whose branch or title matches the new topic,\nDO NOT push onto that branch's head. The user's instructions file may not\nmention an existing PR because they were written assuming a clean slate. Stop\nand ask. The verifying-SHA check (`gh api repos\u002F...\u002Fbranches\u002F\u003Cbranch>`) tells\nyou whose PR it is — if it's not yours, the right move is to open a NEW PR\non a NEW branch from `origin\u002Fmain`, leaving the existing PR alone.\n\n### P2 — The instructions file lists \"git am\" but `git am` fails\n\nThe instructions file may say \"If `git am` fails... use `git apply --3way`\".\nDo not follow that fallback automatically: first make a fresh P14 decision.\nUse the manual conflict-resolution flow below only after recording that drift\nis cosmetic-only; policy or unknown drift must be re-derived on current `main`.\nThe actual conflict resolution is also project-specific.\nCommon conflict points across `jleechanorg\u002F*` repos:\n\n- **`pyproject.toml` version bump** — instructions usually say \"take the\n  higher version and bump patch\". The pattern is to read the current version,\n  read the patch version, take `max(current, patch)` and increment patch by 1.\n- **`CLAUDE.md` append** — instructions usually say \"append the two new\n  sections at the end\". The pattern is `cat >> CLAUDE.md \u003C\u003C 'EOF'` then\n  commit with the same message.\n- **Sub-tree duplication** — some `jleechanorg\u002F*` repos mirror `scripts\u002F` to\n  `src\u002F\u003Cpackage>\u002Fscripts\u002F`. If the patch touches one but not the other, the\n  conflict resolution is to also apply the patch to the mirroring path\n  (often a separate `cp` or `rsync`).\n\nIf the conflict is none of the above, STOP and ask. Do not invent a resolution.\n\n### P3 — Tests fail on placeholder paths the user told you to ignore\n\nThe instructions file may say \"No machine paths (\u002FUsers\u002F\u003Cname>\u002F...) belong\nin any committed file\" — but the patch itself may contain\n`\u002FUsers\u002Fnobody\u002Fprotected-tree` as a TEST FIXTURE in `tests\u002Ftest_*.sh`. These\nare deliberate placeholders (`\u002FUsers\u002Fnobody\u002F` = \"no specific user\"). Do NOT\nreport them as a guardrail violation. Verify the placeholder is in a test\nfile (`tests\u002F` or `scripts\u002Ftest*`) AND uses `\u002FUsers\u002Fnobody\u002F` (not the user's\nreal home), then move on.\n\n### P4 — Both Slack tokens lack `files:write` for binary evidence\n\nPer `evidence-attach-to-slack` v1.8.0, the OAuth scope gap on both\n`HERMES_SLACK_BOT_TOKEN` and `SLACK_USER_TOKEN` means you cannot upload the\npatch to the Slack thread directly. v1.9.0 covers the text-file case: push\nthe patch to a public gist via `gh gist create \u003Cfile>` (text is text, no\nclone-and-replace dance). Capture the SHA via `git clone https:\u002F\u002Fgist.github.com\u002F\u003Cid>.git`\n+ `git rev-parse HEAD` and embed `https:\u002F\u002Fgist.githubusercontent.com\u002F\u003Cuser>\u002F\u003Cid>\u002Fraw\u002F\u003Csha>\u002F\u003Cfile>`\nin the Slack reply.\n\n### P5 — The user wants to be the assignee, not you\n\nBy default, the PR author is whoever ran `gh pr create` (which is whoever\nauthenticated `gh`). That's fine for jleechanorg\u002F* repos where\n`jleechan2015` is the active `gh` user. But if a different account did the\nauth, the PR is owned by that account. Verify `gh pr view \u003CN> --json author`\nmatches the user the instructions expect. If it doesn't, add `--assignee`\nto the `gh pr create` call.\n\n### P6 — Slack thread routing for the summary reply\n\nAfter opening the PR, post the summary to the SAME thread the user started\nin (per SOUL.md `slack-reply-inherit-thread-ts`). If the user's most recent\nmessage was a HERMES-bot self-message, scan further back — do NOT reply to\nthe bot self-message. The `not_in_channel` error on `conversations_add_message`\nindicates you need the xoxp fallback (P5 above cross-references this).\n\n### P8 — Force-pushing a follow-up commit when the origin branch was deleted by a prior session\n\nWhen the prior session shipped a PR by force-pushing, then the agent\ncrashed\u002Fended before merge — and a NEW session is asked to follow up on the\nsame PR by adding commits — the workflow is:\n\n1. Verify origin\u002FPR state via `gh pr view \u003CN> --json headRefOid` — head\n   should still resolve even if the feature branch is gone locally.\n2. Reconstruct from the PR's head SHA directly:\n   ```bash\n   git fetch origin +refs\u002Fpull\u002F\u003CN>\u002Fhead:refs\u002Fremotes\u002Forigin\u002Fpr\u002F\u003CN>\n   git checkout -B \u003Cbranch> refs\u002Fremotes\u002Forigin\u002Fpr\u002F\u003CN>\n   ```\n3. Add the follow-up commit on top of that ref.\n4. When pushing, use plain `--force`, NOT `--force-with-lease`. The lease\n   target (the deleted remote ref) doesn't exist on origin, so\n   `--force-with-lease` will return \"stale info\" and fail. Plain\n   `--force` rewrites the same path (`refs\u002Fheads\u002F\u003Cbranch>`) and is correct\n   here because no other agent or branch is sharing that ref.\n5. Verify with `gh pr view \u003CN> --json headRefOid` returns your new SHA\n   before claiming the push landed.\n\nVerified 2026-07-21 on `jleechanorg\u002Fdark-factory` PR #407: prior session\nshipped commit `f461f93da`, then origin branch `receipt-gate-reviewer` was\ndeleted (no on-disk lease target). Follow-up commit `b04df6f44` pushed\nwith `--force` succeeded; `gh pr view 407 --json headRefOid` then\nreturned `b04df6f44960db5dca15b0539e9360d8956736bd` confirming PR head\nmoved correctly.\n\n### P9 — Two-tier \"delete X gate\" distinction (workflow gate vs pipeline node type)\n\nWhen the user says \"delete the X gate\" in an agent-orchestrator-style\nproject, distinguish TWO unrelated layers:\n\n- **Workflow-level gate**: `.github\u002Fworkflows\u002FX-gate*.yml` files. These\n  define GitHub Actions checks that block PRs (e.g. `skeptic-gate-caller.yml`\n  triggers on `pull_request_target` and posts a `skeptic` status check).\n  Deleting these removes the CI gate.\n- **Pipeline-level gate type**: a handler registered in\n  `runner\u002Fhandlers.py` TYPE_REGISTRY (e.g. `gate_skeptic` →\n  `_gate_skeptic(node, ctx)` in `runner\u002Fhandler_universal_prompts.py`)\n  used by DOT pipelines as a `type=\"gate_X\"` node. Many `.dot` pipelines\n  + many tests + many fixtures depend on this registration.\n\nDeleting the workflow gate does NOT affect the pipeline node type. Most\n\"delete X\" requests target the workflow gate (the CI blocker); deleting\nboth is rare and requires updating fixtures + tests.\n\nDiscovery workflow:\n```bash\n# Workflow gate check\nls -la .github\u002Fworkflows\u002F | grep -i X\n\n# Pipeline node type check\ngrep -rn \"gate_X\\b\" runner\u002F handlers.py\ngrep -rn \"gate_X\\b\" tests\u002F tests\u002Ffixtures\u002F\n```\n\n### P10 — Pre-existing test-failure attribution via stash\u002Freset\u002Frestore\n\nWhen you delete code that some tests depend on, the deletion will break\nthose tests. To attribute which failures are caused by your deletion vs.\npre-existing on `origin\u002Fmain` (per SOUL.md `same-test-name-rule`):\n\n```bash\n# 1. Capture current changes\ngit stash\n\n# 2. Reset to origin\u002Fmain\ngit reset --hard origin\u002Fmain\n\n# 3. Run the failing tests on clean main\n.venv\u002Fbin\u002Fpython -m pytest tests\u002Ftest_X.py -v --no-header 2>&1 | tail -20\n\n# 4. Restore the branch + changes\ngit checkout -B \u003Cbranch> refs\u002Fremotes\u002Forigin\u002Fpr\u002F\u003CN>   # or origin\u002F\u003Cbranch>\ngit stash pop\n\n# 5. Compare results — if same SHA, same exit code, same error line →\n#    PRE-EXISTING (not your fault). Attribute correctly in the PR summary.\n```\n\nVerified 2026-07-21 on `jleechanorg\u002Fdark-factory` PR #407: 4 test\nfailures observed after skeptic-gate deletion; stash\u002Freset confirmed all\n4 had identical SHA + identical output on `origin\u002Fmain` (3× git-lfs PATH\ndrift, 1× macOS `\u002Fbin\u002Ffalse` not-found). Zero new failures caused by\ndeletion.\n\n### P11 — Fresh destructive user comments OVERRIDE prior closeouts\n\nWhen the user previously claimed a PR was closed out (e.g. comment 5111574771\non your-project.com PR #8661 said \"all CodeRabbit blockers fixed\"), then\nlater posts a file comment like \"Delete this\" or \"Do not add things specific\nto a campaign\", the destructive comment **overrides** the closeout — even\nif the closeout was posted by the same agent. Workflow:\n\n1. **Before executing any closeout work**, re-fetch\n   `gh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fissues\u002F\u003CN>\u002Fcomments?per_page=100\"` and\n   `gh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fpulls\u002F\u003CN>\u002Fcomments?per_page=100\"` and\n   sort by `created_at`. If any comment is destructive-verbing\n   (`delete`, `remove`, `revert`, `do not add`, `drop`, `simplify to`)\n   AND newer than the most recent closeout claim, the closeout is stale.\n2. **Reclassify the work** as destructive-removal: delete the named\n   files\u002Fconstants, then update the tests that referenced them, then push.\n   Do NOT do another round of \"fix the CodeRabbit findings\" — the user\n   is telling you the whole PR is the wrong shape.\n3. **Ask one question, not five.** If the destructive comment is ambiguous\n   (e.g. \"delete this\" without specifying scope), ask one `clarify` with\n   the scope choices. Do not invent a destructive scope and do not redo\n   the full closeout.\n4. **Reference the newer comment in the PR comment** so the reviewer can\n   see why the work shifted from \"fix CodeRabbit\" to \"delete the artifact\".\n\nVerified 2026-08-01 on `$GITHUB_REPOSITORY` PR #8661: a\n2026-07-29 closeout claimed all 5 CodeRabbit P1\u002FP2 items were fixed.\nTwo 2026-08-01 user file comments (\"Do not add things specific to a\ncampaign\" on `constants.py`, \"Delete this\" on the overlay) overrode the\ncloseout. Net effect: 4 Spellblade-specific artifacts deleted, 910 lines\nremoved, +44\u002F-0 net diff left on the PR (just generic shared-contract\ntext). The earlier fix work was not wasted — it informed the right answer\n(\"delete the artifacts, keep the generic sections\") — but the agent must\nNOT have blindly executed the closeout instructions.\n\n### P12 — Explain rebase-before-push necessity in the approval ask, not after\n\nIf a destructive-Removal rebase is required (e.g. the local branch needs\nto be rebased onto current `origin\u002Fmain` before push, so the cleanup\ncommit is a fast-forward onto the remote tip), make the rebase reason\n**part of the approval ask**, not a follow-up explanation. The user\nshould not have to ask \"why is force-push needed?\" after the push lands.\n\n**Approval-ask template** (use before any force-push that requires prior user\napproval):\n\n> Need force-push to `feat\u002F\u003Cbranch>` because the local branch was rebased\n> onto current `origin\u002Fmain` (N newer commits behind your remote tip\n> `\u003Csha>`), so the cleanup commit can't be a fast-forward onto the old\n> remote tip. Alternative: open a new branch + new PR (safer, reviewable\n> independently). Approve force-push, or pick the new-branch route?\n\n**Why this matters:** the user typed \"force push is fine although i donts\nee why thats needed\" — the user accepted the push, but the framing landed\nas mysterious. The next session should reverse this: name the reason\nin the same message as the approval, not after.\n\nVerified 2026-08-01 on `$GITHUB_REPOSITORY` PR #8661: the\nagent should have surfaced \"the local branch is 6 commits behind\n`origin\u002Fmain` because I rebased onto current main first\" in the\napproval ask, not in the post-push reply.\n\n### P13 — Multi-reviewer fan-out loop on destructive-removal cleanup (iteration gate)\n\nAfter a P11 destructive cleanup, dense PRs (multiple CodeRabbit items,\nmultiple reviewers, dangling references, generic-vs-campaign rules)\nneed a **multi-reviewer second-opinion pass** before the work is shippable.\nThe pattern is:\n\n1. **List the open review items** before writing any new code: `gh api\n   \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fpulls\u002F\u003CN>\u002Fcomments?per_page=100\"` (issue-level) + the\n   `latestOpinion` GraphQL review-thread query (per-thread resolution\n   state). The 2-axis matrix is: severity x staleness. Moot items (target\n   file deleted) you can cross off in 30 seconds; live items need a fix plan.\n2. **Run \u002Fadvice (3 reviewers) + \u002Fweb-advice (multi-model) in parallel.**\n   The reviewer roles are:\n   - **Reviewer A (source-accuracy):** byte-equality of any copied files\n     (e.g. shared contracts cherry-picked from a sibling branch), include\n     resolution, test suite pass count, MBTI\u002Falignment\u002Fcampaign-shaped\n     string scan across the diff.\n   - **Reviewer B (external-docs \u002F spec compliance):** repo conventions\n     (AGENTS.md, the prompts\u002FCLAUDE.md), commit-attribution rule, README\n     alignment, hidden internal-only data leakage.\n   - **Reviewer C (adversarial):** cross-agent coverage, runtime failure\n     modes for directives, orphan references, conflict with other recent\n     changes.\n   - **\u002Fweb-advice is the cross-model independent review** — it does NOT\n      share the prior context. Prefer `aside-mcp` (or `aside repl` Playwright API)\n      to navigate directly to ChatGPT Web, Gemini Web, Grok Web, and Perplexity Web\n      in the authenticated browser. If Aside is unavailable or unsupported, use\n      the canonical skill's approved Playwright\u002FChrome browser fallbacks.\n      NEVER use Aside inference (`aside exec`, `aside \"...\"` NL agent, `aside exec -m`).\n      If every approved browser route is genuinely auth-walled\u002Funavailable,\n      report the available seats or mark `\u002Fweb-advice` unavailable; do not\n      substitute an inference mechanism.\n3. **Convergence signal:** when 2 of 3 \u002Fadvice reviewers and the available\n   `\u002Fweb-advice` browser panel agree\n   on a finding, the finding is real — fix it. Don't fix reviewer-unique\n   nits unless they fall in the user's destructive scope.\n4. **Re-run after fix.** Don't compose a one-shot pass — the iteration\n   is the value. Watch the live transcript (`~\u002F.hermes\u002Fcache\u002Fdelegation\u002F\n   live\u002F\u003Cdeleg-id>\u002Ftask-N.log`) for the final `status=completed` block\n   before trusting the verdict.\n5. **Final-state acceptance requires:**\n   - All reviewer APPROVED-as-is verdicts collected (or only the\n     deferred-to-PR-A items remaining).\n   - The `\u002Fweb-advice` browser panel reaches the required verdict.\n   - 4-lane (ponytail\u002FZFC\u002Froot-cause-first) all PASS for the diff.\n   - Test suite green on the rebased branch.\n   - Diff is `N files \u002F +X \u002F -Y` with no MBTI\u002Falignment player-facing\n     exposure (verified by grep against the 16 MBTI type codes +\n     big-five + alignment labels).\n   - Then force-push + PR comment + 20m babysit cron.\n\n#### P13a — Cross-prompt coverage gap (the DialogAgent pattern)\n\nWhen a `{{PROMPT_INCLUDE:}}` directive lives in a parent prompt (e.g.\n`narrative_system_instruction.md`) and the rule is described as\n\"mandatory for every agent on every turn\", but a lighter agent\n(`DialogAgent`) only loads a stripped variant (`narrative_lite`),\nthe claim is false. Two real signals that this is happening:\n\n- `grep -A 5 \"REQUIRED_PROMPT_ORDER\" $PROJECT_ROOT\u002Fagents.py DialogAgent`\n  returns a list that includes `narrative_lite` but not `narrative`.\n- The prompt description says \"every agent\" but the lighter parent\n  doesn't have the same `{{PROMPT_INCLUDE:}}` directive.\n\nThe fix has two options:\n\n| Option | When to use | Cost |\n|---|---|---|\n| **Include from the lighter parent too** (recommended) | The rule is genuinely global (e.g. npc autonomy, witness rules) | +12 lines per lighter parent |\n| **Soften the wording** in the heavy parent | The rule is heavy-parent-specific (e.g. long-form narrative only) | One-line edit, but you lose the \"mandatory everywhere\" claim |\n\nThe include-from-lighter-parent option is almost always right because\nthe rule is genuinely global — DialogAgent narrates, narrating needs\nthe contract. Verified 2026-08-01 on PR #8661, where the Codex\nreview flagged the gap and the fix was to add 4 `{{PROMPT_INCLUDE:}}`\ndirectives to `narrative_lite_system_instruction.md` covering the\nsame 4 narrative contracts.\n\n#### P13b — Pulling shared contracts from a sibling PR (the PR-A cherry-pick pattern)\n\nWhen the destructively-removed code referenced contracts that live\non a sister PR (e.g. PR-A `feat\u002Fshared-contracts-mbti-internal-drive`),\n**don't redeclare the contracts inline** — pull them from the sister\nbranch via `git show \u003Cbranch>:\u003Cpath>` and write them as new files.\nThis is the right move when:\n\n- The sister PR has already been reviewed and the contracts are\n  considered load-bearing.\n- The contracts are pulling shared payload (rules, state schemas) that\n  the destructive-removal PR needs to reference.\n- The sister PR is the canonical source of truth for the contracts.\n\nThe pattern is:\n\n```bash\n# Verify byte-equality after pull\nfor f in \u003Clist-of-contracts>; do\n  diff -q \\\n    \u003C(git show origin\u002F\u003Csister-branch>:$PROJECT_ROOT\u002Fprompts\u002Fshared\u002F$f) \\\n    $PROJECT_ROOT\u002Fprompts\u002Fshared\u002F$f\ndone\n# Should print 0 differences\n\n# Pull only the contracts you need (not the whole branch)\nfor f in \u003Clist-of-contracts>; do\n  git show origin\u002F\u003Csister-branch>:$PROJECT_ROOT\u002Fprompts\u002Fshared\u002F$f \\\n    > $PROJECT_ROOT\u002Fprompts\u002Fshared\u002F$f\ndone\n```\n\n**Do NOT pull the sister PR's MBTI-internal-data file** (e.g.\n`ai_generated_mystery_and_internal_drive_plot_arc.md`) — that's the\ninternal-only personality model that lives on PR-A only. The user\nexplicitly stated \"Did not touch PR #8539 (MBTI internal-only\ncanonical contract) or the PR-A worktree\" in the closeout comment.\nVerify with `ls \u003Cshared>\u002F` and grep for \"mystery\" \u002F \"internal_drive\" \u002F\n\"MBTI\" before commit.\n\n**Then wire the contracts via `{{PROMPT_INCLUDE:}}`** in the parents\nthat need them. The `{{PROMPT_INCLUDE:}}` directive is the canonical\nmechanism documented in `$PROJECT_ROOT\u002Fprompts\u002FAGENTS.md` and `$PROJECT_ROOT\u002Fprompts\u002F\nCLAUDE.md` §\"Shared rules across agents\". Existing examples:\n- `narrative_system_instruction.md:66` → `shared\u002Fnpc_canon_anchoring.md`\n- `character_creation_*.md:24-60` → `shared\u002Fskill_selection_rules.md` +\n  `shared\u002Fuser_directive_supremacy.md`\n- `dice_system_instruction.md:59` → `shared\u002Fdice_notation_contract.md`\n\nUse markdown-link references (`See \u003Cfile>.md for the rule.`) ONLY for\nhuman reading; the `{{PROMPT_INCLUDE:}}` directive is what the runtime\nresolves. The `{{PROMPT_INCLUDE:}}` form is parsed by\n`$PROJECT_ROOT\u002Fagent_prompts._resolve_prompt_includes` (fail-fast on\nmissing\u002Funsafe targets — see `agent_prompts.py:817-881`).\n\nVerified 2026-08-01 on PR #8661: 5 shared contracts pulled from PR-A\n`feat\u002Fshared-contracts-mbti-internal-drive` (byte-identical, verified\nvia `diff -q`), wired into narrative + combat + narrative_lite, all\n3 lighter agents (DialogAgent, LiteDialogAgent via narrative_lite,\nStoryModeAgent via mandatory narrative injection) now see the rules.\n\n#### P13c — `\u002Fweb-advice` browser navigation vs inference\n\nThe `\u002Fweb-advice` skill drives real browser sessions to ChatGPT Web (`chatgpt.com`), Gemini Web (`gemini.google.com\u002Fapp`), Grok Web (`grok.com`), and Perplexity Web (`perplexity.ai`). Prefer `aside-mcp` or `aside repl`; when Aside is unavailable or unsupported, use the canonical approved Playwright\u002FChrome fallbacks. Every route uses the user's web chat subscriptions directly instead of Aside inference or provider APIs.\n\n**Do NOT use Aside inference (`aside exec`, `aside \"...\"` NL agent, `aside --effort ultrabrowse`, `aside exec -m \u003Cmodel>`).**\n`aside exec -m \u003Cmodel>` invokes Aside's internal model inference backend (which consumes Aside credits and rate limits) rather than automating browser tabs to the web chat interfaces.\n\nIf browser-based web LLM tabs are auth-walled or unreachable in the browser:\n\n1. **Follow honest panel accounting** in `\u002Fweb-advice` and synthesize the available reachable seats (e.g. 2-of-4 or 3-of-4).\n2. **If all web LLM tabs are auth-walled\u002Funreachable**, mark `\u002Fweb-advice` unavailable and stop that review. Any non-browser review is a separate workflow and cannot satisfy `\u002Fweb-advice`.\n3. **Post the synthesis as a PR comment** with a transparency note explaining which models were queried and why any seats were unavailable.\n\n#### P13d — The \"iterate until \u002Fadvice and \u002Fweb-advice approve\" user directive\n\nWhen the user types \"keep iterating until PR comments are handled and\n\u002Fadvice and \u002Fweb-advice approve\" (or equivalent), this is a\n**completion criterion**, not a vibe. The work is not done until:\n\n1. Both \u002Fadvice (3 reviewers) and the `\u002Fweb-advice` browser panel return APPROVED.\n2. The diff passes the 4-lane (\u002Fdocument-standards) check.\n3. Tests pass.\n4. The PR comment is posted with the full per-comment fix map.\n5. Force-push is approved + executed.\n6. The 20-min babysit cron is scheduled.\n\nIf any of those gate-criteria fails, fix the underlying issue and\nre-run the relevant reviewer. Don't ask the user \"should I keep\niterating?\" — the directive is the user explicitly saying \"iterate\nuntil X is true.\" The right move is to keep working until X is true\nor until a hard block surfaces (missing credentials, ambiguous\npreference, etc.).\n\nVerified 2026-08-01 on PR #8661: the user-typed phrase \"Keep iterating\nuntil PR comments are handled and \u002Fadvice and \u002Fweb-advice approve\"\ndrove 3 rounds of reviewer fan-out (initial → fix DialogAgent gap →\nre-run) before the convergence signal was strong enough to ship. The\npost-fix `\u002Fadvice` Reviewer C re-run and browser-based `\u002Fweb-advice` re-run\nboth returned APPROVED, which is the ship criteria.\n\n### P13 checklist — when the user types \"iterate until reviews approve\"\n\nWhen the user types \"iterate until \u002Fadvice + \u002Fweb-advice approve\" (or\nthe PR has multiple review items from a destructive cleanup):\n\n1. **List open review items** via `gh api ...\u002Fissues\u002F\u003CN>\u002Fcomments` +\n   `reviews(last:5)` + the `latestOpinion` GraphQL thread query. Mark\n   each item as live vs. moot.\n2. **For live items, identify the minimal fix surface.** Generic\n   rules → `shared\u002F` contracts via `{{PROMPT_INCLUDE:}}`. Campaign-\n   specific → delete. Duplicated localization → extract to one shared.\n3. **Verify the existing tests pass** on the rebased branch\n   (`cd \u003Cworktree> && $HOME\u002Fprojects\u002Fyour-project.com\u002Fvenv\u002Fbin\u002Fpython -m unittest \u003Cmodule>`).\n4. **Run \u002Fadvice (3 reviewers) + browser-based \u002Fweb-advice in parallel.**\n   Use `delegate_task` for the \u002Fadvice fan-out and real authenticated web-chat\n   tabs for `\u002Fweb-advice`; unavailable browser seats remain unavailable.\n5. **Convergence signal:** 2\u002F3 \u002Fadvice reviewers and the available\n   `\u002Fweb-advice` browser panel agree on a finding → fix it. Re-run only the\n   disagreeing reviewers.\n6. **Apply the fix.** Verify tests still pass. Force-push only after\n   the convergence signal is strong.\n7. **Post the PR comment** with the full per-comment fix map + review\n   verdicts table. Use `gh pr comment \u003CN> --body \"...\"`.\n8. **Schedule a 20-min babysit cron** targeting the same Slack channel\n   via `hermes cron create \"20m\" --name \"\u003Cname> status (20m)\" --deliver\n   'slack:\u003Cchannel>' --repeat 1`. The cron will report CI status +\n   CodeRabbit review flip (or self-cancel if the PR is merged).\n\n## P7 — Refreshed patch supersedes a prior-session PR for the same topic\n\n### P7 — Refreshed patch supersedes a prior-session PR for the same topic\n\nThis is a recurring shape when the user re-runs the same workflow with a\n**refreshed patch** (e.g. new patch supersedes the previous day's patch).\nThe verification case (2026-07-16, disk_magician): user sent the same patch\nshape (sister files: `\u003Ctopic>.patch` + `\u003Ctopic>-PROMPT.md`) two days in a\nrow; the new instructions file literally said \"REFRESHED 2026-07-16,\nsupersedes the 2026-07-15 patch.\"\n\n**Detection signals (Step 1 pre-flight):**\n- A same-topic PR is OPEN from a prior session (`gh api ...\u002Fpulls?state=all&head=\u003COWNER>:\u003Cbranch>` returns a match)\n- `gh api repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fcompare\u002F\u003Cnew-base-sha>...\u003Cprior-PR-head-sha>` returns `behind_by > 0` or `status: diverged`\n- The instructions file says \"REFRESHED\", \"supersedes\", \"v2\", or similar\n\n**What to do (no user confirmation needed — this is the natural end-state of \"supersedes\"):**\n1. Use a fresh branch name from current `origin\u002Fmain` — e.g. `\u003Cbranch>-v2`,\n   `\u003Cbranch>-refreshed-\u003Cdate>`. NEVER push onto the prior PR's branch head\n   (P1 applies: that branch is owned by the prior session's commit, and\n   `git push --force` onto it would rewrite history that other PRs may\n   reference).\n2. Fetch `origin\u002Fmain` and verify the refreshed patch's stated base SHA matches\n   it immediately before applying. If it does not, stop and make the fresh\n   Step 1\u002FP14 drift decision; do not infer safety from a clean apply.\n3. Open the NEW PR; in the body, reference the prior PR explicitly:\n   `> **Note:** this PR **supersedes** [PR #N](...) — the \u003Cdate> patch\n   against base \\`\u003Cprior-base-sha>\\`. PR #N is now \u003CN> commits behind main;\n   this refreshed patch (against base \\`\u003Cnew-base-sha>\\`) is the new source\n   of truth.`\n4. Close the prior PR with a comment that links to the new PR and quotes\n   the user's \"supersedes\" directive. Do NOT delete the prior branch —\n   leave it in place for diff inspection. `gh pr close \u003CN> --repo ... --comment \"...\"`\n5. In the Slack summary reply, name both PRs and explain the close as a\n   supersede (not a rejection). One-time 20m status cron targets the new\n   PR's URL.\n\n**Why this is non-destructive and safe to do without asking:** closing a PR\nwith a supersede comment is a reversible action (reopen via `gh pr reopen`\nin \u003C2s). The user explicitly stated the new patch supersedes the old — the\n\"no confirmation gate\" applies because the directive is unambiguous.\n\n**Failure modes to avoid:**\n- ❌ Pushing onto the prior PR's branch head (`git push --force-with-lease\n  origin HEAD:refs\u002Fheads\u002F\u003Cprior-branch>`) — rewrites shared history, breaks\n  reviewers' local checkouts, fails SOUL.md `never-push-onto-someone-elses-pr-head`\n- ❌ Asking the user \"Want me to close the prior PR?\" mid-stream — the\n  supersede directive is the user's explicit instruction; this is the\n  finish-the-job end-state\n- ❌ Deleting the prior branch — leaves no diff trail if the new PR is reverted\n- ❌ Forgetting to mention the prior PR in the new PR body — CodeRabbit\n  reviewers will see two PRs for the same feature and ask which is canonical\n\n### P14 — A verified bundle whose base has drifted must be re-derived, not replayed\n\nA bundle can be internally perfect and still be wrong to land: the patch series reproduces a pinned\ntree hash, but `origin\u002Fmain` moved past it. Verified case 2026-11-04 (jleechanorg\u002Fjleechan-skills):\na 34-patch `pr-lifecycle` compaction series verified `git rev-parse HEAD^{tree}` ==\n`deb7d05f5297…` at its stated base, and `main` had moved 21 commits since — including the review-routing\npolicy (`#667`, `#673`, `#675`) the series predated. Replaying it forced 35 conflict hunks in 10 files\nwhose \"ours\" side would have reverted table-selected source review.\n\nDiagnose before you resolve:\n\n1. **Confirm the bundle is intact in an isolated checkout of its stated base** —\n   `git am --3way` there, then compare `git rev-parse HEAD^{tree}` to the hash in\n   the handoff README. This checks archive integrity only; it does not authorize\n   replay on current `origin\u002Fmain`. A mismatch means the bundle is corrupt; stop.\n2. **Measure drift** — `git rev-list --count \u003Cbase>..origin\u002Fmain` and\n   `git diff --name-only \u003Cbase>..origin\u002Fmain`. Intersect that with the patch series's own file list.\n   Zero drift → normal `git am`. Non-zero → step 3.\n3. **Classify drift before resolving conflicts** — if the newer side carries or may carry *policy* the\n   bundle predates (new routing tables, new gates or helper scripts), or the classification is\n   uncertain, the bundle is superseded. Do not replay or resolve it; re-derive on current `main`. Only\n   when a fresh comparison records cosmetic-only drift as safe may the manual replay\u002Fconflict flow\n   continue. A merge commit can silently revert policy while looking like a clean resolution.\n4. **Re-derive on current `main` instead of replaying.** For a split\u002Fcompaction bundle the mechanical\n   form works well: parse `main`'s file by heading, move each block **verbatim** into its new part,\n   and leave a one-line pointer where it was. Moving text verbatim still changes *which instructions an\n   agent loads and in what order*, so the resulting instruction paths need the same independent\n   review an agent-policy change always needs — the mechanical move removes prose-editing risk, not\n   the review.\n5. **Prove content preservation, not just test green** — compare the non-empty-line multiset of the\n   original file against the union of the new files. Expect `missing == 0`; the only extra lines should\n   be the pointers and part intros. Report both counts.\n6. **Say in the PR body why the bundle was not replayed**, naming the commits that superseded it. The\n   reviewer will otherwise ask for the 34-commit history.\n\nWhen only part of the bundle survives, land each surviving part as its own PR (scope split) and report\nthe superseded remainder as a decision, not as a silent drop.\n\nCorollary for CI: if a bundle's PR inherits failures the environment produces, prove it with a\nthrowaway branch from the PR's exact base, open it as a **draft** PR, then compare **failure signatures,\nnot test names**: the same test can fail for a different reason on each side, so require matching\nassertion\u002Ferror text and cause for every failure before calling it inherited. State the limits honestly:\nthe probe is a different SHA, and a workflow with `paths:` filters may not trigger at all for a\ncomment-only diff — record which jobs ran and which filters should have fired. A name-only match clears\nnothing.\n\n## Verified case\n\n2026-07-15, `jleechanorg\u002Fdisk_magician` PR #17 — Slack message \"Handle\" +\ntwo attached files (`0001-feat-safety-machine-loca.disk-magician-findings-wiki.patch`\n41,016 B, and `UPSTREAM-PROMPT.md` 4,213 B \u002F 71 lines). The instructions file\nlisted:\n\n- Target repo: `jleechanorg\u002Fdisk_magician`\n- Branch: `findings-wiki-contract`\n- Base SHA: `efc51ba` (and `git ls-remote` confirmed HEAD was exactly `efc51ba` at apply time)\n- 4 test suites + 1 lint to run\n- PR title + body template\n- \"Do NOT merge — leave the PR for the repo owner to review\"\n\nEnd-state: PR #17 opened, all 4 test suites green, lint clean, base SHA\nexactly matched. No existing PR for the topic. No push onto a non-owned\nbranch. Slack summary posted via xoxp fallback (bot token had `not_in_channel`).\nPatch archived at a public gist via `gh gist create` (text-file shortcut,\nv1.9.0).\n\n2026-07-16, `jleechanorg\u002Fdisk_magician` PR #21 (supersedes PR #17) — same\npatch shape, refreshed version. Slack message body \"Make sure these are\nhandled or do the extra work as needed. use \u002Fms and search slack history\nmight already be in progress\" + 2 file attachments:\n- `0001-feat-safety-machine-loca.disk-magician-findings-wiki.patch` (64,987 B\n  — refreshed, supersedes the 2026-07-15 patch)\n- `UPSTREAM-PROMPT.md` (188,464 B \u002F 71 lines — explicit \"REFRESHED 2026-07-16,\n  supersedes the 2026-07-15 patch\" in opening paragraph)\n\n**Deltas from the 2026-07-15 patch:**\n- Base SHA: `b187d8e8` (was `efc51ba`); current `origin\u002Fmain` HEAD matched\n  the new base exactly → `git am` applied cleanly with no conflicts.\n- Scope grew: 35 files \u002F +1092\u002F-33 (was 17 \u002F +856\u002F-4). New gates wired into\n ALL cleanup scripts (was 2: `cleanup_agent_artifacts` + `cleanup_worktrees`).\n New Section N: `~\u002FSnapchat\u002FDev\u002F.cache\u002Fbazel` governance with pgrep+lsof\n liveness gates. New CLAUDE.md sections.\n - 4 test suites all green: `test_safety_lib.sh` PASS=31, `test_cleanup_safety.sh`\n 93\u002F93, `test_package_sync.sh` PASS=16 ALL TESTS PASSED, `findings_lint.sh\n --upstream` clean.\n - Prior PR #17 detected as `diverged, behind_by=14` against current main.\n Followed P7 supersede pattern: created fresh branch `findings-wiki-contract-v2`\n from `b187d8e8`, pushed `3d63d703`, opened PR #21 (MERGEABLE), closed\n PR #17 with supersede comment. Branch `findings-wiki-contract` left in\n place for diff inspection (NOT deleted).\n\n 2026-07-21, `jleechanorg\u002Fdark-factory` PR #407 — follow-up commit on a\n prior-session PR. Slack message body \"lets delete skeptic gate and then\n directly code this PR\" + 3 file attachments (`GUIDE.md`,\n `INSTRUCTIONS.md`, `receipt-gate-reviewer.patch`). Prior session had\n shipped commit `f461f93da` and then the origin branch\n `receipt-gate-reviewer` was deleted (no on-disk lease target for\n `--force-with-lease`).\n\n **P8 applied (force-push after branch deletion):** reconstructed from\n `refs\u002Fpull\u002F407\u002Fhead`, added 3rd commit `b04df6f44` deleting\n `.github\u002Fworkflows\u002Fskeptic-gate*.yml` + `.github\u002Factions\u002Fskeptic-setup\u002F`\n + 6 adversarial tests + `evidence-gate.yml` \"Skeptic PASS\" line, pushed\n with plain `--force`. `gh pr view 407 --json headRefOid` confirmed\n PR head moved from `f461f93` to `b04df6f44`.\n\n **P9 applied (two-tier skeptic-gate distinction):** user said \"delete\n skeptic gate\" — workflow-level gate (CI blocker) deleted; pipeline-level\n `_gate_skeptic` DOT node type kept (used by level5 pipelines + tests).\n\n **P10 applied (pre-existing failure attribution):** observed 4 test\n failures after deletion; stash\u002Freset\u002Frestore to `origin\u002Fmain` confirmed\n all 4 byte-identical pre-existing (3× git-lfs PATH drift,\n 1× macOS `\u002Fbin\u002Ffalse` not-found). PR summary cited zero new failures.\n\n End-state: PR #407 `+331\u002F-863` across 8 files, all remaining CI checks\n green (test, daemon-tests, Evidence Gate, CodeRabbit SUCCESS, Bugbot\n NEUTRAL). Skeptic no longer in `statusCheckRollup` (gate deleted).\n Bead `$USER-pm8f` closed as resolved-via-deletion.\n\n- **No patch attached.** If the user said \"fix this bug\" with no diff, you\n  need `always-pr-never-local-edit` + AO dispatch — that's a fix-X task, not\n  an apply-supplied-patch task.\n- **No instructions file.** If the user just sent a patch with no\n  structured instructions, the workflow is much more flexible — you have to\n  figure out the target repo, branch name, test gates yourself. That's\n  closer to `github-pr-workflow` with an `apply` step added.\n- **User said \"apply this locally, don't push yet.\"** This skill assumes the\n  user wants the PR opened. For \"stage this and show me\" tasks, do just\n  Steps 1-5 then report.\n- **User gave you destructive ops (force-push, branch delete on protected\n  branch, etc.).** STOP. Per SOUL.md merge discipline + commit\u002Fpush gate,\n  destructive operations require explicit user approval in the current thread\n  (`MERGE APPROVED`-style signal).\n\n## Legacy helper — unsupported for this workflow\n\n`~\u002F.hermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002Fscripts\u002Fapply_patch_and_open_pr.sh`\ndoes not implement Step 1\u002FP14 judgment and is not a supported entrypoint for\napplying supplied patches. Do not invoke it for this workflow. Use only the\nmanual Step 1\u002FP14-gated recipe above; this skill makes no claim about helper\nruntime behavior.\n\n## Support files\n\n- `references\u002Fpre-existing-failure-attribution.md` — the 5-step\n  stash\u002Freset\u002Frestore protocol for machine-checking that a test failure\n  is pre-existing on `origin\u002Fmain` (companion to P10; used to satisfy\n  SOUL.md `same-test-name-rule` + `qa-test-failure-dismissal-anti-pattern`).\n- `references\u002Fupstream-prompt-format.md` — the canonical structure of an\n  `UPSTREAM-PROMPT.md` \u002F `RUNBOOK.md` file (what sections to expect, what\n  to extract from each).\n- `references\u002Frefreshed-patch-supersede-pattern.md` — the recurring\n  \"refreshed patch supersedes prior-session PR\" shape (Pitfall P7); how to\n  detect it, what to do, and why this is durable across repos.\n\n**Supported file layout:**\n```\n~\u002F.hermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002F\n├── SKILL.md                          (this file)\n└── references\u002F\n    └── upstream-prompt-format.md\n```\n","# apply-supplied-patch-and-open-pr\n\nApply a user-supplied patch to its target repository, run the listed verification\nsuites, push, and open the PR with the title + body the user provided. Distinct\nfrom `always-pr-never-local-edit` (route-through-AO for general fix work) and\nfrom `github-pr-workflow` (general PR lifecycle).\n\n## When this skill fits\n\nThis is the right skill when ALL of the following hold:\n\n1. The user has sent a **pre-built patch file** (typically `.patch` or `.diff`\n   attached to a Slack\u002FGitHub\u002Femail message). The diff is *not* something you\n   need to write.\n2. The user has sent **structured instructions** — either inline in the\n   message body or in a sibling instructions file (often named\n   `UPSTREAM-PROMPT.md`, `RUNBOOK.md`, `HANDOFF.md`, or `\u003Cname>-PROMPT.md`).\n   These instructions explicitly call out:\n   - The target repository (e.g. `jleechanorg\u002Fdisk_magician`)\n   - The branch name to create (e.g. `findings-wiki-contract`)\n   - The list of test suites to run (e.g. `tests\u002Ftest_safety_lib.sh`)\n   - The PR title + body template\n   - Whether to merge or leave for review\n3. The work is **bounded** — pre-specified, not iterate-to-green. Before any\n   replay, freshly compare the supplied patch base with `origin\u002Fmain` and use\n   Step 1's P14 decision. A failed `git am` or conflict does not establish\n   that drift is cosmetic. Use `git apply --3way` only in\n   the manual flow after P14 records cosmetic-only drift as safe to replay;\n   policy or unknown drift requires re-deriving on current `main`.\n\nIf ANY of these is missing (no patch, no instructions, OR unclear target),\nthis is NOT the right skill — fall back to either:\n\n- **`always-pr-never-local-edit`** if the user said \"fix X\" and you have to\n  figure out the diff yourself\n- **`github-pr-workflow`** if it's a general PR task without a supplied patch\n\n## Trigger-1 anti-pattern: don't narrate before reading attachments\n\nWhen a Slack message has a body word like \"Handle\" (1-2 words, generic) AND\nfile attachments, **the attachments are the ask**, not the body. The wrong\nmove is to immediately write narration messages like:\n\n- \"I see file attachments...\"\n- \"Let me work on this...\"\n- \"On it — applying the patch...\"\n\nbefore checking what the attachments actually are. The right move is to\n**download the attachments first, read them, then compose a single coherent\nresponse**. Verified failure mode (2026-07-15, jleechanorg\u002Fdisk_magician\nPR #17): the bot wrote 4 narration messages before realizing the body text\nwas empty\u002Fshort and the actual ask lived in the patch + UPSTREAM-PROMPT.md\nfile pair.\n\n**The rule:** if `mcp__slack__conversations_replies` shows a parent message\nwith `files: [...]` populated and a body of ≤5 words, the first tool call\nin the response turn MUST be reading the files — not writing a narration\nmessage.\n\n## Recipe — the 7-step bounded workflow\n\n### Step 1 — Pre-flight checks (parallel, fast)\n\n```bash\n# A) gh auth status\ngh auth status 2>&1 | head -3\n\n# B) Does the target repo exist + what is its default branch HEAD?\ngh api repos\u002F\u003COWNER>\u002F\u003CREPO> --jq '{default_branch, pushed_at, archived}'\ngh api repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fbranches\u002Fmain --jq '{sha, date}'\n\n# C) Does a PR for this topic already exist? (REST, not GraphQL — GraphQL hits\n#    rate limits fast and you can avoid them)\ngh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fpulls?state=all&head=\u003COWNER>:\u003Cbranch>&per_page=10\" \\\n  --jq '.[] | {number, title, state, head_sha, url}'\n\n# D) List open PRs + branches matching the topic to avoid stepping on existing work\ngh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fpulls?state=open&per_page=20\" \\\n  --jq '.[] | {number, title, head_ref, author: .user.login}'\ngh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fbranches?per_page=100\" \\\n  --jq '.[] | select(.name | test(\"\u003Ctopic-regex>\")) | .name'\n```\n\n**Decision matrix (after pre-flight):**\n\n| Finding | Action |\n|---|---|\n| Auth OK, repo exists, HEAD matches the patch's base SHA exactly (`git log --oneline origin\u002Fmain -1` returns the SHA named in the patch message) | Proceed — `git am` will apply cleanly |\n| Auth OK, repo exists, HEAD differs from the patch base SHA | **Do not invoke a replay command yet.** Run a fresh P14 drift decision first. If drift adds, may add, or cannot be ruled out as carrying newer policy, do **not** replay; re-derive on current `main`. Only after the recorded P14 decision classifies the drift as cosmetic-only may the manual flow replay it. |\n| Auth OK, repo exists, but PR for this branch\u002Ftopic already exists | STOP. Confirm with the user — do NOT push onto a non-owned PR head (see `pr-cleanup-replay` skill, Phase -1). Either push to the existing branch and comment on the PR, OR close the existing PR and open a fresh one. |\n| **A prior-session PR for the SAME topic is OPEN but the new patch is a \"refreshed\u002Fsupersedes\" version** (new instructions file says \"REFRESHED … supersedes the YYYY-MM-DD patch\", OR the existing PR's base SHA is N commits behind current `origin\u002Fmain`) | This is the **supersede pattern** — see Pitfall P7. Open a NEW branch from current `origin\u002Fmain` (e.g. `\u003Cbranch>-v2`), apply the refreshed patch, open a NEW PR, then **close the prior PR with a \"superseded by #N\" comment** linking to the new PR. Do NOT rebase the prior PR; do NOT push onto its branch head. The new PR is the source of truth. |\n| A related branch exists with the same topic but not yet PR'd | Inspect it: `gh api ...\u002Fcompare\u002F\u003Cpatch-base-sha>...heads\u002F\u003Crelated-branch>` — if `ahead_by > 0` and the topic matches, consider whether to push onto that branch instead of opening a parallel one |\n\n### Step 2 — Clone to a scratch dir (NOT the user's home directory)\n\n```bash\nSCRATCH=\u002Ftmp\u002F\u003Ctask-prefix>-\u003Cunix-ts>\nmkdir -p \"$SCRATCH\"\ncd \"$SCRATCH\"\ngit clone --quiet https:\u002F\u002Fgithub.com\u002F\u003COWNER>\u002F\u003CREPO>.git repo\ncd repo\n\n# Verify local HEAD matches origin\u002Fmain (sanity)\ngit rev-parse HEAD       # should equal the SHA from Step 1.B\ngit fetch origin main --quiet\ngit rev-parse origin\u002Fmain  # same as above\n```\n\n**Why scratch \u002Ftmp\u002F:** the user's home directory has a directory-state tracker\n(`CLAUDE.md` \"Working directory lock — stay in the session's primary cwd\"),\nand writing to an existing home dir creates the \"file modified since read\"\ndivergence error. A scratch dir is fully isolated.\n\n### Step 3 — Branch + apply the patch\n\n```bash\n# Branch from origin\u002Fmain (clean, no carried-over history)\ngit checkout -B \u003Cbranch-name> origin\u002Fmain\ngit rev-parse HEAD  # confirm same as origin\u002Fmain\n\n# This manual recipe is the only supported apply path. Do not invoke the legacy\n# helper: it does not implement Step 1\u002FP14 judgment. Apply only after the fresh\n# decision: exact base match permits replay; cosmetic-only drift permits manual\n# replay only after that classification is recorded. Policy or unknown drift\n# must be re-derived.\ngit am \u003Cpath-to-patch>\necho \"git am exit: $?\"\n\n# If git am fails, do not infer that the drift is cosmetic and do not fall back\n# automatically. Re-run P14 against freshly fetched origin\u002Fmain. Use the\n# manual fallback below only when that decision records cosmetic-only drift:\n#   1. git am --abort\n#   2. git apply --3way \u003Cpatch>\n#   3. Resolve conflicts per the instructions file (often only pyproject.toml\n#      version + CLAUDE.md appends are conflict points)\n#   4. git add \u003Cresolved-files>\n#   5. git commit -m \"\u003Coriginal-commit-message>\"\n```\n\n### Step 4 — Run the user-listed test suites verbatim\n\nThe instructions file lists specific test paths. Run EACH one and capture the\nexit code. Do NOT substitute \"I think these tests are equivalent\" — the user\ngave you an exact list because those are the gates they want on the PR.\n\n```bash\necho \"=== \u003Ctest-suite-1> ===\"\nbash \u003Cpath-to-test-1> 2>&1 | tail -15\necho \"exit=${PIPESTATUS[0]}\"\n\necho \"=== \u003Ctest-suite-2> ===\"\nbash \u003Cpath-to-test-2> 2>&1 | tail -15\necho \"exit=${PIPESTATUS[0]}\"\n\n# ...repeat for each suite listed in the instructions file\n```\n\n**Required evidence per suite:**\n- Exit code (printed)\n- Last 10-15 lines of output (so the user can see PASS\u002FFAIL counts)\n- For pure-PASS suites: the line that says \"ALL TESTS PASSED\" or equivalent\n\n**If a test FAILS:** STOP. Do NOT push. Do NOT open the PR. Report the\nfailing test verbatim in the Slack reply and ask the user how to proceed.\n\n### Step 5 — Verify guardrails from the instructions file\n\nMost UPSTREAM-PROMPT.md files list guardrails like:\n- \"No machine paths (\u002FUsers\u002F\u003Cname>\u002F...) belong in any committed file\"\n- \"Must not add any file under findings_wiki\u002F other than README + TEMPLATE\"\n- \"Run `findings_lint.sh --upstream` for purity\"\n\nVerify each guardrail with a `grep`\u002F`ls`\u002Fthe linter the instructions file\ncalls out. The pitfalls section below has worked examples.\n\n### Step 6 — Push + open the PR\n\n```bash\n# Push (pre-push secret guard runs automatically on jleechanorg\u002F* repos)\ngit push -u origin \u003Cbranch-name>\necho \"remote SHA: $(git rev-parse origin\u002F\u003Cbranch-name>)\"\n# Confirm SHA matches local: must equal `git rev-parse HEAD`\n```\n\n**Open the PR** with title + body from the instructions file (verbatim, but\nun-indented if it was indented by the user):\n\n```bash\n~\u002F.hermes\u002Fscripts\u002Fgh-safe-publish pr create \\\n  --repo \u003COWNER>\u002F\u003CREPO> \\\n  --base main \\\n  --head \u003Cbranch-name> \\\n  --title \"\u003Cexact title from instructions file>\" \\\n  --body-file \u002Ftmp\u002F\u003Ctask-prefix>\u002FPR_BODY.md\n\n# Capture\ngh pr list --head \u003Cbranch-name> --json number,title,url,state\n```\n\n**Do NOT merge** unless the instructions explicitly say \"merge it yourself\".\nMost UPSTREAM-PROMPT.md files say \"leave the PR for the repo owner to review\"\nout of politeness — but the agent's default is also \"no merge without explicit\n`MERGE APPROVED`\" per SOUL.md merge discipline.\n\n### Step 7 — Post the Slack reply\n\nIf the user sent this from Slack, post ONE reply with:\n- PR URL (linked markdown, see `.cursor\u002Frules\u002Fpr-hyperlink.mdc`)\n- Branch name + final SHA\n- Exit code + tail of each test suite\n- A summary of the guardrail checks\n- The patch location if archived (gist URL or local path)\n\nIf `mcp__slack__conversations_add_message` returns `not_in_channel` (sub-class\n5f, cross-workspace bot-token hard-block), follow SOUL.md\n`slack-cross-workspace-fallback-xoxp` — fall back to `SLACK_USER_TOKEN` via\nPath B curl. Note in the message body if the message will appear under the\nuser's identity instead of the bot identity.\n\nSchedule a one-shot 20m check-back cron per\n`## COMMIT: one-time-status-cron-after-every-task` so the user gets a\nfollow-up only if CodeRabbit posts a verdict or the user comments.\n\n### Step 8 — Cleanup\n\n```bash\nrm -rf \u002Ftmp\u002F\u003Ctask-prefix>\u002Frepo \u002Ftmp\u002F\u003Ctask-prefix>\u002FPR_BODY.md\n# Optional: preserve the patch itself at \u002Ftmp\u002F\u003Ctask-prefix>\u002F\u003Cpatch-file>\n# for re-application if the user wants to redo the PR\n```\n\n## Pitfalls\n\n### P1 — Overwriting non-owned PRs (cross-ref `pr-cleanup-replay`)\n\nIf Step 1.C finds an existing PR whose branch or title matches the new topic,\nDO NOT push onto that branch's head. The user's instructions file may not\nmention an existing PR because they were written assuming a clean slate. Stop\nand ask. The verifying-SHA check (`gh api repos\u002F...\u002Fbranches\u002F\u003Cbranch>`) tells\nyou whose PR it is — if it's not yours, the right move is to open a NEW PR\non a NEW branch from `origin\u002Fmain`, leaving the existing PR alone.\n\n### P2 — The instructions file lists \"git am\" but `git am` fails\n\nThe instructions file may say \"If `git am` fails... use `git apply --3way`\".\nDo not follow that fallback automatically: first make a fresh P14 decision.\nUse the manual conflict-resolution flow below only after recording that drift\nis cosmetic-only; policy or unknown drift must be re-derived on current `main`.\nThe actual conflict resolution is also project-specific.\nCommon conflict points across `jleechanorg\u002F*` repos:\n\n- **`pyproject.toml` version bump** — instructions usually say \"take the\n  higher version and bump patch\". The pattern is to read the current version,\n  read the patch version, take `max(current, patch)` and increment patch by 1.\n- **`CLAUDE.md` append** — instructions usually say \"append the two new\n  sections at the end\". The pattern is `cat >> CLAUDE.md \u003C\u003C 'EOF'` then\n  commit with the same message.\n- **Sub-tree duplication** — some `jleechanorg\u002F*` repos mirror `scripts\u002F` to\n  `src\u002F\u003Cpackage>\u002Fscripts\u002F`. If the patch touches one but not the other, the\n  conflict resolution is to also apply the patch to the mirroring path\n  (often a separate `cp` or `rsync`).\n\nIf the conflict is none of the above, STOP and ask. Do not invent a resolution.\n\n### P3 — Tests fail on placeholder paths the user told you to ignore\n\nThe instructions file may say \"No machine paths (\u002FUsers\u002F\u003Cname>\u002F...) belong\nin any committed file\" — but the patch itself may contain\n`\u002FUsers\u002Fnobody\u002Fprotected-tree` as a TEST FIXTURE in `tests\u002Ftest_*.sh`. These\nare deliberate placeholders (`\u002FUsers\u002Fnobody\u002F` = \"no specific user\"). Do NOT\nreport them as a guardrail violation. Verify the placeholder is in a test\nfile (`tests\u002F` or `scripts\u002Ftest*`) AND uses `\u002FUsers\u002Fnobody\u002F` (not the user's\nreal home), then move on.\n\n### P4 — Both Slack tokens lack `files:write` for binary evidence\n\nPer `evidence-attach-to-slack` v1.8.0, the OAuth scope gap on both\n`HERMES_SLACK_BOT_TOKEN` and `SLACK_USER_TOKEN` means you cannot upload the\npatch to the Slack thread directly. v1.9.0 covers the text-file case: push\nthe patch to a public gist via `gh gist create \u003Cfile>` (text is text, no\nclone-and-replace dance). Capture the SHA via `git clone https:\u002F\u002Fgist.github.com\u002F\u003Cid>.git`\n+ `git rev-parse HEAD` and embed `https:\u002F\u002Fgist.githubusercontent.com\u002F\u003Cuser>\u002F\u003Cid>\u002Fraw\u002F\u003Csha>\u002F\u003Cfile>`\nin the Slack reply.\n\n### P5 — The user wants to be the assignee, not you\n\nBy default, the PR author is whoever ran `gh pr create` (which is whoever\nauthenticated `gh`). That's fine for jleechanorg\u002F* repos where\n`jleechan2015` is the active `gh` user. But if a different account did the\nauth, the PR is owned by that account. Verify `gh pr view \u003CN> --json author`\nmatches the user the instructions expect. If it doesn't, add `--assignee`\nto the `gh pr create` call.\n\n### P6 — Slack thread routing for the summary reply\n\nAfter opening the PR, post the summary to the SAME thread the user started\nin (per SOUL.md `slack-reply-inherit-thread-ts`). If the user's most recent\nmessage was a HERMES-bot self-message, scan further back — do NOT reply to\nthe bot self-message. The `not_in_channel` error on `conversations_add_message`\nindicates you need the xoxp fallback (P5 above cross-references this).\n\n### P8 — Force-pushing a follow-up commit when the origin branch was deleted by a prior session\n\nWhen the prior session shipped a PR by force-pushing, then the agent\ncrashed\u002Fended before merge — and a NEW session is asked to follow up on the\nsame PR by adding commits — the workflow is:\n\n1. Verify origin\u002FPR state via `gh pr view \u003CN> --json headRefOid` — head\n   should still resolve even if the feature branch is gone locally.\n2. Reconstruct from the PR's head SHA directly:\n   ```bash\n   git fetch origin +refs\u002Fpull\u002F\u003CN>\u002Fhead:refs\u002Fremotes\u002Forigin\u002Fpr\u002F\u003CN>\n   git checkout -B \u003Cbranch> refs\u002Fremotes\u002Forigin\u002Fpr\u002F\u003CN>\n   ```\n3. Add the follow-up commit on top of that ref.\n4. When pushing, use plain `--force`, NOT `--force-with-lease`. The lease\n   target (the deleted remote ref) doesn't exist on origin, so\n   `--force-with-lease` will return \"stale info\" and fail. Plain\n   `--force` rewrites the same path (`refs\u002Fheads\u002F\u003Cbranch>`) and is correct\n   here because no other agent or branch is sharing that ref.\n5. Verify with `gh pr view \u003CN> --json headRefOid` returns your new SHA\n   before claiming the push landed.\n\nVerified 2026-07-21 on `jleechanorg\u002Fdark-factory` PR #407: prior session\nshipped commit `f461f93da`, then origin branch `receipt-gate-reviewer` was\ndeleted (no on-disk lease target). Follow-up commit `b04df6f44` pushed\nwith `--force` succeeded; `gh pr view 407 --json headRefOid` then\nreturned `b04df6f44960db5dca15b0539e9360d8956736bd` confirming PR head\nmoved correctly.\n\n### P9 — Two-tier \"delete X gate\" distinction (workflow gate vs pipeline node type)\n\nWhen the user says \"delete the X gate\" in an agent-orchestrator-style\nproject, distinguish TWO unrelated layers:\n\n- **Workflow-level gate**: `.github\u002Fworkflows\u002FX-gate*.yml` files. These\n  define GitHub Actions checks that block PRs (e.g. `skeptic-gate-caller.yml`\n  triggers on `pull_request_target` and posts a `skeptic` status check).\n  Deleting these removes the CI gate.\n- **Pipeline-level gate type**: a handler registered in\n  `runner\u002Fhandlers.py` TYPE_REGISTRY (e.g. `gate_skeptic` →\n  `_gate_skeptic(node, ctx)` in `runner\u002Fhandler_universal_prompts.py`)\n  used by DOT pipelines as a `type=\"gate_X\"` node. Many `.dot` pipelines\n  + many tests + many fixtures depend on this registration.\n\nDeleting the workflow gate does NOT affect the pipeline node type. Most\n\"delete X\" requests target the workflow gate (the CI blocker); deleting\nboth is rare and requires updating fixtures + tests.\n\nDiscovery workflow:\n```bash\n# Workflow gate check\nls -la .github\u002Fworkflows\u002F | grep -i X\n\n# Pipeline node type check\ngrep -rn \"gate_X\\b\" runner\u002F handlers.py\ngrep -rn \"gate_X\\b\" tests\u002F tests\u002Ffixtures\u002F\n```\n\n### P10 — Pre-existing test-failure attribution via stash\u002Freset\u002Frestore\n\nWhen you delete code that some tests depend on, the deletion will break\nthose tests. To attribute which failures are caused by your deletion vs.\npre-existing on `origin\u002Fmain` (per SOUL.md `same-test-name-rule`):\n\n```bash\n# 1. Capture current changes\ngit stash\n\n# 2. Reset to origin\u002Fmain\ngit reset --hard origin\u002Fmain\n\n# 3. Run the failing tests on clean main\n.venv\u002Fbin\u002Fpython -m pytest tests\u002Ftest_X.py -v --no-header 2>&1 | tail -20\n\n# 4. Restore the branch + changes\ngit checkout -B \u003Cbranch> refs\u002Fremotes\u002Forigin\u002Fpr\u002F\u003CN>   # or origin\u002F\u003Cbranch>\ngit stash pop\n\n# 5. Compare results — if same SHA, same exit code, same error line →\n#    PRE-EXISTING (not your fault). Attribute correctly in the PR summary.\n```\n\nVerified 2026-07-21 on `jleechanorg\u002Fdark-factory` PR #407: 4 test\nfailures observed after skeptic-gate deletion; stash\u002Freset confirmed all\n4 had identical SHA + identical output on `origin\u002Fmain` (3× git-lfs PATH\ndrift, 1× macOS `\u002Fbin\u002Ffalse` not-found). Zero new failures caused by\ndeletion.\n\n### P11 — Fresh destructive user comments OVERRIDE prior closeouts\n\nWhen the user previously claimed a PR was closed out (e.g. comment 5111574771\non your-project.com PR #8661 said \"all CodeRabbit blockers fixed\"), then\nlater posts a file comment like \"Delete this\" or \"Do not add things specific\nto a campaign\", the destructive comment **overrides** the closeout — even\nif the closeout was posted by the same agent. Workflow:\n\n1. **Before executing any closeout work**, re-fetch\n   `gh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fissues\u002F\u003CN>\u002Fcomments?per_page=100\"` and\n   `gh api \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fpulls\u002F\u003CN>\u002Fcomments?per_page=100\"` and\n   sort by `created_at`. If any comment is destructive-verbing\n   (`delete`, `remove`, `revert`, `do not add`, `drop`, `simplify to`)\n   AND newer than the most recent closeout claim, the closeout is stale.\n2. **Reclassify the work** as destructive-removal: delete the named\n   files\u002Fconstants, then update the tests that referenced them, then push.\n   Do NOT do another round of \"fix the CodeRabbit findings\" — the user\n   is telling you the whole PR is the wrong shape.\n3. **Ask one question, not five.** If the destructive comment is ambiguous\n   (e.g. \"delete this\" without specifying scope), ask one `clarify` with\n   the scope choices. Do not invent a destructive scope and do not redo\n   the full closeout.\n4. **Reference the newer comment in the PR comment** so the reviewer can\n   see why the work shifted from \"fix CodeRabbit\" to \"delete the artifact\".\n\nVerified 2026-08-01 on `$GITHUB_REPOSITORY` PR #8661: a\n2026-07-29 closeout claimed all 5 CodeRabbit P1\u002FP2 items were fixed.\nTwo 2026-08-01 user file comments (\"Do not add things specific to a\ncampaign\" on `constants.py`, \"Delete this\" on the overlay) overrode the\ncloseout. Net effect: 4 Spellblade-specific artifacts deleted, 910 lines\nremoved, +44\u002F-0 net diff left on the PR (just generic shared-contract\ntext). The earlier fix work was not wasted — it informed the right answer\n(\"delete the artifacts, keep the generic sections\") — but the agent must\nNOT have blindly executed the closeout instructions.\n\n### P12 — Explain rebase-before-push necessity in the approval ask, not after\n\nIf a destructive-Removal rebase is required (e.g. the local branch needs\nto be rebased onto current `origin\u002Fmain` before push, so the cleanup\ncommit is a fast-forward onto the remote tip), make the rebase reason\n**part of the approval ask**, not a follow-up explanation. The user\nshould not have to ask \"why is force-push needed?\" after the push lands.\n\n**Approval-ask template** (use before any force-push that requires prior user\napproval):\n\n> Need force-push to `feat\u002F\u003Cbranch>` because the local branch was rebased\n> onto current `origin\u002Fmain` (N newer commits behind your remote tip\n> `\u003Csha>`), so the cleanup commit can't be a fast-forward onto the old\n> remote tip. Alternative: open a new branch + new PR (safer, reviewable\n> independently). Approve force-push, or pick the new-branch route?\n\n**Why this matters:** the user typed \"force push is fine although i donts\nee why thats needed\" — the user accepted the push, but the framing landed\nas mysterious. The next session should reverse this: name the reason\nin the same message as the approval, not after.\n\nVerified 2026-08-01 on `$GITHUB_REPOSITORY` PR #8661: the\nagent should have surfaced \"the local branch is 6 commits behind\n`origin\u002Fmain` because I rebased onto current main first\" in the\napproval ask, not in the post-push reply.\n\n### P13 — Multi-reviewer fan-out loop on destructive-removal cleanup (iteration gate)\n\nAfter a P11 destructive cleanup, dense PRs (multiple CodeRabbit items,\nmultiple reviewers, dangling references, generic-vs-campaign rules)\nneed a **multi-reviewer second-opinion pass** before the work is shippable.\nThe pattern is:\n\n1. **List the open review items** before writing any new code: `gh api\n   \"repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fpulls\u002F\u003CN>\u002Fcomments?per_page=100\"` (issue-level) + the\n   `latestOpinion` GraphQL review-thread query (per-thread resolution\n   state). The 2-axis matrix is: severity x staleness. Moot items (target\n   file deleted) you can cross off in 30 seconds; live items need a fix plan.\n2. **Run \u002Fadvice (3 reviewers) + \u002Fweb-advice (multi-model) in parallel.**\n   The reviewer roles are:\n   - **Reviewer A (source-accuracy):** byte-equality of any copied files\n     (e.g. shared contracts cherry-picked from a sibling branch), include\n     resolution, test suite pass count, MBTI\u002Falignment\u002Fcampaign-shaped\n     string scan across the diff.\n   - **Reviewer B (external-docs \u002F spec compliance):** repo conventions\n     (AGENTS.md, the prompts\u002FCLAUDE.md), commit-attribution rule, README\n     alignment, hidden internal-only data leakage.\n   - **Reviewer C (adversarial):** cross-agent coverage, runtime failure\n     modes for directives, orphan references, conflict with other recent\n     changes.\n   - **\u002Fweb-advice is the cross-model independent review** — it does NOT\n      share the prior context. Prefer `aside-mcp` (or `aside repl` Playwright API)\n      to navigate directly to ChatGPT Web, Gemini Web, Grok Web, and Perplexity Web\n      in the authenticated browser. If Aside is unavailable or unsupported, use\n      the canonical skill's approved Playwright\u002FChrome browser fallbacks.\n      NEVER use Aside inference (`aside exec`, `aside \"...\"` NL agent, `aside exec -m`).\n      If every approved browser route is genuinely auth-walled\u002Funavailable,\n      report the available seats or mark `\u002Fweb-advice` unavailable; do not\n      substitute an inference mechanism.\n3. **Convergence signal:** when 2 of 3 \u002Fadvice reviewers and the available\n   `\u002Fweb-advice` browser panel agree\n   on a finding, the finding is real — fix it. Don't fix reviewer-unique\n   nits unless they fall in the user's destructive scope.\n4. **Re-run after fix.** Don't compose a one-shot pass — the iteration\n   is the value. Watch the live transcript (`~\u002F.hermes\u002Fcache\u002Fdelegation\u002F\n   live\u002F\u003Cdeleg-id>\u002Ftask-N.log`) for the final `status=completed` block\n   before trusting the verdict.\n5. **Final-state acceptance requires:**\n   - All reviewer APPROVED-as-is verdicts collected (or only the\n     deferred-to-PR-A items remaining).\n   - The `\u002Fweb-advice` browser panel reaches the required verdict.\n   - 4-lane (ponytail\u002FZFC\u002Froot-cause-first) all PASS for the diff.\n   - Test suite green on the rebased branch.\n   - Diff is `N files \u002F +X \u002F -Y` with no MBTI\u002Falignment player-facing\n     exposure (verified by grep against the 16 MBTI type codes +\n     big-five + alignment labels).\n   - Then force-push + PR comment + 20m babysit cron.\n\n#### P13a — Cross-prompt coverage gap (the DialogAgent pattern)\n\nWhen a `{{PROMPT_INCLUDE:}}` directive lives in a parent prompt (e.g.\n`narrative_system_instruction.md`) and the rule is described as\n\"mandatory for every agent on every turn\", but a lighter agent\n(`DialogAgent`) only loads a stripped variant (`narrative_lite`),\nthe claim is false. Two real signals that this is happening:\n\n- `grep -A 5 \"REQUIRED_PROMPT_ORDER\" $PROJECT_ROOT\u002Fagents.py DialogAgent`\n  returns a list that includes `narrative_lite` but not `narrative`.\n- The prompt description says \"every agent\" but the lighter parent\n  doesn't have the same `{{PROMPT_INCLUDE:}}` directive.\n\nThe fix has two options:\n\n| Option | When to use | Cost |\n|---|---|---|\n| **Include from the lighter parent too** (recommended) | The rule is genuinely global (e.g. npc autonomy, witness rules) | +12 lines per lighter parent |\n| **Soften the wording** in the heavy parent | The rule is heavy-parent-specific (e.g. long-form narrative only) | One-line edit, but you lose the \"mandatory everywhere\" claim |\n\nThe include-from-lighter-parent option is almost always right because\nthe rule is genuinely global — DialogAgent narrates, narrating needs\nthe contract. Verified 2026-08-01 on PR #8661, where the Codex\nreview flagged the gap and the fix was to add 4 `{{PROMPT_INCLUDE:}}`\ndirectives to `narrative_lite_system_instruction.md` covering the\nsame 4 narrative contracts.\n\n#### P13b — Pulling shared contracts from a sibling PR (the PR-A cherry-pick pattern)\n\nWhen the destructively-removed code referenced contracts that live\non a sister PR (e.g. PR-A `feat\u002Fshared-contracts-mbti-internal-drive`),\n**don't redeclare the contracts inline** — pull them from the sister\nbranch via `git show \u003Cbranch>:\u003Cpath>` and write them as new files.\nThis is the right move when:\n\n- The sister PR has already been reviewed and the contracts are\n  considered load-bearing.\n- The contracts are pulling shared payload (rules, state schemas) that\n  the destructive-removal PR needs to reference.\n- The sister PR is the canonical source of truth for the contracts.\n\nThe pattern is:\n\n```bash\n# Verify byte-equality after pull\nfor f in \u003Clist-of-contracts>; do\n  diff -q \\\n    \u003C(git show origin\u002F\u003Csister-branch>:$PROJECT_ROOT\u002Fprompts\u002Fshared\u002F$f) \\\n    $PROJECT_ROOT\u002Fprompts\u002Fshared\u002F$f\ndone\n# Should print 0 differences\n\n# Pull only the contracts you need (not the whole branch)\nfor f in \u003Clist-of-contracts>; do\n  git show origin\u002F\u003Csister-branch>:$PROJECT_ROOT\u002Fprompts\u002Fshared\u002F$f \\\n    > $PROJECT_ROOT\u002Fprompts\u002Fshared\u002F$f\ndone\n```\n\n**Do NOT pull the sister PR's MBTI-internal-data file** (e.g.\n`ai_generated_mystery_and_internal_drive_plot_arc.md`) — that's the\ninternal-only personality model that lives on PR-A only. The user\nexplicitly stated \"Did not touch PR #8539 (MBTI internal-only\ncanonical contract) or the PR-A worktree\" in the closeout comment.\nVerify with `ls \u003Cshared>\u002F` and grep for \"mystery\" \u002F \"internal_drive\" \u002F\n\"MBTI\" before commit.\n\n**Then wire the contracts via `{{PROMPT_INCLUDE:}}`** in the parents\nthat need them. The `{{PROMPT_INCLUDE:}}` directive is the canonical\nmechanism documented in `$PROJECT_ROOT\u002Fprompts\u002FAGENTS.md` and `$PROJECT_ROOT\u002Fprompts\u002F\nCLAUDE.md` §\"Shared rules across agents\". Existing examples:\n- `narrative_system_instruction.md:66` → `shared\u002Fnpc_canon_anchoring.md`\n- `character_creation_*.md:24-60` → `shared\u002Fskill_selection_rules.md` +\n  `shared\u002Fuser_directive_supremacy.md`\n- `dice_system_instruction.md:59` → `shared\u002Fdice_notation_contract.md`\n\nUse markdown-link references (`See \u003Cfile>.md for the rule.`) ONLY for\nhuman reading; the `{{PROMPT_INCLUDE:}}` directive is what the runtime\nresolves. The `{{PROMPT_INCLUDE:}}` form is parsed by\n`$PROJECT_ROOT\u002Fagent_prompts._resolve_prompt_includes` (fail-fast on\nmissing\u002Funsafe targets — see `agent_prompts.py:817-881`).\n\nVerified 2026-08-01 on PR #8661: 5 shared contracts pulled from PR-A\n`feat\u002Fshared-contracts-mbti-internal-drive` (byte-identical, verified\nvia `diff -q`), wired into narrative + combat + narrative_lite, all\n3 lighter agents (DialogAgent, LiteDialogAgent via narrative_lite,\nStoryModeAgent via mandatory narrative injection) now see the rules.\n\n#### P13c — `\u002Fweb-advice` browser navigation vs inference\n\nThe `\u002Fweb-advice` skill drives real browser sessions to ChatGPT Web (`chatgpt.com`), Gemini Web (`gemini.google.com\u002Fapp`), Grok Web (`grok.com`), and Perplexity Web (`perplexity.ai`). Prefer `aside-mcp` or `aside repl`; when Aside is unavailable or unsupported, use the canonical approved Playwright\u002FChrome fallbacks. Every route uses the user's web chat subscriptions directly instead of Aside inference or provider APIs.\n\n**Do NOT use Aside inference (`aside exec`, `aside \"...\"` NL agent, `aside --effort ultrabrowse`, `aside exec -m \u003Cmodel>`).**\n`aside exec -m \u003Cmodel>` invokes Aside's internal model inference backend (which consumes Aside credits and rate limits) rather than automating browser tabs to the web chat interfaces.\n\nIf browser-based web LLM tabs are auth-walled or unreachable in the browser:\n\n1. **Follow honest panel accounting** in `\u002Fweb-advice` and synthesize the available reachable seats (e.g. 2-of-4 or 3-of-4).\n2. **If all web LLM tabs are auth-walled\u002Funreachable**, mark `\u002Fweb-advice` unavailable and stop that review. Any non-browser review is a separate workflow and cannot satisfy `\u002Fweb-advice`.\n3. **Post the synthesis as a PR comment** with a transparency note explaining which models were queried and why any seats were unavailable.\n\n#### P13d — The \"iterate until \u002Fadvice and \u002Fweb-advice approve\" user directive\n\nWhen the user types \"keep iterating until PR comments are handled and\n\u002Fadvice and \u002Fweb-advice approve\" (or equivalent), this is a\n**completion criterion**, not a vibe. The work is not done until:\n\n1. Both \u002Fadvice (3 reviewers) and the `\u002Fweb-advice` browser panel return APPROVED.\n2. The diff passes the 4-lane (\u002Fdocument-standards) check.\n3. Tests pass.\n4. The PR comment is posted with the full per-comment fix map.\n5. Force-push is approved + executed.\n6. The 20-min babysit cron is scheduled.\n\nIf any of those gate-criteria fails, fix the underlying issue and\nre-run the relevant reviewer. Don't ask the user \"should I keep\niterating?\" — the directive is the user explicitly saying \"iterate\nuntil X is true.\" The right move is to keep working until X is true\nor until a hard block surfaces (missing credentials, ambiguous\npreference, etc.).\n\nVerified 2026-08-01 on PR #8661: the user-typed phrase \"Keep iterating\nuntil PR comments are handled and \u002Fadvice and \u002Fweb-advice approve\"\ndrove 3 rounds of reviewer fan-out (initial → fix DialogAgent gap →\nre-run) before the convergence signal was strong enough to ship. The\npost-fix `\u002Fadvice` Reviewer C re-run and browser-based `\u002Fweb-advice` re-run\nboth returned APPROVED, which is the ship criteria.\n\n### P13 checklist — when the user types \"iterate until reviews approve\"\n\nWhen the user types \"iterate until \u002Fadvice + \u002Fweb-advice approve\" (or\nthe PR has multiple review items from a destructive cleanup):\n\n1. **List open review items** via `gh api ...\u002Fissues\u002F\u003CN>\u002Fcomments` +\n   `reviews(last:5)` + the `latestOpinion` GraphQL thread query. Mark\n   each item as live vs. moot.\n2. **For live items, identify the minimal fix surface.** Generic\n   rules → `shared\u002F` contracts via `{{PROMPT_INCLUDE:}}`. Campaign-\n   specific → delete. Duplicated localization → extract to one shared.\n3. **Verify the existing tests pass** on the rebased branch\n   (`cd \u003Cworktree> && $HOME\u002Fprojects\u002Fyour-project.com\u002Fvenv\u002Fbin\u002Fpython -m unittest \u003Cmodule>`).\n4. **Run \u002Fadvice (3 reviewers) + browser-based \u002Fweb-advice in parallel.**\n   Use `delegate_task` for the \u002Fadvice fan-out and real authenticated web-chat\n   tabs for `\u002Fweb-advice`; unavailable browser seats remain unavailable.\n5. **Convergence signal:** 2\u002F3 \u002Fadvice reviewers and the available\n   `\u002Fweb-advice` browser panel agree on a finding → fix it. Re-run only the\n   disagreeing reviewers.\n6. **Apply the fix.** Verify tests still pass. Force-push only after\n   the convergence signal is strong.\n7. **Post the PR comment** with the full per-comment fix map + review\n   verdicts table. Use `gh pr comment \u003CN> --body \"...\"`.\n8. **Schedule a 20-min babysit cron** targeting the same Slack channel\n   via `hermes cron create \"20m\" --name \"\u003Cname> status (20m)\" --deliver\n   'slack:\u003Cchannel>' --repeat 1`. The cron will report CI status +\n   CodeRabbit review flip (or self-cancel if the PR is merged).\n\n## P7 — Refreshed patch supersedes a prior-session PR for the same topic\n\n### P7 — Refreshed patch supersedes a prior-session PR for the same topic\n\nThis is a recurring shape when the user re-runs the same workflow with a\n**refreshed patch** (e.g. new patch supersedes the previous day's patch).\nThe verification case (2026-07-16, disk_magician): user sent the same patch\nshape (sister files: `\u003Ctopic>.patch` + `\u003Ctopic>-PROMPT.md`) two days in a\nrow; the new instructions file literally said \"REFRESHED 2026-07-16,\nsupersedes the 2026-07-15 patch.\"\n\n**Detection signals (Step 1 pre-flight):**\n- A same-topic PR is OPEN from a prior session (`gh api ...\u002Fpulls?state=all&head=\u003COWNER>:\u003Cbranch>` returns a match)\n- `gh api repos\u002F\u003COWNER>\u002F\u003CREPO>\u002Fcompare\u002F\u003Cnew-base-sha>...\u003Cprior-PR-head-sha>` returns `behind_by > 0` or `status: diverged`\n- The instructions file says \"REFRESHED\", \"supersedes\", \"v2\", or similar\n\n**What to do (no user confirmation needed — this is the natural end-state of \"supersedes\"):**\n1. Use a fresh branch name from current `origin\u002Fmain` — e.g. `\u003Cbranch>-v2`,\n   `\u003Cbranch>-refreshed-\u003Cdate>`. NEVER push onto the prior PR's branch head\n   (P1 applies: that branch is owned by the prior session's commit, and\n   `git push --force` onto it would rewrite history that other PRs may\n   reference).\n2. Fetch `origin\u002Fmain` and verify the refreshed patch's stated base SHA matches\n   it immediately before applying. If it does not, stop and make the fresh\n   Step 1\u002FP14 drift decision; do not infer safety from a clean apply.\n3. Open the NEW PR; in the body, reference the prior PR explicitly:\n   `> **Note:** this PR **supersedes** [PR #N](...) — the \u003Cdate> patch\n   against base \\`\u003Cprior-base-sha>\\`. PR #N is now \u003CN> commits behind main;\n   this refreshed patch (against base \\`\u003Cnew-base-sha>\\`) is the new source\n   of truth.`\n4. Close the prior PR with a comment that links to the new PR and quotes\n   the user's \"supersedes\" directive. Do NOT delete the prior branch —\n   leave it in place for diff inspection. `gh pr close \u003CN> --repo ... --comment \"...\"`\n5. In the Slack summary reply, name both PRs and explain the close as a\n   supersede (not a rejection). One-time 20m status cron targets the new\n   PR's URL.\n\n**Why this is non-destructive and safe to do without asking:** closing a PR\nwith a supersede comment is a reversible action (reopen via `gh pr reopen`\nin \u003C2s). The user explicitly stated the new patch supersedes the old — the\n\"no confirmation gate\" applies because the directive is unambiguous.\n\n**Failure modes to avoid:**\n- ❌ Pushing onto the prior PR's branch head (`git push --force-with-lease\n  origin HEAD:refs\u002Fheads\u002F\u003Cprior-branch>`) — rewrites shared history, breaks\n  reviewers' local checkouts, fails SOUL.md `never-push-onto-someone-elses-pr-head`\n- ❌ Asking the user \"Want me to close the prior PR?\" mid-stream — the\n  supersede directive is the user's explicit instruction; this is the\n  finish-the-job end-state\n- ❌ Deleting the prior branch — leaves no diff trail if the new PR is reverted\n- ❌ Forgetting to mention the prior PR in the new PR body — CodeRabbit\n  reviewers will see two PRs for the same feature and ask which is canonical\n\n### P14 — A verified bundle whose base has drifted must be re-derived, not replayed\n\nA bundle can be internally perfect and still be wrong to land: the patch series reproduces a pinned\ntree hash, but `origin\u002Fmain` moved past it. Verified case 2026-11-04 (jleechanorg\u002Fjleechan-skills):\na 34-patch `pr-lifecycle` compaction series verified `git rev-parse HEAD^{tree}` ==\n`deb7d05f5297…` at its stated base, and `main` had moved 21 commits since — including the review-routing\npolicy (`#667`, `#673`, `#675`) the series predated. Replaying it forced 35 conflict hunks in 10 files\nwhose \"ours\" side would have reverted table-selected source review.\n\nDiagnose before you resolve:\n\n1. **Confirm the bundle is intact in an isolated checkout of its stated base** —\n   `git am --3way` there, then compare `git rev-parse HEAD^{tree}` to the hash in\n   the handoff README. This checks archive integrity only; it does not authorize\n   replay on current `origin\u002Fmain`. A mismatch means the bundle is corrupt; stop.\n2. **Measure drift** — `git rev-list --count \u003Cbase>..origin\u002Fmain` and\n   `git diff --name-only \u003Cbase>..origin\u002Fmain`. Intersect that with the patch series's own file list.\n   Zero drift → normal `git am`. Non-zero → step 3.\n3. **Classify drift before resolving conflicts** — if the newer side carries or may carry *policy* the\n   bundle predates (new routing tables, new gates or helper scripts), or the classification is\n   uncertain, the bundle is superseded. Do not replay or resolve it; re-derive on current `main`. Only\n   when a fresh comparison records cosmetic-only drift as safe may the manual replay\u002Fconflict flow\n   continue. A merge commit can silently revert policy while looking like a clean resolution.\n4. **Re-derive on current `main` instead of replaying.** For a split\u002Fcompaction bundle the mechanical\n   form works well: parse `main`'s file by heading, move each block **verbatim** into its new part,\n   and leave a one-line pointer where it was. Moving text verbatim still changes *which instructions an\n   agent loads and in what order*, so the resulting instruction paths need the same independent\n   review an agent-policy change always needs — the mechanical move removes prose-editing risk, not\n   the review.\n5. **Prove content preservation, not just test green** — compare the non-empty-line multiset of the\n   original file against the union of the new files. Expect `missing == 0`; the only extra lines should\n   be the pointers and part intros. Report both counts.\n6. **Say in the PR body why the bundle was not replayed**, naming the commits that superseded it. The\n   reviewer will otherwise ask for the 34-commit history.\n\nWhen only part of the bundle survives, land each surviving part as its own PR (scope split) and report\nthe superseded remainder as a decision, not as a silent drop.\n\nCorollary for CI: if a bundle's PR inherits failures the environment produces, prove it with a\nthrowaway branch from the PR's exact base, open it as a **draft** PR, then compare **failure signatures,\nnot test names**: the same test can fail for a different reason on each side, so require matching\nassertion\u002Ferror text and cause for every failure before calling it inherited. State the limits honestly:\nthe probe is a different SHA, and a workflow with `paths:` filters may not trigger at all for a\ncomment-only diff — record which jobs ran and which filters should have fired. A name-only match clears\nnothing.\n\n## Verified case\n\n2026-07-15, `jleechanorg\u002Fdisk_magician` PR #17 — Slack message \"Handle\" +\ntwo attached files (`0001-feat-safety-machine-loca.disk-magician-findings-wiki.patch`\n41,016 B, and `UPSTREAM-PROMPT.md` 4,213 B \u002F 71 lines). The instructions file\nlisted:\n\n- Target repo: `jleechanorg\u002Fdisk_magician`\n- Branch: `findings-wiki-contract`\n- Base SHA: `efc51ba` (and `git ls-remote` confirmed HEAD was exactly `efc51ba` at apply time)\n- 4 test suites + 1 lint to run\n- PR title + body template\n- \"Do NOT merge — leave the PR for the repo owner to review\"\n\nEnd-state: PR #17 opened, all 4 test suites green, lint clean, base SHA\nexactly matched. No existing PR for the topic. No push onto a non-owned\nbranch. Slack summary posted via xoxp fallback (bot token had `not_in_channel`).\nPatch archived at a public gist via `gh gist create` (text-file shortcut,\nv1.9.0).\n\n2026-07-16, `jleechanorg\u002Fdisk_magician` PR #21 (supersedes PR #17) — same\npatch shape, refreshed version. Slack message body \"Make sure these are\nhandled or do the extra work as needed. use \u002Fms and search slack history\nmight already be in progress\" + 2 file attachments:\n- `0001-feat-safety-machine-loca.disk-magician-findings-wiki.patch` (64,987 B\n  — refreshed, supersedes the 2026-07-15 patch)\n- `UPSTREAM-PROMPT.md` (188,464 B \u002F 71 lines — explicit \"REFRESHED 2026-07-16,\n  supersedes the 2026-07-15 patch\" in opening paragraph)\n\n**Deltas from the 2026-07-15 patch:**\n- Base SHA: `b187d8e8` (was `efc51ba`); current `origin\u002Fmain` HEAD matched\n  the new base exactly → `git am` applied cleanly with no conflicts.\n- Scope grew: 35 files \u002F +1092\u002F-33 (was 17 \u002F +856\u002F-4). New gates wired into\n ALL cleanup scripts (was 2: `cleanup_agent_artifacts` + `cleanup_worktrees`).\n New Section N: `~\u002FSnapchat\u002FDev\u002F.cache\u002Fbazel` governance with pgrep+lsof\n liveness gates. New CLAUDE.md sections.\n - 4 test suites all green: `test_safety_lib.sh` PASS=31, `test_cleanup_safety.sh`\n 93\u002F93, `test_package_sync.sh` PASS=16 ALL TESTS PASSED, `findings_lint.sh\n --upstream` clean.\n - Prior PR #17 detected as `diverged, behind_by=14` against current main.\n Followed P7 supersede pattern: created fresh branch `findings-wiki-contract-v2`\n from `b187d8e8`, pushed `3d63d703`, opened PR #21 (MERGEABLE), closed\n PR #17 with supersede comment. Branch `findings-wiki-contract` left in\n place for diff inspection (NOT deleted).\n\n 2026-07-21, `jleechanorg\u002Fdark-factory` PR #407 — follow-up commit on a\n prior-session PR. Slack message body \"lets delete skeptic gate and then\n directly code this PR\" + 3 file attachments (`GUIDE.md`,\n `INSTRUCTIONS.md`, `receipt-gate-reviewer.patch`). Prior session had\n shipped commit `f461f93da` and then the origin branch\n `receipt-gate-reviewer` was deleted (no on-disk lease target for\n `--force-with-lease`).\n\n **P8 applied (force-push after branch deletion):** reconstructed from\n `refs\u002Fpull\u002F407\u002Fhead`, added 3rd commit `b04df6f44` deleting\n `.github\u002Fworkflows\u002Fskeptic-gate*.yml` + `.github\u002Factions\u002Fskeptic-setup\u002F`\n + 6 adversarial tests + `evidence-gate.yml` \"Skeptic PASS\" line, pushed\n with plain `--force`. `gh pr view 407 --json headRefOid` confirmed\n PR head moved from `f461f93` to `b04df6f44`.\n\n **P9 applied (two-tier skeptic-gate distinction):** user said \"delete\n skeptic gate\" — workflow-level gate (CI blocker) deleted; pipeline-level\n `_gate_skeptic` DOT node type kept (used by level5 pipelines + tests).\n\n **P10 applied (pre-existing failure attribution):** observed 4 test\n failures after deletion; stash\u002Freset\u002Frestore to `origin\u002Fmain` confirmed\n all 4 byte-identical pre-existing (3× git-lfs PATH drift,\n 1× macOS `\u002Fbin\u002Ffalse` not-found). PR summary cited zero new failures.\n\n End-state: PR #407 `+331\u002F-863` across 8 files, all remaining CI checks\n green (test, daemon-tests, Evidence Gate, CodeRabbit SUCCESS, Bugbot\n NEUTRAL). Skeptic no longer in `statusCheckRollup` (gate deleted).\n Bead `$USER-pm8f` closed as resolved-via-deletion.\n\n- **No patch attached.** If the user said \"fix this bug\" with no diff, you\n  need `always-pr-never-local-edit` + AO dispatch — that's a fix-X task, not\n  an apply-supplied-patch task.\n- **No instructions file.** If the user just sent a patch with no\n  structured instructions, the workflow is much more flexible — you have to\n  figure out the target repo, branch name, test gates yourself. That's\n  closer to `github-pr-workflow` with an `apply` step added.\n- **User said \"apply this locally, don't push yet.\"** This skill assumes the\n  user wants the PR opened. For \"stage this and show me\" tasks, do just\n  Steps 1-5 then report.\n- **User gave you destructive ops (force-push, branch delete on protected\n  branch, etc.).** STOP. Per SOUL.md merge discipline + commit\u002Fpush gate,\n  destructive operations require explicit user approval in the current thread\n  (`MERGE APPROVED`-style signal).\n\n## Legacy helper — unsupported for this workflow\n\n`~\u002F.hermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002Fscripts\u002Fapply_patch_and_open_pr.sh`\ndoes not implement Step 1\u002FP14 judgment and is not a supported entrypoint for\napplying supplied patches. Do not invoke it for this workflow. Use only the\nmanual Step 1\u002FP14-gated recipe above; this skill makes no claim about helper\nruntime behavior.\n\n## Support files\n\n- `references\u002Fpre-existing-failure-attribution.md` — the 5-step\n  stash\u002Freset\u002Frestore protocol for machine-checking that a test failure\n  is pre-existing on `origin\u002Fmain` (companion to P10; used to satisfy\n  SOUL.md `same-test-name-rule` + `qa-test-failure-dismissal-anti-pattern`).\n- `references\u002Fupstream-prompt-format.md` — the canonical structure of an\n  `UPSTREAM-PROMPT.md` \u002F `RUNBOOK.md` file (what sections to expect, what\n  to extract from each).\n- `references\u002Frefreshed-patch-supersede-pattern.md` — the recurring\n  \"refreshed patch supersedes prior-session PR\" shape (Pitfall P7); how to\n  detect it, what to do, and why this is durable across repos.\n\n**Supported file layout:**\n```\n~\u002F.hermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002F\n├── SKILL.md                          (this file)\n└── references\u002F\n    └── upstream-prompt-format.md\n```\n",{"name":5,"context":55,"version":56,"triggers":57,"description":64,"when_to_use":65,"allowed-tools":66},"inline","1.3.2",[58,59,60,61,62,63],"Handle","apply this patch","open the PR with this","land this upstream","git am this","use the instructions in the attached file","When a user (often via Slack, GitHub, or email) sends a pre-built patch + a\nstructured instructions file (UPSTREAM-PROMPT.md style) and asks you to open\nthe PR — clone the target repo, branch from origin\u002Fmain, apply the patch\nonly after the fresh base\u002Fdrift check below, run the user's listed test\nsuites verbatim, push, and open the PR with the title\u002Fbody the user\nsupplied. Distinct from `always-pr-never-local-edit`\n(which dispatches fix-X work to AO), and from `github-pr-workflow` (general\nPR lifecycle); this is the bounded \"land this patch\" workflow where the\nintent, title, body, and verification gates are pre-specified.\n\nv1.2.0 adds Pitfalls P8 (force-push after origin branch deletion), P9\n(two-tier \"delete X gate\" distinction — workflow gate vs pipeline node\ntype), and P10 (pre-existing test-failure attribution via stash\u002Freset\u002F\nrestore). Verified case #3 (2026-07-21, dark-factory PR #407 skeptic-\ngate deletion + receipt-gate-reviewer follow-up commit).\n\nv1.3.1 adds Pitfall P14 (a verified patch bundle whose base has drifted\nmust be re-derived on current main, not replayed; includes the\ncontent-multiset preservation proof and the draft-PR baseline probe for\ninherited CI failures). Verified case 2026-11-04, jleechan-skills\npr-lifecycle compaction bundle. v1.3.2 documents the manual Step 1\u002FP14-gated\nrecipe as the only supported apply path; the legacy helper does not\nimplement that judgment and is unsupported for this workflow.\n","- User message has an attached `.patch`\u002F`.diff` file AND a text description\n  of where it should land (\"apply this to disk_magician\", \"open a PR on\n  \u003Crepo> with this\", etc.)\n- Slack\u002FGitHub\u002Femail message body is short (\"Handle\", \"apply this\", \"open\n  the PR\") because the *files* are the ask, not the body text\n- User-provided instructions file lists exact test suites and exact PR title\n  + body template (often called UPSTREAM-PROMPT.md, RUNBOOK.md, HANDOFF.md)\n",[67,68,69,70,30,71],"mcp__slack__*","terminal","read_file","write_file","skill_view","main","8144f00ebafc4306264c63239e4b9fa42e48a90e","hermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr",0,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills","https:\u002F\u002Fgithub.com\u002Fjleechanorg","2026-11-14 14:55:35",{"source":9,"skillName":5,"commands":80,"prompt":90,"zipAvailable":91},[81,84,87],{"tool":82,"command":83},"npx","npx skills add jleechanorg\u002Fjleechan-skills --skill apply-supplied-patch-and-open-pr",{"tool":85,"command":86},"bunx","bunx skills add jleechanorg\u002Fjleechan-skills --skill apply-supplied-patch-and-open-pr",{"tool":88,"command":89},"pnpm","pnpm dlx skills add jleechanorg\u002Fjleechan-skills --skill apply-supplied-patch-and-open-pr","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002Fhermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002FSKILL.md",true,[93,99,103,107],{"path":94,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fpre-existing-failure-attribution.md","REFERENCE","参考文档",5078,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002Fhermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002Freferences\u002Fpre-existing-failure-attribution.md",{"path":100,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Frefreshed-patch-supersede-pattern.md",2456,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002Fhermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002Freferences\u002Frefreshed-patch-supersede-pattern.md",{"path":104,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fupstream-prompt-format.md",4509,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002Fhermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002Freferences\u002Fupstream-prompt-format.md",{"path":108,"resourceType":109,"resourceTypeDesc":110,"sizeBytes":111,"sourceHtmlUrl":112},"scripts\u002Fapply_patch_and_open_pr.sh","SCRIPT","脚本",6587,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002Fhermes\u002Fskills\u002Fworkflow\u002Fapply-supplied-patch-and-open-pr\u002Fscripts\u002Fapply_patch_and_open_pr.sh",[114,122,129,136,144,153],{"skillNo":115,"name":116,"nameZh":13,"description":117,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":121},"01M7DRVZXXMGY4G81K5GVF4V20","disk-reclaim-playbook","Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdisk-reclaim-playbook\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":123,"name":124,"nameZh":13,"description":125,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":121},"01M7B63PNTT2TY78RFKHD8SP3X","claudea-bench","Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fclaudea-bench\u002FSKILL.md",[],[],{"skillNo":130,"name":32,"nameZh":13,"description":131,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":135},"01M7622KQJ32AV4K5BXEMVSSEB","Alias for the canonical pr-lifecycle PR workflow skill (\u002Fpr-workflow, \u002Fprw).","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":137,"name":138,"nameZh":13,"description":139,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":143},"01M7432W92AKC4D1TKJ00VCMMT","whisper","OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwhisper\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":145,"name":146,"nameZh":13,"description":147,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":148,"licenseFileUrl":149,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":143},"01M7432T6BN1A9SHB8RBQR5EMP","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":154,"name":155,"nameZh":13,"description":156,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":143},"01M7432NDC7S6C6MX7M6RW8CTT","pr-report","This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, \u002Fpr-report, or wants per-PR summary with delta files\u002Flines. Generates a structured report for one or more open PRs covering purpose, files changed, +\u002F− line counts, \u002Fcode-standards + \u002Fthermo review findings, \u002Fponytail simplification opportunities, file-overlap combination candidates, and \u002Fgreen status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fpr-report\u002FSKILL.md",[],[]]