@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
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  // Lay screenshots out as one numbered sheet, so a round of first screens can
3
3
  // be seen and picked from together. It writes an HTML page; capture.mjs turns
4
- // that into the picture to show. No dependencies.
4
+ // that into the picture to show. The page is marked as a sheet, so links.mjs never
5
+ // counts it as a page of the prototype. No dependencies.
5
6
  //
6
7
  // node sheet.mjs .longbeard/design/direction/grid/sheet.html .longbeard/design/direction/grid/1.png .longbeard/design/direction/grid/2.png …
7
8
  // node sheet.mjs .longbeard/design/direction/grid/vary.html --cols 5 .longbeard/design/direction/grid/v*.png
@@ -49,6 +50,7 @@ writeFileSync(
49
50
  out,
50
51
  `<!doctype html>
51
52
  <meta charset="utf-8">
53
+ <meta name="generator" content="longbeard sheet">
52
54
  <title>Sheet</title>
53
55
  <style>
54
56
  body { margin: 0; padding: 24px; background: #6f6f6f; font: 600 22px/1 system-ui, sans-serif; }
@@ -17,6 +17,8 @@ Figma is the truth for screens. `DESIGN.md` is the written summary of the rules
17
17
 
18
18
  Load `figma-use`, `figma-generate-library` and `figma-generate-design`, and follow them. This skill adds only what they do not decide.
19
19
 
20
+ **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
22
  ## Gate
21
23
 
22
24
  1. No `DESIGN.md` → `design-prototype` first. Stop.
@@ -59,7 +61,7 @@ If a Figma decision changes a rule (a new token, a variant, a spacing step), upd
59
61
 
60
62
  Say in two lines what they now have: a Figma file of their own, with its link, built from variables and components, so a change to a token changes every screen. They can keep working in it by hand or by asking; a change to a rule goes into `DESIGN.md` too.
61
63
 
62
- Offer to delete `.longbeard/design/` working files: the docs, `DESIGN.md` and Figma carry the result. On no, leave them; they are gitignored. Then the next stage the router lists: architecture, which they start by typing `/grill-with-docs`. A design-only install has none, and ends here.
64
+ Offer to delete `.longbeard/design/` working files: the docs, `DESIGN.md` and Figma carry the result. On no, leave them; they are gitignored. Then the next stage the router lists: architecture, which they start by typing `/grill-with-docs`: the stack, and the words the brief and these screens use, ending with the stack as an ADR in `docs/adr/`. A design-only install has none, and ends here.
63
65
 
64
66
  ## Do not
65
67
 
@@ -13,10 +13,10 @@ description: >
13
13
  # Design identity
14
14
 
15
15
  **Needs:** `docs/design/design-brief.md`, `docs/design/design-direction.md`
16
- **Uses if there:** `docs/design/design-moodboard.md`, `docs/design/design-families.md`
16
+ **Uses if there:** `docs/design/design-moodboard.md`
17
17
  **Writes:** `docs/design/design-identity.md`, `docs/design/design-identity.html`
18
18
 
19
- The direction found the look by building screens from their references. This skill makes it the product's own: it starts from what the chosen screen was built with, shows close alternatives on that same screen, and locks one pairing and one palette. Every option comes from somewhere they can point to: the chosen screen, the measured lists, their references, the subject's pictures, what they own. The agent never invents a palette or picks a face by taste.
19
+ The direction found the look by building screens from their references. This skill makes it the product's own: it starts from what the chosen screen was built with, shows close alternatives on that same screen, and locks one pairing and one palette. Every option comes from somewhere they can point to. The agent never invents a palette or picks a face by taste.
20
20
 
21
21
  Two files come out, both committed:
22
22
 
@@ -27,6 +27,8 @@ Options and captures live in `.longbeard/design/identity/`, gitignored.
27
27
 
28
28
  Three stops, no more: options, one refinement, the board.
29
29
 
30
+ **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.
31
+
30
32
  ## Gate
31
33
 
32
34
  1. No `docs/design/design-brief.md` → `design-brief`. No `docs/design/design-direction.md` → `design-direction`. Stop, and say which.
@@ -34,9 +36,9 @@ Three stops, no more: options, one refinement, the board.
34
36
 
35
37
  A graphic (the brief's surface): read [graphic.md](references/graphic.md) first.
36
38
 
37
- Read the design brief (words, personality, feel, never, what is fixed, accessibility, voice, decides) and the direction's "Look, as built". The chosen screen is `.longbeard/design/direction/prototype/first.html`; if the private folder is gone, rebuild it from `design-direction.md` and say so. **What is fixed is fixed:** a face or colour they own is in every option; a refused one is in none; light, dark or both decides which grounds count.
39
+ Read the design brief (words, personality, feel, never, what is fixed, accessibility, voice, decides) and the direction's principles and "Look, as built". The chosen screen is `.longbeard/design/direction/prototype/first.html`; if the private folder is gone, rebuild it from `design-direction.md` and say so. **What is fixed is fixed:** a face or colour they own is in every option; a refused one is in none; light, dark or both decides which grounds count.
38
40
 
39
- **At `pace: quick`** (the design brief): no options and no refinement. The chosen screen's type and colours, as built, are the identity: check every pair with `contrast.mjs` (at the brief's level), fix a failing ink with the nearest step that passes (`colours.mjs`, with `--level AAA` when the brief asks for it); a colour they liked by name is never stepped: it stays, with its warning, and go to **3. The board**. They can ask for options at the board; that is full pace from there.
41
+ **At `pace: quick`** (the design brief): no options and no refinement. The chosen screen's type and colours, as built, are the identity: check every pair with `contrast.mjs` (at the brief's level), fix a failing ink with the nearest step that passes (`colours.mjs`, with `--level AAA` when the brief asks for it); a colour they liked by name is never stepped: it stays, with its warning. The accent is still asked (below), then go to **3. The board**. They can ask for options at the board; that is full pace from there.
40
42
 
41
43
  ## 1. Options, on the chosen screen, in one message
42
44
 
@@ -66,7 +68,9 @@ When the project brought a `DESIGN.md` with tokens (see `design`), its faces and
66
68
  - **From their other references,** the palettes in the direction's readings (`library.json`), each whole.
67
69
  - **From the subject:** the light, dark and signature palettes `subject-colours.mjs .longbeard/design/pictures --level <AA|AAA>` proposes: the pictures' own colours, chosen and tuned to their roles by rule, never sampled raw. Often the most ownable, because they are the product's own world. Say for each the thing in the picture it came from ("the crust, lightened to carry white text"); a colour that cannot be named as part of the subject is not offered.
68
70
  - **Theirs,** what the design brief records as owned.
69
- - Every palette has an ink that reads on each ground at 4.5:1 (7:1 when the design brief's accessibility is AAA: `contrast.mjs --level AAA`), and an accent that holds 3:1 on at least one ground (4.5:1 at AAA). `colours.mjs` and `subject-colours.mjs` offer only what meets the level they are given, so pass it every time. A colour they liked by name is the exception: it is never stepped to pass. Fix the pair with its other colour, or move the liked one to a fill, a mark or large text; when it still fails, keep it, show the option with a warning and the ratio, and let them choose.
71
+ - Every palette meets [rule 6](references/design-floor.md#6-colour)'s contrast at the brief's level; the scripts offer only that, so pass `--level` every time. A colour they liked by name is never stepped to pass: fix the pair with its other colour, or move it to a fill, a mark or large text; else keep it with its warning and ratio, and let them choose.
72
+
73
+ **The accent, at every pace.** Picking a screen is not picking its accent: unless they named it or the board leaves no doubt, render the harmony options (`colours.mjs --harmony`), the subject's and the built one on the chosen screen, and ask.
70
74
 
71
75
  **Render them on the chosen screen, never list them.** The screen takes overrides in its URL, so each option is a capture, not a rebuild:
72
76
 
@@ -76,7 +80,7 @@ node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/direction/protot
76
80
  node <skill>/scripts/sheet.mjs .longbeard/design/identity/type.html .longbeard/design/identity/type-1.png … --cols 3
77
81
  ```
78
82
 
79
- One sheet of pairings (each on the screen's colours) and one of palettes (each on the screen's type), so each choice is seen alone and in the composition they chose. Number them, never rank them. For each, one line of where it comes from ("as built", "a narrower, darker cousin, less used", "from the bread's crust and flour"), never which is best. Where an option sits plainly against the design brief (a script face for a serious 1, a cold palette for a warm 1, its never word), add that as a fact on the same line; it stays an option.
83
+ One sheet of pairings (each on the screen's colours) and one of palettes (each on the screen's type), so each choice is seen alone and in the composition they chose. Number them, never rank them. For each, one line of where it comes from ("as built", "a narrower, darker cousin, less used", "from the bread's crust and flour"), never which is best. Where an option sits plainly against the design brief (a script face for a serious 1, a cold palette for a warm 1, its never word) or breaks one of the direction's principles, add that as a fact on the same line; it stays an option.
80
84
 
81
85
  > Pick a pairing and a palette (any mix: "type 2, colours 4"), or tell me what you're after: "warmer", "no green", "something like the type in X". "Keep" leaves the screen as built.
82
86
 
@@ -84,7 +88,9 @@ One sheet of pairings (each on the screen's colours) and one of palettes (each o
84
88
 
85
89
  On what they picked, one row of nearby choices, rendered on the screen the same way: the display face's nearest neighbours, each colour's even steps. Or build what they asked for in words, and show it before it counts.
86
90
 
87
- > Keep this, or take any from the row?
91
+ In the same message, the screen with their pick and a few live controls (type scale, line spacing, accent strength, corner radius), each limited to what their references measure, so they judge a value by seeing it. How: [controls.md](references/controls.md).
92
+
93
+ > Keep this, or take any from the row? Or open the screen, press Adjust, and paste the copy-out.
88
94
 
89
95
  "Go" keeps what they picked.
90
96
 
@@ -110,6 +116,9 @@ A note reopens only that row, then the board again. A yes is the identity. When
110
116
  |---|---|---|---|
111
117
  | <name> | #… | ground | ink 17.0:1 |
112
118
 
119
+ ## Adjusted
120
+ <one line per control they moved, "headline 96 to 110 px"; or "none">
121
+
113
122
  ## Board
114
123
  docs/design/design-identity.html
115
124
 
@@ -128,7 +137,7 @@ Then the next step in one line: `design-prototype`. If the name is only set in t
128
137
 
129
138
  ## Do not
130
139
 
131
- - Pick a face or a colour for them, rank options, or show one that fails contrast without saying so (a liked colour kept under the level is shown with its warning).
140
+ - Pick a face or a colour for them, rank options, or hide a failing contrast.
132
141
  - List faces from memory, or describe an option instead of rendering it.
133
142
  - Run more than one refinement round before the board.
134
143
  - Choose spacing, layout or a logo here.
@@ -1,14 +1,14 @@
1
1
  # Live controls on the chosen screen
2
2
 
3
- Read by `design-direction`, step 4, once their favourite is shown alone. They judge a value by seeing it, so a few measures are theirs to move in the browser, and the board bounds each one: a control runs only between values their own references use. It never produces a look no reference has, and it never adds taste that is not theirs.
3
+ Read by `design-identity`, step 2, the one refinement, on the chosen screen. They judge a value by seeing it, so a few measures are theirs to move in the browser, and the board bounds each one: a control runs only between values their own references use. It never produces a look no reference has, and it never adds taste that is not theirs.
4
4
 
5
- It moves measures. It never moves a zone, changes the layout, or adds a device; those stay with the round (more, mix).
5
+ It moves measures. It never moves a zone, changes the layout, or adds a device; those stay with `design-direction`.
6
6
 
7
7
  ## The controls
8
8
 
9
- The screen's page (from [screen-template.html](screen-template.html)) carries them. Each one is read from the screen as it is, so its own value is marked, and each is shown only when the board gives it a range.
9
+ The chosen screen, `.longbeard/design/direction/prototype/first.html` (made from the direction's screen template), carries them. Each one is read from the screen as it is, so its own value is marked, and each is shown only when the board gives it a range.
10
10
 
11
- | Control | What it moves | Its range, from `library.json` |
11
+ | Control | What it moves | Its range, from the direction's `library.json` |
12
12
  |---|---|---|
13
13
  | Type scale | Every display size, against the text size. The text stays. | `type.scale` of each reading. |
14
14
  | Line spacing | The display's line height. | `type.display.leading` of each reading. |
@@ -21,7 +21,7 @@ A range needs two readings that differ. Fewer, or all alike, and the control is
21
21
 
22
22
  ## Fill the ranges
23
23
 
24
- Before they open it, write the board's ranges into the page's `CONTROLS`, in the page that becomes `first.html`. Only from `library.json`, only the lead and the likes:
24
+ Before they open it, write the board's ranges into `first.html`'s `CONTROLS`. Only from `.longbeard/design/direction/library.json`, only the lead and the likes:
25
25
 
26
26
  ```js
27
27
  const CONTROLS = {
@@ -36,23 +36,23 @@ Leave out a line when fewer than two readings have it. Do not compute a contrast
36
36
 
37
37
  ## Open it
38
38
 
39
- Give them the link, and say the button "Adjust" is at the bottom right:
39
+ Give them the link with the pairing and palette they picked as overrides, and say the button "Adjust" is at the bottom right:
40
40
 
41
41
  ```
42
- file://<path>/.longbeard/design/direction/screens/<n>.html?controls
42
+ file://<path>/.longbeard/design/direction/prototype/first.html?face=<display>&body=<text>&ground=%23…&ink=%23…&accent=%23…&controls
43
43
  ```
44
44
 
45
45
  The panel appears only with `?controls`, and never with `?capture`. No capture, sheet or identity option is made with either, so none shows it. It sits over the screen and moves nothing under it. Each slider's tick is the screen's own value; Reset puts the screen back.
46
46
 
47
47
  ## Read the copy-out
48
48
 
49
- They press Copy and paste the text back. It lists only what moved, as own to chosen, each with its factor. Record it in the screen's own `LOOK` and CSS, never as a query string, because `design-identity` and `design-prototype` open the page as it is:
49
+ They press Copy and paste the text back. It lists only what moved, as own to chosen, each with its factor. Record it in the screen's own CSS, never as a query string, because `design-prototype` opens the page as it is:
50
50
 
51
51
  - **Type scale:** multiply every display size by the factor, to the nearest px. The text size stays.
52
52
  - **Line spacing:** multiply each display line height by the factor.
53
- - **Accent strength:** set `LOOK.accent` to the colour given.
53
+ - **Accent strength:** the colour given becomes the palette's accent in the identity (checked like any other: 3:1 on a ground at AA).
54
54
  - **Corner radius:** multiply each rounded corner by the factor.
55
55
 
56
- Nothing else changes. Keep the screen before, capture before and after side by side, and list each change in one line ("headline 96 to 110 px"), as the touch-up does. Add one line under "Look, as built" in `design-direction.md`: `adjusted: <the lines>`.
56
+ Nothing else changes. Keep the screen before, capture before and after side by side, and list each change in one line ("headline 96 to 110 px"). Add the lines to `design-identity.md` under **Adjusted**, so `design-prototype` builds with them.
57
57
 
58
58
  When a value breaks something (a headline past the edge), say so once and leave the choice with them. `CONTROLS` stays in the page; with the new values recorded, each control starts at the screen's new own value.
@@ -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.
@@ -1,7 +1,7 @@
1
1
  <!doctype html>
2
2
  <!--
3
- The identity board. Copy it to .longbeard/design/identity/board.html for the
4
- options, and to docs/design/design-identity.html once they say "this is us".
3
+ The identity board. This comment travels with every copy, so it names no
4
+ working folder: where each copy goes is in design-identity's SKILL.md.
5
5
  Write only the IDENTITY block below: the product's name, the two faces and
6
6
  the colours. Everything else is built from it, so the board is never laid
7
7
  out by hand.
@@ -23,6 +23,13 @@
23
23
  // checked, never chosen one by one: soft text, a hairline, the button's fill
24
24
  // and label, a picture tone, and status (ok, warn, error) on the ground.
25
25
  // node colours.mjs --roles --ground "#3b2416" --ink "#d8b98c" --accent "#e8643c"
26
+ //
27
+ // --harmony: when the board shows no accent and they named none, the accents colour theory
28
+ // offers from the board's primary: complementary, split-complementary (two), analogous (two),
29
+ // each at the board's own lightness and chroma (the median of its coloured --family, else the
30
+ // primary's), so a muted board gets a muted accent. Under 3:1 on the ground (4.5:1 at AAA) is
31
+ // left out. Options, never a pick: they choose.
32
+ // node colours.mjs --harmony --primary "#2b4c7e" --ground "#f1ede4" --family "<board colours>"
26
33
 
27
34
  const args = process.argv.slice(2);
28
35
  const flag = (name) => {
@@ -31,6 +38,8 @@ const flag = (name) => {
31
38
  };
32
39
  const json = args.includes("--json");
33
40
  const rolesMode = args.includes("--roles");
41
+ const harmonyMode = args.includes("--harmony");
42
+ const primaryArg = flag("primary");
34
43
  const groundArg = flag("ground");
35
44
  const inkArg = flag("ink");
36
45
  const accentArg = flag("accent");
@@ -54,7 +63,12 @@ const hex6 = (v) => {
54
63
  const list = (v) => (v ? v.split(",").map(hex6).filter(Boolean) : []);
55
64
  const ground = hex6(groundArg);
56
65
  const ink = hex6(inkArg);
57
- if (!ground || !ink) {
66
+ const primary = hex6(primaryArg);
67
+ if (harmonyMode ? !ground || !primary : !ground || !ink) {
68
+ if (harmonyMode) {
69
+ console.error('usage: node colours.mjs --harmony --primary "#rrggbb" --ground "#rrggbb" [--family "#a,#b"] [--level AA|AAA] [--json]');
70
+ process.exit(2);
71
+ }
58
72
  console.error('usage: node colours.mjs --ground "#rrggbb" --ink "#rrggbb" [--accent "#rrggbb"] [--family "#a,#b"] [--theirs "#c"] [--level AA|AAA] [--json]');
59
73
  process.exit(2);
60
74
  }
@@ -115,6 +129,26 @@ const mix = (a, b, t) => {
115
129
  const dh = ((H2 - H1 + 540) % 360) - 180;
116
130
  return fromOklch([L1 + (L2 - L1) * t, C1 + (C2 - C1) * t, (H1 + dh * t + 360) % 360]);
117
131
  };
132
+ if (harmonyMode) {
133
+ // The board's lightness and chroma: the median of its coloured colours, the primary among them.
134
+ const pool = [...new Set([primary, ...list(familyArg)])].map(oklch).filter(([, C]) => C >= 0.02);
135
+ const median = (xs) => { const s = [...xs].sort((a, b) => a - b); return s[Math.floor((s.length - 1) / 2)]; };
136
+ const [pL, pC, pH] = oklch(primary);
137
+ const L = pool.length ? median(pool.map((c) => c[0])) : pL;
138
+ const C = pool.length ? median(pool.map((c) => c[1])) : pC;
139
+ const kinds = [["complementary", 180], ["split-complementary", 150], ["split-complementary", 210], ["analogous", -30], ["analogous", 30]];
140
+ const rows = [], left = [];
141
+ for (const [label, turn] of kinds) {
142
+ const colour = fromOklch([L, C, (pH + turn + 360) % 360]);
143
+ const k = contrast(colour, ground);
144
+ if (k >= accentNeed) rows.push({ row: "accent", label, colour, contrast: cut(k) });
145
+ else left.push(`${label} ${colour} (${cut(k)}:1, under ${accentNeed}:1 on ${ground})`);
146
+ }
147
+ if (json) console.log(JSON.stringify({ rows, left }, null, 1));
148
+ else for (const r of rows) console.log([r.row, r.label, r.colour, r.contrast].join("\t"));
149
+ for (const l of left) console.error(`colours: left out ${l}`);
150
+ process.exit(0);
151
+ }
118
152
  if (rolesMode) {
119
153
  const r1 = cut;
120
154
  const roles = [];
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  // Lay screenshots out as one numbered sheet, so a round of first screens can
3
3
  // be seen and picked from together. It writes an HTML page; capture.mjs turns
4
- // that into the picture to show. No dependencies.
4
+ // that into the picture to show. The page is marked as a sheet, so links.mjs never
5
+ // counts it as a page of the prototype. No dependencies.
5
6
  //
6
7
  // node sheet.mjs .longbeard/design/direction/grid/sheet.html .longbeard/design/direction/grid/1.png .longbeard/design/direction/grid/2.png …
7
8
  // node sheet.mjs .longbeard/design/direction/grid/vary.html --cols 5 .longbeard/design/direction/grid/v*.png
@@ -49,6 +50,7 @@ writeFileSync(
49
50
  out,
50
51
  `<!doctype html>
51
52
  <meta charset="utf-8">
53
+ <meta name="generator" content="longbeard sheet">
52
54
  <title>Sheet</title>
53
55
  <style>
54
56
  body { margin: 0; padding: 24px; background: #6f6f6f; font: 600 22px/1 system-ui, sans-serif; }