@jonandev/longbeard 0.12.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/AGENTS.md +5 -6
  2. package/CHANGELOG.md +51 -0
  3. package/README.md +3 -4
  4. package/beard.json +6 -20
  5. package/bin/long-beard.js +2 -2
  6. package/package.json +2 -2
  7. package/skills/design/SKILL.md +21 -37
  8. package/skills/design-brief/SKILL.md +7 -5
  9. package/skills/design-check/SKILL.md +1 -1
  10. package/skills/design-check/references/design-rules.md +28 -5
  11. package/skills/design-check/scripts/rules.mjs +143 -9
  12. package/skills/design-content/SKILL.md +2 -0
  13. package/skills/design-direction/SKILL.md +87 -95
  14. package/skills/design-direction/references/design-floor.md +118 -0
  15. package/skills/design-direction/references/graphic.md +5 -10
  16. package/skills/design-direction/references/library.md +8 -6
  17. package/skills/design-direction/references/screen-template.html +3 -3
  18. package/skills/design-direction/references/subject.md +2 -2
  19. package/skills/design-direction/references/variants.js +43 -0
  20. package/skills/design-direction/scripts/canvas.mjs +311 -0
  21. package/skills/design-direction/scripts/colours.mjs +247 -0
  22. package/skills/design-direction/scripts/moodboard.mjs +233 -93
  23. package/skills/design-direction/scripts/rules.mjs +747 -0
  24. package/skills/design-direction/scripts/sheet.mjs +3 -1
  25. package/skills/design-figma/SKILL.md +3 -1
  26. package/skills/design-identity/SKILL.md +17 -8
  27. package/skills/{design-direction → design-identity}/references/controls.md +10 -10
  28. package/skills/design-identity/references/design-floor.md +118 -0
  29. package/skills/design-identity/references/identity-board.html +2 -2
  30. package/skills/design-identity/scripts/colours.mjs +35 -1
  31. package/skills/design-identity/scripts/sheet.mjs +3 -1
  32. package/skills/design-moodboard/SKILL.md +44 -76
  33. package/skills/design-moodboard/references/graphic.md +1 -1
  34. package/skills/design-moodboard/references/sources.md +12 -1
  35. package/skills/design-moodboard/scripts/group.mjs +1 -1
  36. package/skills/design-moodboard/scripts/moodboard.mjs +233 -93
  37. package/skills/design-prototype/SKILL.md +66 -82
  38. package/skills/design-prototype/references/design-floor.md +118 -0
  39. package/skills/design-prototype/references/design-md-template.md +3 -0
  40. package/skills/design-prototype/references/graphic.md +6 -5
  41. package/skills/design-prototype/references/variants.js +43 -0
  42. package/skills/design-prototype/scripts/drift.mjs +273 -0
  43. package/skills/design-prototype/scripts/links.mjs +5 -4
  44. package/skills/design-prototype/scripts/rules.mjs +143 -9
  45. package/skills/design-prototype/scripts/sheet.mjs +3 -1
  46. package/skills/design-wordmark/SKILL.md +8 -2
  47. package/skills/design-wordmark/scripts/sheet.mjs +3 -1
  48. package/skills/idea/SKILL.md +3 -3
  49. package/skills/design-direction/references/design-rules.md +0 -203
  50. package/skills/design-direction/references/five-second.md +0 -47
  51. package/skills/design-direction/references/full-build.md +0 -19
  52. package/skills/design-direction/references/grid.md +0 -114
  53. package/skills/design-direction/scripts/layout-diff.mjs +0 -118
  54. package/skills/design-families/SKILL.md +0 -138
  55. package/skills/design-families/scripts/contact-sheet.mjs +0 -259
  56. package/skills/design-families/scripts/families.mjs +0 -607
  57. package/skills/design-families/scripts/measure.mjs +0 -1728
  58. package/skills/design-families/scripts/moodboard.mjs +0 -469
  59. package/skills/design-families/scripts/tag.mjs +0 -289
  60. package/skills/design-prototype/references/design-rules.md +0 -203
  61. package/skills/design-prototype/references/five-second.md +0 -47
@@ -2,11 +2,12 @@
2
2
  name: design-prototype
3
3
  description: >
4
4
  Design the product's key screens in the chosen direction and identity: the
5
- first screen finished, the other key screens prototyped in one go with real
6
- copy and pictures, every reachable state, options only where a layout really
7
- forks. On their yes to the rendered prototype, writes DESIGN.md in one go,
8
- contrast-checked. Runs when docs/design/design-direction.md and design-identity.md exist and there
9
- is no DESIGN.md, or for a feature that needs screens once DESIGN.md exists.
5
+ first screen finished, then the other key screens in its frame, with real
6
+ copy and pictures and every reachable state, checked by script. On their yes
7
+ to the rendered prototype, writes DESIGN.md in one go, contrast-checked.
8
+ Runs when docs/design/design-direction.md and design-identity.md exist and
9
+ there is no DESIGN.md, or for a feature that needs screens once DESIGN.md
10
+ exists.
10
11
  ---
11
12
 
12
13
  # Design prototype
@@ -15,135 +16,118 @@ description: >
15
16
  **Uses if there:** `docs/design/design-content.md`, `docs/design/design-moodboard.md`
16
17
  **Writes:** `DESIGN.md`
17
18
 
