@jonandev/longbeard 0.9.0 → 0.11.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.
@@ -1,12 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  // A moodboard of the references: every card with a shot, its name, its
3
- // tagline, and a link to its source. The layout is this file. It shows what
3
+ // pattern, and a link to its source. The layout is this file. It shows what
4
4
  // we saw. It does not paint a brand, a logo, a line, or a stat.
5
5
  //
6
- // node moodboard.mjs .design/board.md --out .design/moodboard.html
7
- // node moodboard.mjs .design/hunts/pricing/board.md --out .design/hunts/pricing/moodboard.html
8
- //
9
- // A card with `slot: product` stays off: a product page cropped into a tile is noise.
6
+ // node moodboard.mjs design-exploration/identity/board.md --out design-exploration/identity/moodboard.html
7
+ // node moodboard.mjs design-exploration/pricing/board.md --out design-exploration/pricing/moodboard.html
10
8
  import { execSync } from "node:child_process";
11
9
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
12
10
  import { dirname, isAbsolute, relative, resolve } from "node:path";
@@ -16,7 +14,7 @@ const outAt = args.indexOf("--out");
16
14
  const outArg = outAt === -1 ? "" : (args.splice(outAt, 2)[1] ?? "");
17
15
  const boardArg = args[0];
18
16
  if (!boardArg || !outArg || args.length !== 1) {
19
- console.error("usage: node moodboard.mjs .design/board.md --out .design/moodboard.html");
17
+ console.error("usage: node moodboard.mjs design-exploration/<slug>/board.md --out design-exploration/<slug>/moodboard.html");
20
18
  process.exit(2);
21
19
  }
22
20
 
@@ -65,7 +63,7 @@ const cards = md
65
63
 
66
64
  const tiles = [];
