@jonandev/longbeard 0.13.0 → 0.15.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 (59) hide show
  1. package/AGENTS.md +5 -5
  2. package/CHANGELOG.md +35 -0
  3. package/README.md +3 -4
  4. package/beard.json +6 -17
  5. package/bin/long-beard.js +2 -2
  6. package/package.json +1 -1
  7. package/skills/design/SKILL.md +7 -11
  8. package/skills/design-brief/SKILL.md +5 -35
  9. package/skills/design-check/SKILL.md +5 -7
  10. package/skills/design-check/references/design-rules.md +26 -4
  11. package/skills/design-check/scripts/rules.mjs +143 -9
  12. package/skills/design-content/SKILL.md +3 -8
  13. package/skills/design-direction/SKILL.md +58 -53
  14. package/skills/design-direction/references/design-floor.md +118 -0
  15. package/skills/design-direction/references/graphic.md +5 -6
  16. package/skills/design-direction/references/library.md +7 -7
  17. package/skills/design-direction/references/screen-template.html +7 -164
  18. package/skills/design-direction/references/screen.js +163 -0
  19. package/skills/design-direction/references/subject.md +3 -3
  20. package/skills/design-direction/references/variants.js +43 -0
  21. package/skills/design-direction/scripts/canvas.mjs +12 -9
  22. package/skills/design-direction/scripts/colours.mjs +247 -0
  23. package/skills/design-direction/scripts/moodboard.mjs +1 -1
  24. package/skills/design-direction/scripts/rules.mjs +747 -0
  25. package/skills/design-direction/scripts/sheet.mjs +3 -1
  26. package/skills/design-figma/SKILL.md +4 -6
  27. package/skills/design-identity/SKILL.md +12 -14
  28. package/skills/design-identity/references/design-floor.md +118 -0
  29. package/skills/design-identity/scripts/colours.mjs +35 -1
  30. package/skills/design-identity/scripts/sheet.mjs +3 -1
  31. package/skills/design-moodboard/SKILL.md +11 -11
  32. package/skills/design-moodboard/references/graphic.md +1 -1
  33. package/skills/design-moodboard/references/sources.md +1 -1
  34. package/skills/design-moodboard/scripts/group.mjs +1 -1
  35. package/skills/design-moodboard/scripts/moodboard.mjs +1 -1
  36. package/skills/design-prototype/SKILL.md +51 -49
  37. package/skills/design-prototype/references/design-floor.md +118 -0
  38. package/skills/design-prototype/references/design-md-template.md +4 -2
  39. package/skills/design-prototype/references/graphic.md +6 -5
  40. package/skills/design-prototype/references/variants.js +43 -0
  41. package/skills/design-prototype/scripts/links.mjs +5 -4
  42. package/skills/design-prototype/scripts/rules.mjs +143 -9
  43. package/skills/design-prototype/scripts/sheet.mjs +3 -1
  44. package/skills/design-wordmark/SKILL.md +9 -8
  45. package/skills/design-wordmark/scripts/sheet.mjs +3 -1
  46. package/skills/framework-skills/SKILL.md +3 -5
  47. package/skills/idea/SKILL.md +7 -9
  48. package/skills/design-direction/references/design-rules.md +0 -204
  49. package/skills/design-direction/references/full-build.md +0 -20
  50. package/skills/design-direction/references/grid.md +0 -97
  51. package/skills/design-direction/scripts/layout-diff.mjs +0 -118
  52. package/skills/design-families/SKILL.md +0 -139
  53. package/skills/design-families/scripts/contact-sheet.mjs +0 -259
  54. package/skills/design-families/scripts/families.mjs +0 -607
  55. package/skills/design-families/scripts/measure.mjs +0 -1728
  56. package/skills/design-families/scripts/moodboard.mjs +0 -609
  57. package/skills/design-families/scripts/tag.mjs +0 -289
  58. package/skills/design-prototype/references/design-rules.md +0 -204
  59. package/skills/design-prototype/references/five-second.md +0 -46