18
- Comes out: a prototype they approved (in `.longbeard/design/prototype/`, gitignored), then **`DESIGN.md`**, committed, the official look. Then `design-figma`.
19
+ A prototype they approve (in `.longbeard/design/prototype/`, gitignored), then **`DESIGN.md`**, committed. Then `design-figma`. Read [Before you build](references/design-floor.md#before-you-build) before building, and apply it while you draw; [the floor](references/design-floor.md) is the checklist here. The direction's **principles** are what every page answers to; the soft rules are `design-check`'s.
19
20
 
20
- Read [design-rules.md](references/design-rules.md) before the first screen: it is the checklist here and in `design-check`.
21
+ **They are the designer; you do the craft.** The chosen screen carries their concept. Develop it across the product, make the craft decisions it leaves open, and add no taste of your own.
22
+
23
+ **At every stop,** say what is new and the one question, in up to five lines: a path or a sheet instead of pasted content, one line per option, nothing they already know.
21
24
 
22
25
  ## Gate
23
26
 
24
27
  1. No `docs/design/design-direction.md` → `design-direction`. No `docs/design/design-identity.md` → `design-identity`. Stop, and say which.
25
28
  2. `DESIGN.md` exists with token tables (rows like `color/ink`) → **Feature loop**.
26
- 3. Otherwise → **First pass**. A `DESIGN.md` with no token tables is one they brought: say that this writes ours, and ask before it replaces theirs.
29
+ 3. Otherwise → **First pass**. A `DESIGN.md` with no token tables is one they brought: say this writes ours, and ask before replacing it.
27
30
 
28
31
  A graphic (the brief's surface): read [graphic.md](references/graphic.md) first.
29
32
 
30
- Read the brief, `docs/design/design-brief.md`, `design-identity.md`, `design-direction.md`, and `design-content.md` if it exists. The chosen first screen is `.longbeard/design/direction/prototype/first.html`. If the private folder is gone, rebuild the first screen from `design-direction.md`'s composition and the identity, and say so.
31
-
32
- **At `pace: quick`** (the design brief): options only when they ask, never offered at a fork (build the one that follows the first screen, and name the fork). Everything else is as full: the states, contrast, the walks and the five-second check are what make it work, and quick never skips them.
33
+ Read the brief, the design brief, the identity, the direction and `design-content.md` if there. The chosen first screen is `.longbeard/design/direction/prototype/first.html`; if it is gone, rebuild it from the direction's composition and the identity, and say so.
33
34
 
34
35
  ## First pass
35
36
 
36
37
  ### 1. Finish the first screen
37
38
 
38
- The chosen screen, `first.html`, is a fixed 1440×900 page built from their references: the reference, not the page. Build `.longbeard/design/prototype/home.html` (or the brief's first key screen) as a real page from it: the same composition, type, colours, finish, content and devices, responsive, on one stylesheet (and script) that every key screen shares. Keep `first.html` open beside it and compare captures at 1440: the first screen must still be the one they chose. Then finish it:
39
-
40
- - **The faces** loaded properly at every size. A stand-in face is said again: the product ships it, or the face it stands in for.
41
- - **Spacing:** as built, tighter and looser (the same page with its margins and gaps scaled to 0.8 and 1.25), shown on a crop where the margin and the navigation meet as well as whole. They pick.
42
- - **The rest of the page:** what sits below the first screen, the small text, every width down to the phone. The direction's ranges hold.
43
- - **Motion,** exactly what the design brief's `motion` line picks, and nothing beyond it. `none` is state changes only, no entrances. How much: quiet is fades only; present adds moves that guide the eye; leading makes motion part of the identity. Driven by: only the triggers it names (scroll, cursor, time). Character: each named character (physics: inertia, springs, weight; smooth: eased, calm; snappy: fast, crisp) where the line says it applies. Moments: only those it names. A pick the line leaves out is not built. Build from `design-direction.md`'s `motion:` line, within the picks. Play its base reference again from its frames or its live link (`capture.mjs <url> --out .longbeard/design/prototype/<name>-replay --frames 12`), build that motion in CSS, none of its content, and say which reference's motion was replayed. Every motion honours `prefers-reduced-motion`.
44
- - **What waits for the prototype.** The grid screen carried only what its reference carries; `design-direction.md`'s `for the prototype` line lists the rest the first screen needs (a second action, the full list, pickup times). Place each in the composition's own system: aligned to what is there, in its type sizes, never shrinking the headline or tidying a device to make room. What does not fit the first screen goes below it or onto the screen it belongs to. Where it forks (the full list on the first screen, or one line and a link to it), build two or three options and let them choose (at `pace: quick`, the one that keeps the first screen as chosen, and name the fork).
45
- - **The ownable**, finished from the product's own world.
46
- - **The states** a person can reach here (empty, loading, error), and the second theme if the design brief asked for both.
39
+ `first.html` is a fixed 1440 by 900 page. Build `home.html` (or the brief's first key screen) from it as a real, responsive page, on one stylesheet every key screen shares. At 1440 it must still be the screen they chose.
47
40
 
48
- ### 2. The other key screens, in one go
41
+ - **Faces** loaded at every size. A stand-in face is said again.
42
+ - **The rest of the page:** below the first screen, small text, every width down to the phone.
43
+ - **Motion:** exactly the design brief's `motion` line, from the direction's `motion:` line, nothing beyond (`none` is state changes only). Honour `prefers-reduced-motion`.
44
+ - **What waits for the prototype** (the direction's `for the prototype` line), placed in the composition's own system, never shrinking the headline or tidying a device.
45
+ - **The ownable**, finished. **The states** reachable here (empty, loading, error), and the second theme if asked for.
49
46
 
50
- List them once, navigation's details first (the menu open, on scroll, on a phone):
47
+ ### 2. The other key screens
51
48
 
52
49
  > I'll prototype <the menu>, <screen>, <screen>. Change the list?
53
50
 
54
- Then build them all, linked so they click through, in the identity and the direction. Build once and reuse: one menu, one card, one row, one heading style everywhere.
55
-
56
- - **Layout:** where a moodboard reference shows that kind of screen, take its layout (never its content), from any family; the look is already fixed. Where none does, it follows from the first screen.
57
- - **The direction's devices carry over.** Overlaps, collisions, crops, giant type, wide empty space: the chosen screen's moves appear on the other screens too, never tidied away. Text cropped on purpose is marked `data-crop`. Each screen gets the same light touch-up as the first: contrast where text sits, every item the screen needs and its primary action present, nothing plainly broken. A screen is not done until it reads right *and* still looks like the chosen one.
58
- - **Density** as the design brief's `dense` asks, on every screen: how much sits on a screen, row heights, how much is shown before "more". An airy 1–2 shows less and lets it breathe; a dense 4–5 shows more per screen and keeps spacing tight.
59
- - **Real content, complete.** Copy in the voice, the longest real names, every section a person needs to act, and everything under `for the prototype` that belongs on this screen. With `design-content.md`, follow it. Without it, fill `design-content`'s fact sheet from the brief and the design brief first, and draft only from the fields that have something in them: an empty field shrinks or drops its section, and you say what they must supply. Each rhetorical device appears once on a screen. A detail you assumed is marked as assumed (see the prototype's stand-in marks). Say the copy is a draft. Pictures: theirs, or the stand-ins of the product's own subject in `.longbeard/design/pictures/` (more with `pictures.mjs`, or a full set planned with `design-content`); never grey boxes, never the references' subject.
60
- - **States,** once a screen is settled: empty, loading and error where reachable (`?state=empty`), every width, each theme.
61
-
62
- - **Marked, not hidden.** Anything a screen shows that the product does not really have yet carries a mark in the markup: `data-standin="picture"` on a stand-in picture, `data-standin="fact"` on a price, hour, number or name the brief and `design-content.md` do not give, with `data-standin-note` for what is assumed. A picture and a fact of theirs carry nothing.
63
-
64
- A pattern that brings a feature the brief does not have is named when shown: kept, it is a product change (`idea`, Change) before `DESIGN.md`.
51
+ Then build them all, linked.
65
52
 
66
- ### 3. Show it, and name the forks
53
+ - **The direction's principles hold on every page.** They are this design's rules: a page that would break one is drawn again, or the clash goes to them as a choice.
54
+ - **The chosen screen is the frame, as a system, not a composition to repeat.** Its header, navigation, grid, type sizes, colour roles (which colour for headlines, small text, buttons and fields) and spacing steps stay the same on every page. One menu, one card, one row, one heading style everywhere.
55
+ - **Each page opens with its own job** in the first view (the list on the menu, the form on checkout), never the first screen's hero again.
56
+ - **The direction's devices carry over** where the page has room for them: overlaps, crops, giant type, empty space, never tidied (`data-crop` on text cropped on purpose).
57
+ - **Every part** (a footer, a form, a menu, a list) comes, in this order, from:
58
+ 1. The chosen screen's frame and concept, always: beside the first screen, it reads as the same product.
59
+ 2. Their liked references that show that part, minus their **Leave out**: its layout, inside the frame, never its content, faces or colours.
60
+ 3. None, for a key part (a footer, a form, a page's main content): ask once, all of them in one message, with the closest cards or a search for that one part (`design-moodboard`'s One piece).
61
+ 4. Never block: build it meanwhile, and a small part (a field, a stepper) at once, from the frame's own system, marked `data-standin`, and put their answer in when it comes.
62
+ - **Density** as the design brief's `dense` asks: airy 1–2 shows less, dense 4–5 shows more and keeps spacing tight.
63
+ - **Real content:** copy in the voice, the longest real names, every section a person needs. Follow `design-content.md`; without it, draft only from what the brief gives and say what they must supply. Pictures: theirs or the subject's stand-ins in `.longbeard/design/pictures/`; never grey boxes, never a reference's subject.
64
+ - **States:** empty, loading and error where reachable (`?state=empty`), every width, each theme.
65
+ - **Marked, not hidden:** `data-standin="picture"` or `"fact"` (with `data-standin-note`) on anything the product does not really have yet.
67
66
 
68
- Give the paths and say what each screen is made of. Name every fork: a screen the references arrange in clearly different ways, or one where you had to choose. Never pick among them silently.
67
+ A pattern that brings a feature the brief does not have is named; kept, it is a product change (`idea`) first.
69
68
 
70
- > Click through. Want options anywhere? I'd offer them for <forks>.
69
+ ### 3. Check by script
71
70
 
72
- **Options, only at a fork or when asked:** two to four layouts, each from a different reference (or one that follows the first screen), built inside the prototype, captured on one sheet (`sheet.mjs`), never ranked. They pick, mix or ask for more. Nothing fits → `design-moodboard`, one piece, then back.
73
-
74
- ### 4. Self-check
75
-
76
- Capture every screen and state at desktop and phone, each theme:
71
+ Capture every screen and state at 1440 and 390, each theme, and look at each capture yourself. Then:
77
72
 
78
73
  ```
79
- node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/prototype/home.html?capture" --out <scratch>/home.png
80
- node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/prototype/home.html?capture" --out <scratch>/home-phone.png --width 390
81
74
  node <skill>/scripts/screen-contrast.mjs "file://$PWD/.longbeard/design/prototype/home.html" --wait-title ready
82
- ```
83
-
84
- `screen-contrast.mjs` reads the whole page down to `--max-height` (10000 px), and takes `--level AAA` at that brief. Say in the self-check where it stopped if it did not reach the bottom, and list every text it printed as "not read" (a colour it could not resolve, a fill clipped to the letters): those are unchecked, not passed. Exit 1 is a failing text, 3 is a run that did not finish.
85
-
86
- Check them against the rules: Idea first, then hard (structure, contrast, targets, focus, states, labels), then soft. Fix what fails before they see it.
87
-
88
- **Run the rules script** on every screen and state, in each theme. It measures what a browser can: sideways scroll at phone width, small targets, inputs without a visible label, a focus that shows nothing, placeholder copy and clipped text.
89
-
90
- ```
91
75
  node <skill>/scripts/rules.mjs "file://$PWD/.longbeard/design/prototype/home.html" --screen home
76
+ node <skill>/scripts/drift.mjs "file://$PWD/.longbeard/design/prototype/home.html" "file://$PWD/.longbeard/design/prototype/menu.html" --identity docs/design/design-identity.md
77
+ node <skill>/scripts/links.mjs "file://$PWD/.longbeard/design/prototype/home.html"
92
78
  ```
93
79
 
94
- It prints findings in `design-check`'s table, each with its rule. Fix every hard one. Words cut off on purpose, the look's own crop, carry `data-crop` in the markup and are skipped; any other cut word is a finding. Fix what it found after every run, then run it again: two runs with no fix between are one round, and so is a first run of another state of the same screen (`?menu=open`, the same `--screen`). The script counts rounds per screen: when it says "rounds used up", stop fixing and tell them what is open. A finding that is wrong is waived with a reason (`--waive <id> --reason "…"`) and still shown to them. A check it could not run is "not checked", never passed. It does not look at overlap, collision, alignment, empty space or section height: those are the look, and only your eye judges them.
80
+ - **Contrast** reads the whole page (`--level AAA` at that brief). If a colour role fails, change that role everywhere, never on one page. A liked colour may stay, with its ratio said.
81
+ - **Rules** measures what a browser can: sideways scroll, small targets, unlabelled inputs, invisible focus, placeholder copy, clipped text. Fix after every run; at "rounds used up", stop and say what is open. A wrong finding is waived with a reason (`--waive <id> --reason "…"`).
82
+ - **Drift** lists each face and colour no screen should have, and the type sizes, radii and spacing steps only one screen uses. Bring them to the frame's.
83
+ - **Links:** every broken link, dead button and page with no way on is fixed. It also lists the stand-ins.
95
84
 
96
- **Scan the links.** Every page of the prototype, from the first:
85
+ **The floor, inside the concept** ([how they split](references/design-floor.md#how-to-use-this)). Text a person acts on must pass, fixed from inside the concept. Display type over a picture, overlaps, crops and wide empty space are the look when the chosen screen does them: never tidied away. A finding that would undo the concept is left and told to them as a choice, one line each (what it costs, and what would fix it: keep, or change?): they decide.
97
86
 
98
- ```
99
- node <skill>/scripts/links.mjs "file://$PWD/.longbeard/design/prototype/home.html"
100
- ```
101
-
102
- It says each broken link, each link or button that goes nowhere, and each page with no way on. Fix every one before they see it. Whether a person reaches each key screen is the flow walks' to say, below, not this scan's. It also lists every stand-in and assumed fact on the pages it walks (`stand-in` lines, or "stand-ins: none marked"), and says `unmarked` for a stand-in picture that carries no mark: mark it.
87
+ ### 4. Show it
103
88
 
104
- **Walk the flows.** For each flow in the brief, one fresh agent that knows nothing of the product: a new agent or a clean session, on a smaller model where your agent lets you choose one (in Claude Code, the Agent tool's `model: sonnet`), given the first page's path and the flow's goal in the person's words, never the steps ("you want a sourdough for Saturday pickup"). It uses the browser it already has (a browser tool, or Playwright from a script: never a browser tool written for the job) to click, fill and choose through the prototype like a person, and says where it went, where it hesitated, and whether it got there. A flow it cannot finish, a wrong turn two of them take, or a step it calls unclear is fixed inside the identity and the direction: a label, a missing link or action, an order of sections. No agent can be started clean: walk it yourself, say so, and say it is weaker.
89
+ Give the paths and every key screen on one sheet, desktop then phone (`sheet.mjs --cols 4`), so they judge the set as one product. One line per screen only for a fault, a choice you made, or what sits against the design brief (its words, its never, could it be mistaken for what it must stand apart from). Then **what they still supply**: each stand-in from `links.mjs`, one line each, by screen.
105
90
 
106
- **The five-second check** on the first screen and each key screen, with what each screen is for as its takeaway: [five-second.md](references/five-second.md). Then show the screens with what the walks and the five-second check found and fixed, ask whether this is the product, and iterate until it is. Show the list with them, as what they still need to supply (below). Check it against the design brief too, as facts said with the screens: its three words and never word, its never, and apart from (could it be mistaken for the kind of product named there?).
91
+ > Is this the product? Want options anywhere?
107
92
 
108
- **What they still need to supply.** The stand-ins and assumed facts from `links.mjs`, shown with the prototype in plain words, one line each, by screen: what it shows or says, and that it stands in. They give the real one, say it is right (it loses its mark), or leave it on the list. Nothing is dropped from it unasked.
93
+ **Options** only when asked: two to four layouts for that page or part from different references, on the real page with its header, content and density, each a `data-variant` with `data-from` its reference, flipped with [variants.js](references/variants.js) (`?variant=<n>`, ← →); a sheet only to see them side by side. Never ranked. Iterate until it is the product.
109
94
 
110
95
  ### 5. Approve: write `DESIGN.md` in one go
111
96
 
112
- Only on their yes to the rendered prototype, and, when the design brief's `decides` names someone else, once that person has seen the paths and it holds. Write the whole file from [design-md-template.md](references/design-md-template.md): idea, voice, colour, type, spacing, components, decisions.
97
+ Only on their yes to the rendered prototype (and the `decides` person's, if named). Write the whole file from [design-md-template.md](references/design-md-template.md):
113
98
 
114
- - **Contrast first.** Every text and background pair, and every control against its ground, through `contrast.mjs` (4.5:1 body, 3:1 large and non-text; at the design brief's AAA, `--level AAA`: 7:1 body, 4.5:1 large). Never write a failing pair, except a colour they liked by name and kept: its line carries `WARN liked, kept` after the ratio, its why goes under Decisions, and they are told in one line. The level goes in `DESIGN.md`'s Accessibility line.
99
+ - **Contrast first:** every text, control and focus pair through `contrast.mjs` (4.5:1 body, 3:1 large and non-text; AAA: 7 and 4.5). Never a failing pair, except a liked colour kept: `WARN liked, kept` after the ratio, its why under Decisions.
115
100
  ```
116
101
  node <skill>/scripts/contrast.mjs "#1b1b1f on #fafaf7" "#c2410c on #fafaf7:mark"
117
102
  ```
118
103
  - **Themes:** each colour token once, a value per theme, every pair checked in each.
119
- - **Tokens are code names** (`color/ink`, `type/body`, `space/md`, `radius/md`, `motion/enter`); Figma uses the same. Colour, type, spacing and radius are tables, and motion is a table when the design has motion (the direction's durations and easings as `motion/<name>` rows). The direction's `finish:` is the Finish line under Imagery.
120
- - **The token block.** The tables are the source. Once they are written, run `tokens.mjs`: it writes the same tokens as front matter at the top of `DESIGN.md`, in the published DESIGN.md format, so another tool can take the design without Long Beard. Never write the block by hand. The script changes nothing below it.
121
- ```
122
- node <skill>/scripts/tokens.mjs DESIGN.md --name "<product name>"
123
- ```
124
- It exits 2 and names the row when a table cannot be read (a value that is not a colour, a token twice). `--check` exits 1 when the block and the tables disagree. The format has its own linter that anyone who wants to can run on the file (its command is in the script's header); it is not a gate here.
125
- - **What makes it this design** goes under Components, with values, not adjectives.
126
- - **Soft rules overridden on purpose** go under Decisions, with the reason. A device the chosen look relies on that the rules call a tell is on purpose: write the idea it serves.
127
- - **Still to supply.** Run `links.mjs` again, show the current list once more, then write it as the template's section: what each stand-in picture shows and what each assumed fact says, by screen, never a file name or where a picture came from; "nothing" when `links.mjs` listed none. Figma and the build read it.
128
- - **Ideas, not sources.** Nothing names a reference, site, studio, designer, link or `.longbeard/` path.
104
+ - **Tokens are code names** (`color/ink`, `type/body`, `space/md`, `radius/md`, `motion/enter`), the same in Figma. Colour, type, spacing, radius and motion are tables; the direction's `finish:` is the Finish line; the identity's **Adjusted** lines are built in.
105
+ - **The token block** is generated from the tables, never written by hand: `node <skill>/scripts/tokens.mjs DESIGN.md --name "<product>"` (exit 2 names a row it cannot read; `--check` exits 1 when block and tables disagree).
106
+ - **Principles** from the direction, kept as the prototype proved them.
107
+ - **What makes it this design** goes under Components, with values. **Soft rules overridden on purpose** go under Decisions, with the reason.
108
+ - **Still to supply:** `links.mjs` again, then the list by screen, in words, never a file name; "nothing" when empty.
109
+ - **Ideas, not sources:** no reference, site, person, link or `.longbeard/` path.
110
+
111
+ Then `design-check` docs mode on `DESIGN.md` and `docs/design/` (it runs `tokens.mjs --check`), and fix what it finds.
129
112
 
130
- Then run `design-check` in docs mode on `DESIGN.md` and `docs/design/` (it runs `tokens.mjs --check` too): a picture site, a reference, a link or a `.longbeard/` path left in a committed doc (a copied template's comment counts) is fixed before you say it is done.
113
+ **What this project taught about their taste,** offered once, in the same message as the next step: the whys they gave, what they left out, and what they turned down with their reason (a screen, a face, a palette), from `screens.json`, `library.json` and this run's answers. On yes, write it where their board lives, so the next project starts from it: a Figma board, one `Learned` text frame on the board's page, a line per card (`<card>: like … · why … · leave out …`) and one per no; a folder, `learned.md` in it; anything else, `~/.longbeard/taste.md`. Their own cards and captions are never changed. A no stands.
131
114
 
132
- Then the next step: `design-figma`.
115
+ Next: `design-figma`.
133
116
 
134
117
  ## Feature loop
135
118
 
136
119
  A feature with screens, once `DESIGN.md` exists.
137
120
 
138
121
  - **Only existing parts:** compose the screens in Figma (`design-figma`) with their states; no prototype.
139
- - **New parts:** prototype only them, on the real screens around them, in `.longbeard/design/<feature>/`, with 2–3 options where a real choice is open, then the self-check.
140
- - `DESIGN.md` gets entries (a token, a component, a decision with date and reason, an item under Still to supply). It is never rewritten in a feature. A new or changed token goes in its table, then `tokens.mjs` refreshes the block.
141
- - **Identity changes need their own yes:** a new colour role, a face, a change to the idea or voice, each shown rendered and approved one at a time. A rebrand is `design-identity` again.
122
+ - **New parts:** prototype only them, on the real screens around them, in `.longbeard/design/<feature>/`, in the frame, then the checks. Options for a part, when asked, are variants on that page, as in **Options** above.
123
+ - `DESIGN.md` gets entries (a token, a component, a dated decision, an item to supply), never a rewrite; `tokens.mjs` refreshes the block.
124
+ - **Identity changes need their own yes,** one at a time, rendered. A rebrand is `design-identity` again.
142
125
 
143
126
  ## Do not
144
127
 
145
128
  - Write `DESIGN.md` before they approve a rendered prototype, or rewrite it in a feature.
146
- - Change the identity or the direction's composition while building screens. Say it, and send it back to that skill.
147
- - Pick a fork silently, or rank options.
148
- - Ship a screen with grey boxes, lorem, or an item it needs missing (the `for the prototype` list included).
129
+ - Change the identity, or the frame, on one page: say it, and send it back.
130
+ - Repeat the first screen's composition on a page that has another job.
131
+ - Undo the concept because a check flagged it.
132
+ - Ship a screen with grey boxes, lorem, or an item it needs missing.
149
133
  - Name a reference anywhere that is kept.
@@ -0,0 +1,118 @@
1
+ # Design floor
2
+
3
+ Generated from `rules/design-rules.md` by `npm run share`: its opening sections and every hard check. The soft checks and the tells are `design-check`'s.
4
+
5
+ How a screen is checked. `design-check` reads all of it on every frame and build. The skills that build read only the floor (`design-floor.md`: these opening sections and every hard check), so a better model's craft is never held to a textbook while drawing.
6
+
7
+ These rules decide execution, never the look. The direction and `DESIGN.md` decide the look. A rule that seems to ask for a colour, a typeface or a style is misread. It asks only that whatever was chosen is used with intent.
8
+
9
+ ## Before you build
10
+
11
+ A studio applies these while drawing each screen, not as a check after. Each is the numbered rule's, said there.
12
+
13
+ - One most prominent element and one primary action (rule 1).
14
+ - Contrast where the text sits, over pictures too (rules 6 and 12).
15
+ - One picture leads; pictures that share the screen never compete (rule 12).
16
+ - Text size at its floor (rule 5).
17
+ - One grouping device per group (rule 2).
18
+ - Every screen follows the direction's principles (before the pick, their whys), and reads as the same product as the first.
19
+
20
+ ## How to use this
21
+
22
+ - Check from a screenshot. Every check below can be passed or failed by looking at a rendered screen at its real size. When a check needs a state you cannot see (focus, error, empty), it needs that state's frame, and a missing frame fails rule 8.
23
+ - Go in order: **Idea** first, then every **hard** check, then **soft**.
24
+ - **Hard** is the floor: structure, contrast, text size, targets, focus and states. A hard failure blocks the screen. `DESIGN.md` cannot waive it, except for what the person liked or asked for (below).
25
+ - **When the floor meets a liked concept:**
26
+ - Text a person acts on (body, labels, prices, fields, navigation, buttons): the floor wins. The fix comes from inside the concept: its own ink, another crop, a device the board already has. Never by moving the text off the concept or dropping the concept.
27
+ - Display and composition (giant type over a picture, overlaps, crops): the concept wins, and the fault is written down.
28
+ - A colour or a small size the person liked or asked for: kept, reported as a warning with its measure, not a block. Marked `WARN liked, kept` in `DESIGN.md`; on a page, small text is marked `data-board-size`.
29
+ - **Soft** is a default. `DESIGN.md` may override a soft check on purpose, with a written reason. A soft finding with no reason in `DESIGN.md` is reported, not blocked.
30
+ - A finding is four things: the rule (number and check), hard or soft, where on the screen, and the fix.
31
+ - The shared core applies to everything, except where the Graphics list says it does not. Then add the site, app or graphics list, whichever the brief's surface says.
32
+
33
+ ## 1. Hierarchy
34
+
35
+ **Principle:** the eye lands first on what matters most, then moves in the order the task needs.
36
+ - [hard] Exactly one element is the most prominent on the screen. Squint or blur the shot: one thing still stands out.
37
+ - [hard] The primary action is easier to find than any secondary action. If two actions look equally important, only one of them should be.
38
+
39
+ ## 2. Grouping
40
+
41
+ **Principle:** things that belong together look together, and things that do not are kept apart.
42
+ - [hard] The space between related items is clearly smaller than the space between groups. A label sits closer to its field than to the field above.
43
+
44
+ ## 3. Alignment and grid
45
+
46
+ **Principle:** every element sits on a line shared with something else.
47
+ - [hard] Left edges of text blocks in one column line up. No block is nudged a few pixels off its neighbours.
48
+
49
+ ## 5. Typography
50
+
51
+ **Principle:** a few sizes, far apart, set for reading.
52
+ - [hard] At the screen's real size, nothing is under 12px, text a person acts on (links, buttons, labels, fields, prices, navigation) is at least 14px, and body is 16px at every width. Where a reference sets smaller, keep its proportions and scale the step up.
53
+ - [hard] No text is clipped, overlapped, or cut mid-word by its container, in any language the product ships.
54
+
55
+ ## 6. Colour
56
+
57
+ **Principle:** colour carries meaning, and the meaning stays the same everywhere.
58
+ - [hard] Body text has a contrast ratio of at least 4.5:1 against its background. Large text (24px, or 18.66px bold, and up) and the visible parts of controls and icons have at least 3:1. When `DESIGN.md` or the design brief sets the level to AAA: 7:1 for body text and 4.5:1 for large text.
59
+ - [hard] Colour is never the only signal. An error, a selected item or a required field also changes shape, weight, an icon or text.
60
+ - [hard] A product with more than one theme has one set of colour tokens, with a value for each theme, and passes every check here in each theme. A colour that stays the same when the theme changes, and should not, fails.
61
+
62
+ ## 7. Consistency
63
+
64
+ **Principle:** the same thing looks and behaves the same everywhere.
65
+ - [hard] One action has one look. Two primary buttons on different screens are the same component, same size and same label case.
66
+
67
+ ## 8. States
68
+
69
+ **Principle:** every screen is shown in every state a person will meet.
70
+ - [hard] The screen has a frame for each of empty, loading and error that a person can reach, next to the default. A state nobody can reach is recorded as not needed, with the reason. A reachable state with no frame is a failure, not a later task.
71
+ - [hard] Empty says what goes here and gives the one action that fills it. Error says what went wrong in plain words and how to recover.
72
+ - [hard] Interactive components show hover (pointer surfaces), focus, pressed, disabled, and selected where they apply. Each state is visibly different from default.
73
+
74
+ ## 9. Affordance and feedback
75
+
76
+ **Principle:** what can be acted on looks like it, and every action visibly answers.
77
+ - [hard] Every interactive element looks interactive without hovering. Text links are distinct from body text by more than colour alone, unless their position makes them obvious (a nav bar).
78
+ - [hard] Nothing that looks interactive is not. A card that looks clickable is clickable, or loses the look.
79
+
80
+ ## 10. Accessibility
81
+
82
+ **Principle:** the screen works for people who see, move and read differently.
83
+ - [hard] The focused state of every interactive element shows a visible indicator with at least 3:1 contrast against what is around it. Check it in the focus frame.
84
+ - [hard] Targets are at least 24×24 CSS pixels, or have that much space around them (WCAG 2.2 AA). The app list raises this for touch.
85
+ - [hard] Every input has a visible label. A placeholder alone is not a label.
86
+ - [hard] Text is real text, not text in an image, except in logos.
87
+
88
+ ## 11. Copy
89
+
90
+ **Principle:** words do the job of the screen in the product's own voice, made from facts it has.
91
+ - [hard] No placeholder copy: no lorem ipsum, no "Title", no "Button", no "User Name".
92
+
93
+ ## 12. Imagery
94
+
95
+ **Principle:** pictures show the real thing, or there are none.
96
+ - [hard] Text over an image meets the contrast floor in rule 6 across the whole text area, not only on the darkest part.
97
+
98
+ ## 13. Responsive
99
+
100
+ **Principle:** each size is designed, not squeezed.
101
+ - [hard] At mobile width (360–390px) nothing scrolls sideways, nothing is clipped, and nothing overlaps.
102
+ - [hard] The primary action is reachable at every size without hunting: visible, or one obvious step away.
103
+
104
+ ## Sites
105
+
106
+ - [hard] The first screen at mobile and desktop says what this is and who it is for, without scrolling.
107
+
108
+ ## Apps
109
+
110
+ - [hard] Touch targets on touch platforms are at least 44×44 pt (Apple) or 48×48 dp (Material), whichever platform it ships on. The web floor in rule 10 still applies.
111
+ - [hard] The person always knows where they are: the current place in navigation is marked, and the screen title matches the nav item.
112
+
113
+ ## Graphics
114
+
115
+ - **Applies:** rules 0 to 3, 5, 6, 11, 12 and 14. Rule 4 holds for the margin and the gaps between groups. Rule 7 holds across the pieces of a set.
116
+ - **Does not apply:** rule 8 (states), rule 9 (affordance), the targets, focus and label checks of rule 10, and rule 13 (responsive). A missing state frame is not a finding.
117
+ - [hard] Readable at its distance. Scale the shot to how the piece is seen (a poster read across a street, about 400 px on its long side; a feed post at phone width). The headline and every fact the brief gives still read.
118
+ - [hard] Nothing important in the trim. On a print piece, no word, fact or logo sits in the trim or the safe margin. A picture or a crop that runs off the edge on purpose is not a finding.
@@ -13,6 +13,9 @@ Figma: <file URL>. Figma is the truth for screens. This file is the rules behind
13
13
  <one sentence: what this product's look says>
14
14
  - ownable: <the one element made from the product's own identity, as approved on the prototype>
15
15
 
16
+ ## Principles
17
+ - <three to five, from the direction, as the prototype proved them: what every screen of this design does>
18
+
16
19
  ## Voice
17
20
  - <three adjectives>
18
21
  - <one sample line, and one line it would never say>
@@ -6,12 +6,13 @@ For a single piece the prototype finishes the chosen piece and nothing else. For
6
6
 
7
7
  ## First pass
8
8
 
9
- 1. **Finish the chosen piece.** `first.html` is fixed at the format's size, so `home.html` is the same page at that size, not responsive, and `first.html` stays beside it. Keep the faces loaded at the size and the direction's devices untouched. Spacing options, widths, states and walks do not apply. The facts the direction left for the prototype (a second language, the small print) are placed in the composition's own system. A fact the brief marks missing stays a stand-in, marked, and listed under Still to supply.
10
- 2. **A set.** List the other pieces and their sizes once, and ask "Change the list?" Each is built from the chosen piece: reflowed to its size, never scaled, with the same type, colours, devices and facts. A story is tall, a square is square. Each takes the same touch-up as the first. A piece's own choices (which fact leads when there is less room) are named, never silent. A single piece skips this.
11
- 3. **The self-check.** Capture each piece whole: `--width <w> --clip 0,0,<w>,<h>` at its working size. Then:
9
+ 1. **Finish the chosen piece.** `first.html` is fixed at the format's size, so `home.html` is the same page at that size, not responsive, and `first.html` stays beside it. Keep the faces loaded at the size and the direction's devices untouched. Widths and states do not apply. The facts the direction left for the prototype (a second language, the small print) are placed in the composition's own system. A fact the brief marks missing stays a stand-in, marked, and listed under Still to supply.
10
+ 2. **A set.** List the other pieces and their sizes once, and ask "Change the list?" Each is built from the chosen piece: reflowed to its size, never scaled, with the same type, colours, devices and facts. A story is tall, a square is square. Each takes the same checks as the first. A piece's own choices (which fact leads when there is less room) are named, never silent. A single piece skips this.
11
+ 3. **The checks.** Capture each piece whole: `--width <w> --clip 0,0,<w>,<h>` at its working size. Then:
12
12
  - **Contrast:** `screen-contrast.mjs` as usual.
13
- - **Rules script:** run `rules.mjs` with `--widths <the piece's width>`. Read only its copy findings (rule 11) and its cut text (rule 5). Its sideways scroll is reported "not checked" above 480 px. Its targets, focus and labels do not apply to a graphic: report any it prints as "not applicable to a graphic" in the self-check. Never fix or waive them, and ignore its exit code and its round count for them.
14
- - **Walks:** The link scan and the flow walks are not run. The five-second check is, on each piece, at the size it reaches the eye (see the direction's graphic reference).
13
+ - **Rules script:** run `rules.mjs` with `--widths <the piece's width>`. Read only its copy findings (rule 11) and its cut text (rule 5). Its sideways scroll is reported "not checked" above 480 px. Its targets, focus and labels do not apply to a graphic: report any it prints as "not applicable to a graphic". Never fix or waive them, and ignore its exit code and its round count for them.
14
+ - **Links and drift:** not run.
15
+ - **At the size it reaches the eye:** look at each piece as a poster read across a street (long side about 400 px) or a feed post at phone size (about 390 px wide), against the design brief's `read from` line and its takeaway.
15
16
  - **Facts:** every fact in the brief is on the piece, spelt as the brief gives it.
16
17
  - **Trim:** nothing important sits in the trim or the safe margin.
17
18
 
@@ -0,0 +1,43 @@
1
+ // Options on the real page. Each option is an element with data-variant="1", "2", …
2
+ // and data-from="<the reference it comes from>". The page shows one, chosen by
3
+ // ?variant=<n> (1 when absent), and a small bar at the bottom centre: the option's
4
+ // number, its reference, and arrows. ← and → flip between them and keep the URL in
5
+ // step, so a capture or a link opens the same option. ?bar=0 hides the bar for captures.
6
+ // Copy this file next to the page and load it last: <script src="variants.js"></script>
7
+ (() => {
8
+ const all = [...document.querySelectorAll("[data-variant]")];
9
+ const ns = [...new Set(all.map((el) => el.dataset.variant))].sort((a, b) => Number(a) - Number(b));
10
+ if (!ns.length) return;
11
+ const params = new URLSearchParams(location.search);
12
+ let at = Math.max(0, ns.indexOf(params.get("variant") || ns[0]));
13
+ const bar = document.createElement("div");
14
+ bar.setAttribute("role", "toolbar");
15
+ bar.setAttribute("aria-label", "Options");
16
+ bar.style.cssText = "position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:2147483647;display:flex;gap:12px;align-items:center;padding:8px 12px;border-radius:999px;background:#111;color:#fff;font:500 13px/1.2 system-ui,sans-serif;box-shadow:0 2px 12px rgba(0,0,0,.25)";
17
+ const button = (text, label, step) => {
18
+ const b = document.createElement("button");
19
+ b.type = "button";
20
+ b.textContent = text;
21
+ b.setAttribute("aria-label", label);
22
+ b.style.cssText = "all:unset;cursor:pointer;padding:4px 8px;min-width:24px;text-align:center";
23
+ b.onclick = () => show(at + step);
24
+ return b;
25
+ };
26
+ const label = document.createElement("span");
27
+ bar.append(button("←", "Previous option", -1), label, button("→", "Next option", 1));
28
+ function show(i) {
29
+ at = (i + ns.length) % ns.length;
30
+ for (const el of all) el.hidden = el.dataset.variant !== ns[at];
31
+ const from = all.find((el) => el.dataset.variant === ns[at])?.dataset.from || "";
32
+ label.textContent = `${at + 1} / ${ns.length}${from ? " \u00b7 from " + from : ""}`;
33
+ params.set("variant", ns[at]);
34
+ history.replaceState(null, "", "?" + params.toString() + location.hash);
35
+ }
36
+ addEventListener("keydown", (e) => {
37
+ if (e.target.closest?.("input, textarea, select, [contenteditable]")) return;
38
+ if (e.key === "ArrowLeft") show(at - 1);
39
+ if (e.key === "ArrowRight") show(at + 1);
40
+ });
41
+ if (params.get("bar") !== "0") document.body.append(bar);
42
+ show(at);
43
+ })();