Skip to main content

cedit

Keep local adaptations of vendored Markdown alive across upstream updates — a persistent block-level overlay, re-applied by a 3-way structural merge over the document’s AST rather than over lines.

The problem

You vendored a Markdown document — a skill file, a runbook, a template — and adapted it: a few fenced commands rewritten for the shell your environment actually has. Then upstream ships an update. Today you either freeze the file and lose upstream’s fixes, or take the update and re-apply your edits by hand, every time.

cedit makes those edits a durable overlay and turns “update from upstream” into a structural merge that either succeeds silently or reports a precise, per-block conflict — with all three versions recorded, and your text kept in the working file.

pipx install cedit

cedit snapshot skills/SKILL.md --from vendor/skills/SKILL.md # start tracking
# ... adapt the file in place ...
cedit diff # what your overlay currently holds
cedit sync --from vendor # re-apply it over the new upstream
cedit status # edits re-applied, conflicts outstanding

Exit codes are contract: 0 clean, 1 unresolved conflicts, 2 errors — for a human and for CI alike.

User guide

How to drive it: a five-minute tour, every flag of every subcommand, the conflict lifecycle worked end to end, and a troubleshooting table.

Spec

The design: the merge matrix, the normative sync algorithm, the state format, the reuse rules, and what is phase 1 versus phase 2.

Architecture

The code: every module, function and constant, the call graph from cli.main down to the splice, and where each invariant is enforced.

Canonicalization reference

Every Markdown element and what cedit md canonicalize does to it, with the known caveats and quick test commands.