@@ -1,12 +1,9 @@
1
1
  ---
2
2
  name: design-prototype
3
3
  description: >
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.
4
+ The key screens and their states in the chosen direction, checked by
5
+ script; on their yes, DESIGN.md. Runs when the direction and identity
6
+ exist and there is no DESIGN.md, or for a feature with screens.
10
7
  ---
11
8
 
12
9
  # Design prototype
@@ -15,7 +12,9 @@ description: >
15
12
  **Uses if there:** `docs/design/design-content.md`, `docs/design/design-moodboard.md`
16
13
  **Writes:** `DESIGN.md`
17
14
 
18
- A prototype they approve (in `.longbeard/design/prototype/`, gitignored), then **`DESIGN.md`**, committed. Then `design-figma`. Read [design-rules.md](references/design-rules.md) before the first screen: it is the checklist here and in `design-check`.
15
+ 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.
16
+
17
+ **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.
19
18
 
20
19
  **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
20
 
@@ -29,71 +28,68 @@ A graphic (the brief's surface): read [graphic.md](references/graphic.md) first.
29
28
 
30
29
  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.
31
30
 
32
- **At `pace: quick`:** options only when asked (build the one that follows the first screen, and name the fork). States, contrast, the walks and the five-second check are never skipped.
33
-
34
31
  ## First pass
35
32
 
36
33
  ### 1. Finish the first screen
37
34
 
38
- `first.html` is a fixed 1440×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, and compare captures at 1440: it must still be the screen they chose. Then:
35
+ `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.
39
36
 
40
37
  - **Faces** loaded at every size. A stand-in face is said again.
41
- - **Spacing:** as built, 0.8 and 1.25 (margins and gaps scaled), whole and on a crop where margin meets navigation. They pick.
42
38
  - **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, nothing beyond (`none` is state changes only). Build from the direction's `motion:` line: replay its base reference (`capture.mjs <url> --frames 12`), build that motion in CSS, and say whose it was. 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. Where it forks (the full list here, or a line and a link), two or three options.
39
+ - **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`.
40
+ - **Motion options,** when the brief's motion is present or leading, as a studio shows motion studies once the still look holds: for each moment the brief names (two at most), two or three versions, each rebuilt from a different reference on the board that shows it moving (what moves, trigger, time, easing: from a live page's code, its CSS and the motion library calls in its scripts; from a GIF or video, its own frames; recorded frames only to see the sequence), on `home.html` as a `data-variant` with `data-from`, flipped with [variants.js](references/variants.js). Build each with what its move needs, as the reference does: CSS for a state change, a motion library for sequenced, scroll-driven, split-type or physics work. A version that only hints at a complex move is not that reference. One such reference: one version, and say so. Never a move no reference makes.
41
+ - **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
42
  - **The ownable**, finished. **The states** reachable here (empty, loading, error), and the second theme if asked for.
46
43
 
47
- ### 2. The other key screens, in one go
44
+ ### 2. The other key screens
48
45
 
49
46
  > I'll prototype <the menu>, <screen>, <screen>. Change the list?
50
47
 
