Skip to content

explain: new plugin whose changes-high-level skill explains a change to a service as one HTML page - #7

Open
fprochazka wants to merge 1 commit into
masterfrom
explain-plugin
Open

fprochazka wants to merge 1 commit into
masterfrom
explain-plugin

Conversation

@fprochazka

@fprochazka fprochazka commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Why

A tech lead who judges many merge requests, tickets and design documents cares most about the parts that are hard to change later: database schemas, queue topology, API contracts. The source hides them in migrations, nested DTOs and configuration classes, and a dense ticket or design document is hard to read in one pass. The new explain plugin turns any such change into one HTML page that shows those parts in full, so the reader can judge the change without reading the source. It explains and never reviews: no findings, no verdicts, nothing posted anywhere. Reviews stay with code-review.

What it does

One skill, explain:changes-high-level, usable as /explain:changes-high-level <source> [focus] and loaded by Claude when you ask what a change does. The source is anything the session can read that describes a change: an MR or PR, the current branch, a ticket, a document, a chat thread, a URL, a file, or pasted text.

A run:

  1. Intake (the session itself): fetches the source with whatever tool the session has, finds out whether a diff exists, and writes change.md. Without a diff, the page compares the proposed change with the current code and marks it as proposed.
  2. Surface scan (one sonnet subagent, 2 minutes): lists the areas of the code the change touches and the contract files in each. It starts in the background as soon as the range is known and overlaps the rest of the intake.
  3. Decide (the session): picks the deep dives from the scan's reply alone, at most six, grouping the smallest areas when there are more. Every contract file lands on exactly one deep dive's checklist.
  4. Deep dives (opus subagents, all in one message, 5 minutes each): each writes a JSON fragment with its area's database, messaging, HTTP and configuration changes, its entry points and what each reads, writes, publishes and calls, flow notes, and a Mermaid flow diagram. A deep dive may read another service's clone already on disk, read-only, for the far side of an interface; the page names the clone and commit as possibly stale.
  5. Render (one separate sonnet subagent, 2.5 minutes): merges the fragments with build.py merge (which also checks every path:line ref against the code), writes page.json, generates the overview diagrams with build.py diagrams, renders all diagrams with mmdc, and builds the page with build.py page. No subagent writes HTML or SVG, and no model draws the overview diagrams.
  6. Output: opens the page in the browser, with the opener command the user's CLAUDE.md names when there is one, and publishes it where the user's saved preference says, or asks once.

The target is about 10 minutes of wall clock for a typical change and about 15 for a large one. Every budget is in minutes; each subagent keeps its own time with date +%s. A large change gets grouped areas and more unknowns, never more time per stage.

The page has the same layout every time: a short framing of what the change is and why; a change map with the services involved (when more than one) and one flow diagram per entry point, every box linking to its card; then every cross-system interface as a card that opens with one sentence, then its diff, with what it costs to change later and how it rolls out. Tables show as their CREATE TABLE statement in the service's SQL dialect, diffed before and after, with notes as aligned -- comments, and a second tab draws the tables and their foreign keys. Payloads show as JSON-like diffs with // comments. After the interfaces come modules and placement per package, then code internals, short. Contract files that no deep dive covered are listed at the top. The page is one self-contained file: inline SVG diagrams, inline CSS and JS, no network, light and dark mode.

Where to start reading

  1. plugins/explain/DESIGN.md for the purpose, the non-goals and the principles.
  2. plugins/explain/skills/changes-high-level/SKILL.md, the driver with the stages, the subagent prompts and the budgets.
  3. The subagent briefs under references/: surface.md, deep-dive.md, render.md, and the per-kind database.md, messaging.md, http.md, which say how a found table, route, message or endpoint is written into the fragment so it renders as a diff. The intake and output steps live in SKILL.md.
  4. scripts/build.py with page.schema.json and contracts.schema.json, which define what subagents may write, and assets/template.html, which owns the look.

scripts/fixtures/ is an invented two-area change (invoicing and shipments) used by the tests.

Changes outside plugins/explain

  • .claude-plugin/marketplace.json and the root README: the marketplace entry, the dependency row (prose, diagrams) and the plugin table row.
  • .claude/rules/plugins/explain.md: the path-scoped rule that points at the design.
  • Makefile: make test runs test_build.py.
  • .github/workflows/check.yml: installs jsonschema, which build.py and its tests need.
  • Root README, Checks paragraph: make test now covers "the hook and build-script test suites".

What was checked

  • make all passes locally: the repository checks, claude plugin validate --strict, and the test suites, including the 55 tests in test_build.py (schemas, merge and coverage gaps, path-located validation errors, the ref check, section order, the SQL and payload diffs, the generated diagrams and their links, escaping, SVG inlining, the offline check, and the time-budget and clone rules in the skill's text).
  • A smoke page built from the fixture: build.py merge and build.py diagrams, all diagrams rendered with mmdc, then build.py page, with 1700 px wide full-page screenshots in light and dark mode in headless Chrome, offline. Clicking a box in a change-flow diagram jumps to its card, and clicking a box in the relationships tab opens the SQL tab at that table.

Not verified

  • One end-to-end run on a real merge request, against the previous version of this branch (8 minutes); its findings shaped this version. This version has not been run end to end yet.
  • Whether the Agent tool honors a per-spawn model and effort set by the skill is unconfirmed.
  • There is no eval suite, by the maintainer's choice. A change to SKILL.md or a brief is checked by using the skill on real changes, as DESIGN.md says.

@fprochazka
fprochazka force-pushed the explain-plugin branch 3 times, most recently from 72576cd to 99aa0de Compare November 19, 2026 16:54
…to a service as one HTML page

The page is for a tech lead who reads it instead of the MR, ticket or document: a change
map of the services and entry points involved, then every database, messaging, HTTP and
other cross-system interface change in full, each labeled with what it costs to change
later and how it rolls out, then placement per package, then short code internals.
Tables show as diffed CREATE TABLE statements and payloads as JSON-like diffs.

build.py validates the subagents' JSON against JSON Schemas, generates the overview
diagrams from it so every box links to its card, and renders the fixed template, so the
layout is the same on every page; CI installs jsonschema for its tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant