@jonandev/longbeard 0.11.2 → 0.12.1
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 +4 -5
- package/CHANGELOG.md +72 -0
- package/README.md +64 -43
- package/beard.json +124 -28
- package/bin/long-beard.js +171 -36
- package/package.json +1 -1
- package/skills/design/SKILL.md +51 -126
- package/skills/design-brief/SKILL.md +146 -0
- package/skills/design-brief/references/graphic.md +59 -0
- package/skills/design-check/SKILL.md +27 -11
- package/skills/design-check/references/design-rules.md +21 -7
- package/skills/design-check/scripts/capture.mjs +121 -37
- package/skills/design-check/scripts/contrast.mjs +23 -9
- package/skills/design-check/scripts/rules.mjs +613 -0
- package/skills/design-check/scripts/screen-contrast.mjs +428 -0
- package/skills/design-check/scripts/tokens.mjs +346 -0
- package/skills/design-content/SKILL.md +118 -0
- package/skills/design-content/scripts/contact-sheet.mjs +259 -0
- package/skills/design-content/scripts/pictures.mjs +197 -0
- package/skills/design-direction/SKILL.md +115 -200
- package/skills/design-direction/references/controls.md +58 -0
- package/skills/{design → design-direction}/references/design-rules.md +21 -7
- package/skills/design-direction/references/five-second.md +47 -0
- package/skills/design-direction/references/full-build.md +19 -0
- package/skills/design-direction/references/graphic.md +35 -0
- package/skills/design-direction/references/grid.md +114 -0
- package/skills/design-direction/references/library.md +75 -0
- package/skills/design-direction/references/screen-template.html +233 -0
- package/skills/design-direction/references/subject.md +33 -0
- package/skills/design-direction/scripts/capture.mjs +121 -37
- package/skills/design-direction/scripts/contact-sheet.mjs +18 -7
- package/skills/design-direction/scripts/fonts.mjs +276 -0
- package/skills/design-direction/scripts/layout-diff.mjs +118 -0
- package/skills/design-direction/scripts/measure.mjs +1728 -0
- package/skills/design-direction/scripts/moodboard.mjs +123 -32
- package/skills/design-direction/scripts/picture-cast.mjs +270 -0
- package/skills/design-direction/scripts/pictures.mjs +197 -0
- package/skills/design-direction/scripts/screen-contrast.mjs +428 -0
- package/skills/design-direction/scripts/sheet.mjs +67 -0
- package/skills/design-direction/scripts/subject-colours.mjs +410 -0
- package/skills/design-families/SKILL.md +138 -0
- package/skills/design-families/scripts/contact-sheet.mjs +259 -0
- package/skills/design-families/scripts/families.mjs +606 -0
- package/skills/design-families/scripts/measure.mjs +1728 -0
- package/skills/design-families/scripts/moodboard.mjs +467 -0
- package/skills/design-families/scripts/tag.mjs +289 -0
- package/skills/design-figma/SKILL.md +69 -0
- package/skills/design-figma/references/graphic.md +26 -0
- package/skills/design-identity/SKILL.md +134 -0
- package/skills/design-identity/references/graphic.md +8 -0
- package/skills/design-identity/references/identity-board.html +140 -0
- package/skills/{design → design-identity}/scripts/capture.mjs +121 -37
- package/skills/design-identity/scripts/colours.mjs +213 -0
- package/skills/design-identity/scripts/contrast.mjs +41 -0
- package/skills/design-identity/scripts/fonts.mjs +276 -0
- package/skills/design-identity/scripts/measure.mjs +1728 -0
- package/skills/design-identity/scripts/sheet.mjs +67 -0
- package/skills/design-identity/scripts/subject-colours.mjs +410 -0
- package/skills/design-moodboard/SKILL.md +184 -0
- package/skills/design-moodboard/references/graphic.md +25 -0
- package/skills/{design-direction → design-moodboard}/references/sources.md +21 -11
- package/skills/design-moodboard/scripts/capture.mjs +893 -0
- package/skills/design-moodboard/scripts/contact-sheet.mjs +259 -0
- package/skills/design-moodboard/scripts/crops.mjs +256 -0
- package/skills/design-moodboard/scripts/dribbble-cards.mjs +418 -0
- package/skills/design-moodboard/scripts/families.mjs +606 -0
- package/skills/design-moodboard/scripts/group.mjs +221 -0
- package/skills/design-moodboard/scripts/measure.mjs +1728 -0
- package/skills/design-moodboard/scripts/moodboard.mjs +467 -0
- package/skills/{design-direction → design-moodboard}/scripts/picker.mjs +121 -20
- package/skills/design-moodboard/scripts/pictures.mjs +197 -0
- package/skills/design-moodboard/scripts/tag.mjs +289 -0
- package/skills/design-prototype/SKILL.md +149 -0
- package/skills/design-prototype/references/design-md-template.md +82 -0
- package/skills/design-prototype/references/design-rules.md +203 -0
- package/skills/design-prototype/references/five-second.md +47 -0
- package/skills/design-prototype/references/graphic.md +27 -0
- package/skills/design-prototype/scripts/capture.mjs +893 -0
- package/skills/design-prototype/scripts/contrast.mjs +41 -0
- package/skills/design-prototype/scripts/links.mjs +308 -0
- package/skills/design-prototype/scripts/pictures.mjs +197 -0
- package/skills/design-prototype/scripts/rules.mjs +613 -0
- package/skills/design-prototype/scripts/screen-contrast.mjs +428 -0
- package/skills/design-prototype/scripts/sheet.mjs +67 -0
- package/skills/design-prototype/scripts/tokens.mjs +346 -0
- package/skills/design-wordmark/SKILL.md +65 -0
- package/skills/design-wordmark/scripts/capture.mjs +893 -0
- package/skills/design-wordmark/scripts/sheet.mjs +67 -0
- package/skills/framework-skills/SKILL.md +71 -0
- package/skills/idea/SKILL.md +13 -7
- package/skills/idea/references/graphic.md +64 -0
- package/skills/design/references/design-md-template.md +0 -58
- package/skills/design/scripts/contrast.mjs +0 -27
- package/skills/design-direction/scripts/dribbble-cards.mjs +0 -356
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Lay screenshots out as one numbered sheet, so a round of first screens can
|
|
3
|
+
// be seen and picked from together. It writes an HTML page; capture.mjs turns
|
|
4
|
+
// that into the picture to show. No dependencies.
|
|
5
|
+
//
|
|
6
|
+
// node sheet.mjs .longbeard/design/direction/grid/sheet.html .longbeard/design/direction/grid/1.png .longbeard/design/direction/grid/2.png …
|
|
7
|
+
// node sheet.mjs .longbeard/design/direction/grid/vary.html --cols 5 .longbeard/design/direction/grid/v*.png
|
|
8
|
+
// node capture.mjs "file://$PWD/.longbeard/design/direction/grid/sheet.html" --out .longbeard/design/direction/grid/sheet.png
|
|
9
|
+
// node sheet.mjs <out.html> --rough 1,2,4 --note "built without fresh agents: weaker" <shots…>
|
|
10
|
+
//
|
|
11
|
+
// --rough 1,2,4 (or none) labels those tiles "rough" and the rest "full", so a quick screen is never
|
|
12
|
+
// read as a finished one. --note prints a line under the sheet.
|
|
13
|
+
|
|
14
|
+
// Tiles are numbered in the order given, left to right, top to bottom, which
|
|
15
|
+
// is the recipe's number when the shots are passed in order.
|
|
16
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
17
|
+
import { dirname, relative, resolve } from "node:path";
|
|
18
|
+
|
|
19
|
+
const args = process.argv.slice(2);
|
|
20
|
+
const at = args.indexOf("--cols");
|
|
21
|
+
const cols = at === -1 ? 2 : Number(args.splice(at, 2)[1]);
|
|
22
|
+
const take = (name) => {
|
|
23
|
+
const i = args.indexOf(name);
|
|
24
|
+
return i === -1 ? null : (args.splice(i, 2)[1] ?? "");
|
|
25
|
+
};
|
|
26
|
+
const roughArg = take("--rough");
|
|
27
|
+
const note = take("--note");
|
|
28
|
+
const rough = new Set((roughArg ?? "").split(",").filter((n) => n && n !== "none").map(Number));
|
|
29
|
+
const [outArg, ...shots] = args;
|
|
30
|
+
if (!outArg || [...rough].some((n) => !Number.isInteger(n) || n < 1) || roughArg === "" || note === "" || !/\.html$/.test(outArg) || !shots.length || !Number.isInteger(cols) || cols < 1 || cols > 8) {
|
|
31
|
+
console.error('usage: node sheet.mjs <out.html> [--cols 2] [--rough 1,2|none] [--note "text"] <shot.png> …');
|
|
32
|
+
process.exit(2);
|
|
33
|
+
}
|
|
34
|
+
const out = resolve(outArg);
|
|
35
|
+
for (const shot of shots) {
|
|
36
|
+
if (!existsSync(resolve(shot))) {
|
|
37
|
+
console.error(`sheet: no file at ${shot}`);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const escape = (text) => text.replace(/[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c]);
|
|
42
|
+
// A local path in a src: each part encoded, so # ? % and spaces stay in the name.
|
|
43
|
+
const urlPath = (path) => path.split("/").map(encodeURIComponent).join("/");
|
|
44
|
+
const tiles = shots
|
|
45
|
+
.map((shot, i) => `<figure><img src="${escape(urlPath(relative(dirname(out), resolve(shot)).split("\\").join("/")))}" alt="Screen ${i + 1}"><figcaption>${i + 1}${roughArg === null ? "" : rough.has(i + 1) ? " · rough" : " · full"}</figcaption></figure>`)
|
|
46
|
+
.join("\n");
|
|
47
|
+
mkdirSync(dirname(out), { recursive: true });
|
|
48
|
+
writeFileSync(
|
|
49
|
+
out,
|
|
50
|
+
`<!doctype html>
|
|
51
|
+
<meta charset="utf-8">
|
|
52
|
+
<title>Sheet</title>
|
|
53
|
+
<style>
|
|
54
|
+
body { margin: 0; padding: 24px; background: #6f6f6f; font: 600 22px/1 system-ui, sans-serif; }
|
|
55
|
+
main { display: grid; grid-template-columns: repeat(${cols}, 720px); gap: 24px; width: max-content; }
|
|
56
|
+
figure { margin: 0; display: flex; flex-direction: column-reverse; gap: 8px; }
|
|
57
|
+
img { display: block; width: 720px; height: auto; }
|
|
58
|
+
/* The number sits above the screen, never on it: a corner of a screen is where its name or menu is. */
|
|
59
|
+
p { margin: 24px 0 0; max-width: 1200px; font-weight: 400; font-size: 20px; line-height: 1.4; color: #fff; }
|
|
60
|
+
figcaption { align-self: flex-start; min-width: 44px; padding: 8px 10px; text-align: center; background: #111; color: #fff; }
|
|
61
|
+
</style>
|
|
62
|
+
<main>
|
|
63
|
+
${tiles}
|
|
64
|
+
</main>
|
|
65
|
+
${note ? `<p>${escape(note)}</p>\n` : ""}`,
|
|
66
|
+
);
|
|
67
|
+
console.log(`${shots.length} screens, ${cols} across: ${outArg}`);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: framework-skills
|
|
3
|
+
description: >
|
|
4
|
+
Find and propose agent skills for the frameworks and languages the project
|
|
5
|
+
uses: the framework's own published skills first, else the most installed,
|
|
6
|
+
read before proposing, installed on yes with longbeard add. Runs at
|
|
7
|
+
Architecture once the stack is decided, and again when the repo gains a new
|
|
8
|
+
stack (a pubspec.yaml, a new framework in package.json, a Cargo.toml).
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Framework skills
|
|
12
|
+
|
|
13
|
+
The kit knows the pipeline, not the stack. This skill finds skills for the stack the project actually uses, proposes them, and installs them on a yes. It never installs without one.
|
|
14
|
+
|
|
15
|
+
## Gate
|
|
16
|
+
|
|
17
|
+
Look at the repo. Do not ask what is there.
|
|
18
|
+
|
|
19
|
+
1. List the stack from the ADRs in `docs/adr/` and the manifests: `pubspec.yaml`, `package.json` dependencies, `Cargo.toml`, `go.mod`, `pyproject.toml` or `requirements.txt`, `Gemfile`, `composer.json`, `build.gradle`, `Package.swift`, `*.csproj`. Count only what shapes how code is written: a framework (Flutter, Next.js, Expo, Rails, Django, Laravel, SwiftUI, Spring) or a language with no framework. A utility library is not a stack.
|
|
20
|
+
2. Drop each one that already has a skill: a folder for it in `.agents/skills/`, `.claude/skills/` or `.cursor/skills/`, or an entry in `beard.local.json`.
|
|
21
|
+
3. Drop each one an ADR records as declined.
|
|
22
|
+
4. Nothing left → say so in one line and stop.
|
|
23
|
+
|
|
24
|
+
## Find
|
|
25
|
+
|
|
26
|
+
For each one left, search with the Skills CLI Long Beard pins. It needs the network.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
npx skills@1.7.2 find <framework>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
It lists `owner/repo@skill` by installs. Choose in this order, and stop at the first that has something:
|
|
33
|
+
|
|
34
|
+
1. **The framework's own.** The owner is the organisation that publishes the framework (the `flutter` org for Flutter, the framework's GitHub org in general). Check that from the framework's site or repository, not from the name: anyone can call a repo `flutter-skills`.
|
|
35
|
+
2. **The most installed** that is about this framework and not about one library inside it.
|
|
36
|
+
|
|
37
|
+
Then, before proposing any of them:
|
|
38
|
+
|
|
39
|
+
- List what the repo publishes: `npx skills@1.7.2 add <owner/repo> --list`. A kit has many skills. Propose the ones this project will use now, from its flows and ADRs, not all of them.
|
|
40
|
+
- Open each proposed `SKILL.md` on GitHub and read it. Drop one that runs scripts you cannot read, fetches and runs remote code, asks for credentials, or tells the agent to ignore the project's own rules.
|
|
41
|
+
- Note the license and the date of the last commit. Over a year untouched, say so.
|
|
42
|
+
|
|
43
|
+
If the search finds nothing that passes, say that, and that the stack's own docs are the fallback. Do not write a skill for it here.
|
|
44
|
+
|
|
45
|
+
## Propose
|
|
46
|
+
|
|
47
|
+
One message per stack, in this shape:
|
|
48
|
+
|
|
49
|
+
> **Flutter**, from the Flutter team (`flutter/agent-plugins`, <license>, updated <when>).
|
|
50
|
+
> 1. `flutter-apply-architecture-best-practices`: layers and state, for the app structure in ADR 0002.
|
|
51
|
+
> 2. `flutter-add-widget-test`: widget tests, which `tdd` will write.
|
|
52
|
+
> 3. `flutter-setup-declarative-routing`: the deep links in the brief's share flow.
|
|
53
|
+
> Install these three? Reply with the numbers to keep, or no.
|
|
54
|
+
|
|
55
|
+
The source is a link a person can open. The why is one line, tied to this project.
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
On yes, once per source, with every chosen skill:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
npx longbeard add https://github.com/<owner>/<repo> --skill <name> --skill <name> --author "<owner>" --why "<one line>" --when "<when to load it>"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`add` writes `beard.local.json`, installs for the project's agents, and adds a line to the `AGENTS.md` block, so later sessions load it at the right moment. `update` refreshes it from its author.
|
|
66
|
+
|
|
67
|
+
On no, write one line in the stack's ADR (create `docs/adr/` if it is missing): `Agent skills for <framework>: declined <date>.` It is not offered again until the stack changes.
|
|
68
|
+
|
|
69
|
+
## End
|
|
70
|
+
|
|
71
|
+
Say what was installed, what was declined, and what you did not check: a skill not read in full, a license not found, a stack the search did not cover.
|
package/skills/idea/SKILL.md
CHANGED
|
@@ -11,9 +11,9 @@ description: >
|
|
|
11
11
|
|
|
12
12
|
# Idea
|
|
13
13
|
|
|
14
|
-
One file comes out: `docs/brief.md`, about 500 words, one page. Every later stage reads it:
|
|
14
|
+
One file comes out: `docs/brief.md`, about 500 words, one page. Every later stage reads it: the design-* skills for the people, surface, position, identity nouns and key screens, `to-spec` for the flows. No stage asks for these again, so the brief has to settle them.
|
|
15
15
|
|
|
16
|
-
The brief says what and for whom, never how. No framework, database, host or library. Those are Architecture's.
|
|
16
|
+
The brief says what and for whom, never how. No framework, database, host or library. Those are Architecture's. And never how it looks: no layout, colour, typeface, named style or page furniture. Those are chosen in Design, on rendered screens, and a brief that describes a look decides it before anyone has seen it.
|
|
17
17
|
|
|
18
18
|
## Gate
|
|
19
19
|
|
|
@@ -24,6 +24,8 @@ Look at the repo. Do not ask what is there.
|
|
|
24
24
|
3. No brief, and the repo has code or a README → **Existing project**.
|
|
25
25
|
4. Otherwise → **New idea**.
|
|
26
26
|
|
|
27
|
+
The idea is a piece to look at, not a product to use (a poster, a card, a social post): read [graphic.md](references/graphic.md) first.
|
|
28
|
+
|
|
27
29
|
## New idea
|
|
28
30
|
|
|
29
31
|
Load Matt's `grilling` and run it. The design tree is the brief's sections below. Start with the frontier: a working name, problem, who it is for, surface. Flows, screens, position and scope hang off those. A working name is enough; it can change.
|
|
@@ -68,7 +70,7 @@ Read the brief. Grill only what changes and what hangs off it: a new surface reo
|
|
|
68
70
|
<2–4. The screens design prototypes first. No UI: "none".>
|
|
69
71
|
|
|
70
72
|
## Surface
|
|
71
|
-
<site | app | no UI (CLI, API, library)>. <One line why. A site is the page a person lands on to understand or choose; an app is the tool they come back to.>
|
|
73
|
+
<site | app | graphic | no UI (CLI, API, library)>. <One line why. A site is the page a person lands on to understand or choose; an app is the tool they come back to.>
|
|
72
74
|
|
|
73
75
|
## V1 and later
|
|
74
76
|
- v1: <what ships first, as flows from above>
|
|
@@ -92,22 +94,26 @@ Read the brief. Grill only what changes and what hangs off it: a new surface reo
|
|
|
92
94
|
- Every section has content. "None" is an answer. A guess is not.
|
|
93
95
|
- **Changes** is added under Out of scope by the first Change, never before.
|
|
94
96
|
- Position is concrete. "Fast, simple, trustworthy" says nothing every rival would not say. `remembered for` is a thing you could point at on a screen or in a sentence; `against` names real products or habits.
|
|
95
|
-
- Content is real: the longest names the people will type, the likely numbers, the real empty case. `design` uses them as copy.
|
|
97
|
+
- Content is real: the longest names the people will type, the likely numbers, the real empty case. `design-prototype` uses them as copy.
|
|
98
|
+
- A screen is described by what is on it and what it is for, never by how it is arranged or styled. `remembered for` is a thing the product has or does, in the product's own words. If they describe a look while being grilled, keep it out of the brief and tell them it belongs in `design-brief`, which asks it next.
|
|
96
99
|
- Over a page means a flow is really two products, or a section is doing Architecture's job. Cut it.
|
|
97
100
|
|
|
98
101
|
## After writing
|
|
99
102
|
|
|
100
|
-
Offer the next stage in one line. A stage whose file already exists is done, so go past it:
|
|
103
|
+
Offer the next stage in one line, from the stages the router lists. A stage whose file already exists is done, so go past it:
|
|
101
104
|
|
|
102
|
-
- Site or
|
|
103
|
-
- No UI, or `DESIGN.md` exists →
|
|
105
|
+
- Site, app or graphic, no `DESIGN.md` → `design`, which suggests the first design skill (`design-brief`).
|
|
106
|
+
- No UI, or `DESIGN.md` exists → Design is skipped. Next is Architecture: they type `/grill-with-docs`.
|
|
104
107
|
- `GLOSSARY.md` exists too → next is Plan: they type `/to-spec` for the first flow or feature.
|
|
105
108
|
|
|
109
|
+
With no Architecture stage in the router (a design-only install), the next stage is `design` for a site or app. Otherwise the brief is the result.
|
|
110
|
+
|
|
106
111
|
Do not start it until they say so.
|
|
107
112
|
|
|
108
113
|
## Do not
|
|
109
114
|
|
|
110
115
|
- Pick a stack, or write a requirement as one ("uses Postgres").
|
|
116
|
+
- Describe a look: a layout, a colour, a typeface, a style by name.
|
|
111
117
|
- Ask a question the repo or the idea already answers.
|
|
112
118
|
- Write the brief before they confirm the seven-line summary.
|
|
113
119
|
- Edit the brief for a feature. Features get specs.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# A graphic
|
|
2
|
+
|
|
3
|
+
Read when the idea is a piece to look at, not a product to use: a poster, a card or invitation, a social post, a cover. Everything in `SKILL.md` holds except what is said here. A piece counts as a screen wherever a skill says screen.
|
|
4
|
+
|
|
5
|
+
The kind is said once, here, on the brief's `surface` line, and no later skill asks it again.
|
|
6
|
+
|
|
7
|
+
## What changes
|
|
8
|
+
|
|
9
|
+
- **Do not ask for flows or key screens.** A piece has none.
|
|
10
|
+
- **Ask for four things:** what it is for, who sees it and where, the facts it must carry, and the format.
|
|
11
|
+
- **One round, two at most.** Start with what the idea gives and recommend the rest. A birthday card needs a few lines, not a page.
|
|
12
|
+
- **Facts first.** The facts are what, when, where, who, and a link or a code if there is one. Each is given, or marked missing. A missing fact is never invented: it is written "missing" and stays in the brief until they supply it.
|
|
13
|
+
- **Format.** A size (a paper size, or pixels), portrait or landscape, print or screen. For a set (a poster with a story and a square version), list each piece with its size. A single piece is one line.
|
|
14
|
+
- **A set or a single piece.** Ask only if the idea does not say.
|
|
15
|
+
|
|
16
|
+
## The brief
|
|
17
|
+
|
|
18
|
+
About 250 words. The headings the design skills read by name stay; flows, key screens and v1 are replaced.
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
# <Piece name>
|
|
22
|
+
|
|
23
|
+
<One sentence: what it is, and for whom.>
|
|
24
|
+
|
|
25
|
+
## What it is for
|
|
26
|
+
<The one thing it makes someone do or feel, in two sentences. The cost of it going unseen.>
|
|
27
|
+
|
|
28
|
+
## Seen by
|
|
29
|
+
<Who sees it, where, and from how far: a street, a phone feed, a hand.>
|
|
30
|
+
|
|
31
|
+
## Must carry
|
|
32
|
+
- what: <…>
|
|
33
|
+
- when: <…, or "missing">
|
|
34
|
+
- where: <…, or "missing">
|
|
35
|
+
- who: <…>
|
|
36
|
+
- link or code: <…, or "none">
|
|
37
|
+
|
|
38
|
+
## Format
|
|
39
|
+
- <size, portrait or landscape, print or screen>
|
|
40
|
+
- <for a set, one line per piece>
|
|
41
|
+
|
|
42
|
+
## Surface
|
|
43
|
+
graphic. <One line why: a piece to look at, not a tool to use.>
|
|
44
|
+
|
|
45
|
+
## Constraints
|
|
46
|
+
- <What is fixed: a deadline, a budget, a logo or colours they own. Not tech choices and not a look.>
|
|
47
|
+
|
|
48
|
+
## Position
|
|
49
|
+
- against: <what pieces of its kind usually look like, or "none: a personal piece">
|
|
50
|
+
- remembered for: <one concrete thing someone would describe to a friend>
|
|
51
|
+
- personality: <three adjectives>. Says: "<a line it would say>". Never: "<a line it would never say>"
|
|
52
|
+
|
|
53
|
+
## Identity nouns
|
|
54
|
+
<4–8 concrete nouns from its world.>
|
|
55
|
+
|
|
56
|
+
## Out of scope
|
|
57
|
+
- <What it will not do or carry.>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Every section has content. "None" is an answer. A guess is not. The brief names no look, as in any brief.
|
|
61
|
+
|
|
62
|
+
## After writing
|
|
63
|
+
|
|
64
|
+
Offer `design` in one line. A graphic's run ends at its exported Figma frame: never offer Architecture or Plan, even though no `GLOSSARY.md` exists.
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# DESIGN.md template
|
|
2
|
-
|
|
3
|
-
Write the whole file once, from the approved prototype. A builder follows it without the prototype or the references open. Short lines. Our words, never a reference's name.
|
|
4
|
-
|
|
5
|
-
```markdown
|
|
6
|
-
# Design
|
|
7
|
-
|
|
8
|
-
Figma: <file URL>. Figma is the truth for screens. This file is the rules behind them.
|
|
9
|
-
|
|
10
|
-
## Idea
|
|
11
|
-
<one sentence: what this product's look says>
|
|
12
|
-
- ownable: <the one element made from the product's own identity, as approved on the prototype>
|
|
13
|
-
|
|
14
|
-
## Voice
|
|
15
|
-
- <three adjectives>
|
|
16
|
-
- <one sample line, and one line it would never say>
|
|
17
|
-
|
|
18
|
-
## Colour
|
|
19
|
-
| Token | Value | Use |
|
|
20
|
-
|---|---|---|
|
|
21
|
-
| color/bg | #… | page ground |
|
|
22
|
-
| color/ink | #… | body text |
|
|
23
|
-
| … | | |
|
|
24
|
-
|
|
25
|
-
Contrast (scripts/contrast.mjs):
|
|
26
|
-
- color/ink on color/bg: <ratio> <AA | AAA>
|
|
27
|
-
- <every text, control and focus pair>
|
|
28
|
-
|
|
29
|
-
## Type
|
|
30
|
-
| Token | Face, weight | Size / line height | Use |
|
|
31
|
-
|---|---|---|---|
|
|
32
|
-
| type/heading | … | …/… | screen titles |
|
|
33
|
-
| type/body | … | …/… | body, lists |
|
|
34
|
-
|
|
35
|
-
- Licence: <covers how this ships: web, app bundle>
|
|
36
|
-
|
|
37
|
-
## Spacing
|
|
38
|
-
- Scale: <space/sm 8, space/md 16, …>
|
|
39
|
-
- <how the scale is used: inside components, between items, between groups, between sections>
|
|
40
|
-
- Corner radius: <value, and where>
|
|
41
|
-
|
|
42
|
-
## Components
|
|
43
|
-
- <component>: <what it is for, its variants, its states>
|
|
44
|
-
|
|
45
|
-
## Imagery
|
|
46
|
-
- <what the pictures are and how they are treated, or "none">
|
|
47
|
-
|
|
48
|
-
## Decisions
|
|
49
|
-
- <date>: <what was decided> — <the reason>. <Soft rule overridden, if any: rule number and why>
|
|
50
|
-
|
|
51
|
-
## Do not
|
|
52
|
-
- <what we leave, as ideas: "a bright brand accent", never whose>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
- Every token name is its code name, and the same name in Figma.
|
|
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.
|
|
58
|
-
- A section with nothing to say is left out, not filled with a guess.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// WCAG 2.x contrast for colour pairs.
|
|
3
|
-
// node contrast.mjs "#2c2824 on #f6f1e7" "#b0563a on #f6f1e7:mark"
|
|
4
|
-
// Suffix :large or :mark checks against 3:1 instead of 4.5:1.
|
|
5
|
-
const lum = (hex) => {
|
|
6
|
-
const [r, g, b] = [1, 3, 5]
|
|
7
|
-
.map((i) => parseInt(hex.slice(i, i + 2), 16) / 255)
|
|
8
|
-
.map((c) => (c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));
|
|
9
|
-
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
10
|
-
};
|
|
11
|
-
let failed = false;
|
|
12
|
-
for (const arg of process.argv.slice(2)) {
|
|
13
|
-
const m = arg.match(/^(#[0-9a-f]{6})\s+on\s+(#[0-9a-f]{6})(?::(large|mark))?$/i);
|
|
14
|
-
if (!m) {
|
|
15
|
-
console.error(`skip: ${arg}`);
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
const [a, b] = [lum(m[1]), lum(m[2])];
|
|
19
|
-
const ratio = (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
|
|
20
|
-
const need = m[3] ? 3 : 4.5;
|
|
21
|
-
const verdict = ratio >= 7 && !m[3] ? "AAA" : ratio >= need ? "AA" : "FAIL";
|
|
22
|
-
if (verdict === "FAIL") failed = true;
|
|
23
|
-
console.log(
|
|
24
|
-
`${m[1]} on ${m[2]} ${ratio.toFixed(2)}:1 ${verdict}${m[3] ? ` (${m[3]}, needs 3:1)` : ""}`,
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
process.exit(failed ? 1 : 0);
|