[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735AX6QB0AB87W8V2P9QA9N":3,"skill-same:01M735AX6QB0AB87W8V2P9QA9N":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":50},"01M735AX6QB0AB87W8V2P9QA9N","sync-pr-branch",null,"Sync PR branch with main.","Morrison-Lab\u002Fai-config","Morrison-Lab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F104235520?v=4","01M734G0451S2G35MN4HFQK7XP","Morrison Lab","01M734G059BYFDFQA8YTPDGPMH",4,"MIT","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fsync-pr-branch\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: sync-pr-branch\ndescription: \"Sync PR branch with main.\"\nuser-invocable: true\nallowed-tools:\n  - Bash\n  - Read\n  - Edit\n  - Write\n---\n\n# sync-pr-branch\n\nKeep a PR branch current with **both** `main` and **its own remote**, so\nreviewers (human and the `@claude` bot) evaluate it against today's `main`, and\nso commits that reached the remote from elsewhere (the `@claude` CI bot,\nanother machine, a teammate, GitHub's web editor) are merged in rather than\ncausing a rejected `git push`. The standing rule: whenever `main` *or* the\nremote branch has moved, **merge it in** — don't wait for a conflict to surface\nor for the user to ask.\n\nSynonyms: `sync`, `resync-branch`, `merge-main` — all route here.\n\n## When this fires\n\n- Before pushing fixes to a PR branch, or before triggering a fresh review.\n- \"sync\", \"sync the branch\", \"resync the branch\", \"update the branch\", \"merge\n  main in\", \"sync with main\", \"reconcile local and remote\", \"my branch and\n  origin have diverged\", \"the branch is behind main\", \"resolve the conflicts\n  with main\".\n- Any time you notice `main` is ahead of the branch, or suspect the remote copy\n  of the branch has moved ahead of (or sideways from) your local copy — e.g.\n  the `@claude` bot pushed a commit, or you worked on this branch from two\n  machines.\n\n## The procedure\n\n1. **Fetch everything from origin** (gets both `origin\u002Fmain` and the\n   remote-tracking copy of the current branch in one shot):\n   ```bash\n   git fetch origin   # FETCH\n   BR=\"$(git branch --show-current)\"\n   ```\n   If `BR` is empty (detached HEAD) or `main`\u002F`master`, stop and tell the user\n   — this skill is for a feature\u002FPR branch, not `main` itself.\n\n2. **Verify the branch's PR is still active before changing or pushing it.**\n   A branch may have been merged or closed while this checkout was stale;\n   pushing it again can recreate a deleted head branch with no PR, or make a\n   merged diff look like new work. Query every PR for the branch, including\n   closed ones:\n   ```bash\n   gh pr list --head \"$BR\" --state all --json number,state,mergedAt,url\n   ```\n   If its PR is `MERGED` (or has a non-null `mergedAt`), stop: do **not** merge\n   or push the old branch. Update the local checkout from `origin\u002Fmain` and\n   start a new branch for any genuinely new work. If no PR exists, or its PR\n   remains open, continue. A `CLOSED` (unmerged) PR is treated like no PR, but\n   flag it to the user before proceeding because the branch may still carry\n   genuine work.\n\n3. **Merge `origin\u002Fmain` into the branch.** A merge commit (not a rebase)\n   matches GitHub's \"Update branch\" button and preserves PR history. **Never**\n   rebase or squash-rewrite a *published* branch unless the user explicitly\n   asks.\n   ```bash\n   git merge origin\u002Fmain   # MERGE_BRANCH\n   ```\n\n4. **Merge `origin\u002F\u003Ccurrent-branch>` into local** — reconcile any commits that\n   reached the remote from elsewhere:\n   ```bash\n   git merge \"origin\u002F$BR\"   # MERGE_BRANCH\n   ```\n   \"Already up to date\" just means local was already ahead of or equal to the\n   remote — fine, carry on.\n\n5. **(As you see fit) re-merge `origin\u002Fmain`.** If step 4 pulled in new\n   commits, those may predate the `main` you merged in step 3. When that's the\n   case, merge `main` once more so the final tree is current with both inputs:\n   ```bash\n   git merge origin\u002Fmain   # MERGE_BRANCH\n   ```\n   Skip this when step 4 was a no-op — it would just be an empty merge.\n\n6. **Resolve any conflicts fully** in the working tree (from any of steps 3–5)\n   — consolidate the best of both sides, don't blind-pick `--ours`\u002F`--theirs`.\n   See the `resolve-conflicts` skill (alias `rc`) for the how-to. Don't push a\n   half-resolved merge.\n\n7. **Run the repo's pre-commit checks before committing a conflict\n   resolution.** Run whatever the current repo's checks are — build, lint,\n   test, spellcheck — and only proceed once they pass. If the repo ships\n   `render` \u002F `lint` \u002F `spell` \u002F `test` skills, use them. A clean,\n   conflict-free merge auto-commits and needs no extra commit.\n\n   \u003Cdetails>\u003Csummary>Example: an R + Quarto package\u003C\u002Fsummary>\n\n   ```bash\n   quarto render \u003Cchapter.qmd> --to html      # each parent chapter touched by the merge\n   Rscript -e 'lintr::lint(\"path\u002Fto\u002Ffile\")'   # each changed .R \u002F .qmd\n   Rscript -e 'spelling::spell_check_package()'\n   ```\n   (Or use that repo's `quarto-preflight` \u002F `render` \u002F `lint` \u002F `spell` skills.)\n   \u003C\u002Fdetails>\n\n8. **Push the branch back to origin:**\n   ```bash\n   git push origin HEAD   # PUSH\n   ```\n   Because step 4 already merged the remote tip, this is a fast-forward of the\n   remote and won't be rejected. If it *is* rejected, the remote moved again\n   between fetch and push — re-run from step 1.\n\n## Notes\n\n- If everything is already up to date (steps 3–5 all no-ops, clean tree), say\n  so and stop — nothing to push.\n- Order matters only loosely: merging `origin\u002Fmain` first (step 3) then the\n  remote branch (step 4) is the canonical flow, but the reverse converges to\n  the same tree. Optional step 5 papers over whichever you did first.\n- This skill is the sync-with-main step of an `ardi` round (step 4). When\n  iterating, run it before each review trigger.\n- Only merge **`origin\u002Fmain`** and **`origin\u002F\u003Cthis branch>`** — never another\n  open PR's branch. Cross-PR changes belong in their own branch.\n","# sync-pr-branch\n\nKeep a PR branch current with **both** `main` and **its own remote**, so\nreviewers (human and the `@claude` bot) evaluate it against today's `main`, and\nso commits that reached the remote from elsewhere (the `@claude` CI bot,\nanother machine, a teammate, GitHub's web editor) are merged in rather than\ncausing a rejected `git push`. The standing rule: whenever `main` *or* the\nremote branch has moved, **merge it in** — don't wait for a conflict to surface\nor for the user to ask.\n\nSynonyms: `sync`, `resync-branch`, `merge-main` — all route here.\n\n## When this fires\n\n- Before pushing fixes to a PR branch, or before triggering a fresh review.\n- \"sync\", \"sync the branch\", \"resync the branch\", \"update the branch\", \"merge\n  main in\", \"sync with main\", \"reconcile local and remote\", \"my branch and\n  origin have diverged\", \"the branch is behind main\", \"resolve the conflicts\n  with main\".\n- Any time you notice `main` is ahead of the branch, or suspect the remote copy\n  of the branch has moved ahead of (or sideways from) your local copy — e.g.\n  the `@claude` bot pushed a commit, or you worked on this branch from two\n  machines.\n\n## The procedure\n\n1. **Fetch everything from origin** (gets both `origin\u002Fmain` and the\n   remote-tracking copy of the current branch in one shot):\n   ```bash\n   git fetch origin   # FETCH\n   BR=\"$(git branch --show-current)\"\n   ```\n   If `BR` is empty (detached HEAD) or `main`\u002F`master`, stop and tell the user\n   — this skill is for a feature\u002FPR branch, not `main` itself.\n\n2. **Verify the branch's PR is still active before changing or pushing it.**\n   A branch may have been merged or closed while this checkout was stale;\n   pushing it again can recreate a deleted head branch with no PR, or make a\n   merged diff look like new work. Query every PR for the branch, including\n   closed ones:\n   ```bash\n   gh pr list --head \"$BR\" --state all --json number,state,mergedAt,url\n   ```\n   If its PR is `MERGED` (or has a non-null `mergedAt`), stop: do **not** merge\n   or push the old branch. Update the local checkout from `origin\u002Fmain` and\n   start a new branch for any genuinely new work. If no PR exists, or its PR\n   remains open, continue. A `CLOSED` (unmerged) PR is treated like no PR, but\n   flag it to the user before proceeding because the branch may still carry\n   genuine work.\n\n3. **Merge `origin\u002Fmain` into the branch.** A merge commit (not a rebase)\n   matches GitHub's \"Update branch\" button and preserves PR history. **Never**\n   rebase or squash-rewrite a *published* branch unless the user explicitly\n   asks.\n   ```bash\n   git merge origin\u002Fmain   # MERGE_BRANCH\n   ```\n\n4. **Merge `origin\u002F\u003Ccurrent-branch>` into local** — reconcile any commits that\n   reached the remote from elsewhere:\n   ```bash\n   git merge \"origin\u002F$BR\"   # MERGE_BRANCH\n   ```\n   \"Already up to date\" just means local was already ahead of or equal to the\n   remote — fine, carry on.\n\n5. **(As you see fit) re-merge `origin\u002Fmain`.** If step 4 pulled in new\n   commits, those may predate the `main` you merged in step 3. When that's the\n   case, merge `main` once more so the final tree is current with both inputs:\n   ```bash\n   git merge origin\u002Fmain   # MERGE_BRANCH\n   ```\n   Skip this when step 4 was a no-op — it would just be an empty merge.\n\n6. **Resolve any conflicts fully** in the working tree (from any of steps 3–5)\n   — consolidate the best of both sides, don't blind-pick `--ours`\u002F`--theirs`.\n   See the `resolve-conflicts` skill (alias `rc`) for the how-to. Don't push a\n   half-resolved merge.\n\n7. **Run the repo's pre-commit checks before committing a conflict\n   resolution.** Run whatever the current repo's checks are — build, lint,\n   test, spellcheck — and only proceed once they pass. If the repo ships\n   `render` \u002F `lint` \u002F `spell` \u002F `test` skills, use them. A clean,\n   conflict-free merge auto-commits and needs no extra commit.\n\n   \u003Cdetails>\u003Csummary>Example: an R + Quarto package\u003C\u002Fsummary>\n\n   ```bash\n   quarto render \u003Cchapter.qmd> --to html      # each parent chapter touched by the merge\n   Rscript -e 'lintr::lint(\"path\u002Fto\u002Ffile\")'   # each changed .R \u002F .qmd\n   Rscript -e 'spelling::spell_check_package()'\n   ```\n   (Or use that repo's `quarto-preflight` \u002F `render` \u002F `lint` \u002F `spell` skills.)\n   \u003C\u002Fdetails>\n\n8. **Push the branch back to origin:**\n   ```bash\n   git push origin HEAD   # PUSH\n   ```\n   Because step 4 already merged the remote tip, this is a fast-forward of the\n   remote and won't be rejected. If it *is* rejected, the remote moved again\n   between fetch and push — re-run from step 1.\n\n## Notes\n\n- If everything is already up to date (steps 3–5 all no-ops, clean tree), say\n  so and stop — nothing to push.\n- Order matters only loosely: merging `origin\u002Fmain` first (step 3) then the\n  remote branch (step 4) is the canonical flow, but the reverse converges to\n  the same tree. Optional step 5 papers over whichever you did first.\n- This skill is the sync-with-main step of an `ardi` round (step 4). When\n  iterating, run it before each review trigger.\n- Only merge **`origin\u002Fmain`** and **`origin\u002F\u003Cthis branch>`** — never another\n  open PR's branch. Cross-PR changes belong in their own branch.\n",{"name":5,"description":7,"allowed-tools":24,"user-invocable":29},[25,26,27,28],"Bash","Read","Edit","Write",true,"main","0f720481f8ce3b3d9fef485f6e230d8b3035748e","skills\u002Fsync-pr-branch",1,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config","https:\u002F\u002Fmorrison-lab.github.io\u002Fai-config\u002F","https:\u002F\u002Fgithub.com\u002FMorrison-Lab","2026-11-15 04:39:15",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":29},[40,43,46],{"tool":41,"command":42},"npx","npx skills add Morrison-Lab\u002Fai-config --skill sync-pr-branch",{"tool":44,"command":45},"bunx","bunx skills add Morrison-Lab\u002Fai-config --skill sync-pr-branch",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Morrison-Lab\u002Fai-config --skill sync-pr-branch","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fsync-pr-branch\u002FSKILL.md",[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M735BVYCGR5VEC65AFDVSNKW","wrap-up","End-of-session verification and UMS.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M735BTH469T1CQ8G2Q9GENCR","workaround-watcher","Watch upstream issue for fix.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fworkaround-watcher\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M735BRKZWFANSQ0GM380B4TD","wn","→ whats-next.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwn\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M735BPE9V830B3B6NGXQ56J6","whats-next","Recommend concrete next step or action.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwhats-next\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M735BMHQ60EAD5B7QAWXC5A0","wait-for-results","Wait for pipeline\u002FCI results.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwait-for-results\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M735BKGZHPN1PEMJ7YBD5VJ8","wai","→ send-notes.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwai\u002FSKILL.md",[],[]]