51
- Then build them all, linked, in the identity and the direction; one menu, one card, one row, one heading style everywhere.
52
-
53
- - **Layout, closest first:** the screen the direction already built for it (`screens.json`'s `"test": true`); else the base reference's own screen of that kind (its card's `also` shots); else that kind of screen from a reference in the base's family; else from any reference; else the first screen's own system. Never its content. A layout from another product takes the first screen's measures (the direction's `holds across screens`), never its own. Say which in the screen's one line.
54
- - **The direction's devices carry over:** overlaps, crops, giant type, empty space appear on every screen, never tidied (`data-crop` on text cropped on purpose). Each screen gets the direction's touch-up: contrast where text sits, its items and primary action present, nothing plainly broken.
48
+ Then build them all, linked.
49
+
50
+ - **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.
51
+ - **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.
52
+ - **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.
53
+ - **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).
54
+ - **Every part** (a footer, a form, a menu, a list) comes, in this order, from:
55
+ 1. The chosen screen's frame and concept, always: beside the first screen, it reads as the same product.
56
+ 2. Their liked references that show that part, minus their **Leave out**: its layout, inside the frame, never its content, faces or colours.
57
+ 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).
58
+ 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.
55
59
  - **Density** as the design brief's `dense` asks: airy 1–2 shows less, dense 4–5 shows more and keeps spacing tight.
56
- - **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. Say the copy is a draft. Pictures: theirs or the subject's stand-ins in `.longbeard/design/pictures/`; never grey boxes, never a reference's subject.
60
+ - **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.
57
61
  - **States:** empty, loading and error where reachable (`?state=empty`), every width, each theme.
58
62
  - **Marked, not hidden:** `data-standin="picture"` or `"fact"` (with `data-standin-note`) on anything the product does not really have yet.
59
63
 
60
64
  A pattern that brings a feature the brief does not have is named; kept, it is a product change (`idea`) first.
61
65
 
62
- **Parts, if they want,** on any screen, as in the direction: name its parts in one line, "Open any part?", and three or four versions of the one part they open, in place, each from a reference that shows that part; "find more" is `design-moodboard`'s one piece. A part changed on one screen changes everywhere it is used.
63
-
64
- ### 3. Show it, and name the forks
65
-
66
- Give the paths, one line per screen. Name every fork (a screen the references arrange in clearly different ways, or where you had to choose); never pick silently.
66
+ ### 3. Check by script
67
67
 
68
- > Click through. Want options anywhere? I'd offer them for <forks>.
69
-
70
- **Options**, only at a fork or when asked: two to four layouts from different references, on one sheet (`sheet.mjs`), never ranked. Nothing fits → `design-moodboard`, one piece.
71
-
72
- ### 4. Self-check
73
-
74
- Capture every screen and state at desktop and phone, each theme, and run the scripts. Fix what fails before they see it.
68
+ Capture every screen and state at 1440 and 390, each theme, and look at each capture yourself. Then:
75
69
 
76
70
  ```
77
- node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/prototype/home.html?capture" --out <scratch>/home.png
78
- node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/prototype/home.html?capture" --out <scratch>/home-phone.png --width 390
79
71
  node <skill>/scripts/screen-contrast.mjs "file://$PWD/.longbeard/design/prototype/home.html" --wait-title ready
80
72
  node <skill>/scripts/rules.mjs "file://$PWD/.longbeard/design/prototype/home.html" --screen home
73
+ 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
81
74
  node <skill>/scripts/links.mjs "file://$PWD/.longbeard/design/prototype/home.html"
82
75
  ```
83
76
 
84
- - **Contrast** reads the whole page down to `--max-height` (`--level AAA` at that brief). Exit 1 is a failing text, 3 a run that did not finish; "not read" texts are unchecked, never passed.
85
- - **Rules,** in order: Idea, hard (structure, contrast, targets, focus, states, labels), then soft. `rules.mjs` measures what a browser can (sideways scroll, small targets, unlabelled inputs, invisible focus, placeholder copy, clipped text) and counts rounds per screen: 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 "…"`), still shown. Overlap, collision, alignment and empty space are the look: only your eye judges them.
86
- - **The whole set:** every key screen on one sheet, desktop then phone (`sheet.mjs --cols 4`), shown with the prototype so they judge the screens together.
87
- - **Drift:** what the screens use, measured against the identity:
88
- ```
89
- 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
90
- ```
91
- It lists each face and colour no screen should have (not in the identity), and counts the type sizes, radii and spacing steps in all, with the screen that adds each one. A face or colour outside the identity is fixed to the identity's; a size, radius or step only one screen uses is brought to the nearest the others use, unless the look needs it, said in one line. It measures; the eye decides the rest.
92
- - **Links:** every broken link, dead button and page with no way on is fixed. It also lists the stand-ins, and `unmarked` for an unmarked stand-in picture: mark it.
93
- - **Flow walks:** for each flow in the brief, one fresh agent (on `sonnet` where you can choose) gets the first page and the goal in the person's words, never the steps, clicks through with the browser it has, and says where it went, hesitated, and whether it got there. A failure or a wrong turn two take is fixed inside the identity and the direction. No clean agent: walk it yourself and say it is weaker.
94
- - **The five-second check,** once, here: the same three strangers see the first screen (against the design brief's takeaway) and each key screen (against what it is for): [five-second.md](references/five-second.md). The first screen's result is `DESIGN.md`'s `five seconds:` line.
77
+ - **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.
78
+ - **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 "…"`).
79
+ - **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.
80
+ - **Links:** every broken link, dead button and page with no way on is fixed. It also lists the stand-ins.
81
+
82
+ **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.
83
+
84
+ ### 4. Show it
85
+
86
+ 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.
95
87
 
