rebase-context
Rebase one context branch onto another in the context repo, resolving glossary + ADR conflicts as you go. Use when the base a branch forked from has advanced, or to re-parent a context branch. Distinct from merge-context (reconcile into trunk via merge) and offload-context (commit + push, no cross-branch).
- License 许可
- MIT
- 所属仓库
- epr3/dotfiles
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- rebase-context
- description
- Rebase one context branch onto another in the context repo, resolving glossary + ADR conflicts as you go. Use when the base a branch forked from has advanced, or to re-parent a context branch. Distinct from merge-context (reconcile into trunk via merge) and offload-context (commit + push, no cross-branch).
- argument-hint
- <source> onto <onto>: branch whose context to rebase, and the branch to rebase it onto (source defaults to the current branch; onto defaults to its base)
- disable-model-invocation
- true
03 SKILL.md 正文
Rebase Context
Resolve the context store first: GLOSSARY-FORMAT.md → Resolving the context store. In-repo context → this skill is a no-op; say so and stop.
Under a context repo, replay a source context branch's commits on top of a target so its history sits linearly on top of where it's now based. This is git rebase between two context branches plus conflict resolution with the glossary discipline in merge-context. See GLOSSARY-FORMAT.md → Publish + reconcile across branches.
Typical use: a branch's context was forked off its base (e.g. feature-3 off feature-2); the base has since advanced, so you rebase the branch's context onto the updated base to stay current and linear. Bringing a branch into the context trunk is reconciliation (a merge), not a rebase; use merge-context.
Process
1. Resolve source + onto
Parse the argument as [<source>] onto <onto>. Source context branch: the named branch, else the current code branch's context. Onto: the named target, else the source's recorded base: the fork parent ctx-init.sh persisted for that context branch at fork time; read it at ${AGENT_CONTEXT_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/agent/ctx}/<slug>/.git/info/fork-parent/<branch> (slug formula in GLOSSARY-FORMAT.md → Layout), with cwd inside the code repo. An absent record falls back to the designated master. An explicit named onto always wins. Both are branches in this repo's context repo, their context worktrees pairing 1:1 with the code branches. Resolve the source context worktree; ensure onto exists (materialise its context worktree if needed). Confirm direction before any rewrite: the rebase rewrites the source branch on top of onto; onto is read, never changed.
2. Rebase
In the source context worktree, replay onto the target: git rebase <onto>. Clean commits apply untouched; the first conflicting commit stops the rebase for resolution. git rebase --abort at any point restores the branch exactly; nothing is lost.
3. Resolve each conflict by meaning
At each stop git marks the conflicted files. Resolve by meaning, not just markers, running merge-context's classify-and-interview discipline over the conflicted glossary and unioning ADRs by date-slug (superseding, never deleting). Pause the rebase on any divergence, alias clash, or ADR contradiction for review; never auto-pick meaning.
Stage the resolved files (git add) and git rebase --continue; repeat until the rebase finishes.
4. Ground against the source's code
The authoritative universe after a rebase is the source code worktree, never onto's. Take its path universe via <setup-context skill dir>/manifest.sh, invoked by path with cwd anywhere inside the source code worktree. Follow Running the helper scripts in GLOSSARY-FORMAT.md. A <dir>/GLOSSARY.md, a term keyed to a missing module, or an ADR about absent code that the source's manifest lacks is dangling: surface it as a report + question and keep all context content until the user decides: never silently keep or drop anything. A dangling base-inherited path (present on onto, absent from the source) says "context rebased before code".
Source-only feature paths stay valid: they exist on the source, just not on the base. This step completes once every dangling reference is surfaced and decided; grounding alone drops nothing.
5. Finish
Refresh the index with <setup-context skill dir>/ctx-index.sh. Report: rebased <source> onto <onto>, conflicts resolved, anything held or flagged dangling. Because the history is rewritten, republishing an already-pushed branch needs git push --force-with-lease; a deliberate act. Never force a shared trunk.
04 同仓库更多 Skills
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
wizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
wayfinder
Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
wait-what
Stop. That last message did not land: re-pitch it.
triage
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
to-tickets
Break a plan, spec, or the current conversation into a set of tracer-bullet tickets, each declaring its blocking edges, published to the configured tracker (edges as text in one file per ticket locally, or native blocking links on a real tracker).