@jonandev/longbeard 0.6.0 → 0.9.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/bin/long-beard.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawnSync } from "node:child_process";
4
+ import { createHash } from "node:crypto";
4
5
  import {
5
6
  cpSync,
6
7
  existsSync,
@@ -14,7 +15,7 @@ import {
14
15
  writeFileSync,
15
16
  } from "node:fs";
16
17
  import { homedir } from "node:os";
17
- import { dirname, join, resolve } from "node:path";
18
+ import { dirname, join, relative, resolve } from "node:path";
18
19
  import { fileURLToPath } from "node:url";
19
20
 
20
21
  const root = join(dirname(fileURLToPath(import.meta.url)), "..");
@@ -43,7 +44,8 @@ The catalog is beard.json. The command is longbeard, via npx in the project.
43
44
 
44
45
  init installs missing skills from beard.json. A skill already present for an agent is left there.
45
46
  update installs anything new, refreshes only items in beard-lock.json, and rewrites the AGENTS.md block.
46
- A kit skill is copied from the installed package when its version moved, and the line says which versions.
47
+ A skill written here is copied from the installed package when its version moved, and the line says which versions.
48
+ A kit (ponytail) is every skill its author publishes. update adds new ones and removes retired ones you did not edit, and a kit's skills when the catalog drops it.
47
49
  Install the package first (npm install -D @jonandev/longbeard@latest); update does not fetch it.
48
50
  add in a project writes beard.local.json (an extra, not a second kit). remove omits a kit skill here.
49
51
  --agent skips the agent list and installs for that tool. Repeat it.
@@ -228,6 +230,50 @@ function writeExtra(flags, state) {
228
230
  });
229
231
  }
230
232
 