96
- Then show them, in a few lines: what the walks and the five-second check found and fixed, anything against the design brief (its words and never word, its never, could it be mistaken for what it must stand apart from), and **what they still supply**: each stand-in from `links.mjs`, one line each, by screen. They give the real one, confirm it, or leave it listed. Ask whether this is the product; iterate until it is.
88
+ > Is this the product? Want options anywhere?
89
+
90
+ With motion options, the question also asks which version for each moment, one line each for what moves. The others are removed on their pick, and the pick is what `DESIGN.md`'s Motion records. The pick is the motion system, as the chosen screen is the frame: its eases, times and staggers carry to every page's reveals, hovers and transitions, and their notes on it are iterated like any other.
91
+
92
+ **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.
97
93
 
98
94
  ### 5. Approve: write `DESIGN.md` in one go
99
95
 
@@ -106,25 +102,31 @@ Only on their yes to the rendered prototype (and the `decides` person's, if name
106
102
  - **Themes:** each colour token once, a value per theme, every pair checked in each.
107
103
  - **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.
108
104
  - **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).
105
+ - **Principles** from the direction, kept as the prototype proved them.
109
106
  - **What makes it this design** goes under Components, with values. **Soft rules overridden on purpose** go under Decisions, with the reason.
110
107
  - **Still to supply:** `links.mjs` again, then the list by screen, in words, never a file name; "nothing" when empty.
111
108
  - **Ideas, not sources:** no reference, site, person, link or `.longbeard/` path.
112
109
 
113
- Then `design-check` docs mode on `DESIGN.md` and `docs/design/` (it runs `tokens.mjs --check`), and fix what it finds. Next: `design-figma`.
110
+ Then `design-check` docs mode on `DESIGN.md` and `docs/design/` (it runs `tokens.mjs --check`), and fix what it finds.
111
+
112
+ **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.
113
+
114
+ Next: `design-figma`.
114
115
 
115
116
  ## Feature loop
116
117
 
117
118
  A feature with screens, once `DESIGN.md` exists.
118
119
 
119
120
  - **Only existing parts:** compose the screens in Figma (`design-figma`) with their states; no prototype.
120
- - **New parts:** prototype only them, on the real screens around them, in `.longbeard/design/<feature>/`, with 2–3 options where a choice is open, then the self-check.
121
+ - **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.
121
122
  - `DESIGN.md` gets entries (a token, a component, a dated decision, an item to supply), never a rewrite; `tokens.mjs` refreshes the block.
122
123
  - **Identity changes need their own yes,** one at a time, rendered. A rebrand is `design-identity` again.
123
124
 
124
125
  ## Do not
125
126
 
126
127
  - Write `DESIGN.md` before they approve a rendered prototype, or rewrite it in a feature.
127
- - Change the identity or the direction's composition while building screens: say it, and send it back.
128
- - Pick a fork silently, or rank options.
128
+ - Change the identity, or the frame, on one page: say it, and send it back.
129
+ - Repeat the first screen's composition on a page that has another job.
130
+ - Undo the concept because a check flagged it.
129
131
  - Ship a screen with grey boxes, lorem, or an item it needs missing.
130
132
  - 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.
