{"id":"a3746e4f-e096-4b70-9274-89fc236f94af","entityType":"agent","slug":"clawhub-athola-nm-sanctum-stack-rebase","name":"stack-rebase","canonicalUrl":"https://www.xpersona.co/agent/clawhub-athola-nm-sanctum-stack-rebase","canonicalPath":"/agent/clawhub-athola-nm-sanctum-stack-rebase","generatedAt":"2026-10-12T02:17:49.203Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T18:41:05.368Z","emptyReason":null},"description":"Cascades a rebase through an entire PR stack after a base PR merges or upstream changes Skill: stack-rebase Owner: athola Summary: Cascades a rebase through an entire PR stack after a base PR merges or upstream changes Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:21:04.010Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:41:05.691Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:57:53.571Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:05:42.087Z | user Release v1.9.14 v1.9.13 | 2026-06-27","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-sanctum-stack-rebase","sourceUrl":"https://clawhub.ai/athola/nm-sanctum-stack-rebase","homepage":"https://clawhub.ai/athola/skills/nm-sanctum-stack-rebase","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/athola/nm-sanctum-stack-rebase","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/athola/skills/nm-sanctum-stack-rebase","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Cascades a rebase through an entire PR stack after a base PR merges or upstream changes Skill: stack-rebase Owner: athola Summary: Cascades a rebase through an "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T18:41:05.368Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T18:41:05.368Z","emptyReason":null},"stars":null,"forks":null,"downloads":1008,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"1.9.19","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T18:41:05.355Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T18:41:05.368Z","lastCrawledAt":"2026-10-11T18:41:05.355Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T18:41:05.355Z","lastVerifiedAt":null,"highlights":[{"version":"1.9.19","createdAt":"2026-08-26T13:21:04.010Z","changelog":"Release v1.9.19","fileCount":3,"zipByteSize":4232},{"version":"1.9.17","createdAt":"2026-07-30T05:41:05.691Z","changelog":"Release v1.9.17","fileCount":3,"zipByteSize":4176},{"version":"1.9.16","createdAt":"2026-07-14T19:57:53.571Z","changelog":"Release v1.9.16","fileCount":3,"zipByteSize":4054},{"version":"1.9.14","createdAt":"2026-06-30T18:05:42.087Z","changelog":"Release v1.9.14","fileCount":3,"zipByteSize":4300},{"version":"1.9.13","createdAt":"2026-06-27T16:23:33.278Z","changelog":"Release v1.9.13","fileCount":3,"zipByteSize":4151},{"version":"1.9.12","createdAt":"2026-06-19T03:19:01.158Z","changelog":"Release v1.9.12","fileCount":3,"zipByteSize":3984},{"version":"1.0.0","createdAt":"2026-06-18T15:21:05.376Z","changelog":"- Initial release of the stack-rebase skill. - Enables cascading rebases of entire PR stacks after a base PR merges or upstream branch changes. - Documents all steps: fetching remote state, identifying triggers, running cascading rebase, conflict resolution, force-pushing, and updating pull requests. - Includes guidance for both git and jj workflows with `--update-refs` support. - Outlines required progress tracking and best practices to prevent conflicts in stacked PR workflows.","fileCount":3,"zipByteSize":4121}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-sanctum-stack-rebase","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-12T02:17:49.201Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-sanctum-stack-rebase/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T18:41:05.368Z","emptyReason":null},"readme":"Skill: stack-rebase\n\nOwner: athola\n\nSummary: Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\n\nTags: latest:1.9.19\n\nVersion history:\n\nv1.9.19 | 2026-08-26T13:21:04.010Z | user\n\nRelease v1.9.19\n\nv1.9.17 | 2026-07-30T05:41:05.691Z | user\n\nRelease v1.9.17\n\nv1.9.16 | 2026-07-14T19:57:53.571Z | user\n\nRelease v1.9.16\n\nv1.9.14 | 2026-06-30T18:05:42.087Z | user\n\nRelease v1.9.14\n\nv1.9.13 | 2026-06-27T16:23:33.278Z | user\n\nRelease v1.9.13\n\nv1.9.12 | 2026-06-19T03:19:01.158Z | user\n\nRelease v1.9.12\n\nv1.0.0 | 2026-06-18T15:21:05.376Z | auto\n\n- Initial release of the stack-rebase skill.\n- Enables cascading rebases of entire PR stacks after a base PR merges or upstream branch changes.\n- Documents all steps: fetching remote state, identifying triggers, running cascading rebase, conflict resolution, force-pushing, and updating pull requests.\n- Includes guidance for both git and jj workflows with `--update-refs` support.\n- Outlines required progress tracking and best practices to prevent conflicts in stacked PR workflows.\n\nArchive index:\n\nArchive v1.9.19: 3 files, 4232 bytes\n\nFiles: skill-card.md (2145b), SKILL.md (6125b), _meta.json (143b)\n\nFile v1.9.19:SKILL.md\n\n---\nname: stack-rebase\ndescription: |\n  Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\nversion: 1.9.8\ntriggers:\n  - git\n  - stacked-diffs\n  - rebase\n  - pr\n  - cascade\n  - a stack needs to incorporate new base branch commits\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\u2699\\ufe0f\", \"requires\": {\"config\": [\"night-market.sanctum:stack-create\", \"night-market.sanctum:stack-push\", \"night-market.sanctum:git-workspace-review\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Stack Rebase\n\nCascade a rebase through an entire PR stack after a base\nPR merges or the upstream base branch changes.\n\n## When to Use\n\nRun `stack-rebase` in any of these situations:\n\n- The first PR in the stack merged into `master`; the\n  second PR now needs to target `master` directly\n- `master` has moved forward and stack branches need to\n  incorporate the new commits\n- A mid-stack PR was revised and descendants need to\n  pick up the change\n\n## Prerequisites\n\n- All slice branches exist locally (`git branch --list`)\n- Remote is up to date (`git fetch origin`)\n- Working tree is clean (`git status`)\n- Git 2.38+ for `--update-refs`\n\n## Required Progress Tracking\n\nCreate `TodoWrite` items before starting:\n\n1. `stack-rebase:fetch-complete`\n2. `stack-rebase:trigger-identified`\n3. `stack-rebase:rebase-complete`\n4. `stack-rebase:conflicts-resolved`\n5. `stack-rebase:force-pushed`\n6. `stack-rebase:prs-updated`\n\n## Step 1: Fetch Remote State (`fetch-complete`)\n\n```bash\ngit fetch origin\n```\n\nIf the merged PR's branch still exists on remote, note\nthat GitHub retains the branch after merge.\nThe merged branch itself is no longer a valid stack base.\n\n## Step 2: Identify the Trigger (`trigger-identified`)\n\nDetermine what changed:\n\n**Case A — Base PR merged into master:**\nThe slice that was the old \"root\" is now in `master`.\nAll remaining slices need to rebase onto `master`.\n\n```bash\n# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\"\n```\n\n**Case B — Master moved forward:**\nSlices are behind `master` but the stack topology is\nunchanged.\nRebase the root slice onto `master`; `--update-refs`\ncarries all descendants.\n\n**Case C — Mid-stack revision:**\nA slice was amended.\nAll descendant slices need to rebase onto it.\n\n## Step 3: Run the Cascading Rebase (`rebase-complete`)\n\n### Case A and B: Rebase root slice onto master\n\n```bash\nSTACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs origin/${BASE}\n```\n\n`--update-refs` scans the reflog and updates every local\nbranch ref that points to a commit being rebased.\nAll slice branches in the stack are rewritten in one pass.\n\n### Case C: Rebase from a mid-stack slice\n\n```bash\n# Check out the first slice BELOW the amended one\nCHILD_SLICE=stack/my-feature/add-api  # example\n\ngit checkout \"${CHILD_SLICE}\"\ngit rebase --update-refs stack/my-feature/add-schema\n```\n\n### jj Accelerator (if available)\n\n```bash\n# jj rebases all descendants automatically on any change\n# To rebase the whole stack onto master:\njj rebase -d master \\\n  -r \"ancestors(${STACK}/add-ui) & !ancestors(master)\"\n```\n\n## Step 4: Resolve Conflicts (`conflicts-resolved`)\n\nIf the rebase pauses with conflicts:\n\n```bash\n# See which file conflicts\ngit status\n\n# After resolving each file:\ngit add <resolved-file>\ngit rebase --continue\n```\n\nRepeat until the rebase completes.\nIf a conflict is too complex, abort and investigate:\n\n```bash\ngit rebase --abort\n```\n\nThen examine the diff between the conflicting commits\nbefore retrying.\n\n## Step 5: Force-Push Updated Branches (`force-pushed`)\n\nAfter a successful rebase, push all slice branches.\nUse `--force-with-lease` to guard against remote changes\nmade since the last fetch:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  git push --force-with-lease origin \"${branch}\"\n  echo \"force-pushed: ${branch}\"\ndone\n```\n\nNever use `--force` (drops the remote-change guard).\n\n### jj Accelerator (if available)\n\n```bash\njj git push --all --allow-new\n```\n\n## Step 6: Update PR Bases (`prs-updated`)\n\n**Case A only**: After the root slice merged and you\nrebased remaining slices onto `master`, the next PR in\nthe stack now targets the wrong base.\nUpdate its base via the GitHub CLI:\n\n```bash\nNEXT_PR=456   # PR number of the new stack root\n\ngh pr edit \"${NEXT_PR}\" --base master\n```\n\nFor PRs further down the stack, their bases remain the\nprevious slice branch, which `--update-refs` already\nrewrote; no base edit is needed for them.\n\nVerify the full stack is consistent:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  pr_num=$(gh pr list --head \"${branch}\" \\\n    --json number,baseRefName \\\n    --jq '.[0] | \"#\\(.number) base=\\(.baseRefName)\"')\n  echo \"${branch}: ${pr_num}\"\ndone\n```\n\n## Conflict Prevention Tips\n\n- Keep slices small: the smaller each PR, the less surface\n  area for conflicts during rebase\n- Rebase frequently: rebasing onto a freshly merged master\n  once a day is cheaper than resolving a week of drift\n- Avoid amending commits that are already under review;\n  prefer a fixup commit and squash at merge time\n\n## Notes\n\n- `git rebase --update-refs` requires Git 2.38+; confirm\n  with `git version` before running\n- If `--update-refs` is unavailable, manually check out\n  and rebase each slice branch in order from root to tip\n- After force-pushing, GitHub automatically marks PR\n  reviews as stale; remind reviewers to re-approve\n- The `stack-push` skill documents how to re-post the\n  stack summary comment after a rebase changes PR SHAs\n\nFile v1.9.19:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-stack-rebase\",\n  \"version\": \"1.9.19\",\n  \"publishedAt\": 1787750464010\n}\n\nFile v1.9.19:skill-card.md\n\n## Description:\n\nCascades a rebase through an entire PR stack after a base PR merges or upstream changes.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[athola](https://clawhub.ai/user/athola)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to update stacked pull request branches after a base PR merges, the upstream base branch advances, or a mid-stack slice is revised.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can rewrite several local and remote stack branches and edit pull request bases.\n\nMitigation: Fetch first, verify the stack pattern, list every branch and PR that will be affected, and use force-with-lease rather than force pushing.\n\nRisk: History rewrites on shared or protected branches can disrupt reviewers or collaborators.\n\nMitigation: Confirm no one else has pushed to the affected branches and avoid shared or protected branches unless the team has explicitly agreed to the rewrite.\n\nRisk: Broad git, rebase, and PR triggers may activate the workflow in repositories where a stacked-PR rebase is not intended.\n\nMitigation: Confirm the current repository, clean working tree, Git version, target base, and stack topology before running any rebase or push command.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-stack-rebase)\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, shell commands, configuration]\n\n**Output Format:** [Markdown with inline bash code blocks]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes ordered rebase, conflict-resolution, force-push, and pull-request-base update steps.]\n\n## Skill Version(s):\n\n1.9.19 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.9.17: 3 files, 4176 bytes\n\nFiles: skill-card.md (2097b), SKILL.md (6125b), _meta.json (143b)\n\nFile v1.9.17:SKILL.md\n\n---\nname: stack-rebase\ndescription: |\n  Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\nversion: 1.9.8\ntriggers:\n  - git\n  - stacked-diffs\n  - rebase\n  - pr\n  - cascade\n  - a stack needs to incorporate new base branch commits\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\u2699\\ufe0f\", \"requires\": {\"config\": [\"night-market.sanctum:stack-create\", \"night-market.sanctum:stack-push\", \"night-market.sanctum:git-workspace-review\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Stack Rebase\n\nCascade a rebase through an entire PR stack after a base\nPR merges or the upstream base branch changes.\n\n## When to Use\n\nRun `stack-rebase` in any of these situations:\n\n- The first PR in the stack merged into `master`; the\n  second PR now needs to target `master` directly\n- `master` has moved forward and stack branches need to\n  incorporate the new commits\n- A mid-stack PR was revised and descendants need to\n  pick up the change\n\n## Prerequisites\n\n- All slice branches exist locally (`git branch --list`)\n- Remote is up to date (`git fetch origin`)\n- Working tree is clean (`git status`)\n- Git 2.38+ for `--update-refs`\n\n## Required Progress Tracking\n\nCreate `TodoWrite` items before starting:\n\n1. `stack-rebase:fetch-complete`\n2. `stack-rebase:trigger-identified`\n3. `stack-rebase:rebase-complete`\n4. `stack-rebase:conflicts-resolved`\n5. `stack-rebase:force-pushed`\n6. `stack-rebase:prs-updated`\n\n## Step 1: Fetch Remote State (`fetch-complete`)\n\n```bash\ngit fetch origin\n```\n\nIf the merged PR's branch still exists on remote, note\nthat GitHub retains the branch after merge.\nThe merged branch itself is no longer a valid stack base.\n\n## Step 2: Identify the Trigger (`trigger-identified`)\n\nDetermine what changed:\n\n**Case A — Base PR merged into master:**\nThe slice that was the old \"root\" is now in `master`.\nAll remaining slices need to rebase onto `master`.\n\n```bash\n# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\"\n```\n\n**Case B — Master moved forward:**\nSlices are behind `master` but the stack topology is\nunchanged.\nRebase the root slice onto `master`; `--update-refs`\ncarries all descendants.\n\n**Case C — Mid-stack revision:**\nA slice was amended.\nAll descendant slices need to rebase onto it.\n\n## Step 3: Run the Cascading Rebase (`rebase-complete`)\n\n### Case A and B: Rebase root slice onto master\n\n```bash\nSTACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs origin/${BASE}\n```\n\n`--update-refs` scans the reflog and updates every local\nbranch ref that points to a commit being rebased.\nAll slice branches in the stack are rewritten in one pass.\n\n### Case C: Rebase from a mid-stack slice\n\n```bash\n# Check out the first slice BELOW the amended one\nCHILD_SLICE=stack/my-feature/add-api  # example\n\ngit checkout \"${CHILD_SLICE}\"\ngit rebase --update-refs stack/my-feature/add-schema\n```\n\n### jj Accelerator (if available)\n\n```bash\n# jj rebases all descendants automatically on any change\n# To rebase the whole stack onto master:\njj rebase -d master \\\n  -r \"ancestors(${STACK}/add-ui) & !ancestors(master)\"\n```\n\n## Step 4: Resolve Conflicts (`conflicts-resolved`)\n\nIf the rebase pauses with conflicts:\n\n```bash\n# See which file conflicts\ngit status\n\n# After resolving each file:\ngit add <resolved-file>\ngit rebase --continue\n```\n\nRepeat until the rebase completes.\nIf a conflict is too complex, abort and investigate:\n\n```bash\ngit rebase --abort\n```\n\nThen examine the diff between the conflicting commits\nbefore retrying.\n\n## Step 5: Force-Push Updated Branches (`force-pushed`)\n\nAfter a successful rebase, push all slice branches.\nUse `--force-with-lease` to guard against remote changes\nmade since the last fetch:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  git push --force-with-lease origin \"${branch}\"\n  echo \"force-pushed: ${branch}\"\ndone\n```\n\nNever use `--force` (drops the remote-change guard).\n\n### jj Accelerator (if available)\n\n```bash\njj git push --all --allow-new\n```\n\n## Step 6: Update PR Bases (`prs-updated`)\n\n**Case A only**: After the root slice merged and you\nrebased remaining slices onto `master`, the next PR in\nthe stack now targets the wrong base.\nUpdate its base via the GitHub CLI:\n\n```bash\nNEXT_PR=456   # PR number of the new stack root\n\ngh pr edit \"${NEXT_PR}\" --base master\n```\n\nFor PRs further down the stack, their bases remain the\nprevious slice branch, which `--update-refs` already\nrewrote; no base edit is needed for them.\n\nVerify the full stack is consistent:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  pr_num=$(gh pr list --head \"${branch}\" \\\n    --json number,baseRefName \\\n    --jq '.[0] | \"#\\(.number) base=\\(.baseRefName)\"')\n  echo \"${branch}: ${pr_num}\"\ndone\n```\n\n## Conflict Prevention Tips\n\n- Keep slices small: the smaller each PR, the less surface\n  area for conflicts during rebase\n- Rebase frequently: rebasing onto a freshly merged master\n  once a day is cheaper than resolving a week of drift\n- Avoid amending commits that are already under review;\n  prefer a fixup commit and squash at merge time\n\n## Notes\n\n- `git rebase --update-refs` requires Git 2.38+; confirm\n  with `git version` before running\n- If `--update-refs` is unavailable, manually check out\n  and rebase each slice branch in order from root to tip\n- After force-pushing, GitHub automatically marks PR\n  reviews as stale; remind reviewers to re-approve\n- The `stack-push` skill documents how to re-post the\n  stack summary comment after a rebase changes PR SHAs\n\nFile v1.9.17:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-stack-rebase\",\n  \"version\": \"1.9.17\",\n  \"publishedAt\": 1785390065691\n}\n\nFile v1.9.17:skill-card.md\n\n## Description: <br>\nCascades a rebase through an entire PR stack after a base PR merges or upstream changes. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to update stacked pull request branches after a base branch changes, a root PR merges, or a mid-stack slice is revised. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Broad git and pull-request triggers may route ordinary repository requests into a stacked-branch rebase workflow. <br>\nMitigation: Use the skill only when an agent-assisted stacked-PR rebase is intended, and confirm the target stack, base branch, current repository, and remote state before proceeding. <br>\nRisk: The workflow can rewrite branch history, force-push branches, and edit pull request bases. <br>\nMitigation: Review every `git push --force-with-lease`, `jj git push --all --allow-new`, and `gh pr edit` action before execution. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-stack-rebase) <br>\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n- [Publisher profile](https://clawhub.ai/user/athola) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, guidance] <br>\n**Output Format:** [Markdown guidance with inline bash commands and progress checklist items] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Guides Git, jj, and GitHub CLI actions for rebasing and force-pushing stacked branches.] <br>\n\n## Skill Version(s): <br>\n1.9.17 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.16: 3 files, 4054 bytes\n\nFiles: skill-card.md (1807b), SKILL.md (6125b), _meta.json (143b)\n\nFile v1.9.16:SKILL.md\n\n---\nname: stack-rebase\ndescription: |\n  Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\nversion: 1.9.8\ntriggers:\n  - git\n  - stacked-diffs\n  - rebase\n  - pr\n  - cascade\n  - a stack needs to incorporate new base branch commits\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\u2699\\ufe0f\", \"requires\": {\"config\": [\"night-market.sanctum:stack-create\", \"night-market.sanctum:stack-push\", \"night-market.sanctum:git-workspace-review\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Stack Rebase\n\nCascade a rebase through an entire PR stack after a base\nPR merges or the upstream base branch changes.\n\n## When to Use\n\nRun `stack-rebase` in any of these situations:\n\n- The first PR in the stack merged into `master`; the\n  second PR now needs to target `master` directly\n- `master` has moved forward and stack branches need to\n  incorporate the new commits\n- A mid-stack PR was revised and descendants need to\n  pick up the change\n\n## Prerequisites\n\n- All slice branches exist locally (`git branch --list`)\n- Remote is up to date (`git fetch origin`)\n- Working tree is clean (`git status`)\n- Git 2.38+ for `--update-refs`\n\n## Required Progress Tracking\n\nCreate `TodoWrite` items before starting:\n\n1. `stack-rebase:fetch-complete`\n2. `stack-rebase:trigger-identified`\n3. `stack-rebase:rebase-complete`\n4. `stack-rebase:conflicts-resolved`\n5. `stack-rebase:force-pushed`\n6. `stack-rebase:prs-updated`\n\n## Step 1: Fetch Remote State (`fetch-complete`)\n\n```bash\ngit fetch origin\n```\n\nIf the merged PR's branch still exists on remote, note\nthat GitHub retains the branch after merge.\nThe merged branch itself is no longer a valid stack base.\n\n## Step 2: Identify the Trigger (`trigger-identified`)\n\nDetermine what changed:\n\n**Case A — Base PR merged into master:**\nThe slice that was the old \"root\" is now in `master`.\nAll remaining slices need to rebase onto `master`.\n\n```bash\n# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\"\n```\n\n**Case B — Master moved forward:**\nSlices are behind `master` but the stack topology is\nunchanged.\nRebase the root slice onto `master`; `--update-refs`\ncarries all descendants.\n\n**Case C — Mid-stack revision:**\nA slice was amended.\nAll descendant slices need to rebase onto it.\n\n## Step 3: Run the Cascading Rebase (`rebase-complete`)\n\n### Case A and B: Rebase root slice onto master\n\n```bash\nSTACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs origin/${BASE}\n```\n\n`--update-refs` scans the reflog and updates every local\nbranch ref that points to a commit being rebased.\nAll slice branches in the stack are rewritten in one pass.\n\n### Case C: Rebase from a mid-stack slice\n\n```bash\n# Check out the first slice BELOW the amended one\nCHILD_SLICE=stack/my-feature/add-api  # example\n\ngit checkout \"${CHILD_SLICE}\"\ngit rebase --update-refs stack/my-feature/add-schema\n```\n\n### jj Accelerator (if available)\n\n```bash\n# jj rebases all descendants automatically on any change\n# To rebase the whole stack onto master:\njj rebase -d master \\\n  -r \"ancestors(${STACK}/add-ui) & !ancestors(master)\"\n```\n\n## Step 4: Resolve Conflicts (`conflicts-resolved`)\n\nIf the rebase pauses with conflicts:\n\n```bash\n# See which file conflicts\ngit status\n\n# After resolving each file:\ngit add <resolved-file>\ngit rebase --continue\n```\n\nRepeat until the rebase completes.\nIf a conflict is too complex, abort and investigate:\n\n```bash\ngit rebase --abort\n```\n\nThen examine the diff between the conflicting commits\nbefore retrying.\n\n## Step 5: Force-Push Updated Branches (`force-pushed`)\n\nAfter a successful rebase, push all slice branches.\nUse `--force-with-lease` to guard against remote changes\nmade since the last fetch:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  git push --force-with-lease origin \"${branch}\"\n  echo \"force-pushed: ${branch}\"\ndone\n```\n\nNever use `--force` (drops the remote-change guard).\n\n### jj Accelerator (if available)\n\n```bash\njj git push --all --allow-new\n```\n\n## Step 6: Update PR Bases (`prs-updated`)\n\n**Case A only**: After the root slice merged and you\nrebased remaining slices onto `master`, the next PR in\nthe stack now targets the wrong base.\nUpdate its base via the GitHub CLI:\n\n```bash\nNEXT_PR=456   # PR number of the new stack root\n\ngh pr edit \"${NEXT_PR}\" --base master\n```\n\nFor PRs further down the stack, their bases remain the\nprevious slice branch, which `--update-refs` already\nrewrote; no base edit is needed for them.\n\nVerify the full stack is consistent:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  pr_num=$(gh pr list --head \"${branch}\" \\\n    --json number,baseRefName \\\n    --jq '.[0] | \"#\\(.number) base=\\(.baseRefName)\"')\n  echo \"${branch}: ${pr_num}\"\ndone\n```\n\n## Conflict Prevention Tips\n\n- Keep slices small: the smaller each PR, the less surface\n  area for conflicts during rebase\n- Rebase frequently: rebasing onto a freshly merged master\n  once a day is cheaper than resolving a week of drift\n- Avoid amending commits that are already under review;\n  prefer a fixup commit and squash at merge time\n\n## Notes\n\n- `git rebase --update-refs` requires Git 2.38+; confirm\n  with `git version` before running\n- If `--update-refs` is unavailable, manually check out\n  and rebase each slice branch in order from root to tip\n- After force-pushing, GitHub automatically marks PR\n  reviews as stale; remind reviewers to re-approve\n- The `stack-push` skill documents how to re-post the\n  stack summary comment after a rebase changes PR SHAs\n\nFile v1.9.16:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-stack-rebase\",\n  \"version\": \"1.9.16\",\n  \"publishedAt\": 1784059073571\n}\n\nFile v1.9.16:skill-card.md\n\n## Description: <br>\nCascades a rebase through an entire PR stack after a base PR merges or upstream changes. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers maintaining stacked pull requests use this skill to rebase local slice branches after base branch, root PR, or mid-stack changes and to update PR bases when needed. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Force-pushing rebased stack branches can rewrite shared branch history or affect branches outside the intended stack. <br>\nMitigation: Fetch first, confirm the branch pattern matches only the intended stack, verify collaborators are not depending on old branch history, and use force-with-lease safeguards. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-stack-rebase) <br>\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Includes git rebase, force-push, and PR base update guidance that should be reviewed before execution.] <br>\n\n## Skill Version(s): <br>\n1.9.16 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.14: 3 files, 4300 bytes\n\nFiles: skill-card.md (2403b), SKILL.md (6125b), _meta.json (143b)\n\nFile v1.9.14:SKILL.md\n\n---\nname: stack-rebase\ndescription: |\n  Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\nversion: 1.9.8\ntriggers:\n  - git\n  - stacked-diffs\n  - rebase\n  - pr\n  - cascade\n  - a stack needs to incorporate new base branch commits\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\u2699\\ufe0f\", \"requires\": {\"config\": [\"night-market.sanctum:stack-create\", \"night-market.sanctum:stack-push\", \"night-market.sanctum:git-workspace-review\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Stack Rebase\n\nCascade a rebase through an entire PR stack after a base\nPR merges or the upstream base branch changes.\n\n## When to Use\n\nRun `stack-rebase` in any of these situations:\n\n- The first PR in the stack merged into `master`; the\n  second PR now needs to target `master` directly\n- `master` has moved forward and stack branches need to\n  incorporate the new commits\n- A mid-stack PR was revised and descendants need to\n  pick up the change\n\n## Prerequisites\n\n- All slice branches exist locally (`git branch --list`)\n- Remote is up to date (`git fetch origin`)\n- Working tree is clean (`git status`)\n- Git 2.38+ for `--update-refs`\n\n## Required Progress Tracking\n\nCreate `TodoWrite` items before starting:\n\n1. `stack-rebase:fetch-complete`\n2. `stack-rebase:trigger-identified`\n3. `stack-rebase:rebase-complete`\n4. `stack-rebase:conflicts-resolved`\n5. `stack-rebase:force-pushed`\n6. `stack-rebase:prs-updated`\n\n## Step 1: Fetch Remote State (`fetch-complete`)\n\n```bash\ngit fetch origin\n```\n\nIf the merged PR's branch still exists on remote, note\nthat GitHub retains the branch after merge.\nThe merged branch itself is no longer a valid stack base.\n\n## Step 2: Identify the Trigger (`trigger-identified`)\n\nDetermine what changed:\n\n**Case A — Base PR merged into master:**\nThe slice that was the old \"root\" is now in `master`.\nAll remaining slices need to rebase onto `master`.\n\n```bash\n# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\"\n```\n\n**Case B — Master moved forward:**\nSlices are behind `master` but the stack topology is\nunchanged.\nRebase the root slice onto `master`; `--update-refs`\ncarries all descendants.\n\n**Case C — Mid-stack revision:**\nA slice was amended.\nAll descendant slices need to rebase onto it.\n\n## Step 3: Run the Cascading Rebase (`rebase-complete`)\n\n### Case A and B: Rebase root slice onto master\n\n```bash\nSTACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs origin/${BASE}\n```\n\n`--update-refs` scans the reflog and updates every local\nbranch ref that points to a commit being rebased.\nAll slice branches in the stack are rewritten in one pass.\n\n### Case C: Rebase from a mid-stack slice\n\n```bash\n# Check out the first slice BELOW the amended one\nCHILD_SLICE=stack/my-feature/add-api  # example\n\ngit checkout \"${CHILD_SLICE}\"\ngit rebase --update-refs stack/my-feature/add-schema\n```\n\n### jj Accelerator (if available)\n\n```bash\n# jj rebases all descendants automatically on any change\n# To rebase the whole stack onto master:\njj rebase -d master \\\n  -r \"ancestors(${STACK}/add-ui) & !ancestors(master)\"\n```\n\n## Step 4: Resolve Conflicts (`conflicts-resolved`)\n\nIf the rebase pauses with conflicts:\n\n```bash\n# See which file conflicts\ngit status\n\n# After resolving each file:\ngit add <resolved-file>\ngit rebase --continue\n```\n\nRepeat until the rebase completes.\nIf a conflict is too complex, abort and investigate:\n\n```bash\ngit rebase --abort\n```\n\nThen examine the diff between the conflicting commits\nbefore retrying.\n\n## Step 5: Force-Push Updated Branches (`force-pushed`)\n\nAfter a successful rebase, push all slice branches.\nUse `--force-with-lease` to guard against remote changes\nmade since the last fetch:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  git push --force-with-lease origin \"${branch}\"\n  echo \"force-pushed: ${branch}\"\ndone\n```\n\nNever use `--force` (drops the remote-change guard).\n\n### jj Accelerator (if available)\n\n```bash\njj git push --all --allow-new\n```\n\n## Step 6: Update PR Bases (`prs-updated`)\n\n**Case A only**: After the root slice merged and you\nrebased remaining slices onto `master`, the next PR in\nthe stack now targets the wrong base.\nUpdate its base via the GitHub CLI:\n\n```bash\nNEXT_PR=456   # PR number of the new stack root\n\ngh pr edit \"${NEXT_PR}\" --base master\n```\n\nFor PRs further down the stack, their bases remain the\nprevious slice branch, which `--update-refs` already\nrewrote; no base edit is needed for them.\n\nVerify the full stack is consistent:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  pr_num=$(gh pr list --head \"${branch}\" \\\n    --json number,baseRefName \\\n    --jq '.[0] | \"#\\(.number) base=\\(.baseRefName)\"')\n  echo \"${branch}: ${pr_num}\"\ndone\n```\n\n## Conflict Prevention Tips\n\n- Keep slices small: the smaller each PR, the less surface\n  area for conflicts during rebase\n- Rebase frequently: rebasing onto a freshly merged master\n  once a day is cheaper than resolving a week of drift\n- Avoid amending commits that are already under review;\n  prefer a fixup commit and squash at merge time\n\n## Notes\n\n- `git rebase --update-refs` requires Git 2.38+; confirm\n  with `git version` before running\n- If `--update-refs` is unavailable, manually check out\n  and rebase each slice branch in order from root to tip\n- After force-pushing, GitHub automatically marks PR\n  reviews as stale; remind reviewers to re-approve\n- The `stack-push` skill documents how to re-post the\n  stack summary comment after a rebase changes PR SHAs\n\nFile v1.9.14:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-stack-rebase\",\n  \"version\": \"1.9.14\",\n  \"publishedAt\": 1782842742087\n}\n\nFile v1.9.14:skill-card.md\n\n## Description: <br>\nCascades a rebase through an entire PR stack after a base PR merges or upstream changes. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to maintain stacked pull requests after a base branch advances, a root PR merges, or a mid-stack branch changes. It guides fetching, rebasing with update-refs, conflict handling, force-pushing with leases, and PR base updates. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Broad activation around Git and PR workflows could lead an agent to consider history-rewriting actions when the user only wanted casual discussion. <br>\nMitigation: Use only when stacked PR rebase assistance is intended, and confirm the repository, branch list, base branch, and push targets before acting. <br>\nRisk: Rebase and force-push guidance can rewrite branch history or overwrite remote changes if applied to the wrong branches. <br>\nMitigation: Fetch first, require a clean working tree, review the exact command plan, and use --force-with-lease rather than unguarded force pushes. <br>\nRisk: Rebases can pause on conflicts or change pull request review state. <br>\nMitigation: Resolve conflicts deliberately, abort and inspect complex conflicts before retrying, update PR bases when needed, and notify reviewers after rewritten SHAs. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill listing](https://clawhub.ai/athola/skills/nm-sanctum-stack-rebase) <br>\n- [Clawdis homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [guidance, shell commands, markdown] <br>\n**Output Format:** [Markdown guidance with inline shell commands] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Includes Git and GitHub CLI command sequences for stacked pull request rebases.] <br>\n\n## Skill Version(s): <br>\n1.9.14 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.13: 3 files, 4151 bytes\n\nFiles: skill-card.md (1995b), SKILL.md (6125b), _meta.json (143b)\n\nFile v1.9.13:SKILL.md\n\n---\nname: stack-rebase\ndescription: |\n  Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\nversion: 1.9.8\ntriggers:\n  - git\n  - stacked-diffs\n  - rebase\n  - pr\n  - cascade\n  - a stack needs to incorporate new base branch commits\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\u2699\\ufe0f\", \"requires\": {\"config\": [\"night-market.sanctum:stack-create\", \"night-market.sanctum:stack-push\", \"night-market.sanctum:git-workspace-review\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Stack Rebase\n\nCascade a rebase through an entire PR stack after a base\nPR merges or the upstream base branch changes.\n\n## When to Use\n\nRun `stack-rebase` in any of these situations:\n\n- The first PR in the stack merged into `master`; the\n  second PR now needs to target `master` directly\n- `master` has moved forward and stack branches need to\n  incorporate the new commits\n- A mid-stack PR was revised and descendants need to\n  pick up the change\n\n## Prerequisites\n\n- All slice branches exist locally (`git branch --list`)\n- Remote is up to date (`git fetch origin`)\n- Working tree is clean (`git status`)\n- Git 2.38+ for `--update-refs`\n\n## Required Progress Tracking\n\nCreate `TodoWrite` items before starting:\n\n1. `stack-rebase:fetch-complete`\n2. `stack-rebase:trigger-identified`\n3. `stack-rebase:rebase-complete`\n4. `stack-rebase:conflicts-resolved`\n5. `stack-rebase:force-pushed`\n6. `stack-rebase:prs-updated`\n\n## Step 1: Fetch Remote State (`fetch-complete`)\n\n```bash\ngit fetch origin\n```\n\nIf the merged PR's branch still exists on remote, note\nthat GitHub retains the branch after merge.\nThe merged branch itself is no longer a valid stack base.\n\n## Step 2: Identify the Trigger (`trigger-identified`)\n\nDetermine what changed:\n\n**Case A — Base PR merged into master:**\nThe slice that was the old \"root\" is now in `master`.\nAll remaining slices need to rebase onto `master`.\n\n```bash\n# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\"\n```\n\n**Case B — Master moved forward:**\nSlices are behind `master` but the stack topology is\nunchanged.\nRebase the root slice onto `master`; `--update-refs`\ncarries all descendants.\n\n**Case C — Mid-stack revision:**\nA slice was amended.\nAll descendant slices need to rebase onto it.\n\n## Step 3: Run the Cascading Rebase (`rebase-complete`)\n\n### Case A and B: Rebase root slice onto master\n\n```bash\nSTACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs origin/${BASE}\n```\n\n`--update-refs` scans the reflog and updates every local\nbranch ref that points to a commit being rebased.\nAll slice branches in the stack are rewritten in one pass.\n\n### Case C: Rebase from a mid-stack slice\n\n```bash\n# Check out the first slice BELOW the amended one\nCHILD_SLICE=stack/my-feature/add-api  # example\n\ngit checkout \"${CHILD_SLICE}\"\ngit rebase --update-refs stack/my-feature/add-schema\n```\n\n### jj Accelerator (if available)\n\n```bash\n# jj rebases all descendants automatically on any change\n# To rebase the whole stack onto master:\njj rebase -d master \\\n  -r \"ancestors(${STACK}/add-ui) & !ancestors(master)\"\n```\n\n## Step 4: Resolve Conflicts (`conflicts-resolved`)\n\nIf the rebase pauses with conflicts:\n\n```bash\n# See which file conflicts\ngit status\n\n# After resolving each file:\ngit add <resolved-file>\ngit rebase --continue\n```\n\nRepeat until the rebase completes.\nIf a conflict is too complex, abort and investigate:\n\n```bash\ngit rebase --abort\n```\n\nThen examine the diff between the conflicting commits\nbefore retrying.\n\n## Step 5: Force-Push Updated Branches (`force-pushed`)\n\nAfter a successful rebase, push all slice branches.\nUse `--force-with-lease` to guard against remote changes\nmade since the last fetch:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  git push --force-with-lease origin \"${branch}\"\n  echo \"force-pushed: ${branch}\"\ndone\n```\n\nNever use `--force` (drops the remote-change guard).\n\n### jj Accelerator (if available)\n\n```bash\njj git push --all --allow-new\n```\n\n## Step 6: Update PR Bases (`prs-updated`)\n\n**Case A only**: After the root slice merged and you\nrebased remaining slices onto `master`, the next PR in\nthe stack now targets the wrong base.\nUpdate its base via the GitHub CLI:\n\n```bash\nNEXT_PR=456   # PR number of the new stack root\n\ngh pr edit \"${NEXT_PR}\" --base master\n```\n\nFor PRs further down the stack, their bases remain the\nprevious slice branch, which `--update-refs` already\nrewrote; no base edit is needed for them.\n\nVerify the full stack is consistent:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  pr_num=$(gh pr list --head \"${branch}\" \\\n    --json number,baseRefName \\\n    --jq '.[0] | \"#\\(.number) base=\\(.baseRefName)\"')\n  echo \"${branch}: ${pr_num}\"\ndone\n```\n\n## Conflict Prevention Tips\n\n- Keep slices small: the smaller each PR, the less surface\n  area for conflicts during rebase\n- Rebase frequently: rebasing onto a freshly merged master\n  once a day is cheaper than resolving a week of drift\n- Avoid amending commits that are already under review;\n  prefer a fixup commit and squash at merge time\n\n## Notes\n\n- `git rebase --update-refs` requires Git 2.38+; confirm\n  with `git version` before running\n- If `--update-refs` is unavailable, manually check out\n  and rebase each slice branch in order from root to tip\n- After force-pushing, GitHub automatically marks PR\n  reviews as stale; remind reviewers to re-approve\n- The `stack-push` skill documents how to re-post the\n  stack summary comment after a rebase changes PR SHAs\n\nFile v1.9.13:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-stack-rebase\",\n  \"version\": \"1.9.13\",\n  \"publishedAt\": 1782577413278\n}\n\nFile v1.9.13:skill-card.md\n\n## Description: <br>\nCascades a rebase through an entire PR stack after a base PR merges or upstream changes. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to update stacked pull request branches after a base branch changes, a root PR merges, or a mid-stack branch is revised. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Broad activation triggers may surface history-rewrite guidance in unrelated development conversations. <br>\nMitigation: Use the skill only for intentional stacked-PR maintenance and narrow activation language to stacked-PR-specific cases. <br>\nRisk: Rebase and force-push workflows can rewrite shared branch history. <br>\nMitigation: Confirm the target stack, start from a clean working tree, fetch remote state first, and review each rebase and force-with-lease push before execution. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-stack-rebase) <br>\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Shell commands, Markdown, Configuration] <br>\n**Output Format:** [Markdown with inline bash code blocks and checklist-style progress guidance] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Includes Git, GitHub CLI, and optional jj command examples for stacked-branch rebases.] <br>\n\n## Skill Version(s): <br>\n1.9.13 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.9.12: 3 files, 3984 bytes\n\nFiles: skill-card.md (1625b), SKILL.md (6125b), _meta.json (143b)\n\nFile v1.9.12:SKILL.md\n\n---\nname: stack-rebase\ndescription: |\n  Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\nversion: 1.9.8\ntriggers:\n  - git\n  - stacked-diffs\n  - rebase\n  - pr\n  - cascade\n  - a stack needs to incorporate new base branch commits\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\u2699\\ufe0f\", \"requires\": {\"config\": [\"night-market.sanctum:stack-create\", \"night-market.sanctum:stack-push\", \"night-market.sanctum:git-workspace-review\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Stack Rebase\n\nCascade a rebase through an entire PR stack after a base\nPR merges or the upstream base branch changes.\n\n## When to Use\n\nRun `stack-rebase` in any of these situations:\n\n- The first PR in the stack merged into `master`; the\n  second PR now needs to target `master` directly\n- `master` has moved forward and stack branches need to\n  incorporate the new commits\n- A mid-stack PR was revised and descendants need to\n  pick up the change\n\n## Prerequisites\n\n- All slice branches exist locally (`git branch --list`)\n- Remote is up to date (`git fetch origin`)\n- Working tree is clean (`git status`)\n- Git 2.38+ for `--update-refs`\n\n## Required Progress Tracking\n\nCreate `TodoWrite` items before starting:\n\n1. `stack-rebase:fetch-complete`\n2. `stack-rebase:trigger-identified`\n3. `stack-rebase:rebase-complete`\n4. `stack-rebase:conflicts-resolved`\n5. `stack-rebase:force-pushed`\n6. `stack-rebase:prs-updated`\n\n## Step 1: Fetch Remote State (`fetch-complete`)\n\n```bash\ngit fetch origin\n```\n\nIf the merged PR's branch still exists on remote, note\nthat GitHub retains the branch after merge.\nThe merged branch itself is no longer a valid stack base.\n\n## Step 2: Identify the Trigger (`trigger-identified`)\n\nDetermine what changed:\n\n**Case A — Base PR merged into master:**\nThe slice that was the old \"root\" is now in `master`.\nAll remaining slices need to rebase onto `master`.\n\n```bash\n# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\"\n```\n\n**Case B — Master moved forward:**\nSlices are behind `master` but the stack topology is\nunchanged.\nRebase the root slice onto `master`; `--update-refs`\ncarries all descendants.\n\n**Case C — Mid-stack revision:**\nA slice was amended.\nAll descendant slices need to rebase onto it.\n\n## Step 3: Run the Cascading Rebase (`rebase-complete`)\n\n### Case A and B: Rebase root slice onto master\n\n```bash\nSTACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs origin/${BASE}\n```\n\n`--update-refs` scans the reflog and updates every local\nbranch ref that points to a commit being rebased.\nAll slice branches in the stack are rewritten in one pass.\n\n### Case C: Rebase from a mid-stack slice\n\n```bash\n# Check out the first slice BELOW the amended one\nCHILD_SLICE=stack/my-feature/add-api  # example\n\ngit checkout \"${CHILD_SLICE}\"\ngit rebase --update-refs stack/my-feature/add-schema\n```\n\n### jj Accelerator (if available)\n\n```bash\n# jj rebases all descendants automatically on any change\n# To rebase the whole stack onto master:\njj rebase -d master \\\n  -r \"ancestors(${STACK}/add-ui) & !ancestors(master)\"\n```\n\n## Step 4: Resolve Conflicts (`conflicts-resolved`)\n\nIf the rebase pauses with conflicts:\n\n```bash\n# See which file conflicts\ngit status\n\n# After resolving each file:\ngit add <resolved-file>\ngit rebase --continue\n```\n\nRepeat until the rebase completes.\nIf a conflict is too complex, abort and investigate:\n\n```bash\ngit rebase --abort\n```\n\nThen examine the diff between the conflicting commits\nbefore retrying.\n\n## Step 5: Force-Push Updated Branches (`force-pushed`)\n\nAfter a successful rebase, push all slice branches.\nUse `--force-with-lease` to guard against remote changes\nmade since the last fetch:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  git push --force-with-lease origin \"${branch}\"\n  echo \"force-pushed: ${branch}\"\ndone\n```\n\nNever use `--force` (drops the remote-change guard).\n\n### jj Accelerator (if available)\n\n```bash\njj git push --all --allow-new\n```\n\n## Step 6: Update PR Bases (`prs-updated`)\n\n**Case A only**: After the root slice merged and you\nrebased remaining slices onto `master`, the next PR in\nthe stack now targets the wrong base.\nUpdate its base via the GitHub CLI:\n\n```bash\nNEXT_PR=456   # PR number of the new stack root\n\ngh pr edit \"${NEXT_PR}\" --base master\n```\n\nFor PRs further down the stack, their bases remain the\nprevious slice branch, which `--update-refs` already\nrewrote; no base edit is needed for them.\n\nVerify the full stack is consistent:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  pr_num=$(gh pr list --head \"${branch}\" \\\n    --json number,baseRefName \\\n    --jq '.[0] | \"#\\(.number) base=\\(.baseRefName)\"')\n  echo \"${branch}: ${pr_num}\"\ndone\n```\n\n## Conflict Prevention Tips\n\n- Keep slices small: the smaller each PR, the less surface\n  area for conflicts during rebase\n- Rebase frequently: rebasing onto a freshly merged master\n  once a day is cheaper than resolving a week of drift\n- Avoid amending commits that are already under review;\n  prefer a fixup commit and squash at merge time\n\n## Notes\n\n- `git rebase --update-refs` requires Git 2.38+; confirm\n  with `git version` before running\n- If `--update-refs` is unavailable, manually check out\n  and rebase each slice branch in order from root to tip\n- After force-pushing, GitHub automatically marks PR\n  reviews as stale; remind reviewers to re-approve\n- The `stack-push` skill documents how to re-post the\n  stack summary comment after a rebase changes PR SHAs\n\nFile v1.9.12:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-stack-rebase\",\n  \"version\": \"1.9.12\",\n  \"publishedAt\": 1781839141158\n}\n\nFile v1.9.12:skill-card.md\n\n## Description: <br>\nCascades a rebase through an entire PR stack after a base PR merges or upstream changes. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to rebase stacked pull request branches after a base branch changes, a root PR merges, or a mid-stack slice is revised. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Review before execution as proposals could introduce incorrect or misleading guidance into skills. <br>\nMitigation: Review and scan skill before deployment. <br>\n\n## Reference(s): <br>\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Shell commands, Configuration instructions] <br>\n**Output Format:** [Markdown with inline bash code blocks] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Includes progress tracking steps, rebase and force-push commands, conflict handling guidance, and reminders to use role-appropriate permissions and built-in safeguards.] <br>\n\n## Skill Version(s): <br>\n1.9.12 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.0: 3 files, 4121 bytes\n\nFiles: skill-card.md (1925b), SKILL.md (6125b), _meta.json (142b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: stack-rebase\ndescription: |\n  Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\nversion: 1.9.8\ntriggers:\n  - git\n  - stacked-diffs\n  - rebase\n  - pr\n  - cascade\n  - a stack needs to incorporate new base branch commits\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\u2699\\ufe0f\", \"requires\": {\"config\": [\"night-market.sanctum:stack-create\", \"night-market.sanctum:stack-push\", \"night-market.sanctum:git-workspace-review\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Stack Rebase\n\nCascade a rebase through an entire PR stack after a base\nPR merges or the upstream base branch changes.\n\n## When to Use\n\nRun `stack-rebase` in any of these situations:\n\n- The first PR in the stack merged into `master`; the\n  second PR now needs to target `master` directly\n- `master` has moved forward and stack branches need to\n  incorporate the new commits\n- A mid-stack PR was revised and descendants need to\n  pick up the change\n\n## Prerequisites\n\n- All slice branches exist locally (`git branch --list`)\n- Remote is up to date (`git fetch origin`)\n- Working tree is clean (`git status`)\n- Git 2.38+ for `--update-refs`\n\n## Required Progress Tracking\n\nCreate `TodoWrite` items before starting:\n\n1. `stack-rebase:fetch-complete`\n2. `stack-rebase:trigger-identified`\n3. `stack-rebase:rebase-complete`\n4. `stack-rebase:conflicts-resolved`\n5. `stack-rebase:force-pushed`\n6. `stack-rebase:prs-updated`\n\n## Step 1: Fetch Remote State (`fetch-complete`)\n\n```bash\ngit fetch origin\n```\n\nIf the merged PR's branch still exists on remote, note\nthat GitHub retains the branch after merge.\nThe merged branch itself is no longer a valid stack base.\n\n## Step 2: Identify the Trigger (`trigger-identified`)\n\nDetermine what changed:\n\n**Case A — Base PR merged into master:**\nThe slice that was the old \"root\" is now in `master`.\nAll remaining slices need to rebase onto `master`.\n\n```bash\n# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\"\n```\n\n**Case B — Master moved forward:**\nSlices are behind `master` but the stack topology is\nunchanged.\nRebase the root slice onto `master`; `--update-refs`\ncarries all descendants.\n\n**Case C — Mid-stack revision:**\nA slice was amended.\nAll descendant slices need to rebase onto it.\n\n## Step 3: Run the Cascading Rebase (`rebase-complete`)\n\n### Case A and B: Rebase root slice onto master\n\n```bash\nSTACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs origin/${BASE}\n```\n\n`--update-refs` scans the reflog and updates every local\nbranch ref that points to a commit being rebased.\nAll slice branches in the stack are rewritten in one pass.\n\n### Case C: Rebase from a mid-stack slice\n\n```bash\n# Check out the first slice BELOW the amended one\nCHILD_SLICE=stack/my-feature/add-api  # example\n\ngit checkout \"${CHILD_SLICE}\"\ngit rebase --update-refs stack/my-feature/add-schema\n```\n\n### jj Accelerator (if available)\n\n```bash\n# jj rebases all descendants automatically on any change\n# To rebase the whole stack onto master:\njj rebase -d master \\\n  -r \"ancestors(${STACK}/add-ui) & !ancestors(master)\"\n```\n\n## Step 4: Resolve Conflicts (`conflicts-resolved`)\n\nIf the rebase pauses with conflicts:\n\n```bash\n# See which file conflicts\ngit status\n\n# After resolving each file:\ngit add <resolved-file>\ngit rebase --continue\n```\n\nRepeat until the rebase completes.\nIf a conflict is too complex, abort and investigate:\n\n```bash\ngit rebase --abort\n```\n\nThen examine the diff between the conflicting commits\nbefore retrying.\n\n## Step 5: Force-Push Updated Branches (`force-pushed`)\n\nAfter a successful rebase, push all slice branches.\nUse `--force-with-lease` to guard against remote changes\nmade since the last fetch:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  git push --force-with-lease origin \"${branch}\"\n  echo \"force-pushed: ${branch}\"\ndone\n```\n\nNever use `--force` (drops the remote-change guard).\n\n### jj Accelerator (if available)\n\n```bash\njj git push --all --allow-new\n```\n\n## Step 6: Update PR Bases (`prs-updated`)\n\n**Case A only**: After the root slice merged and you\nrebased remaining slices onto `master`, the next PR in\nthe stack now targets the wrong base.\nUpdate its base via the GitHub CLI:\n\n```bash\nNEXT_PR=456   # PR number of the new stack root\n\ngh pr edit \"${NEXT_PR}\" --base master\n```\n\nFor PRs further down the stack, their bases remain the\nprevious slice branch, which `--update-refs` already\nrewrote; no base edit is needed for them.\n\nVerify the full stack is consistent:\n\n```bash\nfor branch in $(git branch --list \"${STACK}/*\" \\\n    | sed 's/^[* ]*//' | sort); do\n  pr_num=$(gh pr list --head \"${branch}\" \\\n    --json number,baseRefName \\\n    --jq '.[0] | \"#\\(.number) base=\\(.baseRefName)\"')\n  echo \"${branch}: ${pr_num}\"\ndone\n```\n\n## Conflict Prevention Tips\n\n- Keep slices small: the smaller each PR, the less surface\n  area for conflicts during rebase\n- Rebase frequently: rebasing onto a freshly merged master\n  once a day is cheaper than resolving a week of drift\n- Avoid amending commits that are already under review;\n  prefer a fixup commit and squash at merge time\n\n## Notes\n\n- `git rebase --update-refs` requires Git 2.38+; confirm\n  with `git version` before running\n- If `--update-refs` is unavailable, manually check out\n  and rebase each slice branch in order from root to tip\n- After force-pushing, GitHub automatically marks PR\n  reviews as stale; remind reviewers to re-approve\n- The `stack-push` skill documents how to re-post the\n  stack summary comment after a rebase changes PR SHAs\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-stack-rebase\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1781796065376\n}\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\nCascades a rebase through an entire PR stack after a base PR merges or upstream changes. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[athola](https://clawhub.ai/user/athola) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to guide cascading rebases across stacked pull request branches after a base PR merges, upstream moves forward, or a mid-stack slice changes. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: History-rewriting commands can update local stack branches and force-push rewritten commits. <br>\nMitigation: Review branch variables, fetch remote state first, require a clean working tree, and use --force-with-lease rather than an unguarded force push. <br>\nRisk: Pull request base edits can change review topology or point a PR at the wrong branch. <br>\nMitigation: Confirm the rebase trigger and target base before running gh pr edit, then verify each stack branch and PR base afterward. <br>\n\n\n## Reference(s): <br>\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Markdown, Shell commands] <br>\n**Output Format:** [Markdown guidance with inline bash command blocks] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Includes progress-tracking steps, git, jj, and GitHub CLI command examples that should be reviewed before execution.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: ClawHub release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>","readmeExcerpt":"Skill: stack-rebase Owner: athola Summary: Cascades a rebase through an entire PR stack after a base PR merges or upstream changes Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:21:04.010Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:41:05.691Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:57:53.571Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:05:42.087Z | user Release v1.9.14 v1.9.13 | 2026-06-27","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"git fetch origin"},{"language":"bash","snippet":"# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\""},{"language":"bash","snippet":"STACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs origin/${BASE}"},{"language":"bash","snippet":"# Check out the first slice BELOW the amended one\nCHILD_SLICE=stack/my-feature/add-api  # example\n\ngit checkout \"${CHILD_SLICE}\"\ngit rebase --update-refs stack/my-feature/add-schema"},{"language":"bash","snippet":"# jj rebases all descendants automatically on any change\n# To rebase the whole stack onto master:\njj rebase -d master \\\n  -r \"ancestors(${STACK}/add-ui) & !ancestors(master)\""},{"language":"bash","snippet":"# See which file conflicts\ngit status\n\n# After resolving each file:\ngit add <resolved-file>\ngit rebase --continue"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: stack-rebase\ndescription: |\n  Cascades a rebase through an entire PR stack after a base PR merges or upstream changes\nversion: 1.9.8\ntriggers:\n  - git\n  - stacked-diffs\n  - rebase\n  - pr\n  - cascade\n  - a stack needs to incorporate new base branch commits\nmetadata: {\"openclaw\": {\"homepage\": \"https://github.com/athola/claude-night-market/tree/master/plugins/sanctum\", \"emoji\": \"\\u2699\\ufe0f\", \"requires\": {\"config\": [\"night-market.sanctum:stack-create\", \"night-market.sanctum:stack-push\", \"night-market.sanctum:git-workspace-review\"]}}}\nsource: claude-night-market\nsource_plugin: sanctum\n---\n\n> **Night Market Skill** — ported from [claude-night-market/sanctum](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum). For the full experience with agents, hooks, and commands, install the Claude Code plugin.\n\n\n# Stack Rebase\n\nCascade a rebase through an entire PR stack after a base\nPR merges or the upstream base branch changes.\n\n## When to Use\n\nRun `stack-rebase` in any of these situations:\n\n- The first PR in the stack merged into `master`; the\n  second PR now needs to target `master` directly\n- `master` has moved forward and stack branches need to\n  incorporate the new commits\n- A mid-stack PR was revised and descendants need to\n  pick up the change\n\n## Prerequisites\n\n- All slice branches exist locally (`git branch --list`)\n- Remote is up to date (`git fetch origin`)\n- Working tree is clean (`git status`)\n- Git 2.38+ for `--update-refs`\n\n## Required Progress Tracking\n\nCreate `TodoWrite` items before starting:\n\n1. `stack-rebase:fetch-complete`\n2. `stack-rebase:trigger-identified`\n3. `stack-rebase:rebase-complete`\n4. `stack-rebase:conflicts-resolved`\n5. `stack-rebase:force-pushed`\n6. `stack-rebase:prs-updated`\n\n## Step 1: Fetch Remote State (`fetch-complete`)\n\n```bash\ngit fetch origin\n```\n\nIf the merged PR's branch still exists on remote, note\nthat GitHub retains the branch after merge.\nThe merged branch itself is no longer a valid stack base.\n\n## Step 2: Identify the Trigger (`trigger-identified`)\n\nDetermine what changed:\n\n**Case A — Base PR merged into master:**\nThe slice that was the old \"root\" is now in `master`.\nAll remaining slices need to rebase onto `master`.\n\n```bash\n# Confirm the merged branch is now in master\ngit branch -r --merged origin/master | grep \"${MERGED_BRANCH}\"\n```\n\n**Case B — Master moved forward:**\nSlices are behind `master` but the stack topology is\nunchanged.\nRebase the root slice onto `master`; `--update-refs`\ncarries all descendants.\n\n**Case C — Mid-stack revision:**\nA slice was amended.\nAll descendant slices need to rebase onto it.\n\n## Step 3: Run the Cascading Rebase (`rebase-complete`)\n\n### Case A and B: Rebase root slice onto master\n\n```bash\nSTACK=stack/my-feature\nBASE=master\n\n# Check out the root slice\nROOT_SLICE=$(git branch --list \"${STACK}/*\" \\\n  | sed 's/^[* ]*//' | sort | head -1)\n\ngit checkout \"${ROOT_SLICE}\"\n\n# Rebase with --update-refs rewrites all stack branches\ngit rebase --update-refs o"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7d107jg9jv602h9ytsegydq184a42s\",\n  \"slug\": \"nm-sanctum-stack-rebase\",\n  \"version\": \"1.9.19\",\n  \"publishedAt\": 1787750464010\n}"},{"path":"skill-card.md","content":"## Description:\n\nCascades a rebase through an entire PR stack after a base PR merges or upstream changes.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[athola](https://clawhub.ai/user/athola)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to update stacked pull request branches after a base PR merges, the upstream base branch advances, or a mid-stack slice is revised.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can rewrite several local and remote stack branches and edit pull request bases.\n\nMitigation: Fetch first, verify the stack pattern, list every branch and PR that will be affected, and use force-with-lease rather than force pushing.\n\nRisk: History rewrites on shared or protected branches can disrupt reviewers or collaborators.\n\nMitigation: Confirm no one else has pushed to the affected branches and avoid shared or protected branches unless the team has explicitly agreed to the rewrite.\n\nRisk: Broad git, rebase, and PR triggers may activate the workflow in repositories where a stacked-PR rebase is not intended.\n\nMitigation: Confirm the current repository, clean working tree, Git version, target base, and stack topology before running any rebase or push command.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-sanctum-stack-rebase)\n- [Sanctum plugin homepage](https://github.com/athola/claude-night-market/tree/master/plugins/sanctum)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, shell commands, configuration]\n\n**Output Format:** [Markdown with inline bash code blocks]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes ordered rebase, conflict-resolution, force-push, and pull-request-base update steps.]\n\n## Skill Version(s):\n\n1.9.19 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Cascades a rebase through an entire PR stack after a base PR merges or upstream changes Skill: stack-rebase Owner: athola Summary: Cascades a rebase through an entire PR stack after a base PR merges or upstream changes Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:21:04.010Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:41:05.691Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:57:53.571Z | user Release v1.9.16 v1.9.14 | 2026-06-30T18:05:42.087Z | user Release v1.9.14 v1.9.13 | 2026-06-27","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1173,"uniquenessScore":48,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T18:41:05.368Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T18:41:05.368Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:17:49.203Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}