Skip to content

Docs review: decision-first skill, full output grammar in reference, dedupe README - #35

Merged
tmashara merged 6 commits into
mainfrom
docs-review
Oct 29, 2026
Merged

tmashara merged 6 commits into
mainfrom
docs-review

Conversation

@tmashara

@tmashara tmashara commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

The docs had been updated a piece at a time as --computed, --mask/--mask-media, video freezing, exit-1-by-default, summary.differing, the area-based ceiling, line labels, pseudo-element entries and the base-build reference landed. This PR checks each of them against src/, makes the agent skill spell out its decisions, and removes text that was repeated across files.

Skill

  • SKILL.md is now a short loop with the decisions spelled out:
    • Pick the mode: CSS-only work gets pixels plus --computed (trust dom identical); markup migrations get pixels only; a component gets --selector.
    • Loop: base build vs change build; a base-vs-base baseline, masking whatever differs, then a rerun.
    • Reading a row: the order to read it in, plus the five most common tokens.
    • Fix, accept or mask: a table, including what can't be accepted.
    • Iterate and finish: --rerun-failed and --cache-right, then a fresh full run.
    • Exit codes and the verdict format.
    • Each step names the reference.md section that has the details.
  • reference.md has named sections: Reference and routes, Output (summary lines, row tokens, dom entries, crops), Errors, --computed, Masks/accepts/thresholds, Rationalizations, Exit codes, Iterating, Scoping, Config file, results.json, Gotchas.
    • New here: the full compact-summary grammar, sel "a"→"b" text entries, the computed: block grammar (truncated, unmatched, snapshot failed), the complete exit-2 list, summary.accepted/stale, meta.config, and accept-where-you-check.
    • Fixed: it said --mask applied only "without a config"; it is added to the config's masks.

Word counts

File Before After
skills/renderdiff/SKILL.md 746 744 (about 75 of these are the unchanged frontmatter; it now also covers the cold-read gaps listed below)
skills/renderdiff/reference.md 2,627 3,639 (it absorbs the full output grammar, errors, --computed, exit codes, and the details moved out of SKILL.md)
README.md 3,079 2,113

Human docs

  • README:
    • The intro names the base build as a reference.
    • The token table and the results.json example move to docs/output.md; the README links to them.
    • The accept section is reframed around the baseline (base vs base means mask, not accept).
    • The exit-2 row is complete.
    • The video flag rows are shorter.
    • The quickstart is unchanged.
  • docs/output.md:
    • New Tokens glossary, which adds line, pseudo-element entries, (re-parented), N accepted and the verdict line.
    • New results.json section, with accepted and meta.config added to the example.
    • The --progress regions cell was wrong ("on the report card"). It now shows the real N regions, largest WxH at (x,y) line.
    • The summary prose that the glossary now covers is trimmed.
  • docs/accepted.md:
    • The intro now covers both kinds of reference.
    • New --cache-right section (moved from the README).
  • renderdiff.config.example.ts:
    • Adds freezeVideo and maskMedia, which were missing from the "annotates every field" file.
    • The left and right example origins are now a local build of the base.
    • The threshold comment states exit-1 semantics.
    • The extraCss example no longer hides video, which freezing makes unnecessary.
  • CONTRIBUTING.md: brings the corpus description up to date (seven controls, six equivalence pairs, guard rails for video, the area ceiling and failed assets, accepted/computed test files) and mentions format:check.
  • action.yml: the concurrency, storage-state and wait-timeout descriptions now say what the action does (default, 0600 temp file, exit 2 on timeout).
  • src/cli.ts (help text only): exit 1 is now "differs and isn't accepted", and exit 2 includes an out dir it won't wipe.

Checks: npm run lint, npm run format:check, npm run typecheck and npm test (271 pass) all pass.

Cold-read follow-up (SKILL.md)

A fresh agent that read only the skill and answered seven scenarios found gaps. Added, mostly one line each:

  • The baseline when the change is already made: serve the base build on two ports and diff it against itself.
  • A static-server command, and a warning about clean-URL and trailing-slash mismatches.
  • The default widths.
  • Route coverage for removed CSS: list every page its selectors could match; unlisted pages go under Not verified.
  • Hover, focus and open menus are not shot without a before hook.
  • Exit 0 does not mean verified: unstable pixels or a failed asset alone still exit 0.
  • What dom differs usually means, with a pointer to § --computed.
  • Accepts are per OS.
  • Looping carousels: stop them with a hook or mask them.
  • Section pointers where "can't be accepted" and dom differs come up.

Moved out of SKILL.md to keep its size flat: the example tokens (now in § Output), the exit-code details (§ Exit codes) and the --cache-right details (§ Iterating).

Code bugs found, fixed in separate commits

  1. The stderr failure line counted shots but said routes. src/run.ts printed ✗ ${shots} route(s) differ. It now prints ✗ 2 routes differ (4 shots). (below 97.00% with --threshold). The controls test now covers two routes at two widths.
  2. --accept didn't say which shots it skipped. It printed only accepted N difference(s); the run then exited 1 because shots it can never accept were still differing. It now adds one line: not accepted: N differing shot(s) can't be (1 unstable, 2 width change) — reference.md § Masks, accepts and thresholds. accept.ts exports the reason. A new test in accepted.test.ts widens one side and checks the line.
  3. The manifests still said "against production". .claude-plugin/plugin.json, .claude-plugin/marketplace.json and the package.json description now say "a local build of the base (or production)".

Checks after these: lint, format:check, typecheck and npm test (271 tests) pass. The changed visual tests were run on their own and pass: the threshold/exit tests in controls.test.ts and the accepted-differences tests in accepted.test.ts.

🤖 Generated with Claude Code

tmashara and others added 6 commits October 29, 2026 12:05
…e README

SKILL.md is now a short loop with the decisions explicit: when to add --computed,
base-vs-base baseline then mask, how to read a row, when to fix, accept or mask, and
the verdict. The full output grammar, errors, --computed, exit codes and edge cases
move to reference.md sections it points at. README links to docs/output.md for the
token glossary and results.json instead of repeating them. Help text, action inputs
and the example config are brought in line with the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"✗ 2 routes differ (10 shots)." instead of "✗ 10 route(s) differ.", which counted
shots under the word routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A shot with unstable pixels, a width change or an unaligned height change is never
accepted; the run now prints one line counting them by reason instead of exiting 1
with no explanation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the already-made-change baseline, a static server line, default widths, route
coverage for removed CSS, unshot states, exit 0 not meaning verified, per-OS accepts and
section pointers; moves token examples, exit details and --cache-right to reference.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmashara
tmashara merged commit 0c00c8d into main Oct 29, 2026
3 checks passed
@tmashara tmashara mentioned this pull request Oct 29, 2026
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