@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,203 +0,0 @@
1
- # Design rules
2
-
3
- How a screen is checked. Read by `design-direction` and `design-prototype` before they prototype and by `design-check` on every frame and build.
4
-
5
- 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.
6
-
7
- ## How to use this
8
-
9
- - 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.
10
- - Go in order: **Idea** first, then every **hard** check, then **soft**.
11
- - **Hard** is the floor: structure, contrast, targets, focus and states. A hard failure blocks the screen. `DESIGN.md` cannot waive it, with one exception: a colour the person liked by name and kept under the contrast level, marked `WARN liked, kept` in `DESIGN.md`, is reported as a warning, not a block.
12
- - **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.
13
- - A finding is four things: the rule (number and check), hard or soft, where on the screen, and the fix.
14
- - 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.
15
-
16
- ## 0. Idea
17
-
18
- **Principle:** the screen says one thing about this product that a screen from another product would not.
19
-
20
- - [soft] Cover the logo and the name. Is it still recognisably this product, from its content, imagery, voice or structure? A screen that could belong to any product in the category fails.
21
- - [soft] You can say what the screen is for in one sentence, and the most visible element serves that sentence.
22
- - [soft] The ownable idea in `DESIGN.md` (or the direction, before `DESIGN.md` exists) shows up somewhere you can point to.
23
-
24
- ## 1. Hierarchy
25
-
26
- **Principle:** the eye lands first on what matters most, then moves in the order the task needs.
27
-
28
- - [hard] Exactly one element is the most prominent on the screen. Squint or blur the shot: one thing still stands out.
29
- - [hard] The primary action is easier to find than any secondary action. If two actions look equally important, only one of them should be.
30
- - [soft] Prominence comes from at most two of size, weight, colour and position at once. Using all four on one element is shouting.
31
- - [soft] Secondary text (meta, captions, help) is visibly quieter than body text, by lighter colour or smaller size, not both pushed to the limit.
32
-
33
- ## 2. Grouping
34
-
35
- **Principle:** things that belong together look together, and things that do not are kept apart.
36
-
37
- - [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.
38
- - [soft] Each group is separated by one device: space, a tone step, a box, or a line. Two at once (a boxed card with a divider inside a tinted panel) is noise.
39
- - [soft] A reader can count the groups on the screen at a glance, and the count matches the sections the brief describes.
40
-
41
- ## 3. Alignment and grid
42
-
43
- **Principle:** every element sits on a line shared with something else.
44
-
45
- - [hard] Left edges of text blocks in one column line up. No block is nudged a few pixels off its neighbours.
46
- - [soft] The screen has a small number of alignment lines (often a column grid). Draw them on the shot: an element that touches none of them needs a reason.
47
- - [soft] Centred alignment is used for a single moment (an empty state, a hero line), not as the default for whole sections of left-reading content.
48
- - [soft] Numbers in a column align on the right or on the decimal, so they compare.
49
-
50
- ## 4. Spacing rhythm
51
-
52
- **Principle:** space comes from a short scale, and bigger gaps mean bigger separations.
53
-
54
- - [soft] Every gap on the screen comes from the spacing scale in `DESIGN.md`. Measure five gaps at random: all are on the scale.
55
- - [soft] There are at most three or four distinct gap sizes in one view, and each has a job (inside a component, between items, between groups, between sections).
56
- - [soft] Nothing touches the edge of its container. Text inside a box has padding at least as large as the gap between its lines.
57
- - [soft] Dense views stay dense on purpose: a table or list keeps tight rows rather than inheriting marketing-page spacing.
58
-
59
- ## 5. Typography
60
-
61
- **Principle:** a few sizes, far apart, set for reading.
62
-
63
- - [soft] The view uses at most five font sizes, and adjacent sizes are clearly different (roughly a 1.2× step or more), not 15, 16 and 17.
64
- - [soft] Body text runs about 45 to 80 characters per line on desktop. Count one line.
65
- - [soft] Body line height is visibly looser than heading line height. Headings of two lines do not drift apart.
66
- - [soft] Weight does the work before size. A label is not set larger to be noticed when bold would do.
67
- - [hard] No text is clipped, overlapped, or cut mid-word by its container, in any language the product ships.
68
-
69
- ## 6. Colour
70
-
71
- **Principle:** colour carries meaning, and the meaning stays the same everywhere.
72
-
73
- - [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.
74
- - [hard] Colour is never the only signal. An error, a selected item or a required field also changes shape, weight, an icon or text.
75
- - [soft] Every colour on the screen is a token in `DESIGN.md`. Pick three at random: each maps to a named token.
76
- - [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.
77
- - [soft] The accent colour marks action or state, and is not also used for decoration on the same screen.
78
- - [soft] Status colours (error, warning, success) are used for status only.
79
-
80
- ## 7. Consistency
81
-
82
- **Principle:** the same thing looks and behaves the same everywhere.
83
-
84
- - [hard] One action has one look. Two primary buttons on different screens are the same component, same size and same label case.
85
- - [soft] Components come from the Figma library or the codebase's components. A one-off that looks like a library component, but is slightly different, fails.
86
- - [soft] Icons share a style: one stroke weight or one fill style, one corner treatment, one optical size.
87
- - [soft] The same word means the same thing. "Delete" and "Remove" are not both used for one action.
88
-
89
- ## 8. States
90
-
91
- **Principle:** every screen is shown in every state a person will meet.
92
-
93
- - [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.
94
- - [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.
95
- - [hard] Interactive components show hover (pointer surfaces), focus, pressed, disabled, and selected where they apply. Each state is visibly different from default.
96
- - [soft] Loading keeps the layout's shape (skeleton or reserved space), so content does not jump when it arrives.
97
- - [soft] Long content is shown: the longest real name, a big number, a two-line title. Short sample text hides overflow.
98
-
99
- ## 9. Affordance and feedback
100
-
101
- **Principle:** what can be acted on looks like it, and every action visibly answers.
102
-
103
- - [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).
104
- - [hard] Nothing that looks interactive is not. A card that looks clickable is clickable, or loses the look.
105
- - [soft] Each action has a visible result frame: a saved state, a toast, the item appearing in the list, a progress indicator for anything over a second.
106
- - [soft] Destructive actions look different from safe ones and are never the default or most prominent option.
107
-
108
- ## 10. Accessibility
109
-
110
- **Principle:** the screen works for people who see, move and read differently.
111
-
112
- - [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.
113
- - [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.
114
- - [hard] Every input has a visible label. A placeholder alone is not a label.
115
- - [hard] Text is real text, not text in an image, except in logos.
116
- - [soft] The screen still reads at 200% text size: nothing important is cut off in the zoomed frame.
117
-
118
- ## 11. Copy
119
-
120
- **Principle:** words do the job of the screen in the product's own voice, made from facts it has.
121
-
122
- **Dated 2026-11-21. Reviewed each release.**
123
-
124
- - [hard] No placeholder copy: no lorem ipsum, no "Title", no "Button", no "User Name".
125
- - [soft] Buttons say what happens: "Send invoice", not "Submit", "OK", "Get started" or "Learn more".
126
- - [soft] Headings are short. A heading that runs over two lines at its size is a sentence that belongs in the body.
127
- - [soft] The voice matches `DESIGN.md`. Read three strings aloud: they sound like one product.
128
- - [soft] No genre filler: unlock, supercharge, seamless, elevate, effortless, all-in-one, and "not just X, it's Y". Sincerity is shown, not claimed ("honest", "simply").
129
- - [soft] A rhetorical device (a heading in two fragments, "X, not Y", a row of three figures) appears once on a screen, where it lands hardest.
130
- - [soft] No detail is invented. Every number, name and quote traces to the brief, or is marked as assumed (see the prototype's stand-in marks). A section with nothing true to say is shorter or gone.
131
- - [soft] Voice test: would this voice suit a product in another trade? If yes, it is not this product's yet.
132
-
133
- ## 12. Imagery
134
-
135
- **Principle:** pictures show the real thing, or there are none.
136
-
137
- - [soft] Images show this product's subject, people or interface. A stock scene that fits any product in the category fails.
138
- - [soft] Where a picture belongs, there is a picture, not a grey box, a gradient or a text block pretending.
139
- - [soft] Images share one treatment: one crop logic, one colour handling, one corner shape.
140
- - [hard] Text over an image meets the contrast floor in rule 6 across the whole text area, not only on the darkest part.
141
-
142
- ## 13. Responsive
143
-
144
- **Principle:** each size is designed, not squeezed.
145
-
146
- - [hard] At mobile width (360–390px) nothing scrolls sideways, nothing is clipped, and nothing overlaps.
147
- - [hard] The primary action is reachable at every size without hunting: visible, or one obvious step away.
148
- - [soft] The layout changes structure between sizes where it should: columns stack, tables become lists or scroll inside their own box, navigation collapses into one control.
149
- - [soft] Type and spacing scale down a step on mobile, not to illegible sizes. Body text stays at least 16px.
150
-
151
- ## 14. Tells
152
-
153
- **Dated 2026-11-03. Reviewed each release.** Add new tells, retire ones that stopped being defaults.
154
-
155
- A tell is a device that makes a screen look produced by default rather than designed for this product. Most began as good ideas. They are tells because they arrive without a reason. Every check here is **soft**: present, and `DESIGN.md` gives no reason for it. This list never says what to use instead. That comes from the direction. A device that came with a look they chose on rendered screens is there on purpose: `DESIGN.md` says under Decisions what it does for this product.
156
-
157
- - [soft] Purple-to-blue gradients on backgrounds, buttons, glows or headline text.
158
- - [soft] Translucent blurred panels used on two or more surfaces.
159
- - [soft] The same soft grey shadow under every card.
160
- - [soft] A row of three identical feature cards, each an icon in a rounded square, a heading and two lines.
161
- - [soft] Emoji used as icons or bullets.
162
- - [soft] A tiny tracked uppercase label above every heading, or a pill badge ("New", "Beta") above the hero line.
163
- - [soft] One word of a headline singled out in another face, colour or underline.
164
- - [soft] A cream ground with a terracotta or rust accent, used as a shortcut to "warm".
165
- - [soft] Decorative monospace labels, index numbering (01 / 02 / 03) as ornament, hairline rules boxing everything, or design-tool marks (crosshairs, crop marks) as decoration.
166
- - [soft] A fake dashboard made of grey bars and donut charts where a real interface fragment should be.
167
- - [soft] Invented social proof: logos, quotes, star rows or user counts the product does not have.
168
- - [soft] Every section in the same layout, or the stock order hero, logos, features, testimonial, pricing, call to action, when the argument needs another.
169
- - [soft] One medium corner radius on everything, chosen by default rather than on purpose.
170
-
171
- Removing tells is not the goal. A screen with none and no idea fails rule 0.
172
-
173
- ## Sites
174
-
175
- Add these when the brief's surface is a site: the page a person lands on to understand or choose.
176
-
177
- - [hard] The first screen at mobile and desktop says what this is and who it is for, without scrolling.
178
- - [soft] Sections follow the order of the argument the brief makes, and each section is composed differently from the one before.
179
- - [soft] There is one primary call to action, repeated at most at the end, with the same label.
180
- - [soft] Proof is real (product shots, named customers the product has, numbers it can stand behind) or absent.
181
-
182
- ## Apps
183
-
184
- Add these when the brief's surface is an app: the tool a person comes back to.
185
-
186
- - [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.
187
- - [hard] The person always knows where they are: the current place in navigation is marked, and the screen title matches the nav item.
188
- - [soft] Density fits repeated use. Lists and tables show enough rows to work, not marketing-sized cards.
189
- - [soft] Navigation keeps the same place and shape on every screen of the flow.
190
- - [soft] Frequent actions are one step away. Rare and destructive ones may be further.
191
-
192
- ## Graphics
193
-
194
- Add these when the brief's surface is a graphic: a poster, a card, a social post, a piece to look at. A piece counts as a screen.
195
-
196
- - **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.
197
- - **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.
198
- - [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.
199
- - [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.
200
-
201
- ## Sources
202
-
203
- Ideas drawn from, in our own words: Gestalt principles of grouping; WCAG 2.2 (contrast 1.4.3 and 1.4.11, focus visible 2.4.7, target size 2.5.8, labels 3.3.2); Refactoring UI practice (Adam Wathan and Steve Schoger); Apple Human Interface Guidelines and Material Design basics (touch targets, navigation, states); and the tells registry of taste-skill by Leonxlnx (MIT).
@@ -1,47 +0,0 @@
1
- # The five-second check
2
-
3
- Read by `design-direction` (the chosen screen, after the touch-up) and `design-prototype` (the first screen and each key screen, before `DESIGN.md`). The design brief's takeaway says what someone should think and do in five seconds. This checks it on eyes that know nothing about the product. Every other check asks whether the screen follows the rules; this one asks whether it works.
4
-
5
- ## With fresh agents
6
-
7
- Three agents that have seen nothing: a new agent or a clean session each, on a small model where you can choose one, given only the capture (`capture.mjs … --clip 0,0,1440,900`, or the device size for an app; for a site most people open on their phone, the 390 capture too). Never the brief, the design brief, the product's name from anywhere but the screen, or this conversation. Each gets exactly:
8
-
9
- > You glance at this screen for five seconds. Answer in one short line each, from what you see, not what you guess:
10
- > 1. What is this?
11
- > 2. Who is it for?
12
- > 3. What would you do first?
13
- > 4. One word for how it feels.
14
-
15
- Several screens (the prototype's key screens): the same three agents see all of them, one at a time, each in its own order, and answer the four questions for each. Never three new agents per screen.
16
-
17
- No agent can be started clean (no subagents, no second session): say "five-second check: not run" and offer the people version. Never answer the questions yourself: you know too much.
18
-
19
- ## Compare, as facts
20
-
21
- One table: the takeaway's think and do, then each agent's answers, then a verdict per row.
22
-
23
- | | Takeaway | 1 | 2 | 3 | |
24
- |---|---|---|---|---|---|
25
- | What it is | a bakery, open now | … | … | … | 3 of 3 |
26
- | What to do | order for pickup | … | … | … | 1 of 3 |
27
- | Feel | warm, plain, exact (never: fussy) | … | … | … | 2 of 3 |
28
-
29
- - **Got it:** two or three of three say it in any words.
30
- - **Missed:** one or none. Say what they read instead ("two read it as a café menu, not an order page").
31
- - **Feel:** compared with the design brief's three words and its never word. A never word in an answer is said, always.
32
-
33
- ## Then
34
-
35
- A miss is a fact for them, not a redesign for you.
36
-
37
- - **In the direction:** a miss on what to do, or what it is, is fixed only with the touch-up's own means: the headline says the takeaway outright, the primary action is present and findable, rank put right. Shown before and after, run again once. A miss only a different composition would fix is said in one line, and the choice stays theirs: keep it, or go back to the grid.
38
- - **In the prototype:** the same on each key screen, where "what to do" is that screen's own job (a basket: check out). Fixed inside the identity and the direction.
39
- - **The feel** is never fixed here. A never word in the answers is said with the screens; changing the look is `design-identity` or the direction again, on their word.
40
-
41
- ## People, offered once
42
-
43
- Agents read a screen like a careful stranger, not like the people the product is for. Offer once, with the result:
44
-
45
- > Want a real check? Show the screen for five seconds to two or three people who might use it, and ask the same four questions. Paste what they say.
46
-
47
- Their answers outrank the agents'. Record them the same way. A no stands.
@@ -1,19 +0,0 @@
1
- # The full build
2
-
3
- Read by `design-direction` once they pick: the jobs that take a quick screen to a full one. The principles, the moves and the round's checks are in [grid.md](grid.md).
4
-
5
- Only on what they pick: "more of 3" (the pick, if rough, and the new screens), a mix, or the screen they lean to. A screen made on a picked base is full from its plan. One agent that builds and judges defends its own choices, so each job below has a fresh agent with only what it needs. The plan and the build are the quick round's; then:
6
-
7
- **3. Critique (a fresh agent per screen, pictures only).** It gets: the base reference (cropped to its screen), the final screen, `layout-diff.mjs`'s `side.png` and `overlay.png` for it (`--mirror` when the layout turned) and the lines its `diff.json` marks off, the translation's capture, 3× crops of every small device, rule, tight gap and edge beside the same crops of the source (made for it: it runs no scripts), each move's source picture, the moves in words, and the contrast report. No rules, no brief, no session; only what the product is, in one line. It answers:
8
- - **Where is this screen less finished than its reference?** Every spot, small ones included (a gap, an edge, a size, a weight, a colour, a picture, text that cannot be read), each with the place in the reference that shows how it should be. The reference is the standard: what it does on purpose is never a fault.
9
- - **What changed from the translation that no move names?**
10
- - **In one line, what made the reference work, and does the screen keep it?**
11
- - **Anything on the screen that no reference has?**
12
- - **What on this screen exists only because of this product?** Not its words or pictures but a thing: its ownable, a mark, a number, a form. An empty answer is a fault, listed like any other: a screen as right for another trade has borrowed and added nothing.
13
-
14
- It lists; it never redesigns.
15
-
16
- **4. Fix (a fresh agent per screen).** It gets the critic's list, the screen's file and the same pictures, and changes only the spots listed, each toward what the reference does, with what the screen and its references already have; an empty answer to the last question is fixed with the ownable or a thing from the subject's card. Each fix is a new version (`<n>-a.html`, `<n>-b.html`), every one kept: a later fix is not always better. Then capture, `layout-diff.mjs` and contrast again, and a fresh critic again. **It stops when every spot left is small, or after two passes.** A stand-in picture is never a spot: it is listed under what they still supply. A spot is small when it is within the 15% principle 2 keeps, shows only in a 3× crop and never at the screen's own size, and breaks nothing the reference does on purpose; an empty answer to the product question is never small. What is left goes on the sheet as a known fault, in the table, never hidden.
17
-
18
- Then the round's checks ([grid.md](grid.md)) again on every new or changed screen.
19
-
@@ -1,114 +0,0 @@
1
- # Building the screens
2
-
3
- Read by `design-direction`, steps 3 and 4.
4
-
5
- Eight first screens: each one reference rebuilt faithfully with the product's own content, changed by one or two things borrowed from other references, and checked until it still works. The agent's own taste adds nothing.
6
-
7
- Each screen is its own page, `.longbeard/design/direction/screens/<n>.html`, from [screen-template.html](screen-template.html): plain HTML and CSS, sizes in px at 1440 (or the device's width for an app), every face and colour a variable from `LOOK`, and a `PROVENANCE` list. Keep each screen's translation, before its moves, as `screens/<n>-base.html`. Anything the product does not really have yet (a stand-in picture, a price, an hour, a number or a name the brief does not give) carries `data-standin="picture"` or `data-standin="fact"`, and `data-standin-note` for what is assumed. A picture of theirs carries nothing.
8
-
9
- One file for all eight, `.longbeard/design/direction/screens.json`:
10
-
11
- ```
12
- [{ "n": 1, "base": "<card name>", "moves": [{ "what": "<the move, in a phrase>", "from": "<card name>", "like": "<their words, or null>" }], "picture": "<its main picture>", "tone": "<ground: light or dark, warm or cool>", "why": "<one line>", "proposed": false, "build": "quick", "state": "built" }]
13
- ```
14
-
15
- `build` is `quick` or `full`. `state` is where the screen ended, written by whoever finishes it, and nothing else is final:
16
-
17
- - **A quick screen:** `built`.
18
- - **A full screen:** `built` while its loop runs; `critiqued` when the loop stopped with only small spots left; `fixed` when the third pass ended with larger spots still listed. What is left goes on the sheet as known faults.
19
- - **Failed:** from any job, `"failure": "<why>"`.
20
- - **The round is done** when every screen has ended: a full screen still at `built` is not done. The sheet is drawn only then.
21
-
22
- ## Five principles
23
-
24
- Everything below is one of these; decide a case not listed by them.
25
-
26
- ### 1. The base stands unless a move names it
27
-
28
- A screen is its base, measured, until a move changes one named thing. What no move names stays as the base has it: layout (zones, proportions, margins, where headline, pictures and small text sit), anchors (a centred picture, a full-bleed panel, a headline on the axis), balance, alignments, devices and picture treatment.
29
-
30
- - The layout always comes from a reference. A move may turn it or take another reference's, never invent one.
31
- - What they said they like in the base is kept exactly ("this red" stays this red). That holds against contrast too: a liked colour is never stepped lighter or darker to pass. Text on it that fails is fixed with what else the screen has (the other colour of the pair, a size or weight that makes it large text, another crop, the liked colour moved from the text to a fill behind it); when none fits, the colour stays and the screen carries a warning, on the sheet and in the table, with the pair and its ratio ("liked terracotta under the button label: 3.9:1, AA asks 4.5"). What they never named is kept by its role: "a punchy accent over a quarter of the page" may become a punchy orange from another reference, at the same strength and share.
32
- - A borrowed thing fits around the base's anchors, or goes to a base with room for it.
33
- - Text on a picture sits on a calm area, as light or dark as the source's. The picture is chosen and cropped to the text, never the text moved off it. With no such picture, say so on the sheet and offer one that has it.
34
- - A device that held content in its source (a box with a product, a band of words) holds the product's content, or is left out; never empty.
35
-
36
- ### 2. Every measure is a share of the screen, and is kept
37
-
38
- Sizes, gaps and fills are measured in the source as a share of its width and height, and kept at 1440 within 15%: type sizes, gaps between pictures, the room between headline and menu, text to the margin or a panel's edge, a label to its picture, the parts of a small device (size, stroke, spacing), and how much of its zone a text block fills.
39
-
40
- - An element that grew (longer copy, a bigger face) is set smaller within its role until its room is kept; it never eats its neighbour's gap unless the source collides on purpose.
41
- - A rule or a border ends where it ends in the source; whatever runs off the screen runs off as there.
42
- - Marks that become words (dashes or dots made into links) keep the marks' colour and take the base's small-text size. A poster sets its small text for its own size; on a screen, text read to act (the menu, a control's label) takes the size the board's screen references give it, never smaller.
43
- - **When a layout turns,** every gap and alignment turns with its zone, mirrored, never closed up. Each text block keeps the edge it hangs from (outer margin, seam, axis), its ragged side and its room; running text stays aligned to the reading direction. What is grouped with a text block (button, arrows, small print) moves with it, its inside spacing unchanged.
44
-
45
- ### 3. A borrowed thing keeps its geometry and its why
46
-
47
- Before placing a borrowed thing, measure how it sits in its source (its size against the screen, what it overlaps and how far, the room around it) and keep those relations.
48
-
49
- **The why they gave is the rule for using it.** "The orange dot, the only contrast on a quiet page" goes only on a quiet base, alone. A why that describes an arrangement ("black-and-white photos at different heights, like a contact sheet") goes only where the arrangement is, never onto one framed picture. Read each why against the base; if it would not be true there, the move goes to another base. A like belongs to its reference, never a house style across the round.
50
-
51
- ### 4. A move changes only what it names
52
-
53
- One or two moves per screen, each borrowed from another reference, spread across the round. A move is one of:
54
- - **a palette:** another reference's whole palette, or the subject's;
55
- - **a thing from the subject:** one they liked on its card (a stamp, a number, a paper bag), changed in form to fit, a device or a layout, keeping what they liked in it;
56
- - **a colour by its role:** one colour they did not name, for another of the same role and strength;
57
- - **an element:** one device from another reference, on the base's grid, or a surface finish (a grain, a shadow, a blend) from its reading;
58
- - **the face:** another's display face that can carry the base's headline, at its size;
59
- - **the picture treatment:** another's crop, tone or frame, never its kind of picture (the product's own decide it; with none of that kind, the sheet says so);
60
- - **the layout turned:** mirrored, headline and picture traded, or one zone moved, proportions kept;
61
- - **the scale:** the headline larger or smaller, as far as another reference sets its own.
62
-
63
- A move brings only that one thing: a face move never brings its source's colour, case or weight beyond the role; a palette move never brings a face.
64
-
65
- The moves are theirs: what they said they like in each reference, the subject's card too, is what is borrowed. Where they named nothing, propose a move from the reading, marked `"proposed": true` in `screens.json` and in the table. A move the base cannot take is dropped for another, never forced.
66
-
67
- ### 5. Nothing from outside the board
68
-
69
- Every face, colour, element and effect names its reference in `PROVENANCE`; the subject's card is one, and its pictures and what they liked in them are the product's own material, not the agent's taste. The design brief rules out only what it names; a like it rules out is carried by its role.
70
-
71
- ## Which screens
72
-
73
- Every reference they liked is the base of at least one screen, the lead of two. With fewer than eight, the lead, then the likes, take a second screen with other moves. Across the eight, faces, picture treatments, palettes and pictures spread as widely as the board's: each face mostly on its own reference's screens, a borrowed thing on two screens at most, different photos and crops. **The spread is checked on the plan, before any screen is built:** from the `picture` and `tone` in `screens.json`, no main picture on more than two screens and no tone on more than half. A plan that fails changes its pairings. Only a like that says it is the point ("always black and white") repeats more.
74
-
75
- ## The quick round
76
-
77
- Each screen is built once and not judged: no critic, no fixer, no device close-ups.
78
-
79
- **1. Plan (you).** Pair bases and moves for the eight (principles 3 and 4), write `screens.json` (`build: quick`), check its spread, and only then write each screen's brief, `.longbeard/design/direction/briefs/<n>.md`: the base's reading from `library.json` and its picture's path; each move in words with its source picture's path, its like and its why; the content in the base's slots, in the fill order; the product's pictures for this base (principle 1); the five principles, as written. Nothing else from this file or the session.
80
-
81
- **2. Build (a fresh agent per screen, from its brief only).**
82
- - Translate the base into `screens/<n>-base.html` from [screen-template.html](screen-template.html), with the product's content and pictures, treated only as the reference treats its own. Capture it, then measure it against the reference:
83
- ```
84
- node <skill>/scripts/layout-diff.mjs <reference picture> .longbeard/design/direction/grid/<n>-base.png --out .longbeard/design/direction/checks/<n>-base
85
- ```
86
- Fix the translation until nothing it lists is off, or each that is has a reason (longer copy set smaller).- Make the moves into `screens/<n>.html`, by principles 3 and 4, and capture it. State `built`.
87
-
88
- **Then the round (you).**
89
- - **Not a copy.** One fresh agent is given every screen of the round beside its base, each pair at thumbnail size and numbered, and answers yes or no for each: *can you tell them apart at a glance, by the ground or accent, the face, the layout turned, a device added or gone, or the picture treatment?* Yes is not a copy. No is a copy: its plan gets another move, it is built again from step 2, and the rebuilt screens go to one fresh judge together. Keeping the base's layout, measures and system is the method, never a copy by itself.
90
- - **As varied as the board** (Which screens), again on what was built.
91
- - **Contrast,** every screen, rough or not; a failure blocks the sheet, except a liked colour kept with its warning (principle 1). Fixed with the screen's own colours or another crop (principle 1), never by moving the text:
92
- ```
93
- node <skill>/scripts/screen-contrast.mjs "file://$PWD/.longbeard/design/direction/screens/1.html" --wait-title ready
94
- ```
95
- - **Faults:** a clipped word, text under 12 px at 1440, a lone word on a heading's last line, the same sentence twice.
96
- - **Each picture:** `picture-cast.mjs <pictures>`, run on the product's pictures, not the captures: a cast, blown highlights or crushed shadows the reference lacks is a picture to replace.
97
-
98
- A helper that fails twice is recorded as `failed` with why, and shows on the sheet as failed.
99
-
100
- ## Without fresh agents
101
-
102
- When no agent can be started clean, do the jobs yourself, one screen at a time, each from its brief alone. As critic, look only at the prepared pictures and write the list before you fix anything, never from memory of the build. The round is weaker, and says so: the sheet carries `--note`, and the table's first line says why ("built and judged by one agent: no clean agent could be started"). Never call such a screen checked as if a critic had seen it.
103
-
104
- ## Capture and sheet
105
-
106
- ```
107
- node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/direction/screens/1.html" --out .longbeard/design/direction/grid/1.png --clip 0,0,1440,900
108
- node <skill>/scripts/sheet.mjs .longbeard/design/direction/grid/sheet.html --rough 1,2,4 .longbeard/design/direction/grid/1.png … .longbeard/design/direction/grid/8.png
109
- node <skill>/scripts/capture.mjs "file://$PWD/.longbeard/design/direction/grid/sheet.html" --out .longbeard/design/direction/grid/sheet.png
110
- ```
111
-
112
- `--rough` lists the quick screens (`none` when all are full), which the sheet labels. `--note "<text>"` prints a line under the sheet. A second sheet shows each screen beside its base (`grid/bases.html`, `--cols 2`).
113
-
114
- For an app, or a site whose design brief says `first seen on: phone`, build and capture at the device size (`?size=390x844`, `--width 390`, a clip of that size); the desktop comes in `design-prototype`.
@@ -1,118 +0,0 @@
1
- #!/usr/bin/env node
2
- // Put a screen beside the reference it was built from, measured the same way,
3
- // so the critic's eye has numbers under it. Node 22+, an installed Chrome.
4
- //
5
- // node layout-diff.mjs <reference picture> <screen capture> --out <folder> [--mirror]
6
- //
7
- // Both pictures are read by measure.mjs (a reference in a presentation frame
8
- // is read inside it). Writes to --out:
9
- // diff.json each measure on both sides and whether it is off: the
10
- // headline's size against the screen, its box, its lines, the
11
- // type scale, the margins the text keeps on each side, how
12
- // much is empty and how much is pictures, and every line of
13
- // text matched to its nearest line in the reference;
14
- // side.png the reference (cropped to its screen) and the screen, side by side, at one size;
15
- // overlay.png the screen with the reference faintly over it, at the same size,
16
- // so a box that moved, a gap that closed or a size that drifted shows.
17
- // --mirror compares against the reference flipped, for a screen whose layout turned.
18
- // Sizes are shares of the screen; "off" is more than 15% apart, or a box more
19
- // than 3% of the screen away. Exit 0 whenever both pictures were read, whatever is
20
- // off: it reports, the critic decides. Exit 1 when a picture could not be read,
21
- // 2 when called wrong. A picture that could not be drawn is said on stderr and
22
- // leaves the exit alone; diff.json is already written.
23
- // A tall capture is read on its first screen only, and the pictures show that
24
- // first screen and nothing below it. --out may be relative: it is taken from
25
- // where this is run, and the pictures land beside diff.json.
26
- import { spawnSync } from "node:child_process";
27
- import { mkdirSync, writeFileSync } from "node:fs";
28
- import { dirname, join, resolve } from "node:path";
29
- import { fileURLToPath, pathToFileURL } from "node:url";
30
-
31
- const here = dirname(fileURLToPath(import.meta.url));
32
- const args = process.argv.slice(2);
33
- const flag = (name) => {
34
- const i = args.indexOf(`--${name}`);
35
- return i === -1 ? null : args.splice(i, 2)[1];
36
- };
37
- const has = (name) => {
38
- const i = args.indexOf(`--${name}`);
39
- return i === -1 ? false : (args.splice(i, 1), true);
40
- };
41
- const out = flag("out");
42
- const mirror = has("mirror");
43
- if (args.length !== 2 || !out) {
44
- console.error("usage: node layout-diff.mjs <reference picture> <screen capture> --out <folder> [--mirror]");
45
- process.exit(2);
46
- }
47
- const [refFile, screenFile] = args.map((f) => resolve(f));
48
- const outDir = resolve(out);
49
- mkdirSync(outDir, { recursive: true });
50
-
51
- function read(file) {
52
- const r = spawnSync(process.execPath, [join(here, "measure.mjs"), file, "--lines"], { encoding: "utf8", maxBuffer: 1 << 26 });
53
- if (r.status !== 0) {
54
- console.error(`layout-diff: could not read ${file}: ${r.stderr.trim()}`);
55
- process.exit(1);
56
- }
57
- return JSON.parse(r.stdout);
58
- }
59
- const ref = read(refFile);
60
- const screen = read(screenFile);
61
-
62
- // Boxes as [x, y, w, h] shares of the screen read; the reference's flipped when it turned.
63
- const flip = (b) => (mirror ? [1 - b[0] - b[2], b[1], b[2], b[3]] : b);
64
- const lines = (m, f = (b) => b) => (m.type?.lines || []).map((l) => ({ size: l.size, px: l.px1440, box: f(l.box), case: l.case }));
65
- const R = lines(ref, flip);
66
- const S = lines(screen);
67
- const round = (n, d = 3) => (n == null ? null : Math.round(n * 10 ** d) / 10 ** d);
68
- const ratioOff = (a, b) => a != null && b != null && a > 0 && b > 0 && Math.max(a / b, b / a) > 1.15;
69
- const rows = [];
70
- const row = (what, r, s, off) => rows.push({ what, reference: r, screen: s, off: Boolean(off) });
71
-
72
- const rd = ref.type?.display, sd = screen.type?.display;
73
- row("headline size (share of the screen's height)", round(rd?.size), round(sd?.size), ratioOff(rd?.size, sd?.size));
74
- if (rd?.box && sd?.box) {
75
- const rb = flip(rd.box);
76
- const far = Math.max(...rb.map((v, i) => Math.abs(v - sd.box[i]))) > 0.03;
77
- row("headline box [x, y, w, h]", rb.map((v) => round(v)), sd.box.map((v) => round(v)), far);
78
- }
79
- row("headline lines", ref.type?.headline?.lines ?? null, screen.type?.headline?.lines ?? null, (ref.type?.headline?.lines ?? 0) !== (screen.type?.headline?.lines ?? 0));
80
- row("type scale (headline over body)", ref.type?.scale ?? null, screen.type?.scale ?? null, ratioOff(ref.type?.scale, screen.type?.scale));
81
- const margins = (L) => (L.length ? { left: round(Math.min(...L.map((l) => l.box[0]))), right: round(1 - Math.max(...L.map((l) => l.box[0] + l.box[2]))), top: round(Math.min(...L.map((l) => l.box[1]))), bottom: round(1 - Math.max(...L.map((l) => l.box[1] + l.box[3]))) } : null);
82
- const rm = margins(R), sm = margins(S);
83
- for (const side of ["left", "right", "top", "bottom"]) if (rm && sm) row(`text margin, ${side}`, rm[side], sm[side], Math.abs(rm[side] - sm[side]) > 0.03 && ratioOff(rm[side] + 0.001, sm[side] + 0.001));
84
- row("empty (%)", ref.traits?.empty ?? null, screen.traits?.empty ?? null, Math.abs((ref.traits?.empty ?? 0) - (screen.traits?.empty ?? 0)) > 15);
85
- row("pictures (%)", ref.traits?.pictures ?? null, screen.traits?.pictures ?? null, Math.abs((ref.traits?.pictures ?? 0) - (screen.traits?.pictures ?? 0)) > 15);
86
- row("small text blocks", ref.type?.small ?? null, screen.type?.small ?? null, (screen.type?.small ?? 0) > (ref.type?.small ?? 0) + 1);
87
-
88
- // Each line of the screen matched to the nearest line of the reference of a like size.
89
- const matched = S.map((s) => {
90
- let best = null, cost = Infinity;
91
- for (const r of R) {
92
- const c = Math.hypot(s.box[0] - r.box[0], s.box[1] - r.box[1]) + Math.abs(Math.log(s.size / r.size));
93
- if (c < cost) (cost = c), (best = r);
94
- }
95
- if (!best) return { screen: s, reference: null, off: true };
96
- const moved = Math.hypot(s.box[0] - best.box[0], s.box[1] - best.box[1]);
97
- return { screen: { px: s.px, box: s.box.map((v) => round(v)) }, reference: { px: best.px, box: best.box.map((v) => round(v)) }, moved: round(moved), off: moved > 0.03 || ratioOff(s.size, best.size) };
98
- });
99
-
100
- const off = rows.filter((r) => r.off).map((r) => r.what);
101
- const report = { reference: refFile, screen: screenFile, mirror, off, measures: rows, lines: matched, unread: "pictures' boxes and the gaps between them are not measured here: the critic judges them on side.png and overlay.png" };
102
- writeFileSync(join(outDir, "diff.json"), JSON.stringify(report, null, 1));
103
-
104
- // The pictures: the reference cropped to the screen measure.mjs read, both at 1440 wide.
105
- // That is the frame it found, else (a tall capture, firstScreen) the top 1440 by 900 share, else the whole.
106
- const [fx, fy, fw, fh] = ref.frame?.box || [0, 0, ref.width, ref.firstScreen ? Math.round((ref.width * 900) / 1440) : ref.height];
107
- const W = 1440, H = Math.round((W * fh) / fw);
108
- const refLayer = (opacity) => `<div style="position:absolute;inset:0;overflow:hidden;opacity:${opacity}"><img src="${pathToFileURL(refFile)}" style="position:absolute;left:${(-fx * W) / fw}px;top:${(-fy * W) / fw}px;width:${(ref.width * W) / fw}px;${mirror ? "transform:scaleX(-1);transform-origin:" + ((fx + fw / 2) * W) / fw + "px 0;" : ""}"></div>`;
109
- const shot = `<img src="${pathToFileURL(screenFile)}" style="position:absolute;inset:0;width:${W}px;height:${H}px;object-fit:cover;object-position:top">`;
110
- const page = (body, w) => `<!doctype html><html><head><title>ready</title><style>*{margin:0}body{width:${w}px;background:#777}.f{position:relative;width:${W}px;height:${H}px;overflow:hidden;display:inline-block;vertical-align:top}</style></head><body>${body}</body></html>`;
111
- writeFileSync(join(outDir, "side.html"), page(`<div class="f">${refLayer(1)}</div><div class="f" style="margin-left:20px">${shot}</div>`, W * 2 + 20));
112
- writeFileSync(join(outDir, "overlay.html"), page(`<div class="f">${shot}${refLayer(0.4)}</div>`, W));
113
- for (const [name, w] of [["side", W * 2 + 20], ["overlay", W]]) {
114
- const c = spawnSync(process.execPath, [join(here, "capture.mjs"), pathToFileURL(join(outDir, `${name}.html`)).href, "--out", join(outDir, `${name}.png`), "--width", String(w), "--clip", `0,0,${w},${H}`], { encoding: "utf8" });
115
- if (c.status !== 0) console.error(`layout-diff: ${name}.png not drawn: ${c.stderr.trim()}`);
116
- }
117
- console.log(off.length ? `off: ${off.join("; ")}` : "nothing measured is off");
118
- console.log(`lines off: ${matched.filter((m) => m.off).length} of ${matched.length}. ${join(outDir, "diff.json")}, side.png, overlay.png`);