@jonandev/longbeard 0.10.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.
- package/AGENTS.md +5 -5
- package/CHANGELOG.md +19 -0
- package/README.md +19 -8
- package/beard.json +14 -3
- package/bin/long-beard.js +57 -27
- package/package.json +1 -1
- package/skills/design/SKILL.md +10 -6
- package/skills/design/references/design-md-template.md +1 -0
- package/skills/design/references/design-rules.md +2 -1
- package/skills/design-check/SKILL.md +7 -6
- package/skills/design-check/references/design-rules.md +2 -1
- package/skills/design-direction/SKILL.md +59 -26
- package/skills/design-direction/references/sources.md +22 -3
- package/skills/design-direction/scripts/dribbble-cards.mjs +46 -5
- package/skills/design-direction/scripts/picker.mjs +254 -0
- package/skills/idea/SKILL.md +8 -5
package/AGENTS.md
CHANGED
|
@@ -5,15 +5,15 @@ The project's own code, conventions, and DESIGN.md win. Load only what the task
|
|
|
5
5
|
| Stage | Starts when | Skills | Writes |
|
|
6
6
|
|---|---|---|---|
|
|
7
7
|
| Idea | No docs/brief.md, or the product changes | idea | docs/brief.md |
|
|
8
|
-
| Direction | A brief with UI | design-direction | design-exploration/<slug>/direction.md |
|
|
8
|
+
| Direction | A brief with UI, no DESIGN.md | design-direction | design-exploration/<slug>/direction.md |
|
|
9
9
|
| Design | A direction, no DESIGN.md | design → figma-generate-library → figma-generate-design | DESIGN.md, Ready Figma frames |
|
|
10
|
-
| Architecture | No GLOSSARY.md
|
|
11
|
-
| Plan | A flow or feature
|
|
10
|
+
| Architecture | No GLOSSARY.md | grill-with-docs | GLOSSARY.md, ADRs |
|
|
11
|
+
| Plan | A flow or feature | setup-matt-pocock-skills → to-spec → to-tickets | specs, tickets |
|
|
12
12
|
| Build | Tickets | implement-spec → design-check → pr | one PR per spec |
|
|
13
13
|
|
|
14
|
-
Each stage offers the next; start it on yes. No UI: skip Direction and Design. A feature with a brief: grill-with-docs for new terms, else grilling, then Plan.
|
|
14
|
+
Each stage offers the next; start it on yes. A skill you can't load: they type /<name>. No UI: skip Direction and Design. A feature with a brief: grill-with-docs for new terms, else grilling, then Plan.
|
|
15
15
|
|
|
16
|
-
UI tickets link their Ready Figma frame. UI work follows DESIGN.md and that frame
|
|
16
|
+
UI tickets link their Ready Figma frame. UI work follows DESIGN.md and that frame; a mismatch is a bug.
|
|
17
17
|
|
|
18
18
|
- A hard bug: diagnosing-bugs
|
|
19
19
|
- Test-first, when asked: tdd
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.11.0 — 2026-11-15
|
|
6
|
+
|
|
7
|
+
- `design-direction` calls itself the inspiration step, and its wording and the README's say so plainly.
|
|
8
|
+
- A project that joins with some stages done no longer gets sent back through them. The router starts Direction only when there is no `DESIGN.md`, and `idea` offers the first stage still to do.
|
|
9
|
+
- The router and our skills say to type a command like `/grill-with-docs` when the agent cannot start that skill itself, instead of promising to start it on yes.
|
|
10
|
+
- `idea` reads any file at the root that describes the product, keeps stack and architecture out of the brief, and asks what happens to a document that now covers the same ground.
|
|
11
|
+
- `design` checks and marks a screen Ready when a feature touches it, for projects whose frames were never marked. `design-check` reports a screen with no Ready frame as "not checked".
|
|
12
|
+
- The README says how to catch up a project you already have.
|
|
13
|
+
- Themes are Figma modes on one colour collection, and each screen is built once. `design` builds them that way, and `design-check` flags separate colour sets or a frame per theme, flags unbound colours as hard, and checks each theme. A screen with a copy per theme becomes one frame when a feature touches it.
|
|
14
|
+
- Frame names take a device when the layout differs: `<screen> · <device> — <state>`.
|
|
15
|
+
- Empty, loading and error are required only when a person can reach them. A state nobody can reach is recorded under Decisions in `DESIGN.md`, with the reason.
|
|
16
|
+
- `design-check` finds states by what a frame shows, so state names can be descriptive.
|
|
17
|
+
- When `init` or `update` cannot list a kit from GitHub, it says why: the network error (like `ENOTFOUND`), the HTTP status, a reply that is not JSON, or a kit with no skills. Before, a failed connection said only "Check the network".
|
|
18
|
+
- `design-direction` keeps Dribbble shots people valued, not just new ones. `dribbble-cards.mjs` sorts by likes, drops shots under 100 likes (`--min-likes` changes that), and prints each shot's designer. The skill ranks by likes rather than page order, compares likes between shots of a similar age, drops dated shots, and keeps at most one shot from a studio that posts near-identical concepts.
|
|
19
|
+
|
|
20
|
+
- `design-direction` lets you steer the look. It searches wide (40 to 80 candidates from every source you chose) and cuts only what is off-topic or below the source's quality floor, not for taste. The new `picker.mjs` shows that pool as one page where you mark each like or no and add why, then copy your picks into the chat. The agent reads back what your likes and noes share, runs one sharper second search from that (same designer, same tag, the same pattern on other sources), and builds the moodboard from your likes. What your noes share goes into `leave`. `dribbble-cards.mjs --picker` prints rows for it, and `sources.md` says where each source's cards keep their title, thumbnail and link. siteinspire is no longer ticked by default: it refuses scripted requests, so it cannot be in the picker.
|
|
21
|
+
- `init` asks which add-ons you want, in the same kind of list as the agents. `--all`, `--skill <name>` and the new `--no-addons` answer for you and skip the list. `update` never asks.
|
|
22
|
+
- New add-on: `modern-web-guidance`, from the Chrome team with Edge, Firefox and MDN. It steers HTML, CSS and client-side JS toward current browser APIs. It is ticked in the `init` list, and a first `init --yes` takes it. It looks each guide up with `npx`, so it needs the network; untick it, or pass `--no-addons`, if that does not suit the project. A project that already ran `init` takes it with `npx longbeard update --skill modern-web-guidance`; the agent does not offer this one.
|
|
23
|
+
|
|
5
24
|
## 0.10.0 — 2026-11-04
|
|
6
25
|
|
|
7
26
|
Long Beard is now a pipeline: Idea → Direction → Design → Architecture → Plan → Build. Each stage writes one file the next one reads (`docs/brief.md`, `design-exploration/<slug>/direction.md`, `DESIGN.md` and Ready Figma frames, `GLOSSARY.md`, specs and tickets, one PR per spec), and ends by offering the next. The `AGENTS.md` block is a stage table the agent reads to know where it is, under 200 words.
|
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<img src="logo.png" alt="Long Beard" width="350">
|
|
3
3
|
<h1>Long Beard</h1>
|
|
4
|
-
<p><strong>Designs like an Art director. Codes like a
|
|
4
|
+
<p><strong>Designs like an Art director. Codes like a Senior Engineer.</strong></p>
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
A beard like this takes years: moving logos two pixels left, reviewing pull requests at midnight.
|
|
8
|
+
Your agent gets it on day one. It asks before it draws, and it draws before it codes.
|
|
9
9
|
|
|
10
10
|
Long Beard is a pipeline for the agents you already use — Cursor, Claude Code, and the rest.
|
|
11
11
|
You start with an idea in an empty folder. You end with reviewed pull requests built from a design you approved.
|
|
@@ -21,7 +21,7 @@ It is a base. You keep going from here.
|
|
|
21
21
|
| Stage | What happens | You get |
|
|
22
22
|
|---|---|---|
|
|
23
23
|
| 1. Idea | The agent grills the idea in rounds, each question with its recommendation | `docs/brief.md`: one page, no tech choices |
|
|
24
|
-
| 2. Direction | Three questions about what you like, a
|
|
24
|
+
| 2. Direction | Three questions about what you like, a wide search you mark like or no on a picker page, a sharper second search from your picks, then a moodboard | `design-exploration/<slug>/direction.md`: ideas and patterns, not colours |
|
|
25
25
|
| 3. Design | Questions on colour and type, then two or three prototypes of the key screens; you pick and iterate | `DESIGN.md` on your yes, then the screens in Figma, checked and marked Ready |
|
|
26
26
|
| 4. Architecture | The stack and the words the product uses | `GLOSSARY.md`, decisions |
|
|
27
27
|
| 5. Plan | Each flow becomes a spec, each spec vertical-slice tickets | specs and tickets on GitHub Issues or local files |
|
|
@@ -43,13 +43,14 @@ Four skills are written here, in [`skills/`](skills/). `init` copies them from t
|
|
|
43
43
|
| [figma-use](https://github.com/figma/mcp-server-guide/tree/main/skills/figma-use), [figma-generate-library](https://github.com/figma/mcp-server-guide/tree/main/skills/figma-generate-library), [figma-generate-design](https://github.com/figma/mcp-server-guide/tree/main/skills/figma-generate-design) | How `design` writes tokens, components and screens in Figma | Figma |
|
|
44
44
|
| [figma-design-to-code](https://github.com/figma/mcp-server-guide/tree/main/skills/figma-design-to-code) | Builds from a Figma file a designer handed over | Figma |
|
|
45
45
|
|
|
46
|
-
Add-ons are
|
|
46
|
+
Add-ons are your choice. In a terminal, `init` lists them and you tick the ones you want; `modern-web-guidance` starts ticked, the rest start empty. Later the agent offers one when it is needed; take it with `npx longbeard update --skill <name>`, or all of them with `--all`.
|
|
47
47
|
|
|
48
48
|
| Add-on | What it is for | Author |
|
|
49
49
|
|---|---|---|
|
|
50
50
|
| [animate](https://github.com/emilkowalski/skills/tree/main/skills/animate) | One control or transition you asked to animate | emilkowalski |
|
|
51
51
|
| [jury](https://github.com/juliobsz/skills/tree/main/jury) | Scores a live or local build when you ask. Does not redesign | juliobsz |
|
|
52
52
|
| [web-design-guidelines](https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines) | Reviews UI and accessibility when you ask | Vercel |
|
|
53
|
+
| [modern-web-guidance](https://github.com/GoogleChrome/modern-web-guidance/tree/main/skills/modern-web-guidance) | Current browser APIs instead of legacy patterns when writing HTML, CSS or client-side JS. Ticked at `init`. It looks each guide up with `npx`, so it needs the network | Google Chrome |
|
|
53
54
|
| [security-audit](https://github.com/cloudflare/security-audit-skill/tree/main/skills/security-audit) | Reviews a trust boundary when you ask | Cloudflare |
|
|
54
55
|
| [image-to-code](https://github.com/Leonxlnx/imagegen-skills/tree/main/skills/image-to-code) | Builds a page from a picture you have | Leonxlnx |
|
|
55
56
|
|
|
@@ -57,7 +58,7 @@ A kit is an author's whole flow, taken as they publish it: the skills in their p
|
|
|
57
58
|
|
|
58
59
|
A skill for one stack belongs in the project that uses that stack. The list `init` installs is [`beard.json`](beard.json). A skill written here stays in this repository. Do not copy `beard.json` into your project. That would fork the kit.
|
|
59
60
|
|
|
60
|
-
`design-exploration/`
|
|
61
|
+
`design-exploration/` is your working folder for inspiration, moodboards and prototypes. It stays on your machine, out of git. `DESIGN.md` is the result you keep.
|
|
61
62
|
|
|
62
63
|
## You need
|
|
63
64
|
|
|
@@ -73,7 +74,7 @@ npm install --save-dev @jonandev/longbeard
|
|
|
73
74
|
npx longbeard init
|
|
74
75
|
```
|
|
75
76
|
|
|
76
|
-
`init` installs the list, writes the `AGENTS.md` block, and records it in `beard-lock.json`. In a terminal it asks which agents. When it cannot ask, it installs for Cursor and Claude Code. `--yes` skips the question. `--agent cursor` sets them (repeat it to add another). `--global` installs for every project on this machine. `--all` includes every add-on
|
|
77
|
+
`init` installs the list, writes the `AGENTS.md` block, and records it in `beard-lock.json`. In a terminal it asks which agents. When it cannot ask, it installs for Cursor and Claude Code. `--yes` skips the question. `--agent cursor` sets them (repeat it to add another). `--global` installs for every project on this machine. It then asks which add-ons. When it cannot ask, or with `--yes`, a first `init` takes the ticked ones. `--all` includes every add-on, `--skill <name>` takes one, and `--no-addons` takes none; each skips the list. An add-on you turn down at `init` is not offered again; take it later with `npx longbeard update --skill <name>`.
|
|
77
78
|
|
|
78
79
|
## Start
|
|
79
80
|
|
|
@@ -81,7 +82,17 @@ Open your agent in the project and say what you want to make:
|
|
|
81
82
|
|
|
82
83
|
> I want to build a shared shopping list for flatmates.
|
|
83
84
|
|
|
84
|
-
It reads `AGENTS.md`, sees there is no brief, and starts at Idea. Each stage ends by offering the next, and nothing moves on without your yes.
|
|
85
|
+
It reads `AGENTS.md`, sees there is no brief, and starts at Idea. Each stage ends by offering the next, and nothing moves on without your yes. A few steps start only when you type them, such as `/grill-with-docs` and `/to-spec`. The agent tells you when.
|
|
86
|
+
|
|
87
|
+
### A project you already have
|
|
88
|
+
|
|
89
|
+
Ask for a brief:
|
|
90
|
+
|
|
91
|
+
> Catch this project up to the pipeline. Draft the brief from what is here and skip the stages it already has.
|
|
92
|
+
|
|
93
|
+
The agent drafts `docs/brief.md` from your documents and code, asks only about the gaps, and asks what happens to any document that now says the same thing. A stage whose file exists is done: with a `DESIGN.md`, it goes past Direction and Design.
|
|
94
|
+
|
|
95
|
+
Then type `/grill-with-docs`, and say what already names things in your project and where your decisions live, if that is not `docs/adr/`. Screens you already have in Figma are marked Ready one at a time, when a feature touches them.
|
|
85
96
|
|
|
86
97
|
## Update
|
|
87
98
|
|
package/beard.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "Direction",
|
|
17
|
-
"when": "A brief with UI",
|
|
17
|
+
"when": "A brief with UI, no DESIGN.md",
|
|
18
18
|
"skills": [
|
|
19
19
|
"design-direction"
|
|
20
20
|
],
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"name": "Architecture",
|
|
35
|
-
"when": "No GLOSSARY.md
|
|
35
|
+
"when": "No GLOSSARY.md",
|
|
36
36
|
"skills": [
|
|
37
37
|
"grill-with-docs"
|
|
38
38
|
],
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"name": "Plan",
|
|
43
|
-
"when": "A flow or feature
|
|
43
|
+
"when": "A flow or feature",
|
|
44
44
|
"skills": [
|
|
45
45
|
"setup-matt-pocock-skills",
|
|
46
46
|
"to-spec",
|
|
@@ -171,6 +171,17 @@
|
|
|
171
171
|
"why": "Accessibility and interface rules.",
|
|
172
172
|
"optional": true
|
|
173
173
|
},
|
|
174
|
+
{
|
|
175
|
+
"name": "modern-web-guidance",
|
|
176
|
+
"author": "Google Chrome",
|
|
177
|
+
"license": "Apache-2.0",
|
|
178
|
+
"source": "https://github.com/GoogleChrome/modern-web-guidance/tree/main/skills/modern-web-guidance",
|
|
179
|
+
"when": "Writing HTML, CSS, or client-side JS",
|
|
180
|
+
"why": "Current browser APIs; DESIGN.md decides the look.",
|
|
181
|
+
"optional": true,
|
|
182
|
+
"preselected": true,
|
|
183
|
+
"hint": "current browser APIs, needs the network"
|
|
184
|
+
},
|
|
174
185
|
{
|
|
175
186
|
"name": "security-audit",
|
|
176
187
|
"author": "Cloudflare",
|
package/bin/long-beard.js
CHANGED
|
@@ -37,7 +37,7 @@ The catalog is beard.json. The command is longbeard, via npx in the project.
|
|
|
37
37
|
npx longbeard list
|
|
38
38
|
npx longbeard --version
|
|
39
39
|
|
|
40
|
-
npx longbeard init [--global] [--all] [--skill add-on] [--yes] [--agent cursor]
|
|
40
|
+
npx longbeard init [--global] [--all] [--skill add-on] [--no-addons] [--yes] [--agent cursor]
|
|
41
41
|
npx longbeard update [--global] [--all] [--skill add-on] [--force] [--yes]
|
|
42
42
|
npx longbeard add <source> --skill <name> --author <name> --why <text> [--when text]
|
|
43
43
|
npx longbeard remove <name>
|
|
@@ -48,10 +48,11 @@ A skill written here is copied from the installed package when its version moved
|
|
|
48
48
|
A kit (Matt Pocock's) is every skill its author publishes. update adds new ones, and removes any skill the catalog or its kit no longer lists, unless you edited it.
|
|
49
49
|
Install the package first (npm install -D @jonandev/longbeard@latest); update does not fetch it.
|
|
50
50
|
add in a project writes beard.local.json (an extra, not a second kit). remove omits a kit skill here.
|
|
51
|
-
--all takes every add-on; --skill takes one
|
|
51
|
+
init lists the add-ons in a terminal, some already ticked. --all takes every add-on; --skill takes one; --no-addons takes none.
|
|
52
|
+
Each of those skips the list. An add-on you took stays and refreshes on update.
|
|
52
53
|
--agent skips the agent list and installs for that tool. Repeat it.
|
|
53
54
|
--force replaces local edits of skills this command installed, and removes edited ones the catalog dropped.
|
|
54
|
-
--yes skips prompts and uses the catalog agents (cursor, claude-code).
|
|
55
|
+
--yes skips prompts and uses the catalog agents (cursor, claude-code) and, on a first init, the ticked add-ons.
|
|
55
56
|
This does not install marketplace plugins or replace Cursor or Claude commands.
|
|
56
57
|
`;
|
|
57
58
|
|
|
@@ -143,6 +144,7 @@ function parseArgs(argv) {
|
|
|
143
144
|
force: false,
|
|
144
145
|
yes: false,
|
|
145
146
|
optional: false,
|
|
147
|
+
noAddons: false,
|
|
146
148
|
agents: [],
|
|
147
149
|
skill: [],
|
|
148
150
|
why: "",
|
|
@@ -158,6 +160,7 @@ function parseArgs(argv) {
|
|
|
158
160
|
else if (arg === "--force") flags.force = true;
|
|
159
161
|
else if (arg === "--yes" || arg === "-y") flags.yes = true;
|
|
160
162
|
else if (arg === "--optional") flags.optional = true;
|
|
163
|
+
else if (arg === "--no-addons") flags.noAddons = true;
|
|
161
164
|
else if (arg === "--help" || arg === "-h") flags.help = true;
|
|
162
165
|
else if (arg === "--version" || arg === "-V") flags.version = true;
|
|
163
166
|
else if (arg === "--agent" || arg === "-a") flags.agents.push(take(argv, ++i, arg));
|
|
@@ -245,15 +248,22 @@ async function fetchKit(item) {
|
|
|
245
248
|
if (!repo) fail(`${item.name}: a kit needs a GitHub source.`);
|
|
246
249
|
// update retires what this list leaves out, so a failed fetch must stop here,
|
|
247
250
|
// never fall through to a guess. Only a missing manifest (404) falls back.
|
|
248
|
-
|
|
251
|
+
// Every stop names its reason, so a failure is never just "check the network".
|
|
252
|
+
const cannot = `Could not list the ${item.name} kit from GitHub`;
|
|
249
253
|
const get = async (url) => {
|
|
254
|
+
let res;
|
|
255
|
+
try {
|
|
256
|
+
res = await fetch(url);
|
|
257
|
+
} catch (error) {
|
|
258
|
+
const reason = error.cause?.code ?? error.cause?.message ?? error.message;
|
|
259
|
+
fail(`${cannot}: ${reason} reaching ${url}. Check the network and try again.`);
|
|
260
|
+
}
|
|
261
|
+
if (res.status === 404) return null;
|
|
262
|
+
if (!res.ok) fail(`${cannot}: ${res.status} ${res.statusText} from ${url}.`);
|
|
250
263
|
try {
|
|
251
|
-
const res = await fetch(url);
|
|
252
|
-
if (res.status === 404) return null;
|
|
253
|
-
if (!res.ok) fail(`${cannot} (${res.status} from ${url})`);
|
|
254
264
|
return await res.json();
|
|
255
265
|
} catch {
|
|
256
|
-
fail(cannot);
|
|
266
|
+
fail(`${cannot}: ${url} did not return JSON.`);
|
|
257
267
|
}
|
|
258
268
|
};
|
|
259
269
|
const manifest = await get(`https://raw.githubusercontent.com/${repo}/HEAD/.claude-plugin/plugin.json`);
|
|
@@ -262,7 +272,7 @@ async function fetchKit(item) {
|
|
|
262
272
|
: ((await get(`https://api.github.com/repos/${repo}/git/trees/HEAD?recursive=1`))?.tree ?? [])
|
|
263
273
|
.map((entry) => entry.path.match(/^skills\/([^/]+)\/SKILL\.md$/)?.[1])
|
|
264
274
|
.filter(Boolean);
|
|
265
|
-
if (names.length === 0) fail(cannot);
|
|
275
|
+
if (names.length === 0) fail(`${cannot}: ${repo} lists no skills.`);
|
|
266
276
|
return names;
|
|
267
277
|
}
|
|
268
278
|
|
|
@@ -354,25 +364,22 @@ function readKey() {
|
|
|
354
364
|
return "";
|
|
355
365
|
}
|
|
356
366
|
|
|
357
|
-
|
|
367
|
+
// One checkbox list for both questions init asks. An option is { name, label, detail }.
|
|
368
|
+
function pickList(title, options, selected, { min = 0 } = {}) {
|
|
358
369
|
const on = new Set(selected);
|
|
359
370
|
let index = 0;
|
|
360
371
|
const height = options.length + 1;
|
|
372
|
+
const width = Math.max(16, ...options.map((option) => option.label.length));
|
|
361
373
|
const paintList = (first) => {
|
|
362
374
|
if (!first) process.stdout.write(`\x1b[${height}A`);
|
|
363
|
-
process.stdout.write(`
|
|
375
|
+
process.stdout.write(` ${title} ${dim("space toggle · enter continue")}\x1b[K\n`);
|
|
364
376
|
for (let i = 0; i < options.length; i += 1) {
|
|
365
|
-
const
|
|
377
|
+
const option = options[i];
|
|
366
378
|
const arrow = i === index ? "❯" : " ";
|
|
367
|
-
const mark = on.has(name) ? "x" : " ";
|
|
368
|
-
|
|
369
|
-
const path = flagsPath(name);
|
|
370
|
-
process.stdout.write(` ${arrow} [${mark}] ${label} ${dim(path)}\x1b[K\n`);
|
|
379
|
+
const mark = on.has(option.name) ? "x" : " ";
|
|
380
|
+
process.stdout.write(` ${arrow} [${mark}] ${option.label.padEnd(width)} ${dim(option.detail ?? "")}\x1b[K\n`);
|
|
371
381
|
}
|
|
372
382
|
};
|
|
373
|
-
function flagsPath(name) {
|
|
374
|
-
return agentDirs[name].project;
|
|
375
|
-
}
|
|
376
383
|
process.stdin.setRawMode(true);
|
|
377
384
|
paintList(true);
|
|
378
385
|
try {
|
|
@@ -380,11 +387,11 @@ function pickAgents(options, selected) {
|
|
|
380
387
|
const key = readKey();
|
|
381
388
|
if (key === "ctrl-c") fail("Aborted.");
|
|
382
389
|
if (key === "enter") {
|
|
383
|
-
if (on.size
|
|
384
|
-
return options.filter((
|
|
390
|
+
if (on.size < min) continue;
|
|
391
|
+
return options.filter((option) => on.has(option.name)).map((option) => option.name);
|
|
385
392
|
}
|
|
386
393
|
if (key === "space") {
|
|
387
|
-
const name = options[index];
|
|
394
|
+
const { name } = options[index];
|
|
388
395
|
if (on.has(name)) on.delete(name);
|
|
389
396
|
else on.add(name);
|
|
390
397
|
} else if (key === "up") index = (index + options.length - 1) % options.length;
|
|
@@ -397,6 +404,27 @@ function pickAgents(options, selected) {
|
|
|
397
404
|
}
|
|
398
405
|
}
|
|
399
406
|
|
|
407
|
+
function pickAgents(options, selected) {
|
|
408
|
+
const rows = options.map((name) => ({ name, label: agentNames[name] ?? name, detail: agentDirs[name].project }));
|
|
409
|
+
return pickList("Which agents?", rows, selected, { min: 1 });
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// init asks which add-ons, with the catalog's `preselected` ones ticked. Naming
|
|
413
|
+
// add-ons with a flag is the answer, so it skips the list. Ticks are for a
|
|
414
|
+
// first init only: after that, what you took stays and nothing comes back.
|
|
415
|
+
function chooseAddons(flags) {
|
|
416
|
+
if (flags.all || flags.noAddons || flags.skill.length) return [];
|
|
417
|
+
const taken = readLock(flags).skills;
|
|
418
|
+
const omitted = new Set(extraState(flags).omit);
|
|
419
|
+
const open = catalog(curated()).filter((item) => item.optional && !taken[item.name] && !omitted.has(item.name));
|
|
420
|
+
if (open.length === 0) return [];
|
|
421
|
+
const first = !existsSync(lockFile(flags));
|
|
422
|
+
const ticked = first ? open.filter((item) => item.preselected).map((item) => item.name) : [];
|
|
423
|
+
if (flags.yes || !process.stdin.isTTY) return ticked;
|
|
424
|
+
const rows = open.map((item) => ({ name: item.name, label: item.name, detail: item.hint ?? item.when ?? "" }));
|
|
425
|
+
return pickList("Which add-ons?", rows, ticked);
|
|
426
|
+
}
|
|
427
|
+
|
|
400
428
|
function chooseAgents(manifest, flags, { pick, lock } = {}) {
|
|
401
429
|
const known = knownAgents();
|
|
402
430
|
if (flags.agents.length) {
|
|
@@ -586,7 +614,8 @@ function generateRouter(items, manifest = curated()) {
|
|
|
586
614
|
return [line(item.when?.trim() || item.name, item.name, item.why)];
|
|
587
615
|
});
|
|
588
616
|
const have = new Set(items.map((item) => item.name));
|
|
589
|
-
|
|
617
|
+
// A preselected add-on was decided at init, so it is never offered again.
|
|
618
|
+
const addons = catalog(manifest).filter((item) => item.optional && !item.preselected && !have.has(item.name));
|
|
590
619
|
const rows = stages.map((stage) => `| ${stage.name} | ${stage.when} | ${stage.skills.join(" → ")} | ${stage.writes} |`);
|
|
591
620
|
const offer = addons.length
|
|
592
621
|
? `\nAdd-ons, offered once when needed (\`npx longbeard update --skill <name>\`): ${addons.map((item) => (item.hint ? `${item.name} (${item.hint})` : item.name)).join(", ")}. At Architecture, a framework skill.\n`
|
|
@@ -599,9 +628,9 @@ The project's own code, conventions, and DESIGN.md win. Load only what the task
|
|
|
599
628
|
|---|---|---|---|
|
|
600
629
|
${rows.join("\n")}
|
|
601
630
|
|
|
602
|
-
Each stage offers the next; start it on yes. No UI: skip Direction and Design. A feature with a brief: grill-with-docs for new terms, else grilling, then Plan.
|
|
631
|
+
Each stage offers the next; start it on yes. A skill you can't load: they type /<name>. No UI: skip Direction and Design. A feature with a brief: grill-with-docs for new terms, else grilling, then Plan.
|
|
603
632
|
|
|
604
|
-
UI tickets link their Ready Figma frame. UI work follows DESIGN.md and that frame
|
|
633
|
+
UI tickets link their Ready Figma frame. UI work follows DESIGN.md and that frame; a mismatch is a bug.
|
|
605
634
|
|
|
606
635
|
${helpers.join("\n")}
|
|
607
636
|
${offer}
|
|
@@ -741,8 +770,9 @@ function remember(lock, flags, skills, agents) {
|
|
|
741
770
|
async function init(flags) {
|
|
742
771
|
requireProject(flags);
|
|
743
772
|
knownAddons(flags);
|
|
744
|
-
const
|
|
745
|
-
|
|
773
|
+
const agents = chooseAgents(curated(), flags, { pick: true, lock: readLock(flags) });
|
|
774
|
+
flags.skill.push(...chooseAddons(flags));
|
|
775
|
+
const { extra, items, later, ...picked } = chosen(flags);
|
|
746
776
|
const skills = await expandKits(picked.skills, extra.omit);
|
|
747
777
|
const classified = classify(skills, agents, flags);
|
|
748
778
|
classified.later = later;
|
package/package.json
CHANGED
package/skills/design/SKILL.md
CHANGED
|
@@ -58,7 +58,7 @@ Load Matt's `prototype`, UI branch, and tell it:
|
|
|
58
58
|
- **Real content, not polish skipped.** Real copy in the voice from `direction.md`, real or properly chosen imagery (local files in `prototype/img/`), the longest real names. No lorem, no grey boxes.
|
|
59
59
|
- **No throwaway branch.** The folder is gitignored. The winner goes into `DESIGN.md`, not into git.
|
|
60
60
|
|
|
61
|
-
The default state is not enough. Each key screen also gets empty, loading and error, as frames in the same file (`?variant=B&state=empty`).
|
|
61
|
+
The default state is not enough. Each key screen also gets the empty, loading and error states a person can reach, as frames in the same file (`?variant=B&state=empty`). A product with more than one theme shows each one, so they approve every theme, not only the first.
|
|
62
62
|
|
|
63
63
|
### 3. Self-check, then show
|
|
64
64
|
|
|
@@ -69,7 +69,7 @@ node <skill>/scripts/capture.mjs "file://$PWD/design-exploration/<slug>/prototyp
|
|
|
69
69
|
node <skill>/scripts/capture.mjs "file://$PWD/design-exploration/<slug>/prototype/today.html?variant=B&capture" --out <scratch>/today-b-mobile.png --width 390
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
Shoot every state of every variant, not only the default. Check them against the rules: Idea first, then hard, then soft. That includes the hard rules about controls: every input has a visible label, focus and pressed exist, and what looks tappable has a stated result. A hard finding after approval reopens an approved screen. Fix what fails before they see it. Then give the paths and the `?variant=` keys, name the colours and faces each variant uses, and ask which leads, what to take from the others, and whether the colour and type are right. Expect "the header from B with the list from C": that is the design. Iterate on the prototype until they say it is right.
|
|
72
|
+
Shoot every state of every variant, in every theme, not only the default. Check them against the rules: Idea first, then hard, then soft. That includes the hard rules about controls: every input has a visible label, focus and pressed exist, and what looks tappable has a stated result. A hard finding after approval reopens an approved screen. Fix what fails before they see it. Then give the paths and the `?variant=` keys, name the colours and faces each variant uses, and ask which leads, what to take from the others, and whether the colour and type are right. Expect "the header from B with the list from C": that is the design. Iterate on the prototype until they say it is right.
|
|
73
73
|
|
|
74
74
|
A pattern can bring a feature the brief does not have. Name it when you show it. If they keep it, that is a product change: `idea`, Change, before `DESIGN.md`.
|
|
75
75
|
|
|
@@ -85,6 +85,7 @@ Only on their yes to a rendered prototype. Write the whole file from [design-md-
|
|
|
85
85
|
```
|
|
86
86
|
node <skill>/scripts/contrast.mjs "#1b1b1f on #fafaf7" "#c2410c on #fafaf7:mark"
|
|
87
87
|
```
|
|
88
|
+
- **Themes.** A product with more than one theme lists each colour token once, with a value per theme, and every pair passes the contrast check in each theme.
|
|
88
89
|
- **Ideas, not sources.** `DESIGN.md` is committed and often public. It never names a product, site, studio or designer from the exploration, and never cites a `design-exploration/` path. Turn each into the idea: "a quiet reading page", not whose.
|
|
89
90
|
- **Write down what makes it this design.** Whatever someone would need to rebuild it without the prototype open goes under Components, with values, not adjectives.
|
|
90
91
|
- **Tokens are code names.** Name each colour, type and spacing token as it will be named in code (`color/ink`, `space/md`). Figma variables use the same names, with code syntax `var(--color-ink)`.
|
|
@@ -97,15 +98,17 @@ Load `figma-use`, `figma-generate-library` and `figma-generate-design`, and foll
|
|
|
97
98
|
- **One file per product.** A new one if the project has none (`figma-create-new-file`). Put its URL in `DESIGN.md`.
|
|
98
99
|
- **Our tokens, not a kit.** Variables and styles come from `DESIGN.md`. New files may come with community kits attached (Material, Apple, Simple Design System). Their discovery steps tell you to reuse them. Do not: search the file only (no `includeLibraryKeys`), and build what is missing from `DESIGN.md`.
|
|
99
100
|
- **Build, do not capture.** Compose screens from the tokens and components. Do not run `generate_figma_design` on the prototype. It is a throwaway with a switcher. For pictures, create the image frames, then `upload_assets` the prototype's own files with those `nodeIds`.
|
|
101
|
+
- **Themes are modes.** One colour collection with a mode per theme. Each screen is built once and switches with the mode, never a colour set or a frame per theme. If Figma refuses the modes, stop and ask. Never fall back to separate sets.
|
|
100
102
|
- **Pages:** Cover, Foundations, Components; one `Screens — <flow>` page per flow from the brief; `Explorations` for anything kept for later, by date.
|
|
101
103
|
- **Order:** tokens and styles from `DESIGN.md` → only the components the key screens need → the key screens → their states. The library grows with features. It is not built ahead.
|
|
102
|
-
- **States:** every screen has empty, loading and error
|
|
104
|
+
- **States:** every 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 gets no frame: add the screen, the state and the reason under Decisions in `DESIGN.md`.
|
|
105
|
+
- **Names:** `<screen> — <state>`. When a screen's layout differs by device, `<screen> · <device> — <state>`. The state can describe itself. Theme is never in the name.
|
|
103
106
|
- **Components have their states too:** focus and pressed for every control, before a screen uses it.
|
|
104
107
|
- **One text style per weight used.** Changing a font on styled text detaches it. A weight `DESIGN.md` does not list is a new style, and a new row there.
|
|
105
108
|
- **Trust the file, not the picture.** Take a screenshot only after the edit has returned, and read text back from the nodes. A cloned variant loses its text property links: wire them again. Swapping an instance can keep old overrides: replace it with a fresh one.
|
|
106
109
|
- **Be faithful to the approved prototype.** It is what they said yes to, and Figma is that design, not a new reading of it. Tokens carry the values, not the whole design, so work with the approved variant open and match it. If something cannot be built the same way, say so and ask. Never simplify it silently.
|
|
107
110
|
- **Check each screen** with `design-check` frame mode before showing it, passing the prototype shot. Fix its hard findings.
|
|
108
|
-
- **Ready:** when they approve a frame,
|
|
111
|
+
- **Ready:** when they approve a frame, add `— Ready` to its name. Tickets link Ready frames, and build is checked against them.
|
|
109
112
|
|
|
110
113
|
If a Figma decision changes a rule (a new token, a component variant, a spacing step), update `DESIGN.md` in the same turn and say what changed.
|
|
111
114
|
|
|
@@ -113,7 +116,7 @@ If a Figma decision changes a rule (a new token, a component variant, a spacing
|
|
|
113
116
|
|
|
114
117
|
Offer to delete `design-exploration/<slug>/`. `DESIGN.md` and Figma now carry the result. On no, leave it. It is gitignored either way.
|
|
115
118
|
|
|
116
|
-
Then offer the next stage: architecture
|
|
119
|
+
Then offer the next stage: architecture. They start it by typing `/grill-with-docs`. When it runs, seed `GLOSSARY.md` from the brief and the copy in the Figma screens, and ask before renaming a term the screens show.
|
|
117
120
|
|
|
118
121
|
## Feature loop
|
|
119
122
|
|
|
@@ -125,6 +128,7 @@ A feature with screens, once `DESIGN.md` exists.
|
|
|
125
128
|
- `DESIGN.md` gets entries (a token, a component, a decision with date and reason). It is never rewritten in a feature.
|
|
126
129
|
- **Identity changes need their own yes.** A new colour role, a typeface, a change to the idea or the voice: ask for each one separately, after showing it rendered. Two such changes are approved one at a time, never bundled.
|
|
127
130
|
- A rebrand is not a feature: that is `design-direction` again, then a first pass.
|
|
131
|
+
- **A screen with no Ready frame.** A project that joined with its screens already in Figma has frames nobody marked. When a feature touches one, run `design-check` frame mode on it, add what it lacks, and mark it Ready on their yes. A screen with a copy per theme becomes one frame on modes. Only the screens the feature touches, never the whole file.
|
|
128
132
|
|
|
129
133
|
## Do not
|
|
130
134
|
|
|
@@ -132,4 +136,4 @@ A feature with screens, once `DESIGN.md` exists.
|
|
|
132
136
|
- Name a reference or a `design-exploration/` path in `DESIGN.md`.
|
|
133
137
|
- Use a community kit's components or variables in Figma.
|
|
134
138
|
- Build the whole component library before the screens need it.
|
|
135
|
-
- Mark a frame Ready that
|
|
139
|
+
- Mark a frame Ready that lacks a state a person can reach, or that has open hard findings.
|
|
@@ -54,4 +54,5 @@ Contrast (scripts/contrast.mjs):
|
|
|
54
54
|
|
|
55
55
|
- Every token name is its code name, and the same name in Figma.
|
|
56
56
|
- Every colour pair in the table has been through `scripts/contrast.mjs`. No FAIL is written.
|
|
57
|
+
- More than one theme: one row per token, with a value column per theme. Every pair is checked in each theme.
|
|
57
58
|
- A section with nothing to say is left out, not filled with a guess.
|
|
@@ -73,6 +73,7 @@ These rules decide execution, never the look. The direction and `DESIGN.md` deci
|
|
|
73
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
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
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.
|
|
76
77
|
- [soft] The accent colour marks action or state, and is not also used for decoration on the same screen.
|
|
77
78
|
- [soft] Status colours (error, warning, success) are used for status only.
|
|
78
79
|
|
|
@@ -89,7 +90,7 @@ These rules decide execution, never the look. The direction and `DESIGN.md` deci
|
|
|
89
90
|
|
|
90
91
|
**Principle:** every screen is shown in every state a person will meet.
|
|
91
92
|
|
|
92
|
-
- [hard] The screen has
|
|
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.
|
|
93
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.
|
|
94
95
|
- [hard] Interactive components show hover (pointer surfaces), focus, pressed, disabled, and selected where they apply. Each state is visibly different from default.
|
|
95
96
|
- [soft] Loading keeps the layout's shape (skeleton or reserved space), so content does not jump when it arrives.
|
|
@@ -44,14 +44,15 @@ Read `DESIGN.md` first: its tokens, components and decisions are what "follows t
|
|
|
44
44
|
Called by `design` after it composes or changes a Figma screen. Input: the file key, the node IDs of the screen and its state frames, and the approved prototype shot of that screen when there is one.
|
|
45
45
|
|
|
46
46
|
1. Load `figma-use` for any `use_figma` call. Screenshot each frame (`get_screenshot`, `maxDimension` 1440 so text is readable). Read structure with `get_metadata` when spacing or alignment needs numbers.
|
|
47
|
-
2. Find the states: frames
|
|
48
|
-
3. Check tokens where the screenshot cannot tell: in one read-only `use_figma` call, list fills, gaps and text styles that are not bound to a variable or style. An unbound value is a rule 7 soft finding when a token exists for it.
|
|
49
|
-
4.
|
|
50
|
-
5.
|
|
47
|
+
2. Find the states: the frames next to the default, whatever they are called. Decide from what each frame shows whether it is the screen's empty, loading or error state, not from its name. A reachable state with no frame is a rule 8 hard finding. So is a "not needed" under Decisions in `DESIGN.md` when a person can reach that state after all.
|
|
48
|
+
3. Check tokens where the screenshot cannot tell: in one read-only `use_figma` call, list fills, gaps and text styles that are not bound to a variable or style. An unbound value is a rule 7 soft finding when a token exists for it. With more than one theme, an unbound colour is a rule 6 hard finding, because it will not change with the theme.
|
|
49
|
+
4. Check the themes, when `DESIGN.md` lists more than one. Themes built as separate colour sets or as a frame per theme, instead of modes on one collection, are a rule 6 hard finding. For each mode, set it on a temporary copy of the frame, screenshot the copy, delete it, and run the rules on that shot. If the shot does not change with the mode, report that theme as "not checked", never as passed.
|
|
50
|
+
5. Compare with the prototype shot, side by side. The frame must be faithful to what they approved. Anything lost or changed without their yes is a hard finding, under rule 0. Pixels do not count. No shot: say "not compared".
|
|
51
|
+
6. Return the findings. `design` fixes the hard ones, runs this once more, then shows the screen. A frame with open hard findings is never marked Ready.
|
|
51
52
|
|
|
52
53
|
## Build mode
|
|
53
54
|
|
|
54
|
-
After `implement-spec` builds a UI spec. Input: the running app's URL for each screen, and the Ready frames the tickets link.
|
|
55
|
+
After `implement-spec` builds a UI spec. Input: the running app's URL for each screen, and the Ready frames the tickets link. A screen with no Ready frame has nothing to compare with: report it as "not checked" and send it to `design`.
|
|
55
56
|
|
|
56
57
|
1. **Render** each screen at phone and desktop:
|
|
57
58
|
```
|
|
@@ -59,7 +60,7 @@ After `implement-spec` builds a UI spec. Input: the running app's URL for each s
|
|
|
59
60
|
node <skill>/scripts/capture.mjs <url> --out <scratch>/<screen>-1440.png --strict
|
|
60
61
|
```
|
|
61
62
|
Behind a login, pass `--cookie "name=value"` from a dev session the project already uses (a seed user, a test token). Never ask for real credentials. `--strict` exits 1 when the page lands elsewhere: a shot of the login page is not a check. Report it and stop for that screen.
|
|
62
|
-
2. **Reach the states.** Render
|
|
63
|
+
2. **Reach the states.** Render each state that has a frame the way the app allows: a fixture, a seed, a query flag, a test route. A state that cannot be reached is reported as "not checked", never as passed. With more than one theme, render each one too, the way the app sets it (a cookie, a query flag). The same applies to a theme that cannot be reached.
|
|
63
64
|
3. **Compare with the Ready frame on meaning, not pixels:**
|
|
64
65
|
- structure: the same sections, in the same order, with the same hierarchy
|
|
65
66
|
- tokens: colours, type and spacing are `DESIGN.md`'s values (`scripts/contrast.mjs` for any pair that looks off)
|
|
@@ -73,6 +73,7 @@ These rules decide execution, never the look. The direction and `DESIGN.md` deci
|
|
|
73
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
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
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.
|
|
76
77
|
- [soft] The accent colour marks action or state, and is not also used for decoration on the same screen.
|
|
77
78
|
- [soft] Status colours (error, warning, success) are used for status only.
|
|
78
79
|
|
|
@@ -89,7 +90,7 @@ These rules decide execution, never the look. The direction and `DESIGN.md` deci
|
|
|
89
90
|
|
|
90
91
|
**Principle:** every screen is shown in every state a person will meet.
|
|
91
92
|
|
|
92
|
-
- [hard] The screen has
|
|
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.
|
|
93
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.
|
|
94
95
|
- [hard] Interactive components show hover (pointer surfaces), focus, pressed, disabled, and selected where they apply. Each state is visibly different from default.
|
|
95
96
|
- [soft] Loading keeps the layout's shape (skeleton or reserved space), so content does not jump when it arrives.
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
name: design-direction
|
|
3
3
|
description: >
|
|
4
4
|
Find the direction for a product's look from what they like and from real
|
|
5
|
-
references
|
|
6
|
-
|
|
5
|
+
references: a wide pool from every source they choose, which they mark like
|
|
6
|
+
or no on a picker page, a sharper second search from those picks, then a
|
|
7
|
+
moodboard. Ideas and patterns, never tokens: colour and type are chosen
|
|
8
|
+
later, in design, on rendered screens.
|
|
7
9
|
Runs after docs/brief.md exists and the brief has a UI, or when design hits
|
|
8
10
|
a gap and needs references for one piece. Writes
|
|
9
11
|
design-exploration/<slug>/direction.md, a proposal, then offers to take it
|
|
@@ -14,7 +16,7 @@ description: >
|
|
|
14
16
|
|
|
15
17
|
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
18
|
|
|
17
|
-
Direction
|
|
19
|
+
Direction is the inspiration step: it looks at good designs and works to find ideas and patterns for something new. It never picks a colour, a typeface, a size or a spacing value, and it never writes `DESIGN.md`.
|
|
18
20
|
|
|
19
21
|
## Gate
|
|
20
22
|
|
|
@@ -27,9 +29,9 @@ Look at the repo. Do not ask what is there.
|
|
|
27
29
|
|
|
28
30
|
## Folder
|
|
29
31
|
|
|
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.
|
|
32
|
+
Everything goes in `design-exploration/<slug>/`: `candidates.tsv` and `picker.html` (and `-2` for round 2), `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
33
|
|
|
32
|
-
On the first write, add `design-exploration/` to `.gitignore` if it is missing, and say why in one line:
|
|
34
|
+
On the first write, add `design-exploration/` to `.gitignore` if it is missing, and say why in one line: it is a working folder for inspiration, not part of the product. If `git ls-files design-exploration` already lists files, say so and leave `git rm -r --cached design-exploration` to them.
|
|
33
35
|
|
|
34
36
|
## Identity
|
|
35
37
|
|
|
@@ -42,51 +44,81 @@ Before I look, three questions. Skip any with "go" and I'll decide.
|
|
|
42
44
|
|
|
43
45
|
1. How should <product> feel, and never feel? Any apps, sites, brands, books or places you love for this?
|
|
44
46
|
2. Pictures or links you already like? Screenshots, links or files.
|
|
45
|
-
3. Where should I look, and how many should
|
|
47
|
+
3. Where should I look, and how many should end up on the moodboard? [x] <source> — <what it gives> … [ ] your own. Default 12. You'll pick from a much wider pool first.
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
Default sources:
|
|
49
51
|
|
|
50
52
|
- **App:** popular Dribbble. No award galleries.
|
|
51
|
-
- **Site:** Awwwards,
|
|
53
|
+
- **Site:** Awwwards, Recent. Dribbble for screens. Dark Mode Design only when the feel is dark. siteinspire is offered unticked: it refuses scripts, so it cannot be in the picker.
|
|
52
54
|
- **Imagery** (Wikimedia Commons): only when the brief's key screens need pictures.
|
|
53
55
|
|
|
54
56
|
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
57
|
|
|
56
58
|
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
59
|
|
|
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").
|
|
60
|
+
A picture they gave is a **seed**: a picker row with source `seed`, which starts liked, then a card with `link: none (shared in chat)` or its URL, never dropped. Seeds steer the queries ("more like this").
|
|
59
61
|
|
|
60
|
-
### 2. Search
|
|
62
|
+
### 2. Search wide
|
|
61
63
|
|
|
62
|
-
Read [sources.md](references/sources.md) before keeping anything. Do not narrate while looking. One line at the end is enough ("Found
|
|
64
|
+
Read [sources.md](references/sources.md) before keeping anything. Do not narrate while looking. One line at the end is enough ("Found 64 across Dribbble, Awwwards and Recent, building the picker.").
|
|
63
65
|
|
|
64
|
-
- **
|
|
66
|
+
- **They choose, so the pool is wide:** 40 to 80 candidates across the sources they chose. Cut only what is not a candidate: off-form, off-topic, under the source's quality floor, a near-twin from the same designer, anything sources.md drops. Never cut for taste here. A pool holding only what you would pick is the problem this step exists to fix.
|
|
65
67
|
- **Query the form, not the word.** "writing app" returns T-shirts. `product-design?q=text+editor+screen` returns screens.
|
|
66
|
-
- **
|
|
67
|
-
- **
|
|
68
|
+
- **Thin is a search problem.** 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.
|
|
69
|
+
- **One row per candidate** in `design-exploration/<slug>/candidates.tsv`: `title<TAB>thumbnail<TAB>link<TAB>source<TAB>meta`. The thumbnail is the listing's own: sources.md says where each source keeps it. `meta` is optional, one short line (designer, likes, award).
|
|
70
|
+
- **Nothing is captured yet.** The picker shows listing thumbnails, which is a view, not a capture.
|
|
71
|
+
|
|
72
|
+
### 3. Pick
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
node <skill>/scripts/picker.mjs design-exploration/<slug>/candidates.tsv --out design-exploration/<slug>/picker.html
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Look at it yourself first (`capture.mjs "file://$PWD/design-exploration/<slug>/picker.html" --out <scratch>/picker.jpg`). Drop or replace a row whose thumbnail is broken or blank, and run it again. Then say where it is and ask one line:
|
|
79
|
+
|
|
80
|
+
> Open the picker: click like on what pulls you, no on what feels wrong, add a why if you have one, then paste the picks here.
|
|
81
|
+
|
|
82
|
+
Each id is the round's letter and its row number in that round's TSV, comments not counted: `a7` is row 7 of `candidates.tsv`.
|
|
83
|
+
|
|
84
|
+
**Read the picks back**, in up to four lines, and wait for their yes or correction:
|
|
85
|
+
|
|
86
|
+
- what the likes share: a layout, an arrangement, a kind of picture, a density, a mood, with ids
|
|
87
|
+
- what the noes share
|
|
88
|
+
- the search this points to next
|
|
89
|
+
|
|
90
|
+
> Is that it, or what did I miss?
|
|
91
|
+
|
|
92
|
+
**Round 2, once.** Search again from the corrected read, sharper than round 1: the forms the likes share, the same designer or studio, the same gallery tag or category, and the shared pattern on the other sources (a liked Dribbble concept becomes a search for live sites with that pattern). Leave out what the noes share. 20 to 40 rows in `candidates-2.tsv`, then `picker.mjs … --round 2 --out design-exploration/<slug>/picker-2.html`, and the same ask. Skip round 2 when they say the likes already cover it. There is never a third round.
|
|
93
|
+
|
|
94
|
+
**The likes are the shortlist.** Open each at full size and drop what fails sources.md, naming each drop and why in one line. Keep up to the number they chose (default 12): later-round likes and the clearest patterns first. Capture only these (`node <skill>/scripts/capture.mjs <url> --out design-exploration/<slug>/refs/<name>.jpg`). Nothing is kept from a thumbnail.
|
|
95
|
+
|
|
68
96
|
- **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
97
|
- **Site:** live sites outweigh Dribbble shots.
|
|
70
98
|
|
|
71
|
-
|
|
99
|
+
If they say "go" or "you choose" instead of picking, pick from the pool yourself, closest to the brief, and say so in one line.
|
|
100
|
+
|
|
101
|
+
### 4. Write `board.md`
|
|
72
102
|
|
|
73
103
|
A few header lines, then one card per keep.
|
|
74
104
|
|
|
75
105
|
```
|
|
76
106
|
Asked: <feel, never feel, loves, or none>
|
|
77
107
|
Sources: <what was searched, and any skip: "Awwwards: no fit">
|
|
108
|
+
Picked: <the likes, by id, and what they share>
|
|
109
|
+
Noes: <what the noes share, or none>
|
|
78
110
|
Missing: <what the search could not find, or none>
|
|
79
111
|
|
|
80
112
|
### <name>
|
|
81
113
|
- link: <the page a person can open, or "none (shared in chat)">
|
|
82
114
|
- shot: design-exploration/<slug>/refs/<file>
|
|
83
|
-
- pattern: <the idea
|
|
115
|
+
- pattern: <the idea that inspires, about six words: a layout, an arrangement, a way of showing data, a voice>
|
|
84
116
|
- why: <why it fits this brief, one line>
|
|
85
117
|
```
|
|
86
118
|
|
|
87
119
|
`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
120
|
|
|
89
|
-
###
|
|
121
|
+
### 5. Lead on the moodboard
|
|
90
122
|
|
|
91
123
|
```
|
|
92
124
|
node <skill>/scripts/moodboard.mjs design-exploration/<slug>/board.md --out design-exploration/<slug>/moodboard.html
|
|
@@ -94,11 +126,11 @@ node <skill>/scripts/moodboard.mjs design-exploration/<slug>/board.md --out desi
|
|
|
94
126
|
|
|
95
127
|
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
128
|
|
|
97
|
-
> Which one leads,
|
|
129
|
+
> Which one leads, and does any feel wrong next to the others?
|
|
98
130
|
|
|
99
131
|
If they say "you choose", take the closest to the brief and say which.
|
|
100
132
|
|
|
101
|
-
###
|
|
133
|
+
### 6. Write `direction.md`
|
|
102
134
|
|
|
103
135
|
From their answer. Short: it is read by `design`, not by a client.
|
|
104
136
|
|
|
@@ -109,10 +141,10 @@ Proposal, not official. design turns this into screens. Only an approved prototy
|
|
|
109
141
|
|
|
110
142
|
- idea: <the one thing this product's look says, in one sentence>
|
|
111
143
|
- feel: <their words for feel and never feel>
|
|
112
|
-
- patterns: <what
|
|
144
|
+
- patterns: <what inspires us, each with its reference: a layout, an arrangement, a kind of picture, a way of moving>
|
|
113
145
|
- 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
146
|
- voice: <how it talks: three adjectives and one sample line in that voice>
|
|
115
|
-
- leave: <what
|
|
147
|
+
- leave: <what stays behind: each reference's name, colours and typefaces, what their noes share, and whatever they said feels wrong>
|
|
116
148
|
|
|
117
149
|
## References
|
|
118
150
|
- leads: <card> — <link>
|
|
@@ -143,15 +175,16 @@ Usually called from `design` when a key screen has a gap no reference covers. Sa
|
|
|
143
175
|
- <…>
|
|
144
176
|
```
|
|
145
177
|
|
|
146
|
-
3.
|
|
147
|
-
4.
|
|
148
|
-
5. Write
|
|
178
|
+
3. Build a pool of 20 to 40. Include the same piece in other subjects. For a gap software has not solved, search outside software for the same form.
|
|
179
|
+
4. One picker round, no round 2. Keep up to the number asked (default 8 for one piece) from their likes, opened at full size.
|
|
180
|
+
5. Write `design-exploration/<slug>/board.md`, run the moodboard, and ask which they would take.
|
|
181
|
+
6. Write a short `direction.md` for the piece: `patterns`, `leave`, and the references. Hand back to `design`.
|
|
149
182
|
|
|
150
183
|
## Do not
|
|
151
184
|
|
|
152
185
|
- 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
|
|
155
|
-
- Screenshot a listing
|
|
186
|
+
- Search before the three questions are answered, answer them yourself, or ask them a second round of questions. Run a third picker round.
|
|
187
|
+
- Cut the pool for taste before they pick. Pad the keep by lowering the filter. Keep a shot nobody opened at full size.
|
|
188
|
+
- Screenshot a source's listing or search page, or a candidate you are not keeping. Never stitch screenshots.
|
|
156
189
|
- Name a reference in `direction.md`'s idea, patterns or ownable as the thing to copy. Name the pattern.
|
|
157
190
|
- Put notes or skill feedback under `design-exploration/`. Use the chat.
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Sources: what to keep, and how to get the shot
|
|
2
2
|
|
|
3
|
+
## Thumbnails for the picker
|
|
4
|
+
|
|
5
|
+
Each picker row takes its title, thumbnail and link from the same card on the listing page, so a pick always opens the thing that was picked. Hotlink the thumbnail and never save it. Use the smallest size that still reads at about 400 px wide. The link is the item's own page, never the listing. These were checked by reading the plain listing HTML, without a login (2026-11-14):
|
|
6
|
+
|
|
7
|
+
- **Dribbble:** `dribbble-cards.mjs --picker` prints the rows.
|
|
8
|
+
- **Awwwards:** use `/websites/sites_of_the_day/`, which already meets the award floor. Each card's `figure-rollover__link` has the title (`aria-label`) and the site page (`/sites/<slug>`), and its image's `data-srcset` has the `thumb_440_330` size.
|
|
9
|
+
- **Recent:** each card's image is the poster (`…/recording/poster/640.webp`). The link next to it is labelled `View post: <title>` and goes to `/i/<id>-<slug>`.
|
|
10
|
+
- **Dark Mode Design:** each card is a link to the live site around an image whose `alt` is the title.
|
|
11
|
+
- **Wikimedia Commons:** `thumburl`, with `descriptionurl` as the link.
|
|
12
|
+
|
|
13
|
+
**siteinspire** refuses scripted requests to its listing (429), so it is not in the picker. Do not work around a site that refuses scripts. If they tick it anyway, say so, and take any siteinspire page they paste as a seed.
|
|
14
|
+
|
|
15
|
+
A source whose cards you cannot read is not in the picker. Say so under `Sources:`. Never screenshot a listing to fake one.
|
|
16
|
+
|
|
17
|
+
## Keeping
|
|
18
|
+
|
|
3
19
|
A nominee is not a reference. Open it full size and drop anything weak before it goes on the board. A weak pass means fewer keeps, not a lower bar.
|
|
4
20
|
|
|
5
21
|
## Galleries
|
|
@@ -17,14 +33,17 @@ Listing pages render in the browser, and shot pages hit human verification. Use
|
|
|
17
33
|
node <skill>/scripts/dribbble-cards.mjs "https://dribbble.com/search/shots/popular/product-design?q=text+editor+screen&timeframe=year" --scrolls 4
|
|
18
34
|
```
|
|
19
35
|
|
|
20
|
-
It prints `id-slug`, likes, views, image URL, and title. It drops merch, CVs, worksheets, posters, logos, and tool ads by slug and title. Extend that list with `--drop "a,b"` and relax it with `--keep "a,b"`.
|
|
36
|
+
It prints `id-slug`, likes, views, designer, image URL, and title, sorted by likes. With `--picker` it prints picker rows instead (title, thumbnail, shot page, `dribbble`, designer and likes), ready to append to `candidates.tsv`. It drops shots under 100 likes (`--min-likes` changes that), and merch, CVs, worksheets, posters, logos, and tool ads by slug and title. Extend that list with `--drop "a,b"` and relax it with `--keep "a,b"`. Save the image from `cdn.dribbble.com` (`<url>?resize=1600x1200`).
|
|
21
37
|
|
|
22
38
|
- Use a category path and the form, not the word: `/product-design?q=…`, `/mobile?q=…`, `/web-design?q=…`.
|
|
23
39
|
- If most of what gets through is off-form, the query is wrong. Fix the query rather than scrolling further.
|
|
24
40
|
- 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.
|
|
41
|
+
- A thin query ignores `timeframe=year`: the shot ids show it.
|
|
26
42
|
- 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
|
-
-
|
|
43
|
+
- **Popular is not good.** Dribbble's popular order mixes likes with recency, so the top of a listing is often just new. Rank by likes, never by position on the page.
|
|
44
|
+
- **Likes grow with age.** Shot ids rise over time, so compare likes between shots of similar id. A shot whose id is far below the rest is years old: keep it only if nothing about it looks dated.
|
|
45
|
+
- **Judge the designer, not only the shot.** One designer with several near-identical shots in a listing is a concept studio: keep at most one of theirs.
|
|
46
|
+
- For the pool, the mechanical cuts are enough: off-topic, the likes floor, one per near-identical designer. At the shortlist, keep a shot when you can name its idea in one line, it stands out on likes in its own listing, and it looks current. Drop AI mush, fake browser chrome, purple-on-dark gradients, Inter everywhere, and emoji icons.
|
|
28
47
|
- A Dribbble illustration is imagery, never a site.
|
|
29
48
|
|
|
30
49
|
## Cropping a downloaded image
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// List Dribbble search/popular cards from a listing URL.
|
|
3
|
-
// Headless Chrome; prints TSV: id-slug\tlikes\tviews\timageURL\ttitle
|
|
3
|
+
// Headless Chrome; prints TSV: id-slug\tlikes\tviews\tdesigner\timageURL\ttitle
|
|
4
4
|
// Counts come from the card's own stat elements. A column it cannot read
|
|
5
5
|
// stays empty. It never guesses a count from the title.
|
|
6
6
|
//
|
|
7
|
+
// Dribbble's "popular" order mixes likes with recency, so page order is not
|
|
8
|
+
// quality. Rows come out sorted by likes, most first, and a card under
|
|
9
|
+
// --min-likes (default 100) is dropped. A card whose likes cannot be read
|
|
10
|
+
// is kept, last.
|
|
11
|
+
//
|
|
7
12
|
// Off-topic cards (merch, resumes, worksheets, posters) are dropped by slug
|
|
8
13
|
// and title before anything is fetched, and the noise rate goes to stderr.
|
|
9
14
|
//
|
|
10
15
|
// node dribbble-cards.mjs "https://dribbble.com/search/shots/popular/product-design?q=writing+app&timeframe=year" --scrolls 4
|
|
11
16
|
// node dribbble-cards.mjs "<url>" --drop "mood,habit" --keep "font,illustration"
|
|
17
|
+
// node dribbble-cards.mjs "<url>" --min-likes 300
|
|
18
|
+
// node dribbble-cards.mjs "<url>" --picker >> candidates.tsv # rows for picker.mjs
|
|
12
19
|
import { spawn } from "node:child_process";
|
|
13
20
|
import { existsSync, mkdtempSync, rmSync } from "node:fs";
|
|
14
21
|
import { tmpdir } from "node:os";
|
|
@@ -31,6 +38,8 @@ const has = (name) => {
|
|
|
31
38
|
const url = args[0];
|
|
32
39
|
const scrolls = Math.max(0, Number(flag("scrolls", "3")) || 3);
|
|
33
40
|
const noFilter = has("no-filter");
|
|
41
|
+
const forPicker = has("picker");
|
|
42
|
+
const minLikes = Math.max(0, Number(flag("min-likes", "100")) || 0);
|
|
34
43
|
const words = (s) =>
|
|
35
44
|
String(s || "")
|
|
36
45
|
.toLowerCase()
|
|
@@ -56,7 +65,7 @@ const keep = words(flag("keep", ""));
|
|
|
56
65
|
const dropWords = [...OFF_TOPIC.filter((w) => !keep.includes(w)), ...words(flag("drop", ""))];
|
|
57
66
|
if (!url || !/^https?:\/\/(www\.)?dribbble\.com\//i.test(url)) {
|
|
58
67
|
console.error(
|
|
59
|
-
'usage: node dribbble-cards.mjs "https://dribbble.com/search/..." [--scrolls 4] [--drop "a,b"] [--keep "a,b"] [--no-filter]',
|
|
68
|
+
'usage: node dribbble-cards.mjs "https://dribbble.com/search/..." [--scrolls 4] [--min-likes 100] [--drop "a,b"] [--keep "a,b"] [--no-filter] [--picker]',
|
|
60
69
|
);
|
|
61
70
|
process.exit(2);
|
|
62
71
|
}
|
|
@@ -68,6 +77,14 @@ function offTopic(text) {
|
|
|
68
77
|
return dropWords.find((word) => hay.includes(` ${word.replace(/[^a-z0-9]+/g, " ")} `)) || "";
|
|
69
78
|
}
|
|
70
79
|
|
|
80
|
+
// "15.7k" -> 15700. An unreadable count is NaN, never 0.
|
|
81
|
+
function count(text) {
|
|
82
|
+
const m = String(text || "").replace(/,/g, "").match(/^([\d.]+)([kKmM]?)$/);
|
|
83
|
+
if (!m) return NaN;
|
|
84
|
+
const n = Number(m[1]) * ({ k: 1e3, m: 1e6 }[m[2].toLowerCase()] || 1);
|
|
85
|
+
return Number.isFinite(n) ? n : NaN;
|
|
86
|
+
}
|
|
87
|
+
|
|
71
88
|
function findChrome() {
|
|
72
89
|
const env = process.env.CHROME_PATH;
|
|
73
90
|
if (env && existsSync(env)) return env;
|
|
@@ -264,8 +281,11 @@ const { result } = await page("Runtime.evaluate", {
|
|
|
264
281
|
likes = counts[0] || "";
|
|
265
282
|
views = counts[1] || "";
|
|
266
283
|
}
|
|
284
|
+
// The profile handle, from the card's own designer link.
|
|
285
|
+
const who = li.querySelector('.user-information a[href^="/"]');
|
|
286
|
+
const designer = who ? (who.getAttribute("href") || "").replace(/^\\/|[?#].*$/g, "") : "";
|
|
267
287
|
const title = (img.getAttribute("alt") || a.getAttribute("title") || idSlug).replace(/\\t/g, " ").trim();
|
|
268
|
-
rows.push([idSlug, likes, views, imageURL, title].join("\\t"));
|
|
288
|
+
rows.push([idSlug, likes, views, designer, imageURL, title].join("\\t"));
|
|
269
289
|
}
|
|
270
290
|
return rows.join("\\n");
|
|
271
291
|
})()`,
|
|
@@ -286,7 +306,7 @@ const reasons = new Map();
|
|
|
286
306
|
const kept = noFilter
|
|
287
307
|
? all
|
|
288
308
|
: all.filter((row) => {
|
|
289
|
-
const [idSlug, , , , title = ""] = row.split("\t");
|
|
309
|
+
const [idSlug, , , , , title = ""] = row.split("\t");
|
|
290
310
|
const word = offTopic(`${idSlug} ${title}`);
|
|
291
311
|
if (!word) return true;
|
|
292
312
|
reasons.set(word, (reasons.get(word) ?? 0) + 1);
|
|
@@ -310,6 +330,27 @@ if (!kept.length) {
|
|
|
310
330
|
drop();
|
|
311
331
|
process.exit(1);
|
|
312
332
|
}
|
|
313
|
-
|
|
333
|
+
// Likes are the signal people valued a shot. Sort by them, and drop the
|
|
334
|
+
// ones under the floor. An unreadable count is kept, last, so a markup
|
|
335
|
+
// change shows as empty columns instead of an empty list.
|
|
336
|
+
const likesOf = (row) => count(row.split("\t")[1]);
|
|
337
|
+
const strong = kept.filter((row) => !(likesOf(row) < minLikes));
|
|
338
|
+
const weak = kept.length - strong.length;
|
|
339
|
+
if (weak > 0) {
|
|
340
|
+
console.error(`${weak} of ${kept.length} under ${minLikes} likes, dropped (lower it with --min-likes)`);
|
|
341
|
+
}
|
|
342
|
+
if (!strong.length) {
|
|
343
|
+
console.error("every card was under the likes floor — try a broader form or timeframe before lowering it");
|
|
344
|
+
drop();
|
|
345
|
+
process.exit(1);
|
|
346
|
+
}
|
|
347
|
+
strong.sort((a, b) => (likesOf(b) || -1) - (likesOf(a) || -1));
|
|
348
|
+
// --picker prints picker.mjs rows: title, thumbnail, shot page, source, meta.
|
|
349
|
+
const asPicker = (row) => {
|
|
350
|
+
const [idSlug, likes, , designer, imageURL, title] = row.split("\t");
|
|
351
|
+
const meta = [designer, likes && `${likes} likes`].filter(Boolean).join(" · ");
|
|
352
|
+
return [title, `${imageURL}?resize=400x300`, `https://dribbble.com/shots/${idSlug}`, "dribbble", meta].join("\t");
|
|
353
|
+
};
|
|
354
|
+
console.log((forPicker ? strong.map(asPicker) : strong).join("\n"));
|
|
314
355
|
drop();
|
|
315
356
|
process.exit(0);
|
|
@@ -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, "&")
|
|
58
|
+
.replace(/</g, "<")
|
|
59
|
+
.replace(/>/g, ">")
|
|
60
|
+
.replace(/"/g, """)
|
|
61
|
+
.replace(/'/g, "'");
|
|
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);
|
package/skills/idea/SKILL.md
CHANGED
|
@@ -19,7 +19,7 @@ The brief says what and for whom, never how. No framework, database, host or lib
|
|
|
19
19
|
|
|
20
20
|
Look at the repo. Do not ask what is there.
|
|
21
21
|
|
|
22
|
-
1. `docs/brief.md` exists and they bring a feature → not this skill. Grill the feature
|
|
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
23
|
2. `docs/brief.md` exists and the product itself changes (new people, new surface, a flow dropped) → **Change**.
|
|
24
24
|
3. No brief, and the repo has code or a README → **Existing project**.
|
|
25
25
|
4. Otherwise → **New idea**.
|
|
@@ -35,10 +35,12 @@ Load Matt's `grilling` and run it. The design tree is the brief's sections below
|
|
|
35
35
|
|
|
36
36
|
## Existing project
|
|
37
37
|
|
|
38
|
-
Read the README, the package manifest, the routes or entry points,
|
|
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
39
|
|
|
40
40
|
Show the draft, then grill only the gaps, in rounds. Same confirm, same write.
|
|
41
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
|
+
|
|
42
44
|
## Change
|
|
43
45
|
|
|
44
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.
|
|
@@ -88,10 +90,11 @@ Read the brief. Grill only what changes and what hangs off it: a new surface reo
|
|
|
88
90
|
|
|
89
91
|
## After writing
|
|
90
92
|
|
|
91
|
-
Offer the next stage in one line:
|
|
93
|
+
Offer the next stage in one line. A stage whose file already exists is done, so go past it:
|
|
92
94
|
|
|
93
|
-
-
|
|
94
|
-
- No UI → stages 2 and 3 are skipped. Next is Architecture:
|
|
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.
|
|
95
98
|
|
|
96
99
|
Do not start it until they say so.
|
|
97
100
|
|