233
+ // A kit is what its author publishes: the skills in their plugin manifest, else
234
+ // every folder in their skills/. Read at install time so a new or retired skill
235
+ // follows the author, not this catalog.
236
+ async function kitSkills(item) {
237
+ const repo = item.source.match(/github\.com\/([^/]+\/[^/#?]+)/)?.[1]?.replace(/\.git$/, "");
238
+ if (!repo) fail(`${item.name}: a kit needs a GitHub source.`);
239
+ // update retires what this list leaves out, so a failed fetch must stop here,
240
+ // never fall through to a guess. Only a missing manifest (404) falls back.
241
+ const cannot = `Could not list the ${item.name} kit from GitHub. Check the network and try again.`;
242
+ const get = async (url) => {
243
+ try {
244
+ const res = await fetch(url);
245
+ if (res.status === 404) return null;
246
+ if (!res.ok) fail(`${cannot} (${res.status} from ${url})`);
247
+ return await res.json();
248
+ } catch {
249
+ fail(cannot);
250
+ }
251
+ };
252
+ const manifest = await get(`https://raw.githubusercontent.com/${repo}/HEAD/.claude-plugin/plugin.json`);
253
+ const names = Array.isArray(manifest?.skills)
254
+ ? manifest.skills.map((path) => path.replace(/\/$/, "").split("/").pop())
255
+ : ((await get(`https://api.github.com/repos/${repo}/git/trees/HEAD?recursive=1`))?.tree ?? [])
256
+ .map((entry) => entry.path.match(/^skills\/([^/]+)\/SKILL\.md$/)?.[1])
257
+ .filter(Boolean);
258
+ if (names.length === 0) fail(cannot);
259
+ return names;
260
+ }
261
+
262
+ async function expandKits(skills, omit) {
263
+ const out = [];
264
+ for (const item of skills) {
265
+ if (!item.kit) {
266
+ out.push(item);
267
+ continue;
268
+ }
269
+ for (const name of await kitSkills(item)) {
270
+ if (omit.includes(name)) continue;
271
+ out.push({ name, source: item.source, author: item.author, license: item.license, kit: item.name });
272
+ }
273
+ }
274
+ return out;
275
+ }
276
+
231
277
  function chosen(flags) {
232
278
  const manifest = curated();
233
279
  const extra = extraState(flags);
@@ -387,16 +433,24 @@ function childDirs(dir) {
387
433
  }
388
434
  }
389
435
 
436
+ // Claude Code lists installed plugins in installed_plugins.json. A plugin keeps
437
+ // a skill anywhere under its install path: skills/<name> or skills/<group>/<name>.
390
438
  function pluginHas(name) {
391
- for (const base of [join(homedir(), ".claude", "plugins"), join(process.cwd(), ".claude", "plugins")]) {
392
- for (const plugin of childDirs(base)) {
393
- if (existsSync(join(plugin, "skills", name, "SKILL.md"))) return true;
394
- for (const nested of childDirs(plugin)) {
395
- if (existsSync(join(nested, "skills", name, "SKILL.md"))) return true;
396
- }
397
- }
439
+ let installs;
440
+ try {
441
+ installs = Object.values(readJson(join(homedir(), ".claude", "plugins", "installed_plugins.json")).plugins ?? {}).flat();
442
+ } catch {
443
+ return false;
398
444
  }
399
- return false;
445
+ const here = resolve(process.cwd());
446
+ const find = (dir, depth) =>
447
+ existsSync(join(dir, name, "SKILL.md")) || (depth > 0 && childDirs(dir).some((child) => find(child, depth - 1)));
448
+ return installs.some(
449
+ (install) =>
450
+ install.installPath &&
451
+ (install.scope === "user" || !install.projectPath || resolve(install.projectPath) === here) &&
452
+ find(install.installPath, 3),
453
+ );
400
454
  }
401
455
 
402
456
  function agentDir(agent, global) {
@@ -433,17 +487,36 @@ function packageVersion() {
433
487
  }
434
488
  }
435
489
 
436
- function recordInstall(lock, skill, agents) {
490
+ function recordInstall(lock, skill, agents, global) {
437
491
  const prev = lock.skills[skill.name] ?? { agents: [] };
492
+ const all = [...new Set([...prev.agents, ...agents])];
493
+ const folder = skillFolders(skill.name, all, global)[0];
438
494
  lock.skills[skill.name] = {
439
495
  source: skill.source,
440
496
  author: skill.author,
441
- agents: [...new Set([...prev.agents, ...agents])],
497
+ agents: all,
442
498
  installedAt: new Date().toISOString(),
499
+ ...(skill.kit ? { kit: skill.kit } : {}),
443
500
  ...(skill.source === "local" ? { version: packageVersion() } : {}),
501
+ ...(folder ? { hash: folderHash(folder) } : {}),
444
502
  };
445
503
  }
446
504
 
505
+ // A clone or a checkout rewrites every mtime, so an edit is a change of content.
506
+ function folderHash(dir) {
507
+ const hash = createHash("sha256");
508
+ const walk = (at) => {
509
+ for (const name of readdirSync(at).sort()) {
510
+ if (name === ".DS_Store") continue;
511
+ const file = join(at, name);
512
+ if (statSync(file).isDirectory()) walk(file);
513
+ else hash.update(`${relative(dir, file)}\0`).update(readFileSync(file));
514
+ }
515
+ };
516
+ walk(dir);
517
+ return hash.digest("hex");
518
+ }
519
+
447
520
  // The skills CLI can only update what it can fetch. A kit skill lives in this
448
521
  // package, so update copies it here instead of reporting "up to date" over a
449
522
  // stale file.
@@ -465,29 +538,32 @@ function copyLocalSkill(name, agents, global) {
465
538
  return copied;
466
539
  }
467
540
 
468
- function skillMarkdown(name, agents, global) {
469
- const files = [];
541
+ function skillFolders(name, agents, global) {
542
+ const folders = [];
470
543
  const seen = new Set();
471
544
  for (const agent of agents) {
472
- const file = join(agentDir(agent, global), name, "SKILL.md");
473
- if (seen.has(file)) continue;
474
- seen.add(file);
475
- if (existsSync(file)) files.push(file);
545
+ const folder = join(agentDir(agent, global), name);
546
+ if (seen.has(folder)) continue;
547
+ seen.add(folder);
548
+ if (existsSync(join(folder, "SKILL.md"))) folders.push(folder);
476
549
  }
477
- return files;
550
+ return folders;
478
551
  }
479
552
 
480
553
  function locallyEdited(name, entry, agents, global) {
554
+ const folders = skillFolders(name, entry?.agents ?? agents, global);
555
+ if (entry?.hash) return folders.some((folder) => folderHash(folder) !== entry.hash);
556
+ // Locks written before 0.6.1 have no hash. The next update records one.
481
557
  const installed = Date.parse(entry?.installedAt ?? "");
482
558
  if (Number.isNaN(installed)) return false;
483
- return skillMarkdown(name, entry.agents ?? agents, global).some((file) => statSync(file).mtimeMs > installed + 2000);
559
+ return folders.some((folder) => statSync(join(folder, "SKILL.md")).mtimeMs > installed + 2000);
484
560
  }
485
561
 
486
562
  function generateRouter(items) {
487
- const lines = items.filter((item) => kind(item) === "skill").map((item) => {
488
- const when = item.when?.trim() || item.name;
489
- const why = item.why?.trim();
490
- return why ? `- ${when}: ${item.name}. ${why}` : `- ${when}: ${item.name}`;
563
+ const line = (when, name, why) => (why?.trim() ? `- ${when}: ${name}. ${why.trim()}` : `- ${when}: ${name}`);
564
+ const lines = items.filter((item) => kind(item) === "skill").flatMap((item) => {
565
+ if (item.kit) return (item.routes ?? []).map((route) => line(route.when, route.skill, route.why));
566
+ return [line(item.when?.trim() || item.name, item.name, item.why)];
491
567
  });
492
568
  return `# Long Beard
493
569
 
@@ -495,7 +571,7 @@ The project's own code, conventions, and DESIGN.md win.
495
571
 
496
572
  Load only what the task needs. Leave the rest unread.
497
573
 
498
- A marketing site is the page a person lands on to understand or choose. An application is the tool they come back to. Official look wins: DESIGN.md, then Figma, then the board. Hunt finds references and proposes an adaptation; it does not code the page. Open the moodboard before they pick, mark the lead after, say what we take, change, and leave, then ask once to write or update DESIGN.md — only on yes. Code the page only when they asked to build. Direction-only stops after persist. A site hunts live pages; an application hunts screen shots. With a direction already, hunt only the piece.
574
+ A marketing site is the page a person lands on to understand or choose. An application is the tool they come back to. Official look wins: DESIGN.md, then Figma, then the board. Hunt finds references and proposes an adaptation; it does not code the page. Open the moodboard before they pick, say what we take, change, and leave, then ask to write or update DESIGN.md as its own message — once more, first, if they move on without answering — only on yes. Code the page only when they asked to build. Direction-only stops after the next-step offer. A site hunts live pages; an application hunts screen shots. With a direction already, hunt only the piece.
499
575
 
500
576
  ${lines.join("\n")}
501
577
 
@@ -505,6 +581,12 @@ Write so a person can use the reply in one read. End with what you did not check
505
581
  `;
506
582
  }
507
583
 
584
+ // AGENTS.md in this repository is this output, without the optional skills.
585
+ // `npm run router` rewrites it; `npm test` fails when the two drift.
586
+ function kitRouter() {
587
+ return generateRouter(catalog(curated()).filter((item) => !item.optional));
588
+ }
589
+
508
590
  function pointerWrites(flags, agents) {
509
591
  if (flags.global) {
510
592
  const home = join(homedir(), ".longbeard");
@@ -624,14 +706,15 @@ function setCatalog(manifest, items) {
624
706
  }
625
707
 
626
708
  function remember(lock, flags, skills, agents) {
627
- for (const skill of skills) recordInstall(lock, skill, skill.agentsNeed ?? agents);
709
+ for (const skill of skills) recordInstall(lock, skill, skill.agentsNeed ?? agents, flags.global);
628
710
  writeLock(flags, lock);
629
711
  }
630
712
 
631
- function init(flags) {
713
+ async function init(flags) {
632
714
  requireProject(flags);
633
- const { manifest, skills, items, later } = chosen(flags);
715
+ const { manifest, extra, items, later, ...picked } = chosen(flags);
634
716
  const agents = chooseAgents(manifest, flags, { pick: true, lock: readLock(flags) });
717
+ const skills = await expandKits(picked.skills, extra.omit);
635
718
  const classified = classify(skills, agents, flags);
636
719
  classified.later = later;
637
720
  plan("init", flags, agents, classified);
@@ -647,14 +730,32 @@ function init(flags) {
647
730
  ]);
648
731
  }
649
732
 
650
- function update(flags) {
733
+ async function update(flags) {
651
734
  requireProject(flags);
652
- const { manifest, skills, items, later } = chosen(flags);
735
+ const { manifest, extra, items, later, ...picked } = chosen(flags);
653
736
  const agents = chooseAgents(manifest, flags, { pick: false, lock: readLock(flags) });
737
+ const skills = await expandKits(picked.skills, extra.omit);
654
738
  const classified = classify(skills, agents, flags);
655
739
  classified.later = later;
740
+ // A kit skill nothing lists any more leaves, unless you edited it: the author
741
+ // stopped publishing it, or the catalog dropped the kit.
742
+ const listed = new Set(skills.map((skill) => skill.name));
743
+ const retired = Object.entries(classified.lock.skills)
744
+ .filter(([name, entry]) => entry.kit && !listed.has(name) && !extra.omit.includes(name))
745
+ .map(([name, entry]) => ({ name, author: entry.author, edited: locallyEdited(name, entry, agents, flags.global) }));
746
+ const drop = retired.filter((skill) => !skill.edited);
656
747
  plan("update", flags, agents, classified);
748
+ rows("retired", yellow, drop, "No longer in its kit or the catalog. Removed.", nameWidth([retired]));
749
+ rows("retired, kept", yellow, retired.filter((skill) => skill.edited), "No longer in its kit or the catalog. Kept because you edited it.", nameWidth([retired]));
657
750
  confirmWrite(flags, classified.writes);
751
+ if (drop.length > 0) {
752
+ // No --agent: with one, the skills CLI unlinks Claude Code but leaves the
753
+ // shared .agents/skills folder that Cursor reads.
754
+ const args = ["remove", ...drop.map((skill) => skill.name), "-y"];
755
+ if (flags.global) args.push("--global");
756
+ runSkills(args);
757
+ for (const skill of drop) delete classified.lock.skills[skill.name];
758
+ }
658
759
  const refresh = flags.force ? [...classified.ours, ...classified.edited] : classified.ours;
659
760
  if (classified.missing.length > 0) say(dim("Installing…"));
660
761
  installSkills(classified.missing, { global: flags.global, agents });
@@ -688,7 +789,7 @@ function update(flags) {
688
789
  const held = flags.force ? classified.theirs.length : classified.theirs.length + classified.edited.length;
689
790
  finish([
690
791
  green("Done."),
691
- `${classified.missing.length} installed, ${copied + theirs.length} refreshed, ${held} left as they are.`,
792
+ `${classified.missing.length} installed, ${copied + theirs.length} refreshed, ${drop.length} retired, ${held} left as they are.`,
692
793
  `This is Long Beard ${here}. Run npm install -D @jonandev/longbeard@latest first if a newer one is out.`,
693
794
  flags.global ? "Rewrote ~/.longbeard/AGENTS.md." : "Rewrote the AGENTS.md block.",
694
795
  ]);
@@ -708,9 +809,10 @@ function add(flags, rest) {
708
809
  }
709
810
  setCatalog(manifest, items);
710
811
  writeJson(curatedFile, manifest);
812
+ writeFileSync(join(root, "AGENTS.md"), kitRouter());
711
813
  heading("add", flags, curated().agents);
712
814
  rows("catalog", green, flags.skill.map((name) => entry(name, source, flags)), "", 16);
713
- finish([green("Done."), "Wrote beard.json. Commit it and push. Projects pick this up on update."]);
815
+ finish([green("Done."), "Wrote beard.json and AGENTS.md. Commit them and push. Projects pick this up on update."]);
714
816
  return;
715
817
  }
716
818
  const extra = extraState(flags);
@@ -751,13 +853,19 @@ function remove(flags, rest) {
751
853
  }
752
854
  setCatalog(manifest, items.filter((item) => !names.includes(item.name)));
753
855
  writeJson(curatedFile, manifest);
856
+ writeFileSync(join(root, "AGENTS.md"), kitRouter());
754
857
  heading("remove", flags, curated().agents);
755
858
  rows("catalog", yellow, names.map((name) => ({ name })), "", 16);
756
- finish([green("Done."), "Wrote beard.json. Commit it and push."]);
859
+ finish([green("Done."), "Wrote beard.json and AGENTS.md. Commit them and push."]);
757
860
  return;
758
861
  }
759
862
  const { manifest, extra } = chosen(flags);
760
- const shared = new Set(catalog(manifest).map((item) => item.name));
863
+ const lock = readLock(flags);
864
+ // A skill a kit installed can be omitted like a catalog item.
865
+ const shared = new Set([
866
+ ...catalog(manifest).map((item) => item.name),
867
+ ...Object.keys(lock.skills).filter((name) => lock.skills[name].kit),
868
+ ]);
761
869
  const extraNames = new Set(extra.items.map((item) => item.name));
762
870
  for (const name of names) {
763
871
  if (!shared.has(name) && !extraNames.has(name) && !extra.omit.includes(name)) {
@@ -769,16 +877,15 @@ function remove(flags, rest) {
769
877
  if (shared.has(name) && !extra.omit.includes(name)) extra.omit.push(name);
770
878
  }
771
879
  writeExtra(flags, extra);
772
- const lock = readLock(flags);
773
880
  const ours = names.filter((name) => lock.skills[name]);
774
881
  const agents = chooseAgents(manifest, flags, { pick: false, lock });
775
882
  heading("remove", flags, agents);
776
883
  rows("remove", yellow, names.map((name) => ({ name })), shared.has(names[0]) ? "Omitted here. Still in the shared catalog." : "This project only.", 16);
777
884
  if (ours.length > 0) {
778
885
  say(dim("Removing…"));
886
+ // No --agent, as in update: it would leave the shared .agents/skills folder.
779
887
  const args = ["remove", ...ours, "-y"];
780
888
  if (flags.global) args.push("--global");
781
- for (const agent of agents) args.push("--agent", agent);
782
889
  runSkills(args);
783
890
  for (const name of ours) delete lock.skills[name];
784
891
  writeLock(flags, lock);
@@ -795,7 +902,8 @@ function printSkill(skill, width, extra) {
795
902
  const mark = extra.omit?.includes(skill.name) ? yellow("omitted ") : skill.optional ? dim("optional") : green("kept ");
796
903
  const credit = [skill.author, skill.license].filter(Boolean).join(", ");
797
904
  say(`${mark} ${skill.name.padEnd(width)} ${dim(credit)}`);
798
- if (skill.why) say(` ${skill.why}`);
905
+ const why = skill.why ?? (skill.kit ? `Every skill ${skill.author} publishes, kept current on update.` : "");
906
+ if (why) say(` ${why}`);
799
907
  }
800
908
 
801
909
  function list(flags) {
@@ -819,9 +927,10 @@ function list(flags) {
819
927
  const { command, rest, flags } = parseArgs(process.argv.slice(2));
820
928
  if (flags.version) console.log(readJson(join(root, "package.json")).version);
821
929
  else if (flags.help || command === "help") console.log(help);
822
- else if (command === "init") init(flags);
930
+ else if (command === "init") await init(flags);
823
931
  else if (command === "add") add(flags, rest);
824
932
  else if (command === "remove") remove(flags, rest);
825
- else if (command === "update") update(flags);
933
+ else if (command === "update") await update(flags);
826
934
  else if (command === "list") list(flags);
935
+ else if (command === "router") process.stdout.write(kitRouter());
827
936
  else fail(`Unknown command: ${command}\n\n${help}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonandev/longbeard",
3
- "version": "0.6.0",
3
+ "version": "0.9.0",
4
4
  "description": "Designs like an Art director. Codes like a senior.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,6 +40,8 @@
40
40
  "node": ">=18"
41
41
  },
42
42
  "scripts": {
43
- "longbeard": "node ./bin/long-beard.js"
43
+ "longbeard": "node ./bin/long-beard.js",
44
+ "router": "node ./bin/long-beard.js router > AGENTS.md",
45
+ "test": "node --test"
44
46
  }
45
47
  }
@@ -2,12 +2,14 @@
2
2
  name: design-md
3
3
  description: >
4
4
  Use when building or changing UI and the project has a DESIGN.md, or when
5
- they confirmed writing or updating the brand file after a hunt. Follow that
6
- file. Write or update DESIGN.md only from the adaptation they confirmed
7
- after a hunt — colour, type, control, what we take, what we change, and
8
- leave. Do not copy a reference’s exact palette or faces. Do not invent a
9
- look they did not accept. If they asked to design or define direction and
10
- there is no DESIGN.md and no Figma, that is design-reference-hunt first.
5
+ they confirmed writing or updating the brand file. Follow that file. Write
6
+ or update DESIGN.md only from what they confirmed: the adaptation after a
7
+ hunt, or decisions they approved on a rendered prototype (with the reason,
8
+ the date, and a contrast check). DESIGN.md names ideas, never sources or
9
+ .design paths. Do not copy a reference’s exact palette or faces. Do not
10
+ invent a look they did not accept. If they asked to design or define
11
+ direction and there is no DESIGN.md and no Figma, that is
12
+ design-reference-hunt first.
11
13
  ---
12
14
 
13
15
  # DESIGN.md
@@ -16,38 +18,47 @@ The project's `DESIGN.md` is the durable look. Coding follows it when it exists.
16
18
 
17
19
  ## Follow
18
20
 
19
- If the file exists, read it before writing UI. Use its colour, type, spacing, control, and components the way that file states them.
21
+ If the file exists, read it before writing UI. Use its colour, type, spacing, control, behaviour, and components the way that file states them.
20
22
 
21
23
  They asked to **hunt**, **define direction**, or find references → load `design-reference-hunt`. Do not rewrite this file until they confirm after that pass.
22
24
 
23
25
  ## Write or update (only on confirm)
24
26
 
25
- Write or change `DESIGN.md` only when they said yes to persisting the adaptation (after a whole-look leading pick, or after accepting a later hunt). Do not invent hexes, faces, or controls. Do not copy the leading card’s `colour` or `type` into the brand. Take the adaptation from:
27
+ Write or change `DESIGN.md` only when they said yes to persisting the adaptation (after a whole-look leading pick, or after accepting a later hunt), or approved a decision on a rendered prototype (below). Do not invent hexes, faces, or controls. Do not copy the leading card’s `colour` or `type` into the brand. Take the adaptation from:
26
28
 
27
- - `.design/board.md` **Read this** (`take`, `change`, `ownable`, `colour`, `type`, `control`, `leave`, `gaps`), or
28
- - `.design/hunts/<slug>/note.md` when the change is a later pass they accepted
29
+ - `.design/board.md` **Read this** (`take`, `change`, `ownable`, `colour`, `type`, `control`, `behaviour`, `leave`, `gaps`), or
30
+ - `.design/hunts/<slug>/board.md` **Read this** when the change is a later pass they accepted
29
31
 
30
- `.design/moodboard.html` is the references, and `.design/proof.html` is the adaptation shown with the project’s own words. Do not read either as the brand: the brand is **Read this**.
32
+ `.design/moodboard.html` is the references. Do not read it as the brand: the brand is **Read this**.
31
33
 
32
- If **Read this** has no `take`, `change`, `colour`, or `type`, or has no `ownable`, stop and send it back to the hunt. Do not fill those in here.
34
+ If a whole-look **Read this** has no `take`, `change`, `colour`, or `type`, or has no `ownable`, stop and send it back to the hunt. Do not fill those in here.
33
35
 
34
36
  If neither file exists, ask which reference to follow. Do not guess.
35
37
 
36
38
  Refuse to write a colour palette whose text/background pairs have not been through contrast check. On a board from `design-reference-hunt`, **Read this** `contrast` lists each adapted pair with ratio and verdict (`scripts/contrast.mjs`). Body and small text need 4.5:1; large text and non-text marks need 3:1. If pairs are missing or any still FAIL, send the board back — do not write failing hexes into `DESIGN.md`.
37
39
 
40
+ **Ideas, not sources.** `DESIGN.md` is usually committed, and often public; `.design/` is not. It never names a product, site, studio, or designer the hunt looked at, never cites a `.design/` path, and its contrast notes name our tokens, not a reference's colour. The board's card names and its `leave` line name sources, which is fine there. Turn each into the idea before it crosses: “a quiet reading page, light and dark”, not the product it came from; “a bright brand accent”, not whose.
41
+
42
+ ## Decisions approved on a prototype
43
+
44
+ Most of a design is made after the direction, on rendered screens: the controls, the text sizes, the navigation, the states. When they approve one of those decisions on a rendered prototype, it may go into `DESIGN.md` without a hunt. Write what was approved, the reason they gave, and the date, under **Decisions**. Every new or changed colour token — a surface, a pressed state, a selection, a focus ring, a faint control — goes through the hunt skill's `scripts/contrast.mjs` first, with the same thresholds. An `ownable` element marked unconfirmed is confirmed here, once they have seen it rendered, or replaced.
45
+
46
+ ## The file
47
+
38
48
  Expand the adaptation into a short brand file a builder can follow without the shots open:
39
49
 
40
50
  ```markdown
41
51
  # Design
42
52
 
53
+ To see it working: <prototype path, once there is one>. This file wins where they differ.
54
+
43
55
  ## Direction
44
- - leads: <card name>
45
- - also: <card name, or none>
46
- - from: .design/board.md | .design/hunts/<slug>/note.md
47
- - take: <from Read this>
56
+ - leads: <the idea that leads, in our words>
57
+ - also: <other ideas they liked, in our words, or none>
58
+ - draws on: <what we learn from them: a layout, a temperature, a kind of picture>
48
59
  - change: <the twist>
49
- - ownable: <the one concrete element from the project’s own identity, from Read this>
50
- - leave: <their name, their exact colours, their exact faces, and the rest>
60
+ - ownable: <the one concrete element from the project’s own identity; “unconfirmed” until seen rendered>
61
+ - leave: <ideas we do not use, in our words: “a bright brand accent”, never a product's name>
51
62
 
52
63
  ## Colour
53
64
  - <adapted hex>: <where it sits — ground, text, accent, control fill only if the shot fills one>
@@ -61,14 +72,20 @@ Expand the adaptation into a short brand file a builder can follow without the s
61
72
  ## Layout
62
73
  - <what we take that still belongs on this topic. Form cards: layout or component only, not their type or colours>
63
74
 
75
+ ## Behaviour
76
+ - <how the page moves, pages, fades, or reveals. Omit the section when Read this says none>
77
+
64
78
  ## Imagery
65
79
  - <what the pictures are, if any>
66
80
 
67
81
  ## Gaps
68
- - <screens with no strong reference, from Read this. A builder treats these as open, not as solved by a borrowed pattern>
82
+ - <screens with no strong reference, from Read this. A builder treats these as open, not as solved by a borrowed pattern. A prototype closes them>
83
+
84
+ ## Decisions
85
+ - <date>: <what they approved on the prototype> — <the reason they gave>
69
86
 
70
87
  ## Do not
71
- - <the leave line>
88
+ - <the leave line, as ideas>
72
89
  ```
73
90
 
74
91
  A **later hunt** they accepted: update only the sections that pass changes (often Layout, sometimes Control). Keep colour and type unless they explicitly accepted a change to those. Say in chat what you changed.