[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M734Z7ZM37RVE7QENKQ8WK2F":3,"skill-same:01M734Z7ZM37RVE7QENKQ8WK2F":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},"01M734Z7ZM37RVE7QENKQ8WK2F","cascade",null,"Merge base down PR stack.","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\u002Fcascade\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: cascade\ndescription: \"Merge base down PR stack.\"\nuser-invocable: true\nallowed-tools:\n  - Bash\n  - Read\n  - Edit\n  - Write\n---\n\n# cascade\n\nMerge stacked PRs' **base branches into the PRs stacked on top of them** —\nincluding `main` into unstacked PRs —\nso every open branch in a stack stays synced with what's beneath it.\n\n**This is a downward propagation only.**\n\"Cascade\" never means merging the PRs themselves into `main`;\nmerging PRs is a separate, human-gated action (`merge-it`).\n(A bare \"Cascade\" was misread exactly that way on the\n`d-morrison\u002Frme` #1035–#1042 stack, 2026-07-17 —\nthis skill exists to pin the meaning.)\n\n## Procedure\n\n1. **Map the stack.**\n   List open PRs and their base branches\n   (`gh pr list --json number,headRefName,baseRefName,author,assignees`,\n   or `mcp__github__list_pull_requests` in remote sessions).\n   Keep the full list for mapping the stack, then exclude from the action\n   queue every PR that fails `memories\u002Freviewing-prs.md`'s scope test, as\n   `ardia` step 1 does (opened by or assigned to the invoking user,\n   explicitly requested by name, or authored by the GitHub Actions app (`github-actions`)), and\n   report the PRs excluded: every later step pushes to the branch, which\n   that memory forbids on any other PR.\n   A stacked PR whose base PR is out of scope is synced against that base\n   as it stands; the base itself is left to its author.\n   A PR based on `main` is unstacked;\n   a PR based on another PR's head branch is stacked on it.\n   Order the work from the base outward:\n   `main` → first-level branches → branches stacked on those, and so on.\n\n2. **For each branch, in that order.**\n   Set up one isolated worktree for the whole cascade\n   (so the repo's primary checkout is never disturbed),\n   then switch it from branch to branch as you work down the stack:\n\n   ```bash\n   # once, from the repo's primary checkout:\n   git worktree add --detach \u003Cdir> && cd \u003Cdir>\n\n   # then, per branch:\n   git fetch origin \u003Cbranch> \u003Cbase> -q\n   git checkout -B \u003Cbranch> origin\u002F\u003Cbranch>\n   git merge origin\u002F\u003Cbase>\n   ```\n\n   (`checkout -B` inside the worktree resets to the remote tip even when a\n   stale local branch of that name exists; a branch already checked out in\n   another worktree can't be checked out here — reuse that worktree for it\n   instead.)\n\n3. **Resolve squash-stack conflicts to the branch side.**\n   When the base advanced by squash-merging PRs whose commits the branch\n   already carries (the normal stacked-PR lifecycle),\n   the three-way merge sees the same content twice under different SHAs\n   and conflicts on every co-touched file.\n   The branch side already contains the base's content, so:\n\n   ```bash\n   while IFS= read -r -d '' f; do git checkout --ours \"$f\"; done \\\n     \u003C \u003C(git diff --name-only --diff-filter=U -z)\n   git add -A\n   ```\n\n4. **Verify the merge is content-neutral before trusting it.**\n   The merged tree should be byte-identical to the pre-merge branch tree:\n\n   ```bash\n   git diff --cached HEAD --stat   # staged resolution vs pre-merge tip: expect empty\n   # or, after an auto-committed merge:\n   git diff 'HEAD~1' HEAD --stat   # vs first parent: expect empty\n   ```\n\n   An **empty** diff means the reviewed, render-verified tree is unchanged —\n   finalize the merge, noting the verification in the message\n   (the auto-committed case is already final):\n\n   ```bash\n   git commit -m \"Merge \u003Cbase> into \u003Cbranch> (content-neutral sync)\"\n   ```\n\n   Then skip re-running the repo's pre-commit render\u002Flint\u002Ftest gates.\n   A **non-empty** diff means the base carried changes the branch lacks\n   (someone else's PR merged, a hotfix on `main`):\n   stop treating it as mechanical —\n   review the delta and run the repo's full pre-commit checks before pushing.\n\n5. **Push, minding CI and the remote branch.**\n   Each push triggers a fresh review\u002Fbuild round on that PR,\n   and review\u002Fpreview workflows commonly run under\n   `concurrency: cancel-in-progress` —\n   so batch each branch's cascade into one push,\n   and don't push a branch again while its round is in flight\n   (see `sync-with-main`'s and gha's cancellation-race notes).\n   Step 2's `checkout -B \u003Cbranch> origin\u002F\u003Cbranch>` starts from the\n   just-fetched remote tip, so unlike `sync-pr-branch`'s local-branch flow\n   there's usually nothing to reconcile —\n   but `origin\u002F\u003Cbranch>` can still move in the window before the push\n   (an `@claude` bot commit, another session).\n   If the push is rejected as non-fast-forward,\n   `git fetch origin \u003Cbranch>` and `git merge origin\u002F\u003Cbranch>`,\n   then push again — never force-push.\n\n6. **Repeat down the stack** —\n   after a first-level branch is synced and pushed,\n   the branches stacked on it merge *it* (not `main`) in the same way.\n\n## Relationship to other skills\n\n- **`sync-pr-branch` \u002F `merge-main`** — the single-branch case\n  (one PR vs `main` and its own remote);\n  `cascade` is the whole-stack generalization,\n  and defers to that skill's pre-commit-check guidance\n  whenever a merge is not content-neutral.\n- **`stack-prs`** — creates stacked PRs;\n  `cascade` maintains them as their bases move.\n- **`resolve-conflicts`** — general conflict-resolution mechanics;\n  step 3 here is the squash-stack special case where\n  \"take the branch side\" is provably correct\n  (verified by step 4's empty-diff check, not assumed).\n- **`merge-it`** — merging a PR into `main` stays human-gated there;\n  `cascade` never does it.\n\n## Anti-patterns\n\n- ❌ Reading \"cascade\" as \"merge the stack's PRs into `main`\" —\n  the direction is down the stack, not into it.\n- ❌ Taking `--ours` on conflicts without step 4's empty-diff verification —\n  a non-empty result means the base had content the branch lacks,\n  and blind `--ours` would silently revert it on the next merge.\n- ❌ Cascading a branch before its own base has been cascaded —\n  order matters; work from `main` outward.\n- ❌ Re-rendering\u002Fre-testing after a verified content-neutral merge —\n  the tree is byte-identical to the already-verified state;\n  the checks would re-prove what the empty diff already proved.\n","# cascade\n\nMerge stacked PRs' **base branches into the PRs stacked on top of them** —\nincluding `main` into unstacked PRs —\nso every open branch in a stack stays synced with what's beneath it.\n\n**This is a downward propagation only.**\n\"Cascade\" never means merging the PRs themselves into `main`;\nmerging PRs is a separate, human-gated action (`merge-it`).\n(A bare \"Cascade\" was misread exactly that way on the\n`d-morrison\u002Frme` #1035–#1042 stack, 2026-07-17 —\nthis skill exists to pin the meaning.)\n\n## Procedure\n\n1. **Map the stack.**\n   List open PRs and their base branches\n   (`gh pr list --json number,headRefName,baseRefName,author,assignees`,\n   or `mcp__github__list_pull_requests` in remote sessions).\n   Keep the full list for mapping the stack, then exclude from the action\n   queue every PR that fails `memories\u002Freviewing-prs.md`'s scope test, as\n   `ardia` step 1 does (opened by or assigned to the invoking user,\n   explicitly requested by name, or authored by the GitHub Actions app (`github-actions`)), and\n   report the PRs excluded: every later step pushes to the branch, which\n   that memory forbids on any other PR.\n   A stacked PR whose base PR is out of scope is synced against that base\n   as it stands; the base itself is left to its author.\n   A PR based on `main` is unstacked;\n   a PR based on another PR's head branch is stacked on it.\n   Order the work from the base outward:\n   `main` → first-level branches → branches stacked on those, and so on.\n\n2. **For each branch, in that order.**\n   Set up one isolated worktree for the whole cascade\n   (so the repo's primary checkout is never disturbed),\n   then switch it from branch to branch as you work down the stack:\n\n   ```bash\n   # once, from the repo's primary checkout:\n   git worktree add --detach \u003Cdir> && cd \u003Cdir>\n\n   # then, per branch:\n   git fetch origin \u003Cbranch> \u003Cbase> -q\n   git checkout -B \u003Cbranch> origin\u002F\u003Cbranch>\n   git merge origin\u002F\u003Cbase>\n   ```\n\n   (`checkout -B` inside the worktree resets to the remote tip even when a\n   stale local branch of that name exists; a branch already checked out in\n   another worktree can't be checked out here — reuse that worktree for it\n   instead.)\n\n3. **Resolve squash-stack conflicts to the branch side.**\n   When the base advanced by squash-merging PRs whose commits the branch\n   already carries (the normal stacked-PR lifecycle),\n   the three-way merge sees the same content twice under different SHAs\n   and conflicts on every co-touched file.\n   The branch side already contains the base's content, so:\n\n   ```bash\n   while IFS= read -r -d '' f; do git checkout --ours \"$f\"; done \\\n     \u003C \u003C(git diff --name-only --diff-filter=U -z)\n   git add -A\n   ```\n\n4. **Verify the merge is content-neutral before trusting it.**\n   The merged tree should be byte-identical to the pre-merge branch tree:\n\n   ```bash\n   git diff --cached HEAD --stat   # staged resolution vs pre-merge tip: expect empty\n   # or, after an auto-committed merge:\n   git diff 'HEAD~1' HEAD --stat   # vs first parent: expect empty\n   ```\n\n   An **empty** diff means the reviewed, render-verified tree is unchanged —\n   finalize the merge, noting the verification in the message\n   (the auto-committed case is already final):\n\n   ```bash\n   git commit -m \"Merge \u003Cbase> into \u003Cbranch> (content-neutral sync)\"\n   ```\n\n   Then skip re-running the repo's pre-commit render\u002Flint\u002Ftest gates.\n   A **non-empty** diff means the base carried changes the branch lacks\n   (someone else's PR merged, a hotfix on `main`):\n   stop treating it as mechanical —\n   review the delta and run the repo's full pre-commit checks before pushing.\n\n5. **Push, minding CI and the remote branch.**\n   Each push triggers a fresh review\u002Fbuild round on that PR,\n   and review\u002Fpreview workflows commonly run under\n   `concurrency: cancel-in-progress` —\n   so batch each branch's cascade into one push,\n   and don't push a branch again while its round is in flight\n   (see `sync-with-main`'s and gha's cancellation-race notes).\n   Step 2's `checkout -B \u003Cbranch> origin\u002F\u003Cbranch>` starts from the\n   just-fetched remote tip, so unlike `sync-pr-branch`'s local-branch flow\n   there's usually nothing to reconcile —\n   but `origin\u002F\u003Cbranch>` can still move in the window before the push\n   (an `@claude` bot commit, another session).\n   If the push is rejected as non-fast-forward,\n   `git fetch origin \u003Cbranch>` and `git merge origin\u002F\u003Cbranch>`,\n   then push again — never force-push.\n\n6. **Repeat down the stack** —\n   after a first-level branch is synced and pushed,\n   the branches stacked on it merge *it* (not `main`) in the same way.\n\n## Relationship to other skills\n\n- **`sync-pr-branch` \u002F `merge-main`** — the single-branch case\n  (one PR vs `main` and its own remote);\n  `cascade` is the whole-stack generalization,\n  and defers to that skill's pre-commit-check guidance\n  whenever a merge is not content-neutral.\n- **`stack-prs`** — creates stacked PRs;\n  `cascade` maintains them as their bases move.\n- **`resolve-conflicts`** — general conflict-resolution mechanics;\n  step 3 here is the squash-stack special case where\n  \"take the branch side\" is provably correct\n  (verified by step 4's empty-diff check, not assumed).\n- **`merge-it`** — merging a PR into `main` stays human-gated there;\n  `cascade` never does it.\n\n## Anti-patterns\n\n- ❌ Reading \"cascade\" as \"merge the stack's PRs into `main`\" —\n  the direction is down the stack, not into it.\n- ❌ Taking `--ours` on conflicts without step 4's empty-diff verification —\n  a non-empty result means the base had content the branch lacks,\n  and blind `--ours` would silently revert it on the next merge.\n- ❌ Cascading a branch before its own base has been cascaded —\n  order matters; work from `main` outward.\n- ❌ Re-rendering\u002Fre-testing after a verified content-neutral merge —\n  the tree is byte-identical to the already-verified state;\n  the checks would re-prove what the empty diff already proved.\n",{"name":5,"description":7,"allowed-tools":24,"user-invocable":29},[25,26,27,28],"Bash","Read","Edit","Write",true,"main","0f720481f8ce3b3d9fef485f6e230d8b3035748e","skills\u002Fcascade",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 cascade",{"tool":44,"command":45},"bunx","bunx skills add Morrison-Lab\u002Fai-config --skill cascade",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Morrison-Lab\u002Fai-config --skill cascade","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fcascade\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",[],[]]