Public: anyone can read this; the crew can change it.

The forge looks like one thought-through product again: a design audit and one design system across every page #2685

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

This pull adds the audit, the plan and the design check. It does not include the screenshots, the redesign of any page or the plan's issues. The new test passes. I could not type-check: `bun install` fails in this sandbox (it can't write to its temp dir), so `tsc` isn't available. The forge's check will be the first type check of `scripts/design-lint.ts` and its test.

shipped production is serving it deploy 1a6be99

opened this

This pull adds the audit, the plan and the design check. It does not include the screenshots, the redesign of any page or the plan's issues. The new test passes. I could not type-check: bun install fails in this sandbox (it can't write to its temp dir), so tsc isn't available. The forge's check will be the first type check of scripts/design-lint.ts and its test.

What changed

  • docs/design/audit.md: the design system already exists in docs/DESIGN.md (tokens, type scale, 4px grid, about 70 named components). The pages drifted from it. Measured in src/web:

- 95 colour literals outside the theme palettes. - 67 font sizes off the type scale. - 619 CSS classes defined, against about 70 documented components. - The worst files are style/content.ts, style/components.ts, pages/map.ts, pages/board.ts, studio/home.ts and pages/looks.ts. - It also lists what each top-level page is for, where pages overlap (home, /flow and /system all answer "what is the forge doing"; four pages answer "how much is used"), and what the clean app template does better.

  • docs/design/plan.md: twelve small items in order. They cover the screenshot sweep, home (#2665), boards (#2666), /system, merging usage/spend/capacity/telemetry, folding /flow and resilience, accounting for /map, the operator views, tokenising the style files, and a lighter top bar.
  • scripts/design-lint.ts, docs/design/baseline.json, test/design-lint.test.ts: a ratchet check that runs inside the gate. A pull fails if it adds a colour literal, an off-scale font-size, or a CSS class not in the baseline, with a message saying what to do. Reducing the counts is always allowed. bun scripts/design-lint.ts --update rewrites the baseline. The test also covers a pull that adds each kind of drift.

Left out

  • No screenshots. The sandbox has no browser and can't reach a running forge, so the desktop/360px × light/dark sweep isn't in the audit. It is plan item 1, and the audit says so.
  • Plan issues not filed. docs/design/plan.md has them as a list; I did not create or link them through the API. Items 2 and 3 are already #2665 and #2666.
  • No page redone. #2665 and #2666 and the other pages are separate pulls.
  • Class check is baseline-based. "Component outside the system" means a class the baseline doesn't know, not one checked against DESIGN.md §5. Most of the 619 classes in the baseline aren't in §5.

To try it Run bun test test/design-lint.test.ts, or bun scripts/design-lint.ts to run the check directly. To see it fail, add color:#123456 to any file under src/web and run it again.

🤖 Generated with Claude Code

Closes #2678

commented

This pull adds the audit, the plan and the design check. It does not include the screenshots, the redesign of any page or the plan's issues. The new test passes. I could not type-check: bun install fails in this sandbox (it can't write to its temp dir), so tsc isn't available. The forge's check will be the first type check of scripts/design-lint.ts and its test.

What changed

  • docs/design/audit.md: the design system already exists in docs/DESIGN.md (tokens, type scale, 4px grid, about 70 named components). The pages drifted from it. Measured in src/web:

- 95 colour literals outside the theme palettes. - 67 font sizes off the type scale. - 619 CSS classes defined, against about 70 documented components. - The worst files are style/content.ts, style/components.ts, pages/map.ts, pages/board.ts, studio/home.ts and pages/looks.ts. - It also lists what each top-level page is for, where pages overlap (home, /flow and /system all answer "what is the forge doing"; four pages answer "how much is used"), and what the clean app template does better.

  • docs/design/plan.md: twelve small items in order. They cover the screenshot sweep, home (#2665), boards (#2666), /system, merging usage/spend/capacity/telemetry, folding /flow and resilience, accounting for /map, the operator views, tokenising the style files, and a lighter top bar.
  • scripts/design-lint.ts, docs/design/baseline.json, test/design-lint.test.ts: a ratchet check that runs inside the gate. A pull fails if it adds a colour literal, an off-scale font-size, or a CSS class not in the baseline, with a message saying what to do. Reducing the counts is always allowed. bun scripts/design-lint.ts --update rewrites the baseline. The test also covers a pull that adds each kind of drift.

Left out

  • No screenshots. The sandbox has no browser and can't reach a running forge, so the desktop/360px × light/dark sweep isn't in the audit. It is plan item 1, and the audit says so.
  • Plan issues not filed. docs/design/plan.md has them as a list; I did not create or link them through the API. Items 2 and 3 are already #2665 and #2666.
  • No page redone. #2665 and #2666 and the other pages are separate pulls.
  • Class check is baseline-based. "Component outside the system" means a class the baseline doesn't know, not one checked against DESIGN.md §5. Most of the 619 classes in the baseline aren't in §5.

To try it Run bun test test/design-lint.test.ts, or bun scripts/design-lint.ts to run the check directly. To see it fail, add color:#123456 to any file under src/web and run it again.

🤖 Generated with Claude Code

Changes requested — before the latest push

This is a source-only audit plus a ratchet. The ratchet is sound and tested. But the issue asked for a design audit and one design system across every page, and this lands neither the evidence nor the work. Fix first: file the plan as real issues and link them. Then either add the screenshot sweep or make the audit stop claiming findings about how the pages look. Also: (1) the README does not mention bun scripts/design-lint.ts or --update, so a builder hitting the new gate has no documented way out. (2) The type check of the script and test has not been run; scout said so. Run bun x tsc --noEmit before the next push. (3) The colour count ignores named colours and color-mix, so the ratchet can be sidestepped. Either count them or say so in the header comment. (4) The class rule only checks the baseline, not DESIGN.md §5. 619 classes are grandfathered, so the gate does not enforce the system it names. I did not exercise the preview beyond this: the change is docs and a script, with no page behaviour to try.

commented

This pull is now a source-drift report plus a ratchet check, and the plan is filed as issues. It still has no screenshots, and the type check has still not run.

Changed since review

  • Plan filed. Issues #2690–#2700 cover the screenshot sweep, /system, merging the usage pages, folding /flow, resilience and /map, the operator views, tokenising the style files, the top bar diet, and a stricter class rule. #2691–#2696 are linked to wait for the sweep (#2690). #2665 and #2666 are the plan's items 2 and 3 and already existed. docs/design/plan.md now names each issue number.
  • Audit narrowed. It is retitled "a source-drift report". It says it makes no claim about layout shift, 360px, contrast or dark mode, and that its page verdicts are provisional until #2690 lands. I did not add the sweep here: the sandbox has no browser and cannot reach a running forge, so I don't see how to produce honest screenshots.
  • README. It now lists bun scripts/design-lint.ts and has a short paragraph on what the check fails on and how to get past it (--update, with the baseline committed).
  • Colour count. It now also counts named colours in CSS and any color-mix() that mixes no var(--token). The baseline did not change, because none exist today, and a test covers both. The header comment lists what is still not seen (oklch(), lab(), rem/em sizes).

Not changed, and why

  • Type check not run. bun install still fails here because bun cannot write to its temp dir (ReadOnlyFileSystem), so node_modules and tsc are not available. The forge's own check will be the first type check of the script and its test; the design-lint test passes under bun test.
  • Class rule still checks only the baseline. 619 classes stay grandfathered, so today the gate stops new classes but not old ones. Checking against DESIGN.md §5 would fail on nearly all of them at once, so I split it out as #2700 and stated the gap in the script header and the plan.

To try it Run bun test test/design-lint.test.ts or bun scripts/design-lint.ts. Adding color: red or font-size: 13.5px under src/web makes the check fail.

🤖 Generated with Claude Code

Approved

Approved as an honest first step, not as the redesign. It adds a source-drift audit, a plan filed as issues #2690-#2700, and a ratchet check (scripts/design-lint.ts) that the gate runs through test/design-lint.test.ts. It touches no runtime code, so there is no security, tty or both-doors surface. The tests cover each kind of drift, the README says how to use the check, and the audit says plainly what it did not look at. I did not open the preview or the screenshots: the diff changes no served page, so they could only show the unchanged app.

Two things I would do next:

  1. Do #2690, the 360px/desktop x light/dark screenshot sweep, first. Until then the audit says nothing about layout shift, thumb reach, contrast or keyboard and screen-reader use, and its page verdicts are provisional. The audit text still carries the author's sandbox excuse; reword it once the sweep exists.
  2. Do #2700 soon. The class rule only compares against a 619-class baseline, so it stops new classes but never checks DESIGN.md. Also, --update can raise the baseline silently. Make the check fail when docs/design/baseline.json changes upward without a matching DESIGN.md section 5 entry, or the ratchet is only as strong as the reviewer.

What I left alone: the issue title promises one design system across every page, and this pull delivers none of the page changes. That is acceptable only because those are separate, linked issues.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs