@jonandev/longbeard 0.9.0 → 0.10.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.
- package/AGENTS.md +18 -33
- package/CHANGELOG.md +25 -1
- package/README.md +55 -90
- package/beard.json +137 -198
- package/bin/long-beard.js +53 -21
- package/package.json +3 -2
- package/skills/design/SKILL.md +135 -0
- package/skills/design/references/design-md-template.md +57 -0
- package/skills/design/references/design-rules.md +188 -0
- package/skills/design/scripts/capture.mjs +489 -0
- package/skills/design/scripts/contrast.mjs +27 -0
- package/skills/design-check/SKILL.md +78 -0
- package/skills/design-check/references/design-rules.md +188 -0
- package/skills/{design-reference-hunt → design-check}/scripts/capture.mjs +65 -13
- package/skills/design-direction/SKILL.md +157 -0
- package/skills/{design-reference-hunt → design-direction}/references/sources.md +7 -14
- package/skills/design-direction/scripts/capture.mjs +489 -0
- package/skills/{design-reference-hunt → design-direction}/scripts/contact-sheet.mjs +1 -1
- package/skills/{design-reference-hunt → design-direction}/scripts/moodboard.mjs +7 -9
- package/skills/idea/SKILL.md +103 -0
- package/skills/design-md/SKILL.md +0 -100
- package/skills/design-reference-hunt/SKILL.md +0 -177
- /package/skills/{design-reference-hunt → design-check}/scripts/contrast.mjs +0 -0
- /package/skills/{design-reference-hunt → design-direction}/scripts/dribbble-cards.mjs +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Design rules
|
|
2
|
+
|
|
3
|
+
How a screen is checked. Read by `design` before it prototypes 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.
|
|
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. Then add the site list or the app 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.
|
|
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
|
+
- [soft] The accent colour marks action or state, and is not also used for decoration on the same screen.
|
|
77
|
+
- [soft] Status colours (error, warning, success) are used for status only.
|
|
78
|
+
|
|
79
|
+
## 7. Consistency
|
|
80
|
+
|
|
81
|
+
**Principle:** the same thing looks and behaves the same everywhere.
|
|
82
|
+
|
|
83
|
+
- [hard] One action has one look. Two primary buttons on different screens are the same component, same size and same label case.
|
|
84
|
+
- [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.
|
|
85
|
+
- [soft] Icons share a style: one stroke weight or one fill style, one corner treatment, one optical size.
|
|
86
|
+
- [soft] The same word means the same thing. "Delete" and "Remove" are not both used for one action.
|
|
87
|
+
|
|
88
|
+
## 8. States
|
|
89
|
+
|
|
90
|
+
**Principle:** every screen is shown in every state a person will meet.
|
|
91
|
+
|
|
92
|
+
- [hard] The screen has frames for empty, loading and error, next to the default. A missing state is a failure, not a later task.
|
|
93
|
+
- [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.
|
|
94
|
+
- [hard] Interactive components show hover (pointer surfaces), focus, pressed, disabled, and selected where they apply. Each state is visibly different from default.
|
|
95
|
+
- [soft] Loading keeps the layout's shape (skeleton or reserved space), so content does not jump when it arrives.
|
|
96
|
+
- [soft] Long content is shown: the longest real name, a big number, a two-line title. Short sample text hides overflow.
|
|
97
|
+
|
|
98
|
+
## 9. Affordance and feedback
|
|
99
|
+
|
|
100
|
+
**Principle:** what can be acted on looks like it, and every action visibly answers.
|
|
101
|
+
|
|
102
|
+
- [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).
|
|
103
|
+
- [hard] Nothing that looks interactive is not. A card that looks clickable is clickable, or loses the look.
|
|
104
|
+
- [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.
|
|
105
|
+
- [soft] Destructive actions look different from safe ones and are never the default or most prominent option.
|
|
106
|
+
|
|
107
|
+
## 10. Accessibility
|
|
108
|
+
|
|
109
|
+
**Principle:** the screen works for people who see, move and read differently.
|
|
110
|
+
|
|
111
|
+
- [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.
|
|
112
|
+
- [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.
|
|
113
|
+
- [hard] Every input has a visible label. A placeholder alone is not a label.
|
|
114
|
+
- [hard] Text is real text, not text in an image, except in logos.
|
|
115
|
+
- [soft] The screen still reads at 200% text size: nothing important is cut off in the zoomed frame.
|
|
116
|
+
|
|
117
|
+
## 11. Copy
|
|
118
|
+
|
|
119
|
+
**Principle:** words do the job of the screen in the product's own voice.
|
|
120
|
+
|
|
121
|
+
- [hard] No placeholder copy: no lorem ipsum, no "Title", no "Button", no "User Name".
|
|
122
|
+
- [soft] Buttons say what happens: "Send invoice", not "Submit", "OK", "Get started" or "Learn more".
|
|
123
|
+
- [soft] Headings are short. A heading that runs over two lines at its size is a sentence that belongs in the body.
|
|
124
|
+
- [soft] The voice matches `DESIGN.md`. Read three strings aloud: they sound like one product.
|
|
125
|
+
- [soft] No genre filler: unlock, supercharge, seamless, elevate, effortless, all-in-one, and "not just X, it's Y".
|
|
126
|
+
|
|
127
|
+
## 12. Imagery
|
|
128
|
+
|
|
129
|
+
**Principle:** pictures show the real thing, or there are none.
|
|
130
|
+
|
|
131
|
+
- [soft] Images show this product's subject, people or interface. A stock scene that fits any product in the category fails.
|
|
132
|
+
- [soft] Where a picture belongs, there is a picture, not a grey box, a gradient or a text block pretending.
|
|
133
|
+
- [soft] Images share one treatment: one crop logic, one colour handling, one corner shape.
|
|
134
|
+
- [hard] Text over an image meets the contrast floor in rule 6 across the whole text area, not only on the darkest part.
|
|
135
|
+
|
|
136
|
+
## 13. Responsive
|
|
137
|
+
|
|
138
|
+
**Principle:** each size is designed, not squeezed.
|
|
139
|
+
|
|
140
|
+
- [hard] At mobile width (360–390px) nothing scrolls sideways, nothing is clipped, and nothing overlaps.
|
|
141
|
+
- [hard] The primary action is reachable at every size without hunting: visible, or one obvious step away.
|
|
142
|
+
- [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.
|
|
143
|
+
- [soft] Type and spacing scale down a step on mobile, not to illegible sizes. Body text stays at least 16px.
|
|
144
|
+
|
|
145
|
+
## 14. Tells
|
|
146
|
+
|
|
147
|
+
**Dated 2026-11-03. Reviewed each release.** Add new tells, retire ones that stopped being defaults.
|
|
148
|
+
|
|
149
|
+
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.
|
|
150
|
+
|
|
151
|
+
- [soft] Purple-to-blue gradients on backgrounds, buttons, glows or headline text.
|
|
152
|
+
- [soft] Translucent blurred panels used on two or more surfaces.
|
|
153
|
+
- [soft] The same soft grey shadow under every card.
|
|
154
|
+
- [soft] A row of three identical feature cards, each an icon in a rounded square, a heading and two lines.
|
|
155
|
+
- [soft] Emoji used as icons or bullets.
|
|
156
|
+
- [soft] A tiny tracked uppercase label above every heading, or a pill badge ("New", "Beta") above the hero line.
|
|
157
|
+
- [soft] One word of a headline singled out in another face, colour or underline.
|
|
158
|
+
- [soft] A cream ground with a terracotta or rust accent, used as a shortcut to "warm".
|
|
159
|
+
- [soft] Decorative monospace labels, index numbering (01 / 02 / 03) as ornament, hairline rules boxing everything, or design-tool marks (crosshairs, crop marks) as decoration.
|
|
160
|
+
- [soft] A fake dashboard made of grey bars and donut charts where a real interface fragment should be.
|
|
161
|
+
- [soft] Invented social proof: logos, quotes, star rows or user counts the product does not have.
|
|
162
|
+
- [soft] Every section in the same layout, or the stock order hero, logos, features, testimonial, pricing, call to action, when the argument needs another.
|
|
163
|
+
- [soft] One medium corner radius on everything, chosen by default rather than on purpose.
|
|
164
|
+
|
|
165
|
+
Removing tells is not the goal. A screen with none and no idea fails rule 0.
|
|
166
|
+
|
|
167
|
+
## Sites
|
|
168
|
+
|
|
169
|
+
Add these when the brief's surface is a site: the page a person lands on to understand or choose.
|
|
170
|
+
|
|
171
|
+
- [hard] The first screen at mobile and desktop says what this is and who it is for, without scrolling.
|
|
172
|
+
- [soft] Sections follow the order of the argument the brief makes, and each section is composed differently from the one before.
|
|
173
|
+
- [soft] There is one primary call to action, repeated at most at the end, with the same label.
|
|
174
|
+
- [soft] Proof is real (product shots, named customers the product has, numbers it can stand behind) or absent.
|
|
175
|
+
|
|
176
|
+
## Apps
|
|
177
|
+
|
|
178
|
+
Add these when the brief's surface is an app: the tool a person comes back to.
|
|
179
|
+
|
|
180
|
+
- [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.
|
|
181
|
+
- [hard] The person always knows where they are: the current place in navigation is marked, and the screen title matches the nav item.
|
|
182
|
+
- [soft] Density fits repeated use. Lists and tables show enough rows to work, not marketing-sized cards.
|
|
183
|
+
- [soft] Navigation keeps the same place and shape on every screen of the flow.
|
|
184
|
+
- [soft] Frequent actions are one step away. Rare and destructive ones may be further.
|
|
185
|
+
|
|
186
|
+
## Sources
|
|
187
|
+
|
|
188
|
+
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).
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
// Full-page capture. Unsticks fixed/sticky chrome first so Chrome does not
|
|
3
3
|
// repeat the same fold. Node 22+. Uses an installed Chrome/Edge/Chromium.
|
|
4
4
|
//
|
|
5
|
-
// node capture.mjs <url> --out
|
|
6
|
-
// node capture.mjs <url> --out
|
|
7
|
-
// node capture.mjs <url> --out
|
|
8
|
-
// node capture.mjs <url> --out
|
|
5
|
+
// node capture.mjs <url> --out design-exploration/<slug>/refs/name.jpg
|
|
6
|
+
// node capture.mjs <url> --out design-exploration/<slug>/refs/name.jpg --review /tmp/name-review.jpg
|
|
7
|
+
// node capture.mjs <url> --out design-exploration/<slug>/refs/name.jpg --clip x,y,w,h
|
|
8
|
+
// node capture.mjs <url> --out design-exploration/<slug>/refs/name.jpg --clip-selector "main"
|
|
9
|
+
// node capture.mjs <url> --out /tmp/mobile.png --width 390
|
|
10
|
+
// node capture.mjs http://localhost:3000/app --out /tmp/app.png --cookie "session=abc; theme=dark" --strict
|
|
11
|
+
//
|
|
12
|
+
// A page that ends up at another address (a login, or a site's canonical
|
|
13
|
+
// www) is named on stderr. With --strict that is exit 1, so a 0 means the
|
|
14
|
+
// shot is of the page asked for.
|
|
9
15
|
// node capture.mjs file:///abs/path/moodboard.html --out /tmp/moodboard.jpg
|
|
10
|
-
// node capture.mjs file:///abs/path/shot.jpg --out
|
|
16
|
+
// node capture.mjs file:///abs/path/shot.jpg --out design-exploration/<slug>/refs/name.jpg --clip x,y,w,h
|
|
11
17
|
import { spawn, execSync } from "node:child_process";
|
|
12
18
|
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
13
19
|
import { tmpdir } from "node:os";
|
|
@@ -26,12 +32,25 @@ const outArg = flag("out", "") || "";
|
|
|
26
32
|
const reviewArg = flag("review", "") || "";
|
|
27
33
|
const clipArg = flag("clip", "") || "";
|
|
28
34
|
const clipSelector = flag("clip-selector", "") || "";
|
|
35
|
+
// Sent with every request to the page's own origin, as a logged-in browser would.
|
|
36
|
+
const cookieArg = flag("cookie", "") || "";
|
|
37
|
+
const strictAt = args.indexOf("--strict");
|
|
38
|
+
const strict = strictAt !== -1;
|
|
39
|
+
if (strict) args.splice(strictAt, 1);
|
|
40
|
+
// Below 768 the page gets a phone viewport: mobile layout, 2x pixels.
|
|
41
|
+
const width = Math.round(Number(flag("width", "1440")));
|
|
29
42
|
if (!url || !/^(https?|file):\/\//.test(url) || !outArg) {
|
|
30
43
|
console.error(
|
|
31
|
-
'usage: node capture.mjs <https://url | file:///path> --out
|
|
44
|
+
'usage: node capture.mjs <https://url | file:///path> --out design-exploration/<slug>/refs/name.jpg [--review /tmp/name-review.jpg] [--clip x,y,w,h | --clip-selector "css"] [--width 390] [--cookie "name=value; …"] [--strict]',
|
|
32
45
|
);
|
|
33
46
|
process.exit(2);
|
|
34
47
|
}
|
|
48
|
+
if (!Number.isFinite(width) || width < 200 || width > 3840) {
|
|
49
|
+
console.error("width must be a number from 200 to 3840");
|
|
50
|
+
process.exit(2);
|
|
51
|
+
}
|
|
52
|
+
const mobile = width < 768;
|
|
53
|
+
const height = mobile ? 844 : 900;
|
|
35
54
|
if (clipArg && clipSelector) {
|
|
36
55
|
console.error("pass --clip or --clip-selector, not both");
|
|
37
56
|
process.exit(2);
|
|
@@ -129,7 +148,7 @@ proc = spawn(
|
|
|
129
148
|
"--hide-scrollbars",
|
|
130
149
|
"--mute-audio",
|
|
131
150
|
"--force-color-profile=srgb",
|
|
132
|
-
|
|
151
|
+
`--window-size=${width},${height}`,
|
|
133
152
|
"about:blank",
|
|
134
153
|
],
|
|
135
154
|
{ stdio: ["ignore", "ignore", "pipe"] },
|
|
@@ -196,10 +215,10 @@ const page = (method, params, timeoutMs) => send(method, params, sessionId, time
|
|
|
196
215
|
await page("Page.enable");
|
|
197
216
|
await page("Runtime.enable");
|
|
198
217
|
await page("Emulation.setDeviceMetricsOverride", {
|
|
199
|
-
width
|
|
200
|
-
height
|
|
201
|
-
deviceScaleFactor: 1,
|
|
202
|
-
mobile
|
|
218
|
+
width,
|
|
219
|
+
height,
|
|
220
|
+
deviceScaleFactor: mobile ? 2 : 1,
|
|
221
|
+
mobile,
|
|
203
222
|
});
|
|
204
223
|
// Chrome centres an image file and shrinks it to the window. A page that holds
|
|
205
224
|
// it at full size from 0,0 makes --clip x,y,w,h the image's own pixels.
|
|
@@ -208,6 +227,22 @@ if (/^file:\/\/.*\.(png|jpe?g|webp|gif)$/i.test(url)) {
|
|
|
208
227
|
target = `file://${join(dir, "image.html")}`;
|
|
209
228
|
writeFileSync(join(dir, "image.html"), `<!doctype html><body style="margin:0;background:#000"><img src="${url.replace(/"/g, "%22")}" style="display:block">`);
|
|
210
229
|
}
|
|
230
|
+
if (cookieArg && /^https?:/.test(url)) {
|
|
231
|
+
const cookies = cookieArg
|
|
232
|
+
.split(";")
|
|
233
|
+
.map((pair) => pair.trim())
|
|
234
|
+
.filter(Boolean)
|
|
235
|
+
.map((pair) => {
|
|
236
|
+
const at = pair.indexOf("=");
|
|
237
|
+
return { name: pair.slice(0, at), value: pair.slice(at + 1), url: new URL(url).origin };
|
|
238
|
+
});
|
|
239
|
+
if (cookies.some((cookie) => !cookie.name)) {
|
|
240
|
+
console.error('cookie must be "name=value; name=value"');
|
|
241
|
+
drop();
|
|
242
|
+
process.exit(2);
|
|
243
|
+
}
|
|
244
|
+
await page("Network.setCookies", { cookies });
|
|
245
|
+
}
|
|
211
246
|
await page("Page.navigate", { url: target }, 40000);
|
|
212
247
|
await sleep(2500);
|
|
213
248
|
|
|
@@ -310,6 +345,23 @@ await page("Runtime.evaluate", {
|
|
|
310
345
|
});
|
|
311
346
|
await sleep(400);
|
|
312
347
|
|
|
348
|
+
// A redirect can land late (an app checks the session after it loads), so
|
|
349
|
+
// the address is checked last, right before the shot.
|
|
350
|
+
if (target === url) {
|
|
351
|
+
const landed = (await page("Runtime.evaluate", { expression: "location.href", returnByValue: true })).result.value;
|
|
352
|
+
const where = (href) => {
|
|
353
|
+
const u = new URL(href);
|
|
354
|
+
return `${u.origin}${u.pathname.replace(/\/$/, "")}`;
|
|
355
|
+
};
|
|
356
|
+
if (where(landed) !== where(url)) {
|
|
357
|
+
console.error(`landed on ${landed}, not ${url}.${/^https?:/.test(landed) ? " Behind a login? Pass --cookie." : " Check the address."}`);
|
|
358
|
+
if (strict) {
|
|
359
|
+
drop();
|
|
360
|
+
process.exit(1);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
313
365
|
// --clip-selector takes the element's box in document coordinates, measured
|
|
314
366
|
// after the unstick pass so the numbers match what the capture sees.
|
|
315
367
|
let selected = null;
|
|
@@ -343,8 +395,8 @@ if (clipSelector) {
|
|
|
343
395
|
|
|
344
396
|
const metrics = await page("Page.getLayoutMetrics");
|
|
345
397
|
const size = metrics.cssContentSize || metrics.contentSize;
|
|
346
|
-
const fullWidth = Math.max(1, Math.ceil(size.width ||
|
|
347
|
-
const fullHeight = Math.max(1, Math.min(Math.ceil(size.height ||
|
|
398
|
+
const fullWidth = Math.max(1, Math.ceil(size.width || width));
|
|
399
|
+
const fullHeight = Math.max(1, Math.min(Math.ceil(size.height || height), 14000));
|
|
348
400
|
const clipBox = clip || (selected ? { ...selected, scale: 1 } : null);
|
|
349
401
|
const shotClip = clipBox
|
|
350
402
|
? {
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-direction
|
|
3
|
+
description: >
|
|
4
|
+
Find the direction for a product's look from what they like and from real
|
|
5
|
+
references, picked by looking at a moodboard. Ideas and patterns, never
|
|
6
|
+
tokens: colour and type are chosen later, in design, on rendered screens.
|
|
7
|
+
Runs after docs/brief.md exists and the brief has a UI, or when design hits
|
|
8
|
+
a gap and needs references for one piece. Writes
|
|
9
|
+
design-exploration/<slug>/direction.md, a proposal, then offers to take it
|
|
10
|
+
into design.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Design direction
|
|
14
|
+
|
|
15
|
+
One file comes out: `design-exploration/<slug>/direction.md`, a proposal for how the product should look and sound. It is not official. `design` turns it into screens, and only an approved prototype becomes `DESIGN.md`.
|
|
16
|
+
|
|
17
|
+
Direction finds ideas and patterns. It never picks a colour, a typeface, a size or a spacing value, and it never writes `DESIGN.md`.
|
|
18
|
+
|
|
19
|
+
## Gate
|
|
20
|
+
|
|
21
|
+
Look at the repo. Do not ask what is there.
|
|
22
|
+
|
|
23
|
+
1. No `docs/brief.md` → run `idea` first. Stop.
|
|
24
|
+
2. The brief says no UI (CLI, API, library) → there is no direction to find. Say so and stop.
|
|
25
|
+
3. Called for one piece (a view, a section, a control, an empty state, "ideas for X"), usually by `design` at a gap → **One piece**.
|
|
26
|
+
4. Otherwise → **Identity**. With a `DESIGN.md` already, this is a rebrand. Say that `DESIGN.md` stays as it is until `design` approves a new one.
|
|
27
|
+
|
|
28
|
+
## Folder
|
|
29
|
+
|
|
30
|
+
Everything goes in `design-exploration/<slug>/`: `board.md`, `refs/`, `moodboard.html`, `direction.md`. The first pass is `identity/`. One piece uses its own slug (`pricing`, `empty-state`). If the folder exists, use `<slug>-2`. Two explorations never share a folder.
|
|
31
|
+
|
|
32
|
+
On the first write, add `design-exploration/` to `.gitignore` if it is missing, and say why in one line: the shots are other people's work. If `git ls-files design-exploration` already lists files, say so and leave `git rm -r --cached design-exploration` to them.
|
|
33
|
+
|
|
34
|
+
## Identity
|
|
35
|
+
|
|
36
|
+
### 1. Three questions, one round
|
|
37
|
+
|
|
38
|
+
Read `docs/brief.md` first. It gives the subject, the people, the surface (site or app), the key screens, and the identity nouns. Do not ask for any of that again. Send one message and wait. Do not search in that turn. These questions are how they steer the look, so always ask them, however the run was set up. Only they can say "go".
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Before I look, three questions. Skip any with "go" and I'll decide.
|
|
42
|
+
|
|
43
|
+
1. How should <product> feel, and never feel? Any apps, sites, brands, books or places you love for this?
|
|
44
|
+
2. Pictures or links you already like? Screenshots, links or files.
|
|
45
|
+
3. Where should I look, and how many should I bring back? [x] <source> — <what it gives> … [ ] your own. Default 12.
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Default sources:
|
|
49
|
+
|
|
50
|
+
- **App:** popular Dribbble. No award galleries.
|
|
51
|
+
- **Site:** Awwwards, siteinspire, Recent. Dribbble for screens. Dark Mode Design only when the feel is dark.
|
|
52
|
+
- **Imagery** (Wikimedia Commons): only when the brief's key screens need pictures.
|
|
53
|
+
|
|
54
|
+
Each of these was checked to work with this skill's scripts, without a login (2026-11-03). Do not add a source that has not been.
|
|
55
|
+
|
|
56
|
+
Anything skipped is yours to decide: say what you chose in one line, then search. A Figma link pasted before the search means the look already exists: say so, and offer `design` instead. If their answers contradict the brief, that is `grilling`, not a second round.
|
|
57
|
+
|
|
58
|
+
A picture they gave is a **seed**: a card with `link: none (shared in chat)` or its URL, never dropped. Seeds steer the queries ("more like this").
|
|
59
|
+
|
|
60
|
+
### 2. Search small
|
|
61
|
+
|
|
62
|
+
Read [sources.md](references/sources.md) before keeping anything. Do not narrate while looking. One line at the end is enough ("Found 8, building the moodboard.").
|
|
63
|
+
|
|
64
|
+
- **The keep is the number they chose** (default 12). The moodboard is their only say on the look, so give them enough to react to. Before calling a field thin, search at least three more forms, and the objects in the brief's identity nouns: the product's world often beats its category. Still thin: say what was missing rather than lowering the filter.
|
|
65
|
+
- **Query the form, not the word.** "writing app" returns T-shirts. `product-design?q=text+editor+screen` returns screens.
|
|
66
|
+
- **Thumbnails are the first cut.** Use `scripts/contact-sheet.mjs` in scratch, then open the shortlist at full size. Nothing is kept from a thumbnail.
|
|
67
|
+
- **Capture only a keep:** `node <skill>/scripts/capture.mjs <url> --out design-exploration/<slug>/refs/<name>.jpg`.
|
|
68
|
+
- **App:** a Dribbble concept has never faced real content. Keep it only if its idea survives the brief's longest names and its empty state.
|
|
69
|
+
- **Site:** live sites outweigh Dribbble shots.
|
|
70
|
+
|
|
71
|
+
### 3. Write `board.md`
|
|
72
|
+
|
|
73
|
+
A few header lines, then one card per keep.
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
Asked: <feel, never feel, loves, or none>
|
|
77
|
+
Sources: <what was searched, and any skip: "Awwwards: no fit">
|
|
78
|
+
Missing: <what the search could not find, or none>
|
|
79
|
+
|
|
80
|
+
### <name>
|
|
81
|
+
- link: <the page a person can open, or "none (shared in chat)">
|
|
82
|
+
- shot: design-exploration/<slug>/refs/<file>
|
|
83
|
+
- pattern: <the idea worth taking, about six words: a layout, an arrangement, a way of showing data, a voice>
|
|
84
|
+
- why: <why it fits this brief, one line>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`pattern` is the moodboard caption, so write it as a pattern ("one column, the date as the spine"), never as their brand ("Linear's purple").
|
|
88
|
+
|
|
89
|
+
### 4. Pick on the moodboard
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
node <skill>/scripts/moodboard.mjs design-exploration/<slug>/board.md --out design-exploration/<slug>/moodboard.html
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Look at it yourself first (`capture.mjs "file://$PWD/design-exploration/<slug>/moodboard.html" --out <scratch>/moodboard.jpg`). Fix a wrong caption or a missing picture on the board and run it again. Then say where it is and that every tile links to its source, and ask one line:
|
|
96
|
+
|
|
97
|
+
> Which one leads, which do you also like, which feel wrong, and why?
|
|
98
|
+
|
|
99
|
+
If they say "you choose", take the closest to the brief and say which.
|
|
100
|
+
|
|
101
|
+
### 5. Write `direction.md`
|
|
102
|
+
|
|
103
|
+
From their answer. Short: it is read by `design`, not by a client.
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
# Direction: <product>
|
|
107
|
+
|
|
108
|
+
Proposal, not official. design turns this into screens. Only an approved prototype becomes DESIGN.md.
|
|
109
|
+
|
|
110
|
+
- idea: <the one thing this product's look says, in one sentence>
|
|
111
|
+
- feel: <their words for feel and never feel>
|
|
112
|
+
- patterns: <what we take, each from which reference: a layout, an arrangement, a kind of picture, a way of moving>
|
|
113
|
+
- ownable: <one concrete element made from the brief's identity nouns, so this is not the lead. For a lighthouse logbook: a lamp-glow marker on the active item. Unconfirmed until seen rendered>
|
|
114
|
+
- voice: <how it talks: three adjectives and one sample line in that voice>
|
|
115
|
+
- leave: <what we do not take: their names, their colours and typefaces, and whatever they said feels wrong>
|
|
116
|
+
|
|
117
|
+
## References
|
|
118
|
+
- leads: <card> — <link>
|
|
119
|
+
- also: <cards> — <links>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
- **The lead is the closest**, not the boldest: the subject's world is in the shot. It leads the feeling. It is not the brand.
|
|
123
|
+
- **No values.** No hex, no font name, no size. If a reference's colour or type is the point, describe the quality ("near-black ink on a warm page", "a condensed display face") and let `design` choose the value.
|
|
124
|
+
|
|
125
|
+
Then say the direction in chat in four lines (idea, patterns, ownable, leave), and end with one question. Wait for the answer, however the run was set up: the direction is theirs to correct before anything is built on it.
|
|
126
|
+
|
|
127
|
+
> Change anything, or take this into design?
|
|
128
|
+
|
|
129
|
+
Yes → load `design`. No → stop. The folder stays on this machine.
|
|
130
|
+
|
|
131
|
+
## One piece
|
|
132
|
+
|
|
133
|
+
Usually called from `design` when a key screen has a gap no reference covers. Same card shape, same moodboard, its own slug.
|
|
134
|
+
|
|
135
|
+
1. Read `DESIGN.md` if it exists, and the brief. They are the base: the piece fits the colour, type and voice already chosen and never changes them.
|
|
136
|
+
2. Ask once, then wait, unless the caller already said what is needed:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
Any style or requirements for this? Optional.
|
|
140
|
+
|
|
141
|
+
A few ways to search:
|
|
142
|
+
- <a form you can type into a gallery: "a bar that fills once">
|
|
143
|
+
- <…>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
3. Keep up to the number asked (default 8 for one piece), from at least 30 looked at. Include the same piece in other subjects. For a gap software has not solved, search outside software for the same form.
|
|
147
|
+
4. Write `design-exploration/<slug>/board.md`, run the moodboard, and ask which they would take.
|
|
148
|
+
5. Write a short `direction.md` for the piece: `patterns`, `leave`, and the references. Hand back to `design`.
|
|
149
|
+
|
|
150
|
+
## Do not
|
|
151
|
+
|
|
152
|
+
- Pick colour, type, spacing, or any value. Write `DESIGN.md`. Code or lay out a page.
|
|
153
|
+
- Search before the three questions are answered, answer them yourself, or ask a second round.
|
|
154
|
+
- Pad the keep by lowering the filter, or keep a shot you only saw as a thumbnail.
|
|
155
|
+
- Screenshot a listing, a search grid, or a candidate you are not keeping. Never stitch screenshots.
|
|
156
|
+
- Name a reference in `direction.md`'s idea, patterns or ownable as the thing to copy. Name the pattern.
|
|
157
|
+
- Put notes or skill feedback under `design-exploration/`. Use the chat.
|
|
@@ -5,11 +5,9 @@ A nominee is not a reference. Open it full size and drop anything weak before it
|
|
|
5
5
|
## Galleries
|
|
6
6
|
|
|
7
7
|
- **Awwwards.** Open the site page, not the listing card. Keep Site of the Day, Month, or Year, or an Honorable Mention with overall and Design ≥ 7.5. Drop any 4s, and any gate or password wall.
|
|
8
|
-
- **
|
|
8
|
+
- **siteinspire, Recent** (recent.design/websites). These are curated, not scored. Keep a live page with one clear idea: a crop, a component, or an arrangement. Drop generic SaaS (centred headline, three icon cards, soft gradient, Inter). On Recent, open the source URL on the item.
|
|
9
9
|
- **Dark Mode Design.** Only when the look is dark.
|
|
10
10
|
- **Muzli.** Only a way to reach the original, which then has to pass its own test.
|
|
11
|
-
- **Pinterest.** Keep a pin that is one real screen or page. Drop boards, collages, and AI mush. If you hit a login wall, write `Pinterest: login wall` under `Sources:` and move on.
|
|
12
|
-
- **Mobbin, Refero.** Shipped screens, often behind a login. Handle a login wall the same way.
|
|
13
11
|
|
|
14
12
|
## Dribbble
|
|
15
13
|
|
|
@@ -23,6 +21,8 @@ It prints `id-slug`, likes, views, image URL, and title. It drops merch, CVs, wo
|
|
|
23
21
|
|
|
24
22
|
- Use a category path and the form, not the word: `/product-design?q=…`, `/mobile?q=…`, `/web-design?q=…`.
|
|
25
23
|
- If most of what gets through is off-form, the query is wrong. Fix the query rather than scrolling further.
|
|
24
|
+
- A product's category can be swamped by stores. Query the thing people do with it, and `--drop` what the brief rules out.
|
|
25
|
+
- A thin query ignores `timeframe=year`: the shot ids show it. An old shot is fine when its idea still holds.
|
|
26
26
|
- Run one query at a time. If a query returns 0 cards, retry after 8 s, then 30 s. If it is still 0, note it under `Sources:` as a possible rate limit.
|
|
27
27
|
- Keep a shot when you can name what is worth taking in one line, and people actually saved it. Drop AI mush, fake browser chrome, purple-on-dark gradients, Inter everywhere, and emoji icons.
|
|
28
28
|
- A Dribbble illustration is imagery, never a site.
|
|
@@ -32,7 +32,7 @@ It prints `id-slug`, likes, views, image URL, and title. It drops merch, CVs, wo
|
|
|
32
32
|
To crop a picture you already have (a screen inside a marketing frame, a type specimen):
|
|
33
33
|
|
|
34
34
|
```
|
|
35
|
-
node <skill>/scripts/capture.mjs "file://<abs path to image>" --out
|
|
35
|
+
node <skill>/scripts/capture.mjs "file://<abs path to image>" --out design-exploration/<slug>/refs/<name>.jpg --clip x,y,w,h
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
`--clip` is in the image's own pixels.
|
|
@@ -41,12 +41,11 @@ node <skill>/scripts/capture.mjs "file://<abs path to image>" --out .design/refs
|
|
|
41
41
|
|
|
42
42
|
Search the subject, not a stock category. One real place or material beats a pile of similar ones. Zero imagery is a complete answer.
|
|
43
43
|
|
|
44
|
-
- **
|
|
45
|
-
- **Wikimedia Commons.** Query the API with `-A "<project>-hunt/0.1"`, `prop=imageinfo&iiprop=url&iiurlwidth=1920`. Save `thumburl`. `descriptionurl` is the `url`.
|
|
44
|
+
- **Wikimedia Commons.** Query the API with `-A "<project>-hunt/0.1"`, `prop=imageinfo&iiprop=url&iiurlwidth=1920`. Save `thumburl`. `descriptionurl` is the `link`.
|
|
46
45
|
|
|
47
46
|
## Contact sheets
|
|
48
47
|
|
|
49
|
-
Viewing listing thumbnails is fine. It is not a capture. Build labelled grids in scratch, never under
|
|
48
|
+
Viewing listing thumbnails is fine. It is not a capture. Build labelled grids in scratch, never under `design-exploration/`:
|
|
50
49
|
|
|
51
50
|
```
|
|
52
51
|
node <skill>/scripts/contact-sheet.mjs candidates.tsv --out <scratch>/sheets # TSV: label<TAB>imageURL
|
|
@@ -57,7 +56,7 @@ node <skill>/scripts/contact-sheet.mjs candidates.tsv --out <scratch>/sheets #
|
|
|
57
56
|
Only for a keep, run from the project root:
|
|
58
57
|
|
|
59
58
|
```
|
|
60
|
-
node <skill>/scripts/capture.mjs <url> --out
|
|
59
|
+
node <skill>/scripts/capture.mjs <url> --out design-exploration/<slug>/refs/<name>.jpg
|
|
61
60
|
```
|
|
62
61
|
|
|
63
62
|
The script dismisses cookie banners, scrolls so reveals load, unsticks fixed headers, and takes one full-page JPEG. Node 22+ and an installed Chrome are required (set `CHROME_PATH` if Chrome is somewhere unusual). Options:
|
|
@@ -66,9 +65,3 @@ The script dismisses cookie banners, scrolls so reveals load, unsticks fixed hea
|
|
|
66
65
|
- `--clip-selector "main"` or `--clip x,y,w,h` crops to a type specimen.
|
|
67
66
|
|
|
68
67
|
Open the file. Delete it and run again if it repeats a band, still shows a cookie dialog, or is mostly empty. If a page will not scroll (WebGL, a locked canvas), keep one viewport and say so on the card. Never stitch screenshots.
|
|
69
|
-
|
|
70
|
-
## Colour and type
|
|
71
|
-
|
|
72
|
-
- **Colour.** Sample hexes from a crop of the element named (body text, active tab), never from a photo, a mockup frame, or a presentation background. Card hexes are what we saw, not the brand.
|
|
73
|
-
- **Contrast.** Check pairs with `node <skill>/scripts/contrast.mjs "#2c2824 on #f6f1e7" "#b0563a on #f6f1e7:mark"`. `:large` and `:mark` check 3:1. A failing pair is written as `sampled → used`.
|
|
74
|
-
- **Type.** A face's licence has to cover how this ships: bundled in an app, self-hosted web, or default UI. Set it at real sizes before you pick it. Check that the italic reads at quote size and that its figures suit where numbers sit.
|