@jonandev/longbeard 0.0.0-stage → 0.2.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/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "@jonandev/longbeard",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Drop into a project so the agents you already use produce better work.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/jonanderdev/longbeard.git"
9
+ },
10
+ "homepage": "https://github.com/jonanderdev/longbeard#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/jonanderdev/longbeard/issues"
13
+ },
14
+ "keywords": [
15
+ "design",
16
+ "frontend",
17
+ "ui",
18
+ "code",
19
+ "figma",
20
+ "agents",
21
+ "skills",
22
+ "cursor",
23
+ "claude"
24
+ ],
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "type": "module",
29
+ "bin": {
30
+ "longbeard": "./bin/long-beard.js"
31
+ },
32
+ "files": [
33
+ "bin",
34
+ "beard.json",
35
+ "AGENTS.md",
36
+ "CHANGELOG.md",
37
+ "skills"
38
+ ],
39
+ "engines": {
40
+ "node": ">=18"
41
+ },
42
+ "scripts": {
43
+ "longbeard": "node ./bin/long-beard.js"
44
+ }
45
+ }
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: design-md
3
+ description: >
4
+ Use when building or changing UI and the project has a DESIGN.md, or when
5
+ the user asks to write or follow a brand file. Follow that file.
6
+ If they asked to design a page and there is no DESIGN.md and no Figma,
7
+ that is design-reference-hunt, not this skill. Do not invent a look.
8
+ ---
9
+
10
+ # DESIGN.md
11
+
12
+ The project's `DESIGN.md` is the look.
13
+
14
+ If that file exists, read it before writing UI. Use its color, type, spacing, and components the way that file states them. They asked to **hunt references** → load `design-reference-hunt`. Do not rewrite this file from that hunt.
15
+
16
+ If it does not exist:
17
+
18
+ - They asked to **design a page or a piece** and there is no Figma → load `design-reference-hunt`. Do not ask what the brand is.
19
+ - They asked to **hunt references** → load `design-reference-hunt`.
20
+ - They asked for a **brand file / DESIGN.md** → ask which reference to follow. Write the file only when they want one.
21
+
22
+ Leave brand catalogs out of the repo. Leave a second visual system out when one already exists.
@@ -0,0 +1,213 @@
1
+ ---
2
+ name: design-reference-hunt
3
+ description: >
4
+ Find real visual references. With no official look (no DESIGN.md, no
5
+ Figma link, no .design/board.md), ask once if they have a Figma file;
6
+ if they paste one, stop hunting. If not, do the full hunt and write
7
+ .design/board.md. Look widely. Scroll and screenshot only what you
8
+ keep. A website aims for 10 live award sites this year; those outweigh
9
+ Dribbble, which is up to 20. An application aims for up to 20 screen
10
+ shots; those outweigh award sites. A short board names each drop.
11
+ Cover the same job and also the page type, component, or element,
12
+ including other subjects. The shot files are the evidence. The board’s
13
+ cards are written in the shape taste already reads: idea, hero, type,
14
+ colour, worth taking. A short “Read this” at the top is for a person,
15
+ or for a builder that is not taste. Before looking, ask once for
16
+ optional ideas or concepts to search. They asked to hunt while a
17
+ direction or a design already exists (a view, a button, new ideas, a
18
+ double-check): keep the suggestion set in .design/hunts/<slug>/ and
19
+ do not replace the board, DESIGN.md, or a Figma file. Only keep
20
+ high-rated Awwwards (not weak nominees) and strongly voted Dribbble.
21
+ Use when they ask to design a page or a piece and no direction exists
22
+ yet, or when they ask to hunt references.
23
+ This skill writes the references. Taste builds from the board cards.
24
+ This file does not say how to lay the page out.
25
+ ---
26
+
27
+ # Reference hunt
28
+
29
+ No official look, and they asked to design → this skill writes a board. They asked to hunt references → this skill writes a suggestion set, including when a direction or a design already exists. Then **keep going and build from the board** only on the whole-look path. Which builder to load is the project’s router, not this file. A later hunt does not replace the look.
30
+
31
+ Read [quality.md](references/quality.md) before you keep a reference. Weak nominees and generic Dribbble do not go on the board.
32
+
33
+ A Dribbble illustration is **imagery**, not a website. A Dribbble shot of a real screen can be a screen reference. It is never a Site.
34
+
35
+ ## Where files go
36
+
37
+ Two places. They do not share shots.
38
+
39
+ - **Board** — the one full hunt when this project has no look. `.design/board.md` and `.design/refs/`. Taste reads this file. One board.
40
+ - **Hunt** — every other pass. `.design/hunts/<slug>/note.md` and `.design/hunts/<slug>/refs/`. A suggestion set for that pass. It does not replace the board, `DESIGN.md`, or a Figma file.
41
+
42
+ `<slug>` names what the pass is for: `pricing`, `primary-button`, `settings`, `home-ideas`, `home-check`. If that folder exists, use `<slug>-2`, then `<slug>-3`. Never overwrite a hunt. Never delete one. Leave an old `.design/piece.md` where it is. Do not write a new one.
43
+
44
+ A file in `.design/refs/` that the board does not cite gets deleted. A file in a hunt’s `refs/` that its note does not cite gets deleted. Do not delete across those folders.
45
+
46
+ ## Gate (do this first)
47
+
48
+ Check the repo and the prompt, in order. Stop at the first hit.
49
+
50
+ 1. They did not ask to hunt, and `DESIGN.md` exists → follow it. Do not hunt a whole look.
51
+ 2. They did not ask to hunt, and the prompt has a Figma file or link → implement from that file. Do not hunt.
52
+ 3. They did not ask to hunt, and `.design/board.md` exists → whole look is done when **Read this** names a primary card, that card’s hero names the control, and any shortfall is named. Aims: a website, 10 live sites and up to 20 screens; an application, up to 20 screens and not an Awwwards set. Imagery is up to 10. A short board that does not name each drop is unfinished: finish the hunt. Missing control: open the shot and write it, then build. Or run **Later hunt** if they asked for a section.
53
+ 4. They asked to hunt a view, a control, a section, new ideas, or a double-check → **Later hunt**. A direction or a design already in the project does not block this. Do not ask for a Figma file.
54
+ 5. Otherwise, for a **whole look** only: ask **once**, and wait:
55
+
56
+ Do you have a Figma file for this, or should I hunt references? If I hunt, any ideas or concepts to search for are optional.
57
+
58
+ - They paste a Figma link → implement from Figma. Stop hunting.
59
+ - They say no, skip, or “hunt” → **Whole look** below. Concepts they added ride along. If they added none, do not ask again.
60
+
61
+ Do not ask whether DESIGN.md exists; look for the file.
62
+
63
+ ## Concepts
64
+
65
+ On a later hunt, ask **once** before looking, and wait:
66
+
67
+ Any ideas or concepts to search for? Optional. Skip, and the search follows the subject alone.
68
+
69
+ On a whole look, that question is already in the Figma message. Do not ask it twice.
70
+
71
+ Their words go into the queries, with the subject, the page type, and the element. They do not lower the quality filter. If a concept fights the topic, keep the topic. Write the words on the board as `Asked:`, or on the hunt note as `asked:`. None is valid.
72
+
73
+ ## Whole look
74
+
75
+ No `DESIGN.md`, no Figma, no `.design/board.md`. The first time this project needs a look. A direction that already exists, or a hunt they asked for beside a design, is **Later hunt**, not this.
76
+
77
+ Say once, in one line, what you are looking for, and that the closest come back as a short list. Then look without narrating. No scores, no drops, and no site called interesting until that list.
78
+
79
+ Look, then keep. The counts below are what you **keep**. They are not how many you open. Read listings and score pages until the keep is full of ones that pass [quality.md](references/quality.md), and do not stop at the first page. There is no small cap on looking. A website looks through at least 30 live candidates before it accepts fewer than 10 sites, and through the popular Dribbble sort (and the other-subject queries) before it accepts fewer than the screens it could have kept. If that pass is weak, look at the next gallery. A thin field stays thin: name each drop, and do not lower the filter to fill the count.
80
+
81
+ Scroll and screenshot only a keep. Do not scroll a candidate. Do not screenshot a listing, a score page, or a URL you might drop. The capture script scrolls; run it only on a keep. A file in `.design/refs/` that is not on the board gets deleted. Leave `.design/hunts/` alone.
82
+
83
+ 1. Name the subject and the **surface**: `website` or `app`.
84
+ 2. This year’s date. Do not search only the same subject. Also search the page type, the component, and the element, including other subjects that share that form. Add their concepts when they gave some. Filter with [quality.md](references/quality.md).
85
+ - **Website — Sites (aim 10), mixed `fit`:** live URLs from this year. These outweigh Dribbble. Prefer Awwwards SOTD / high scores (overall and Design ≥ 7.5; never 4s). Also Godly, Land-book, siteinspire. Aim `same-job` 2, `register` 2, `form` 6. `same-job` is this subject. `register` shares its feeling: the hour, the material, the ritual, or the kind of place. `form` is another type of business. From it, take only a layout or a component that still works once this topic’s pictures and words are in the frame. If that frame only makes sense for the other type, drop it. Not its type, and not its colours. Leave their identity. An older site only when nothing current has that structure.
86
+ - **Website — Screens (up to 20):** strongly voted Dribbble from this year, after the quality filter. They lose to a kept site. Tag `role: page | component | element` and `subject: same-job | other`. An illustration stays imagery. These are not Sites.
87
+ - **App — Products (up to 6):** public product pages of this job. Not Awwwards, not a campaign site. Fewer is valid when the board names each drop (a login wall, no public page).
88
+ - **App — Screens (up to 20):** strongly voted Dribbble and component galleries. These outweigh product pages and award sites. The shot is the screen, a component, or an element. Other subjects that share that role count. An illustration stays imagery. Do not fill this board with Awwwards.
89
+ - **Imagery (up to 10):** this subject’s world (Unsplash, Wikimedia, museums). Not stock category. A file counts when a crop can make the principle the subject. Drop the rest. Do not pad.
90
+ - **Type / marks (1–2):** a pairing or a stamp you can name.
91
+ 3. Scroll and screenshot only a keep. `node <skill>/scripts/capture.mjs <url> --out .design/refs/<name>.jpg` for that URL only. Do not stitch. How: [shots.md](references/shots.md). Jury quotes only from an Awwwards page you kept. Dribbble: the shot artwork of a keep, not the search grid.
92
+ 4. Write `.design/board.md`. One file, two layers. **Read this** is a few lines a person can read. **Cards** are the references, in the shape taste already reads. A website is valid at 10 sites, or short when each missing site is named after the 30-candidate look. Screens are up to 20. An application is valid with its screens, and invalid if the spine is Awwwards. A short one names each missing screen. Imagery is up to 10. Products are up to 6. Do not pad by lowering the filter. Hexes come from a kept shot, not a palette library. Later pages reuse it. Do not write a second board. A later pass is a hunt folder. Do not build from a board that is short and does not name each drop.
93
+
94
+ `Asked:` sits above **Read this**. It is not a card.
95
+
96
+ **Read this** is written from the cards, after they choose. The primary card is the closest to this subject, not the largest type and not the highest score. Closest means the subject’s world is in the shot: the same job, or a register that shares its hour, its material, its ritual, or its kind of place. Colour and type come from that card, or from this subject’s pictures. A form card does not supply them. It can only add a layout or a component that still belongs on this topic.
97
+
98
+ Before you write **Read this**, ask once, and wait. That message names the two or three closest cards. Each one has its idea in one line, why it is close, and the live URL, so the page can be opened. It also says the shots and the other cards are in `.design/board.md`. It does not list scores, drops, or the other keeps. Their answer is the primary card. If they say you should choose, take the closest.
99
+
100
+ ```
101
+ Asked: <concepts, or none>
102
+
103
+ ## Read this
104
+ - primary: <card name>
105
+ - also: <one other card>
106
+ - control: <as that card’s hero describes it: text link, filled shape, or absent, and where it sits>
107
+ - colour: <where it sits in the shot>
108
+ - type: <the pairing>
109
+ - leave: <one line>
110
+ ```
111
+
112
+ Each site, product page, or screen is a card, written from the open shot file. `role` is required on `form`. A hero that says “one action” and does not say what the control is does not count. On a website the primary card is the closest live site, not a form site chosen for its type. On an application it is a screen, not an award site.
113
+
114
+ ```
115
+ ### <name>
116
+ - source:
117
+ - score:
118
+ - fit: same-job | register | form
119
+ - role: page | component | element
120
+ - subject: same-job | other
121
+ - url:
122
+ - shot: .design/refs/<file>
123
+ - idea: <one sentence. The principle, not their name>
124
+ - hero: <what is in the frame. The control: text link, filled shape, or absent, and where it sits>
125
+ - type: <the faces, and how the shot uses them>
126
+ - colour: <hexes you can see, and where each sits. A colour is a button fill only when the shot fills a button with it>
127
+ - imagery: <what the pictures are>
128
+ - worth taking: <one principle. On a form card: a layout or a component only, and only if it still works on this topic. Not their type. Not their colours>
129
+ - leave: <their identity, and anything that is not the principle>
130
+ ```
131
+
132
+ Imagery and type stay short. They are material, not cards.
133
+
134
+ ```
135
+ - kind: imagery | type
136
+ - url:
137
+ - shot: .design/refs/<file>
138
+ - shows:
139
+ - leave:
140
+ ```
141
+
142
+ The cards are the references. The shot files are the evidence.
143
+
144
+ ## Later hunt
145
+
146
+ A suggestion set. Use it when they named a view, a section, a component, or a control; when they asked for new ideas or a double-check; when a direction exists and they asked to hunt; or when there is no look yet and they asked only for this piece.
147
+
148
+ Ask the concepts question once, then look. Do not ask for a Figma file.
149
+
150
+ `status` is the project at the start of this pass:
151
+
152
+ - `no-direction` — no `DESIGN.md`, no Figma, no finished board
153
+ - `has-direction` — one of those exists
154
+ - `has-design` — the screen or the page is already designed (they said so, or it is in the repo). Use this when both are true.
155
+
156
+ `intent` is what they asked for: `piece` (a view, section, component, or element), `ideas` (new directions), or `check` (a double-check of a look that exists).
157
+
158
+ 1. Name `for` (hero, menu, pricing, a button, the whole look, …) and, for a piece, its role: page, component, or element. Slug the folder from that name.
159
+ 2. **Keep 10** after the quality filter when `for` is a piece. Not 20. Look through more than 10 before you choose, including the same role in other subjects. A whole-look `ideas` or `check` pass uses the **Whole look** keep counts, written in the hunt folder, not in `.design/board.md`. Name each drop. Do not pad. Dribbble (popular, this year), Land-book, Godly, component galleries, Unsplash for imagery. Add their concepts when they gave some. Capture only what you keep. Crop to the **shot**, not the gallery. Live sites only if the piece is a whole block on a real page.
160
+ 3. Tag each: `kind: section | component | imagery | type | mark` and `subject: same-job | other`. Do not file a drawing as a section.
161
+ 4. Write `.design/hunts/<slug>/note.md`. Shots only in `.design/hunts/<slug>/refs/`. `node <skill>/scripts/capture.mjs <url> --out .design/hunts/<slug>/refs/<name>.jpg`. Do **not** replace `.design/board.md`, `DESIGN.md`, or `.design/refs/`. If a board or `DESIGN.md` exists, a piece takes a layout principle from these refs and keeps that look’s colour and type.
162
+
163
+ ```
164
+ # Hunt
165
+ status: no-direction | has-direction | has-design
166
+ intent: piece | ideas | check
167
+ for: <hero / primary button / whole look>
168
+ asked: <concepts, or none>
169
+ replaces: nothing
170
+ ### <name>
171
+ - kind: section | component | imagery | type | mark
172
+ - subject: same-job | other
173
+ - url:
174
+ - shot: .design/hunts/<slug>/refs/<file>
175
+ - idea:
176
+ - hero: <the frame, and the control>
177
+ - worth taking:
178
+ - leave:
179
+ Read this: <one sentence, from the cards. Suggestions for this pass. They do not replace the board, DESIGN.md, or a Figma file.>
180
+ ```
181
+
182
+ The note is the suggestion set for that status and that `for`. Building, if they also asked to build, is the project’s router after the note exists. This skill does not rewrite the board or `DESIGN.md` to match the note.
183
+
184
+ ## After the board
185
+
186
+ Do not end the turn on the cards. In the chat, name only the two or three closest, each with its live URL, and say the shots are in `.design/board.md`. Then wait. After they answer, write **Read this**, say it in the chat, and build. The cards stay in the file.
187
+
188
+ After a later hunt, name the two or three closest the same way, and say the shots are in `.design/hunts/<slug>/`. Say that this pass does not change the existing look.
189
+
190
+ The cards are the references. Do not deal a library of other ones. On a website the site cards outweigh the screen cards. On an application the screen cards outweigh award sites. How the page is built — scale, grid, sections, motion — belongs to the builder, and with this kit that builder is taste. The control in the primary card is the control. Do not add a filled button the card does not show. Do not lower the score for that. A custom cursor, a password gate, or a WebGL scene is used only when a card shows it.
191
+
192
+ ## Do not
193
+
194
+ - Keep an Awwwards nominee with 4s or overall under 7.5.
195
+ - Stitch viewport screenshots. A file that repeats one fold is invalid.
196
+ - Screenshot a gallery listing.
197
+ - Put files under `.claude/`.
198
+ - Put layout steps in this file. The description may name taste as the reader of the cards.
199
+ - Write a second `.design/board.md`. A later pass is a hunt folder.
200
+ - Overwrite or delete `.design/hunts/<slug>/`. Use the next free slug.
201
+ - Put a later hunt’s shots in `.design/refs/`, or delete a hunt shot because the board does not cite it.
202
+ - Change `DESIGN.md`, a Figma file, or the board from a later hunt.
203
+ - Write a new `.design/piece.md`.
204
+ - Pad the count by lowering the filter, or by keeping pictures you would not put on the page.
205
+ - Stop looking at the first page of results, or treat the keep count as the number of candidates you open.
206
+ - Scroll or screenshot a candidate. The capture script runs on a keep only.
207
+ - Narrate candidates, scores, or drops while looking. After the opening line, the next thing said is the short list of the closest, each with its live URL.
208
+ - Write a hero that does not say what the control is.
209
+ - Build from a short board that does not name each drop.
210
+ - Take colour or type from a card about another business.
211
+ - Let a card lead because its type is large, when a closer card has the subject’s world in the shot.
212
+ - Let a screen card be the primary card on a website, or an award site be the primary card on an application.
213
+ - Fill an application board with Awwwards.
@@ -0,0 +1,45 @@
1
+ # Keep the strong ones
2
+
3
+ A nominee is not a reference. Open the score (or the shot) and drop anything weak before it hits the board. The keep count is the board. Looking goes past it. A weak pass means fewer keeps, not a lower bar.
4
+
5
+ ## Awwwards
6
+
7
+ Look at the **Awwwards site page**, not the listing card.
8
+
9
+ Keep:
10
+
11
+ - Site of the Day, Site of the Month, Developer Award, or Site of the Year, **or**
12
+ - Honorable Mention / Nominee only if **overall ≥ 7.5** and **Design ≥ 7.5** (scores are /10).
13
+
14
+ Drop:
15
+
16
+ - Overall or Design at **6 or below**, and anything with **4s** on Design, Usability, or Creativity.
17
+ - Nominee-only with no SOTD/HM and a soft score.
18
+ - Gates, password walls, or a hero you cannot actually see.
19
+ - A high score whose offer only makes sense for another type of business. Keep that page only when a layout or a component still works once this topic’s pictures and words are in the frame. Do not take its type or its colours.
20
+
21
+ Quote jury lines only from that page, and only for sites you kept.
22
+
23
+ ## Godly, Land-book, siteinspire
24
+
25
+ Curated, not scored. Keep a site if the **live page** has a clear idea (a crop, a component, one arrangement). From another business, that idea has to be a layout or a component that still works on this topic. Drop their type and their colours. Drop generic SaaS: centred headline, three icon cards, soft gradient, Inter.
26
+
27
+ ## Dribbble / Behance
28
+
29
+ Open `/shots/...`, not search.
30
+
31
+ Sort this year by most saved or most liked. Latest is the wrong feed. Look through that sort, then the page type, the component, and the element, including other subjects. A whole-look board keeps up to 20 that pass this filter. On a website they lose to a kept live site. On an application they outweigh award sites. A piece hunt keeps 10. Open more than you keep. If the pass is weak, the board stays short. Do not lower the filter to finish the count.
32
+
33
+ Keep if you can name what is worth taking in one line (a crop, a type pairing, a palette, a component, a screen). The shot has to be one people actually saved.
34
+
35
+ Drop: AI mush, fake browser chrome around a 3-card landing, purple gradient on dark, Inter-everywhere, emoji icons, melted type, a shot whose only job is “bakery website mockup.”
36
+
37
+ A Dribbble drawing is **imagery**, never a site.
38
+
39
+ ## Unsplash / Wikimedia
40
+
41
+ Search **this** subject, not a stock category name. Drop posed lifestyle and fake product. One real place or material beats a pile of similar ones.
42
+
43
+ A file counts when you can point at a crop where that principle is the subject. If the thing you would leave is what the frame is about, drop it or write the crop. Do not keep ten near-misses to fill a count. The page may use fewer.
44
+
45
+ If a pass cannot fill the count without lowering these gates, hunt another gallery. Do not fill the board with 4s.
@@ -0,0 +1,44 @@
1
+ # The whole page, not the gallery, not only the hero
2
+
3
+ A reference is the design from top to bottom. The builder has to take how the **rest** of the page works, not only the first screen.
4
+
5
+ ## Live sites — the script is for a keep
6
+
7
+ Open as many listings and score pages as the hunt asks. Do not scroll a candidate, and do not screenshot one. Run the script only on a URL you are keeping. That run is the only scroll. Do not screenshot the tab by hand. Do not stitch folds. Stitching is what repeats a sticky hero down the file. A file in `.design/refs/` that is not on the board gets deleted. A later hunt keeps its own shots in `.design/hunts/<slug>/refs/`. Do not delete those because the board does not cite them. A file in that folder that its note does not cite gets deleted.
8
+
9
+ From the project root, for the board:
10
+
11
+ ```
12
+ node <skill>/scripts/capture.mjs https://example.com --out .design/refs/<name>.jpg
13
+ ```
14
+
15
+ For a later hunt:
16
+
17
+ ```
18
+ node <skill>/scripts/capture.mjs https://example.com --out .design/hunts/<slug>/refs/<name>.jpg
19
+ ```
20
+
21
+ The script opens Chrome, accepts a cookie button if it can, then scrolls a viewport at a time and pauses so pictures and reveals can finish. It pauses motion. It does not turn animations off, because that puts a revealed section back to blank. Then it unsticks `fixed`/`sticky` and takes **one** JPEG of the document. Node 22+. Chrome, Edge, or Chromium must be installed (`CHROME_PATH` if it is not in the usual place).
22
+
23
+ Then open the file. Write the hero and what is worth taking from it. A line you could have written without opening it does not count. Invalid if:
24
+
25
+ - the same band of the page appears twice (a stacked face, a repeated headline)
26
+ - a cookie dialog is still on it
27
+ - it is only the first screen of a long site
28
+ - most of the file is empty bands. Run the script once more. If the second file is still empty bands, the page is pinned or a canvas: write `coverage: fold`, keep a single viewport, and delete the tall file.
29
+
30
+ If it is invalid, delete it and run the script again. If the site will not scroll (WebGL, a locked canvas), say `coverage: fold` on the board, keep a **single** viewport shot, and find another scrolling site. Never glue folds by hand.
31
+
32
+ ## Open the piece
33
+
34
+ - Prefer a **live site**. Click through from Awwwards / Godly / Land-book to the actual URL, then run the script on that URL.
35
+ - Dribbble: open the **shot page** (`/shots/...`). Capture the artwork image only, not `/search`.
36
+ - Never capture a search grid, a home feed, or a listing of cards.
37
+
38
+ ## Dribbble / Behance / Unsplash — not sites
39
+
40
+ These are pictures, not pages. Capture the **image** (or the type specimen), no page chrome. An illustration goes under **Material** (`kind: imagery`, `type`, or `mark`). A shot of a real screen goes under **Screens**. Never under Sites.
41
+
42
+ Unsplash and Wikimedia: search the **subject**, not stock category.
43
+
44
+ A board entry whose `shot` is a gallery listing, a stitched repeat, or an illustration filed as a website does not count.
@@ -0,0 +1,248 @@
1
+ #!/usr/bin/env node
2
+ // Full-page capture. Unsticks fixed/sticky chrome first so Chrome does not
3
+ // repeat the same fold. Node 22+. Uses an installed Chrome/Edge/Chromium.
4
+ //
5
+ // node capture.mjs <url> --out .design/refs/name.jpg
6
+ import { spawn } from "node:child_process";
7
+ import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
8
+ import { tmpdir } from "node:os";
9
+ import { dirname, join, resolve } from "node:path";
10
+
11
+ const args = process.argv.slice(2);
12
+ const flag = (name, def) => {
13
+ const i = args.indexOf(`--${name}`);
14
+ if (i === -1) return def;
15
+ const v = args[i + 1];
16
+ args.splice(i, 2);
17
+ return v;
18
+ };
19
+ const url = args[0];
20
+ const out = resolve(flag("out", "") || "");
21
+ if (!url || !/^https?:\/\//.test(url) || !out) {
22
+ console.error("usage: node capture.mjs <https://url> --out .design/refs/name.jpg");
23
+ process.exit(2);
24
+ }
25
+
26
+ function findChrome() {
27
+ const env = process.env.CHROME_PATH;
28
+ if (env && existsSync(env)) return env;
29
+ const home = process.env.HOME || process.env.USERPROFILE || "";
30
+ const local = process.env.LOCALAPPDATA || "";
31
+ const pf = process.env.PROGRAMFILES || "C:\\Program Files";
32
+ const pf86 = process.env["PROGRAMFILES(X86)"] || "C:\\Program Files (x86)";
33
+ const candidates = [
34
+ join(pf, "Google/Chrome/Application/chrome.exe"),
35
+ join(pf86, "Google/Chrome/Application/chrome.exe"),
36
+ join(local, "Google/Chrome/Application/chrome.exe"),
37
+ join(pf, "Microsoft/Edge/Application/msedge.exe"),
38
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
39
+ "/Applications/Chromium.app/Contents/MacOS/Chromium",
40
+ "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
41
+ join(home, "Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),
42
+ "/usr/bin/google-chrome",
43
+ "/usr/bin/google-chrome-stable",
44
+ "/usr/bin/chromium",
45
+ "/usr/bin/chromium-browser",
46
+ ];
47
+ return candidates.find((path) => path && existsSync(path)) || null;
48
+ }
49
+
50
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
51
+
52
+ const exe = findChrome();
53
+ if (!exe) {
54
+ console.error("No Chrome/Edge/Chromium found. Install one or set CHROME_PATH.");
55
+ process.exit(1);
56
+ }
57
+ if (typeof WebSocket === "undefined") {
58
+ console.error("Node 22+ is required.");
59
+ process.exit(1);
60
+ }
61
+
62
+ const dir = mkdtempSync(join(tmpdir(), "hunt-chrome-"));
63
+ let proc;
64
+ const drop = () => {
65
+ try {
66
+ if (proc?.pid) process.kill(proc.pid, "SIGKILL");
67
+ } catch {}
68
+ try {
69
+ rmSync(dir, { recursive: true, force: true });
70
+ } catch {}
71
+ };
72
+ process.once("exit", drop);
73
+
74
+ proc = spawn(
75
+ exe,
76
+ [
77
+ "--headless=new",
78
+ "--remote-debugging-port=0",
79
+ `--user-data-dir=${dir}`,
80
+ "--no-first-run",
81
+ "--hide-scrollbars",
82
+ "--mute-audio",
83
+ "--force-color-profile=srgb",
84
+ "--window-size=1440,900",
85
+ "about:blank",
86
+ ],
87
+ { stdio: ["ignore", "ignore", "pipe"] },
88
+ );
89
+
90
+ let buf = "";
91
+ const wsUrl = await new Promise((resolveWs, reject) => {
92
+ const t = setTimeout(() => reject(new Error("Chrome did not start")), 20000);
93
+ proc.stderr.on("data", (d) => {
94
+ buf += d.toString();
95
+ const m = buf.match(/DevTools listening on (ws:\/\/[^\s]+)/);
96
+ if (m) {
97
+ clearTimeout(t);
98
+ resolveWs(m[1]);
99
+ }
100
+ });
101
+ proc.on("exit", (code) => {
102
+ clearTimeout(t);
103
+ reject(new Error(`Chrome exited ${code}`));
104
+ });
105
+ });
106
+
107
+ const ws = new WebSocket(wsUrl);
108
+ await new Promise((res, rej) => {
109
+ ws.onopen = res;
110
+ ws.onerror = () => rej(new Error("CDP socket failed"));
111
+ });
112
+ let nextId = 1;
113
+ const pending = new Map();
114
+ ws.onmessage = (ev) => {
115
+ const msg = JSON.parse(typeof ev.data === "string" ? ev.data : Buffer.from(ev.data).toString());
116
+ if (msg.id && pending.has(msg.id)) {
117
+ const { resolve: ok, reject: bad } = pending.get(msg.id);
118
+ pending.delete(msg.id);
119
+ if (msg.error) bad(new Error(msg.error.message));
120
+ else ok(msg.result);
121
+ }
122
+ };
123
+ const send = (method, params = {}, sessionId, timeoutMs = 30000) => {
124
+ const id = nextId++;
125
+ return new Promise((resolveSend, reject) => {
126
+ const timer = setTimeout(() => {
127
+ pending.delete(id);
128
+ reject(new Error(`CDP timeout: ${method}`));
129
+ }, timeoutMs);
130
+ pending.set(id, {
131
+ resolve: (v) => {
132
+ clearTimeout(timer);
133
+ resolveSend(v);
134
+ },
135
+ reject: (e) => {
136
+ clearTimeout(timer);
137
+ reject(e);
138
+ },
139
+ });
140
+ ws.send(JSON.stringify(sessionId ? { id, method, params, sessionId } : { id, method, params }));
141
+ });
142
+ };
143
+
144
+ const { targetId } = await send("Target.createTarget", { url: "about:blank" });
145
+ const { sessionId } = await send("Target.attachToTarget", { targetId, flatten: true });
146
+ const page = (method, params, timeoutMs) => send(method, params, sessionId, timeoutMs);
147
+
148
+ await page("Page.enable");
149
+ await page("Runtime.enable");
150
+ await page("Emulation.setDeviceMetricsOverride", {
151
+ width: 1440,
152
+ height: 900,
153
+ deviceScaleFactor: 1,
154
+ mobile: false,
155
+ });
156
+ await page("Page.navigate", { url }, 40000);
157
+ await sleep(2500);
158
+
159
+ await page("Runtime.evaluate", {
160
+ expression: `(() => {
161
+ const labels = /accept|agree|ok|got it|allow|i understand|acepto|aceptar/i;
162
+ for (const el of document.querySelectorAll("button, [role=button], a")) {
163
+ const t = (el.innerText || el.textContent || "").trim();
164
+ if (t.length < 40 && labels.test(t)) { el.click(); break; }
165
+ }
166
+ })()`,
167
+ awaitPromise: true,
168
+ returnByValue: true,
169
+ });
170
+ await sleep(800);
171
+
172
+ await page(
173
+ "Runtime.evaluate",
174
+ {
175
+ expression: `(() => new Promise((done) => {
176
+ (async () => {
177
+ for (const img of document.images) {
178
+ if (img.loading === "lazy") img.loading = "eager";
179
+ }
180
+ const dwell = (ms) => new Promise((r) => setTimeout(r, ms));
181
+ const step = Math.max(480, Math.round(window.innerHeight * 0.65));
182
+ const limit = Math.min(
183
+ Math.max(document.documentElement.scrollHeight, document.body?.scrollHeight || 0),
184
+ 14000
185
+ );
186
+ let y = 0;
187
+ while (y < limit) {
188
+ y = Math.min(limit, y + step);
189
+ window.scrollTo(0, y);
190
+ await dwell(600);
191
+ }
192
+ await Promise.race([
193
+ Promise.all([...document.images].map((img) => img.decode().catch(() => {}))),
194
+ dwell(8000),
195
+ ]);
196
+ window.scrollTo(0, 0);
197
+ await dwell(700);
198
+ done();
199
+ })().catch(() => done());
200
+ }))()`,
201
+ awaitPromise: true,
202
+ returnByValue: true,
203
+ },
204
+ 90000,
205
+ );
206
+
207
+ await page("Runtime.evaluate", {
208
+ expression: `(() => {
209
+ const style = document.createElement("style");
210
+ style.textContent = \`
211
+ html, body { height: auto !important; max-height: none !important; overflow: visible !important; }
212
+ * { animation-play-state: paused !important; transition: none !important; scroll-behavior: auto !important; }
213
+ \`;
214
+ document.head.appendChild(style);
215
+ for (const el of document.querySelectorAll("*")) {
216
+ const pos = getComputedStyle(el).position;
217
+ if (pos === "fixed" || pos === "sticky") {
218
+ el.style.setProperty("position", "relative", "important");
219
+ el.style.setProperty("top", "auto", "important");
220
+ el.style.setProperty("bottom", "auto", "important");
221
+ }
222
+ }
223
+ })()`,
224
+ awaitPromise: true,
225
+ returnByValue: true,
226
+ });
227
+ await sleep(400);
228
+
229
+ const metrics = await page("Page.getLayoutMetrics");
230
+ const size = metrics.cssContentSize || metrics.contentSize;
231
+ const width = Math.max(1, Math.ceil(size.width || 1440));
232
+ const height = Math.max(1, Math.min(Math.ceil(size.height || 900), 14000));
233
+ const { data } = await page(
234
+ "Page.captureScreenshot",
235
+ {
236
+ format: "jpeg",
237
+ quality: 70,
238
+ captureBeyondViewport: true,
239
+ clip: { x: 0, y: 0, width, height, scale: 1 },
240
+ },
241
+ 60000,
242
+ );
243
+
244
+ mkdirSync(dirname(out), { recursive: true });
245
+ writeFileSync(out, Buffer.from(data, "base64"));
246
+ console.log(out);
247
+ drop();
248
+ process.exit(0);