diff
Read first (if ${CLAUDE_PLUGIN_ROOT} is empty, the plugin root is two
levels above this skill's base directory): ${CLAUDE_PLUGIN_ROOT}/skills/_shared/rules.md.
- Find the workspace (rules.md). List the versions to compare (tags, then the
latest commits, each a
sync,revieworinit):
git -C <ws> tag --list --sort=-creatordate --format='%(refname:short) %(creatordate:short) %(subject)'
git -C <ws> log --format='%h %ad %s' --date=short -8
- Pick
--fromand--tofrom what the user said: a tag, a commit, or a date ("since 1 October" →git -C <ws> rev-list -1 --before=<date> HEAD).--todefaults toHEAD;WORKTREEwhen the user asks about uncommitted edits. Nothing said → ask, with the newest tag (or the commit before the last sync) recommended and a few of the listed versions as the other options, each named by its date and subject. - Run:
node <plugin root>/dist/open-erd.mjs diff --workspace <ws> --from <ref> --to <ref|HEAD|WORKTREE> [--profile <name>]
--profile <name> when the result will be shared outside the team (same
profiles as render). --from is always a git ref. A warning about
uncommitted changes with --to HEAD means the user's latest edits are
not included: offer --to WORKTREE.
The engine prints the summary line, then one sentence per change, and
writes out/diff.svg (opens on all tables; click a coloured table for its
changes) and out/diff.xlsx (the "to" side's sheets plus a Changes sheet,
opened first).
- Summarise in the user's language, for a reader who does not read code: one sentence with the totals (the engine's summary line), then grouped by domain: tables added, removed, renamed ("possibly renamed" when the engine only guesses), columns and relations changed, enum values changed. Keep names as they are. Give the output paths the engine printed.
- End with the feedback line.