67
65
  for (const card of cards) {
68
- if (!card.shot || /product/i.test(card.slot || "")) continue;
66
+ if (!card.shot) continue;
69
67
  const abs = resolvePath(card.shot.trim());
70
68
  if (!existsSync(abs)) {
71
69
  console.error(`moodboard: missing shot ${card.shot.trim()}`);
@@ -74,12 +72,12 @@ for (const card of cards) {
74
72
  let src = relative(dirname(outPath), abs).split("\\").join("/");
75
73
  if (!src.startsWith(".")) src = `./${src}`;
76
74
  // A seed shared in chat has no URL, so its tile has no link.
77
- const url = (card.url || "").trim().split(/\s+/)[0];
75
+ const url = (card.link || "").trim().split(/\s+/)[0];
78
76
  const img = `<img src="${esc(src)}" alt="${esc(card.name)}" loading="lazy">`;
79
77
  const frame = /^https?:\/\//i.test(url)
80
78
  ? `<a class="frame" href="${esc(url)}" target="_blank" rel="noopener noreferrer">${img}</a>`
81
79
  : `<div class="frame">${img}</div>`;
82
- const line = card.tagline ? `<p class="line">${esc(card.tagline)}</p>` : "";
80
+ const line = card.pattern ? `<p class="line">${esc(card.pattern)}</p>` : "";
83
81
  tiles.push(`<figure class="tile">${frame}<figcaption><p class="name">${esc(card.name)}</p>${line}</figcaption></figure>`);
84
82
  }
85
83
 
@@ -0,0 +1,254 @@
1
+ #!/usr/bin/env node
2
+ // A picker: a wide pool of candidates from any source, as one page where the
3
+ // person marks each like or no. It hotlinks each listing's own thumbnail and
4
+ // saves nothing, so it is a view, not a capture. Their picks come back as
5
+ // text they copy into the chat.
6
+ //
7
+ // The TSV has one row per candidate: title, image, link, source, meta (a
8
+ // short line such as the designer and likes). Columns after the image may be
9
+ // empty. A line starting with # is a comment. Each
10
+ // row's id is the round letter and its row number (a1, a2…, b1… in round 2),
11
+ // so a pick maps to its line in the TSV. A row with source "seed" starts
12
+ // liked; its image may be a path in the project instead of a URL.
13
+ //
14
+ // node picker.mjs design-exploration/identity/candidates.tsv --out design-exploration/identity/picker.html
15
+ // node picker.mjs design-exploration/identity/candidates-2.tsv --round 2 --out design-exploration/identity/picker-2.html
16
+ import { execSync } from "node:child_process";
17
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
18
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
19
+
20
+ const args = process.argv.slice(2);
21
+ const flag = (name) => {
22
+ const i = args.indexOf(`--${name}`);
23
+ return i === -1 ? "" : (args.splice(i, 2)[1] ?? "");
24
+ };
25
+ const outArg = flag("out");
26
+ const roundArg = flag("round") || "1";
27
+ const round = Number(roundArg);
28
+ const tsvArg = args[0];
29
+ if (!tsvArg || !outArg || args.length !== 1 || !Number.isInteger(round) || round < 1 || round > 26) {
30
+ console.error(
31
+ "usage: node picker.mjs design-exploration/<slug>/candidates.tsv --out design-exploration/<slug>/picker.html [--round 2]",
32
+ );
33
+ process.exit(2);
34
+ }
35
+ const letter = String.fromCharCode(96 + round);
36
+
37
+ function projectRoot() {
38
+ try {
39
+ return execSync("git rev-parse --show-toplevel", { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
40
+ } catch {
41
+ return process.cwd();
42
+ }
43
+ }
44
+
45
+ const root = projectRoot();
46
+ const resolvePath = (path) => (isAbsolute(path) ? path : resolve(root, path));
47
+ const tsvPath = resolvePath(tsvArg);
48
+ const outPath = resolvePath(outArg);
49
+ if (!existsSync(tsvPath)) {
50
+ console.error(`picker: no candidates at ${tsvArg}`);
51
+ process.exit(1);
52
+ }
53
+
54
+ // Every field is scraped text from someone else's page.
55
+ const esc = (s) =>
56
+ String(s ?? "")
57
+ .replace(/&/g, "&amp;")
58
+ .replace(/</g, "&lt;")
59
+ .replace(/>/g, "&gt;")
60
+ .replace(/"/g, "&quot;")
61
+ .replace(/'/g, "&#39;");
62
+ const isUrl = (s) => /^https?:\/\//i.test(s);
63
+
64
+ const rows = readFileSync(tsvPath, "utf8")
65
+ .split(/\r?\n/)
66
+ .filter((l) => l.trim() && !l.trimStart().startsWith("#"));
67
+
68
+ const tiles = [];
69
+ const seenImages = new Set();
70
+ rows.forEach((line, i) => {
71
+ const id = `${letter}${i + 1}`;
72
+ const [title = "", image = "", link = "", source = "", meta = ""] = line.split("\t").map((c) => c.trim());
73
+ let src = image;
74
+ if (!isUrl(image)) {
75
+ const abs = image ? resolvePath(image) : "";
76
+ if (!abs || !existsSync(abs)) {
77
+ console.error(`picker: ${id} has no image (${image || "empty"}), skipped`);
78
+ return;
79
+ }
80
+ src = relative(dirname(outPath), abs).split("\\").join("/");
81
+ if (!src.startsWith(".")) src = `./${src}`;
82
+ }
83
+ if (seenImages.has(src)) {
84
+ console.error(`picker: ${id} repeats an earlier image, skipped`);
85
+ return;
86
+ }
87
+ seenImages.add(src);
88
+ const name = title || id;
89
+ const seed = source.toLowerCase() === "seed";
90
+ const caption =
91
+ (isUrl(link)
92
+ ? `<a class="name" href="${esc(link)}" title="${esc(name)}" target="_blank" rel="noopener noreferrer">${esc(name)}</a>`
93
+ : `<span class="name" title="${esc(name)}">${esc(name)}</span>`) +
94
+ (meta ? `<span class="meta">${esc(meta)}</span>` : "");
95
+ tiles.push(`<figure class="tile" data-id="${esc(id)}" data-title="${esc(name)}"${seed ? ' data-seed="1"' : ""}>
96
+ <button type="button" class="frame" aria-pressed="false" aria-label="${esc(`${id} ${name}: mark like, no, or clear`)}">
97
+ <img src="${esc(src)}" alt="" loading="lazy" referrerpolicy="no-referrer">
98
+ <span class="id">${esc(id)}</span>${source ? `<span class="src">${esc(source)}</span>` : ""}
99
+ <span class="mark"></span>
100
+ </button>
101
+ <figcaption>${caption}</figcaption>
102
+ </figure>`);
103
+ });
104
+
105
+ if (!tiles.length) {
106
+ console.error("picker: no row has an image");
107
+ process.exit(1);
108
+ }
109
+
110
+ const html = `<!DOCTYPE html>
111
+ <html lang="en">
112
+ <head>
113
+ <meta charset="utf-8">
114
+ <meta name="viewport" content="width=device-width, initial-scale=1">
115
+ <title>Pick, round ${round}</title>
116
+ <style>
117
+ :root { --canvas: #e4e4e2; --paper: #ffffff; --ink: #1c1c1a; --muted: #6f6f6a; --like: #1f7a3a; --no: #b3261e; }
118
+ * { box-sizing: border-box; }
119
+ html { color-scheme: light; }
120
+ body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
121
+ main { max-width: 1400px; margin: 0 auto; padding: 40px 24px 300px; }
122
+ h1 { margin: 0 0 6px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
123
+ .how { margin: 0 0 20px 2px; font-size: 14px; color: var(--muted); }
124
+ .filters { margin: 0 0 18px 2px; display: flex; gap: 8px; }
125
+ .filters button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid #c8c8c4; background: var(--paper); color: var(--ink); cursor: pointer; }
126
+ .filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
127
+ .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
128
+ .tile { margin: 0; display: flex; flex-direction: column; background: var(--paper); border-radius: 16px; overflow: hidden; outline: 3px solid transparent; outline-offset: -3px; }
129
+ .tile[data-state="like"] { outline-color: var(--like); }
130
+ .tile[data-state="no"] .frame img { opacity: 0.3; filter: grayscale(1); }
131
+ .tile[hidden] { display: none; }
132
+ .frame { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; overflow: hidden; background: #141414; cursor: pointer; }
133
+ .frame:focus-visible { outline: 3px solid #2f6fdb; outline-offset: -3px; }
134
+ .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
135
+ .id, .src, .mark { position: absolute; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px; background: rgba(0,0,0,0.65); color: #fff; }
136
+ .id { top: 8px; left: 8px; }
137
+ .src { top: 8px; right: 8px; font-weight: 500; }
138
+ .mark { bottom: 8px; left: 8px; display: none; font-size: 12px; }
139
+ .tile[data-state="like"] .mark { display: block; background: var(--like); }
140
+ .tile[data-state="like"] .mark::after { content: "Like"; }
141
+ .tile[data-state="no"] .mark { display: block; background: var(--no); }
142
+ .tile[data-state="no"] .mark::after { content: "No"; }
143
+ figcaption { padding: 10px 12px 12px; font-size: 13px; line-height: 1.35; }
144
+ /* A scraped title can carry a whole tag list: two lines, the rest on hover. */
145
+ .name { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
146
+ .meta { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
147
+ a.name:hover { text-decoration: underline; }
148
+ .bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid #c8c8c4; box-shadow: 0 -6px 24px rgba(0,0,0,0.08); }
149
+ .bar-in { max-width: 1400px; margin: 0 auto; padding: 14px 24px 16px; display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 14px; align-items: start; }
150
+ .bar label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
151
+ .bar textarea { width: 100%; font: 13px/1.4 ui-monospace, Menlo, monospace; padding: 8px 10px; border: 1px solid #c8c8c4; border-radius: 8px; resize: vertical; }
152
+ #note { height: 96px; font-family: inherit; font-size: 14px; }
153
+ #out { height: 96px; background: #f6f6f4; }
154
+ .side { display: flex; flex-direction: column; gap: 8px; padding-top: 22px; min-width: 150px; }
155
+ #count { font-size: 13px; color: var(--muted); }
156
+ #copy { font: inherit; font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 10px; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
157
+ @media (max-width: 800px) { .bar-in { grid-template-columns: 1fr; } .side { padding-top: 0; } main { padding-bottom: 480px; } }
158
+ </style>
159
+ </head>
160
+ <body>
161
+ <main>
162
+ <h1>Pick, round ${round}</h1>
163
+ <p class="how">Click a picture: once for like, twice for no, three times to clear. Leave anything you have no view on. The name opens the source.</p>
164
+ <div class="filters" role="group" aria-label="Show">
165
+ <button type="button" data-show="all" aria-pressed="true">All</button>
166
+ <button type="button" data-show="open" aria-pressed="false">Not marked</button>
167
+ <button type="button" data-show="like" aria-pressed="false">Likes</button>
168
+ <button type="button" data-show="no" aria-pressed="false">Noes</button>
169
+ </div>
170
+ <div class="grid">
171
+ ${tiles.join("\n ")}
172
+ </div>
173
+ </main>
174
+ <div class="bar">
175
+ <div class="bar-in">
176
+ <div><label for="note">Why, in your words (optional)</label><textarea id="note" placeholder="What the likes share, what put you off the noes"></textarea></div>
177
+ <div><label for="out">Copy this into the chat</label><textarea id="out" readonly></textarea></div>
178
+ <div class="side"><span id="count"></span><button type="button" id="copy">Copy picks</button></div>
179
+ </div>
180
+ </div>
181
+ <script>
182
+ (() => {
183
+ const key = "longbeard-picker:" + location.pathname + ":${letter}";
184
+ const tiles = [...document.querySelectorAll(".tile")];
185
+ const note = document.getElementById("note");
186
+ const out = document.getElementById("out");
187
+ const count = document.getElementById("count");
188
+ let saved = {};
189
+ try { saved = JSON.parse(localStorage.getItem(key) || "{}"); } catch (e) { saved = {}; }
190
+ const states = saved.states || {};
191
+ note.value = saved.note || "";
192
+ // A mark is saved with its title, so a row dropped and the page rebuilt
193
+ // never moves a mark onto another picture. A cleared seed stays cleared.
194
+ const tag = (t) => t.dataset.id + "|" + t.dataset.title;
195
+ for (const t of tiles) {
196
+ const s = tag(t) in states ? states[tag(t)] : t.dataset.seed ? "like" : "";
197
+ if (s) t.dataset.state = s;
198
+ }
199
+ let show = "all";
200
+ const short = (s) => (s.length > 48 ? s.slice(0, 47) + "…" : s);
201
+ const list = (state) => tiles.filter((t) => t.dataset.state === state).map((t) => t.dataset.id + " " + short(t.dataset.title));
202
+ function render() {
203
+ const like = list("like");
204
+ const no = list("no");
205
+ const lines = ["Picks, round ${round} (${letter})", "like: " + (like.join("; ") || "none"), "no: " + (no.join("; ") || "none")];
206
+ if (note.value.trim()) lines.push("note: " + note.value.trim().replace(/\\s+/g, " "));
207
+ out.value = lines.join("\\n");
208
+ count.textContent = like.length + " like · " + no.length + " no · " + tiles.length + " shown";
209
+ for (const t of tiles) {
210
+ const s = t.dataset.state || "";
211
+ t.querySelector(".frame").setAttribute("aria-pressed", s ? "true" : "false");
212
+ t.hidden = !(show === "all" || (show === "open" ? !s : s === show));
213
+ }
214
+ const keep = {};
215
+ for (const t of tiles) if (t.dataset.state || t.dataset.seed) keep[tag(t)] = t.dataset.state || "";
216
+ try { localStorage.setItem(key, JSON.stringify({ states: keep, note: note.value })); } catch (e) {}
217
+ }
218
+ const next = { "": "like", like: "no", no: "" };
219
+ for (const t of tiles) {
220
+ t.querySelector(".frame").addEventListener("click", () => {
221
+ const s = next[t.dataset.state || ""];
222
+ if (s) t.dataset.state = s; else delete t.dataset.state;
223
+ render();
224
+ });
225
+ }
226
+ for (const b of document.querySelectorAll(".filters button")) {
227
+ b.addEventListener("click", () => {
228
+ show = b.dataset.show;
229
+ for (const o of document.querySelectorAll(".filters button")) o.setAttribute("aria-pressed", o === b ? "true" : "false");
230
+ render();
231
+ });
232
+ }
233
+ note.addEventListener("input", render);
234
+ // The text box is the real path: the clipboard API can be refused on a file:// page.
235
+ document.getElementById("copy").addEventListener("click", async (e) => {
236
+ out.focus();
237
+ out.select();
238
+ let ok = false;
239
+ try { await navigator.clipboard.writeText(out.value); ok = true; } catch (err) {}
240
+ if (!ok) { try { ok = document.execCommand("copy"); } catch (err) {} }
241
+ e.target.textContent = ok ? "Copied" : "Selected, press Cmd/Ctrl+C";
242
+ setTimeout(() => { e.target.textContent = "Copy picks"; }, 1800);
243
+ });
244
+ render();
245
+ })();
246
+ </script>
247
+ </body>
248
+ </html>
249
+ `;
250
+
251
+ mkdirSync(dirname(outPath), { recursive: true });
252
+ writeFileSync(outPath, html);
253
+ console.error(`picker: ${tiles.length} of ${rows.length} rows, ids ${letter}1–${letter}${rows.length}`);
254
+ console.log(outArg);
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: idea
3
+ description: >
4
+ Turn an idea, or an existing repo, into docs/brief.md: one page that says
5
+ what the product is, for whom, its core flows and key screens, and whether
6
+ it has a UI. Grills in rounds until every section is settled, then writes
7
+ the brief and offers the next stage. Runs first in a new project, when a
8
+ repo has no brief, or when the product itself changes. A feature for a
9
+ product that has a brief goes to to-spec, not here.
10
+ ---
11
+
12
+ # Idea
13
+
14
+ One file comes out: `docs/brief.md`, about 500 words, one page. Every later stage reads it: `design-direction` for the people, surface and identity nouns, `design` for the key screens, `to-spec` for the flows. No stage asks for these again, so the brief has to settle them.
15
+
16
+ The brief says what and for whom, never how. No framework, database, host or library. Those are Architecture's.
17
+
18
+ ## Gate
19
+
20
+ Look at the repo. Do not ask what is there.
21
+
22
+ 1. `docs/brief.md` exists and they bring a feature → not this skill. Grill the feature: they type `/grill-with-docs` when it brings new terms, otherwise load `grilling`. Then they type `/to-spec`. The brief stays as it is.
23
+ 2. `docs/brief.md` exists and the product itself changes (new people, new surface, a flow dropped) → **Change**.
24
+ 3. No brief, and the repo has code or a README → **Existing project**.
25
+ 4. Otherwise → **New idea**.
26
+
27
+ ## New idea
28
+
29
+ Load Matt's `grilling` and run it. The design tree is the brief's sections below. Start with the frontier: a working name, problem, who it is for, surface. Flows, screens and scope hang off those. A working name is enough; it can change.
30
+
31
+ - One round per message, numbered, a recommended answer on each, as `grilling` says.
32
+ - Recommend from the idea itself. A one-line idea still has a likely person and a likely first flow: propose them, they correct.
33
+ - A section they do not care about gets your recommendation and a "yes" settles it. Never leave one blank.
34
+ - Stop asking when every section has an answer. Then say the brief in chat in six lines (problem, for, flows, surface, v1, out) and ask "Write `docs/brief.md`?" Write on yes.
35
+
36
+ ## Existing project
37
+
38
+ Read the README, the package manifest, the routes or entry points, any `docs/`, and any file at the root that describes the product. Draft every section you can from what is there and mark each one **from the repo** or **gap**. A section the code shows but a document contradicts is a gap. Stack and architecture stay out, wherever they are written.
39
+
40
+ Show the draft, then grill only the gaps, in rounds. Same confirm, same write.
41
+
42
+ Another document may now cover the same ground as the brief. Two descriptions of the product drift apart, so after writing, recommend what happens to it (trim it, or keep it for detail with a line pointing to the brief) and change it only on their yes.
43
+
44
+ ## Change
45
+
46
+ Read the brief. Grill only what changes and what hangs off it: a new surface reopens key screens, a new person reopens flows. Update those sections, add a line under **Changes** with the date and why, and leave the rest word for word.
47
+
48
+ ## The brief
49
+
50
+ ```markdown
51
+ # <Product name>
52
+
53
+ <One sentence: what it is and for whom.>
54
+
55
+ ## Problem
56
+ <What is hard or missing today, for whom, in two or three sentences. The cost of leaving it.>
57
+
58
+ ## For
59
+ <The one person it is built for first: who, their situation, what they do today instead. Others later, in one line.>
60
+
61
+ ## Flows
62
+ 1. <Verb phrase, start to end: "log a catch from the boat in under a minute">
63
+ <3–5 flows. Each is one thing someone comes to do, and how they know it worked.>
64
+
65
+ ## Key screens
66
+ - <Screen>: <what is on it, which flow it serves>
67
+ <2–4. The screens design prototypes first. No UI: "none".>
68
+
69
+ ## Surface
70
+ <site | app | no UI (CLI, API, library)>. <One line why. A site is the page a person lands on to understand or choose; an app is the tool they come back to.>
71
+
72
+ ## V1 and later
73
+ - v1: <what ships first, as flows from above>
74
+ - later: <what waits>
75
+
76
+ ## Constraints
77
+ - <What is fixed: devices, offline, languages, accessibility needs, a deadline, a budget. Not tech choices.>
78
+
79
+ ## Identity nouns
80
+ <4–8 concrete nouns from the product's world: the things, places, tools and materials its people know. "Tide, buoy, logbook, brass", not "trust, speed, simple".>
81
+
82
+ ## Out of scope
83
+ - <What it will not do, so later stages do not drift into it.>
84
+ ```
85
+
86
+ - Every section has content. "None" is an answer. A guess is not.
87
+ - **Changes** is added under Out of scope by the first Change, never before.
88
+ - Content is real: the longest names the people will type, the likely numbers, the real empty case. `design` uses them as copy.
89
+ - Over a page means a flow is really two products, or a section is doing Architecture's job. Cut it.
90
+
91
+ ## After writing
92
+
93
+ Offer the next stage in one line. A stage whose file already exists is done, so go past it:
94
+
95
+ - Site or app, no `DESIGN.md` → `design-direction`.
96
+ - No UI, or `DESIGN.md` exists → stages 2 and 3 are skipped. Next is Architecture: they type `/grill-with-docs`.
97
+ - `GLOSSARY.md` exists too → next is Plan: they type `/to-spec` for the first flow or feature.
98
+
99
+ Do not start it until they say so.
100
+
101
+ ## Do not
102
+
103
+ - Pick a stack, or write a requirement as one ("uses Postgres").
104
+ - Ask a question the repo or the idea already answers.
105
+ - Write the brief before they confirm the six-line summary.
106
+ - Edit the brief for a feature. Features get specs.
@@ -1,100 +0,0 @@
1
- ---
2
- name: design-md
3
- description: >
4
- Use when building or changing UI and the project has a DESIGN.md, or when
5
- they confirmed writing or updating the brand file. Follow that file. Write
6
- or update DESIGN.md only from what they confirmed: the adaptation after a
7
- hunt, or decisions they approved on a rendered prototype (with the reason,
8
- the date, and a contrast check). DESIGN.md names ideas, never sources or
9
- .design paths. Do not copy a reference’s exact palette or faces. Do not
10
- invent a look they did not accept. If they asked to design or define
11
- direction and there is no DESIGN.md and no Figma, that is
12
- design-reference-hunt first.
13
- ---
14
-
15
- # DESIGN.md
16
-
17
- The project's `DESIGN.md` is the durable look. Coding follows it when it exists.
18
-
19
- ## Follow
20
-
21
- If the file exists, read it before writing UI. Use its colour, type, spacing, control, behaviour, and components the way that file states them.
22
-
23
- They asked to **hunt**, **define direction**, or find references → load `design-reference-hunt`. Do not rewrite this file until they confirm after that pass.
24
-
25
- ## Write or update (only on confirm)
26
-
27
- Write or change `DESIGN.md` only when they said yes to persisting the adaptation (after a whole-look leading pick, or after accepting a later hunt), or approved a decision on a rendered prototype (below). Do not invent hexes, faces, or controls. Do not copy the leading card’s `colour` or `type` into the brand. Take the adaptation from:
28
-
29
- - `.design/board.md` **Read this** (`take`, `change`, `ownable`, `colour`, `type`, `control`, `behaviour`, `leave`, `gaps`), or
30
- - `.design/hunts/<slug>/board.md` **Read this** when the change is a later pass they accepted
31
-
32
- `.design/moodboard.html` is the references. Do not read it as the brand: the brand is **Read this**.
33
-
34
- If a whole-look **Read this** has no `take`, `change`, `colour`, or `type`, or has no `ownable`, stop and send it back to the hunt. Do not fill those in here.
35
-
36
- If neither file exists, ask which reference to follow. Do not guess.
37
-
38
- Refuse to write a colour palette whose text/background pairs have not been through contrast check. On a board from `design-reference-hunt`, **Read this** `contrast` lists each adapted pair with ratio and verdict (`scripts/contrast.mjs`). Body and small text need 4.5:1; large text and non-text marks need 3:1. If pairs are missing or any still FAIL, send the board back — do not write failing hexes into `DESIGN.md`.
39
-
40
- **Ideas, not sources.** `DESIGN.md` is usually committed, and often public; `.design/` is not. It never names a product, site, studio, or designer the hunt looked at, never cites a `.design/` path, and its contrast notes name our tokens, not a reference's colour. The board's card names and its `leave` line name sources, which is fine there. Turn each into the idea before it crosses: “a quiet reading page, light and dark”, not the product it came from; “a bright brand accent”, not whose.
41
-
42
- ## Decisions approved on a prototype
43
-
44
- Most of a design is made after the direction, on rendered screens: the controls, the text sizes, the navigation, the states. When they approve one of those decisions on a rendered prototype, it may go into `DESIGN.md` without a hunt. Write what was approved, the reason they gave, and the date, under **Decisions**. Every new or changed colour token — a surface, a pressed state, a selection, a focus ring, a faint control — goes through the hunt skill's `scripts/contrast.mjs` first, with the same thresholds. An `ownable` element marked unconfirmed is confirmed here, once they have seen it rendered, or replaced.
45
-
46
- ## The file
47
-
48
- Expand the adaptation into a short brand file a builder can follow without the shots open:
49
-
50
- ```markdown
51
- # Design
52
-
53
- To see it working: <prototype path, once there is one>. This file wins where they differ.
54
-
55
- ## Direction
56
- - leads: <the idea that leads, in our words>
57
- - also: <other ideas they liked, in our words, or none>
58
- - draws on: <what we learn from them: a layout, a temperature, a kind of picture>
59
- - change: <the twist>
60
- - ownable: <the one concrete element from the project’s own identity; “unconfirmed” until seen rendered>
61
- - leave: <ideas we do not use, in our words: “a bright brand accent”, never a product's name>
62
-
63
- ## Colour
64
- - <adapted hex>: <where it sits — ground, text, accent, control fill only if the shot fills one>
65
-
66
- ## Type
67
- - <adapted pairing, and how it is used>
68
-
69
- ## Control
70
- - <text link | filled shape | absent, and where it sits — from the leading hero>
71
-
72
- ## Layout
73
- - <what we take that still belongs on this topic. Form cards: layout or component only, not their type or colours>
74
-
75
- ## Behaviour
76
- - <how the page moves, pages, fades, or reveals. Omit the section when Read this says none>
77
-
78
- ## Imagery
79
- - <what the pictures are, if any>
80
-
81
- ## Gaps
82
- - <screens with no strong reference, from Read this. A builder treats these as open, not as solved by a borrowed pattern. A prototype closes them>
83
-
84
- ## Decisions
85
- - <date>: <what they approved on the prototype> — <the reason they gave>
86
-
87
- ## Do not
88
- - <the leave line, as ideas>
89
- ```
90
-
91
- A **later hunt** they accepted: update only the sections that pass changes (often Layout, sometimes Control). Keep colour and type unless they explicitly accepted a change to those. Say in chat what you changed.
92
-
93
- A full redo of the whole look they accepted: rewrite the file from the new adaptation.
94
-
95
- ## Missing file
96
-
97
- - They asked to **define direction**, **hunt**, or **design a page** and there is no Figma → `design-reference-hunt` first. This skill waits for confirm.
98
- - They asked only for a **brand file / DESIGN.md** with no board → ask which reference to follow, then write.
99
-
100
- Leave brand catalogs out of the repo. Leave a second visual system out when one already exists.