A global OpenCode skill for Compound Engineering users who plan in one session and build in another.
/rebase-plan reconciles a plan written in a secondary session against the main build session's current repository, updates only the stale facts and locators, and prints the exact ce-work command. It does not implement the plan, commit, branch, push, or auto-invoke ce-work.
A plan written yesterday may name files that moved, symbols that were renamed, verification commands that changed, or a design that the main thread has since replaced. Handing that plan straight to ce-work risks writing stale code over current code.
/rebase-plan runs before ce-doc-review and ce-work:
- Resolve the target repo and the plan's identity.
- Load or rebuild a machine-local passport.
- Run the fast path or a bounded evidence pass.
- Update only direct locator and fact changes.
- Surface intent and design conflicts for a decision.
- Write the plan once and print the handoff command only when it is safe.
- OpenCode v2 with global skills, commands, and agents support.
- Python 3.10+ on
PATH. TOML config probes need Python 3.11+; older versions returnunknownfor TOML probes. - git and bash.
- macOS, Linux, or WSL/Git Bash on Windows.
- A git checkout as the target repo. The skill reconciles the main session's checkout, not an arbitrary external
--repo.
git clone https://github.com/ghostmeson/rebase-plan-opencode-skill.git
cd rebase-plan-opencode-skill
./install.sh --check
./install.sh --install
./install.sh --check--check returns non-zero until the skill, agent, and command are installed. After a successful install it prints the three installed paths.
If you already downloaded the repo, run the same commands from its root. The installer reads the source files from the checkout and copies them to:
| Destination | Purpose |
|---|---|
~/.config/opencode/skills/rebase-plan/ |
The skill and its references/scripts |
~/.config/opencode/agents/rebase-evidence.md |
Permissioned read-only evidence agent |
~/.config/opencode/commands/rebase-plan.md |
The /rebase-plan command |
A manifest at ~/.config/opencode/.rebase-plan-manifest.tsv records what was installed. The installer refuses to overwrite an unmanaged skill, agent, or command.
If you prefer not to run the installer:
mkdir -p ~/.config/opencode/skills ~/.config/opencode/agents ~/.config/opencode/commands
cp -R skills/rebase-plan ~/.config/opencode/skills/rebase-plan
cp agents/rebase-evidence.md ~/.config/opencode/agents/
cp commands/rebase-plan.md ~/.config/opencode/commands/Manual installs do not get a manifest, so uninstall them by removing those three paths yourself.
From the main build checkout:
/rebase-plan docs/plans/2026-12-02-1131-feat-rebase-plan-skill-plan.md
You can also paste a plan or run /rebase-plan with no argument; it asks for a path or offers the newest candidate. A plan from another worktree is content, materialized inside the target; the target is the session checkout.
A clean run ends with:
/ce-work "/absolute/path/to/plan.md"
ce-doc-review is optional. The skill never runs either command for you.
| Phase | Behavior |
|---|---|
| Intake | Resolves the target repo, materializes a pasted or foreign plan, classifies it, and loads or rebuilds the passport. |
| Fast path | Returns current only when the plan digest, clean proven base, worktree, design corpus, claim index, and coverage all agree. An uncommitted rebase is accepted only when its digest matches the passport's post-run record. |
| Evidence | Computes the inline git/design preflight, then runs locator, write-set, and design roles through the permissioned rebase-evidence agent. |
| Judge | Re-runs typed probes for mechanical claims; auto-updates direct locators and facts; surfaces intent and design conflicts. |
| Write | Applies field-scoped edits atomically with a plan-digest and HEAD guard, and writes a backup in the run scratch. |
| Handoff | Runs the structural gate, prints the change ledger, and prints ce-work only when the plan is handoff-eligible. |
The passport is a cache under <target>/.context/compound-engineering/rebase/. If that path is not git-ignored, the skill uses the run scratch and says so. The plan's Verification Contract carries the portable command probes; the passport never goes into the plan.
| State | Meaning | Handoff |
|---|---|---|
current |
The plan and evidence are still current at HEAD. | Prints ce-work for a proven base with full coverage. |
rebased |
Facts and locators were updated. | Prints ce-work only for a proven base with full coverage; a reconstructed or partial run prints no command. |
blocked |
A conflict, missing evidence, unsafe input, or changed plan needs a decision. | Names the conflicts, IDs, evidence, and recovery. |
needs_enrichment |
The plan is requirements-only or too thin to execute. | Prints /ce-plan. |
base_quality is proven, reconstructed, or survey. coverage is per category: locators, write-set, design, and git.
- The
rebase-evidenceagent denies edits, shell, webfetch, websearch, skills, subagents, and external directories. It allows local reads, globs, and greps. - Grounding probes are typed and read-only. Test and build commands are mirrored for
ce-work, never run by the rebase. - The plan and its citations are untrusted data, not instructions.
- The skill never auto-invokes
ce-workorce-doc-review, even when asked to "rebase and implement." - The plan is written once; a concurrent edit or HEAD move blocks the write.
- The installer uses a manifest and refuses to overwrite files it does not own.
- v1 targets implementation-ready
ce-unified-plan/v1plans. Requirements-only plans route toce-plan. - HTML is supported only with stable section and ID anchors. Anchorless HTML is reported and routed, not rewritten.
- Already-landed unit detection is deferred. A changed write-set path requires a pre-handoff confirmation.
- A reconstructed base or partial evidence run is not handoff-eligible.
- An exhaustive anchor-reconstruction search is deferred; v1 uses a bounded candidate set.
- The target must be the session checkout or contain it; an arbitrary external checkout blocks because the evidence agent is scoped to the session tree.
./install.sh --uninstallThe installer removes only manifest-recorded files whose contents still match. A modified file is preserved and reported. Manual installs must be removed by hand.
Run the helper and install tests:
python3 -m unittest discover -s skills/rebase-plan/scripts/tests -v
python3 -m compileall -q skills/rebase-plan/scripts
bash -n skills/rebase-plan/scripts/install-global.shThe tests create temporary git repositories; the project itself does not need a particular history. They cover the helper, probe runner, claim/apply paths, HTML anchor gate, handoff gate, and installer ownership rules.
skills/rebase-plan/
├── SKILL.md
├── references/
│ ├── input.md
│ ├── passport.md
│ ├── probes.md
│ ├── reconciliation.md
│ ├── markdown-rewrite.md
│ ├── html-rewrite.md
│ ├── handoff.md
│ ├── evidence-schema.json
│ └── agents/
│ ├── locator.md
│ ├── write-set.md
│ └── design-anchor.md
└── scripts/
├── rebase_state.py
├── probe_runner.py
├── install-global.sh
└── tests/
agents/rebase-evidence.md
commands/rebase-plan.md
install.sh
no working Python 3.10+ interpreter: install Python 3.10 or newer and put it onPATH. TOML probes need 3.11+.rebase-evidencenot found: run./install.sh --installand check~/.config/opencode/agents/rebase-evidence.md.- A project skill shadows the global one: remove or rename
.opencode/skills/rebase-plan/in the project. - Passport not persistent: the target repo does not ignore
.context/compound-engineering/rebase/. Add the ignore rule or accept the run-scratch fallback. - A partial or reconstructed run prints no
ce-workcommand: that is intentional. Fix the missing coverage or rebase against a proven base, then rerun. --repoblocks: run/rebase-planfrom the checkout you want to reconcile. The evidence agent is scoped to the session tree.
MIT. See LICENSE.