@@ -12,7 +12,9 @@ Figma: <file URL>. Figma is the truth for screens. This file is the rules behind
12
12
  ## Idea
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
- - five seconds: <first screen: what it is n of 3, what to do n of 3, feel words; people's answers when given; "not run" and why otherwise>
15
+
16
+ ## Principles
17
+ - <three to five, from the direction, as the prototype proved them: what every screen of this design does>
16
18
 
17
19
  ## Voice
18
20
  - <three adjectives>
@@ -51,7 +53,7 @@ Contrast (scripts/contrast.mjs, at the level under Accessibility):
51
53
  - <component>: <what it is for, its variants, its states>
52
54
 
53
55
  ## Motion
54
- - <the design brief's picks as built: how much, driven by, character and where it applies, moments, or "none: state changes only"; what moves and when, as the direction's `motion:` line has it; reduced motion turns it off>
56
+ - <the design brief's picks as built: how much, driven by, character and where it applies, moments, or "none: state changes only"; what moves and when, as the direction's `motion:` line has it, or the motion option they picked; built with CSS or the motion library the prototype used, so the stack can carry it; reduced motion turns it off>
55
57
 
56
58
  | Token | Duration | Easing | Use |
57
59
  |---|---|---|---|
@@ -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: a poster read across a street, scaled so its long side is about 400 px; a feed post at phone size, about 390 px wide. "What would you do first" is what they would do about it: go, scan, remember the date. It is checked against the design brief's `read from` line and its takeaway.
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
+ })();
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  // Scan a clickable prototype: every page in its folder, from its first page on, for
3
3
  // links that break and pages with no way on, and for what it still stands in for.
4
- // Whether a person can reach each screen is the flow walks' job, not this one's.
5
4
  // Node 22+, an installed Chrome, no dependencies.
6
5
  //
7
6
  // node links.mjs "file://$PWD/.longbeard/design/prototype/home.html"
8
7
  //
9
8
  // Pages are rendered (links a script builds count). Links are followed from the first page, then
10
9
  // every other page in the prototype's folder is opened too, so a page behind a state (an empty
11
- // basket) is still scanned. A link elsewhere (a real site, mailto:) is listed, never followed. A form that submits to another page is a way on, and so is
10
+ // basket) is still scanned. A sheet of screenshots that sheet.mjs made there is skipped. A link elsewhere (a real site, mailto:) is listed, never followed. A form that submits to another page is a way on, and so is
12
11
  // a button whose script navigates: each is clicked, and the page it lands on is followed. A query (?state=empty) or a hash is the same page, but the
13
12
  // page is opened with the query it was first reached by, so state a prototype keeps in
14
13
  // the address (a basket, a chosen slot) carries on as it does for a person.
@@ -238,8 +237,10 @@ const seen = new Set([startPath]);
238
237
  const firstUrl = new Map([[startPath, start.split("#")[0]]]);
239
238
  const queue = [startPath];
240
239
  const broken = [], nowhere = [], deadEnds = [], outside = new Set();
241
- // When the links run out, every page in the folder not reached yet is opened by itself.
242
- const rest = () => readdirSync(dirname(startPath)).filter((f) => /\.html?$/i.test(f)).sort().map((f) => join(dirname(startPath), f)).filter((p) => !seen.has(p));
240
+ // When the links run out, every page in the folder not reached yet is opened by itself,
241
+ // except a sheet of screenshots (sheet.mjs marks it): it shows the prototype, it is not a page of it.
242
+ const isSheet = (path) => { try { return /<meta name="generator" content="longbeard sheet">/.test(readFileSync(path, "utf8")); } catch { return false; } };
243
+ const rest = () => readdirSync(dirname(startPath)).filter((f) => /\.html?$/i.test(f)).sort().map((f) => join(dirname(startPath), f)).filter((p) => !seen.has(p) && !isSheet(p));
243
244
  while (queue.length || (queue.push(...rest().slice(0, 1)), queue.length)) {
244
245
  const path = queue.shift();
245
246
  seen.add(path);