From backend-factory
Compare architecture between two git commits or branches and visualize the differences
How this skill is triggered — by the user, by Claude, or both
Slash command
/backend-factory:diffThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Compare the backend architecture at two git refs and visualize what changed — like a factory renovation blueprint.
Compare the backend architecture at two git refs and visualize what changed — like a factory renovation blueprint.
curl -s http://localhost:7777/api/status
If the server is not running, tell the user to run /backend-factory:start first.
Parse two git refs from $ARGUMENTS:
REF_OLD and REF_NEWREF_OLD and HEAD as REF_NEWREF_OLD=HEAD~1 and REF_NEW=HEADValidate both refs exist:
git rev-parse --verify "$REF_OLD" && git rev-parse --verify "$REF_NEW"
For each ref, extract the project state and run the analysis script. Use git worktree to avoid destructive checkouts:
# Analyze OLD ref
git worktree add /tmp/factory-diff-old-$$ "$REF_OLD" --detach 2>/dev/null
TMPFILE_OLD=$(mktemp /tmp/factory-diff-old-XXXXXX.json)
node ${CLAUDE_PLUGIN_ROOT}/analysis/analyze.js /tmp/factory-diff-old-$$ > "$TMPFILE_OLD"
git worktree remove /tmp/factory-diff-old-$$ --force 2>/dev/null
# Analyze NEW ref
git worktree add /tmp/factory-diff-new-$$ "$REF_NEW" --detach 2>/dev/null
TMPFILE_NEW=$(mktemp /tmp/factory-diff-new-XXXXXX.json)
node ${CLAUDE_PLUGIN_ROOT}/analysis/analyze.js /tmp/factory-diff-new-$$ > "$TMPFILE_NEW"
git worktree remove /tmp/factory-diff-new-$$ --force 2>/dev/null
Read both JSON files and produce a diff by comparing nodes, edges, and actions.
For every node, match by id across old and new:
diff_status: "added".diff_status: "removed".diff_status: "modified". Include diff_changes array.diff_status: "unchanged".Compare edges (connections between nodes):
Compare actions (route flows, worker flows, etc.):
Construct a combined architecture JSON with ALL nodes from both states, each annotated with diff_status. Enrich ALL nodes with full metadata following the same enrichment rules from /backend-factory:start and /backend-factory:analyze.
Add a diff_summary top-level field with counts and lists.
TMPFILE_DIFF=$(mktemp /tmp/factory-diff-XXXXXX.json)
# Write the diff architecture JSON to the file
curl -s -X POST http://localhost:7777/api/architecture \
-H "Content-Type: application/json" \
-d @"$TMPFILE_DIFF"
rm -f "$TMPFILE_OLD" "$TMPFILE_NEW" "$TMPFILE_DIFF"
Report the diff with a creative "factory renovation report" narration:
End with:
/backend-factory:start, /backend-factory:analyze, /backend-factory:simulatenpx claudepluginhub randyquaye/backend-come-alive --plugin backend-factoryVisualizes git diffs, branches, commits, PRs, and ranges as interactive HTML reports with architecture diagrams, KPI dashboards, code review cards, and side-by-side comparisons.
Visualizes planned code changes as ASCII diagrams with before/after architecture, risk analysis, execution order, and impact metrics. Use for reviewing plans, migrations, or assessing change impacts.
Compares Trailmark code graphs between git commits, tags, or directories to detect new attack paths, complexity shifts, blast radius growth, and other security changes missed by text diffs.