flet-box 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,23 @@
1
1
  // bin/utils/templates.js
2
2
 
3
+ import * as skills from "./skills.js";
4
+
5
+ /**
6
+ * The plate behind everything a reader sees before the app paints: the PWA
7
+ * splash (`manifest.json`), the Android and iOS launch screens, the adaptive
8
+ * icon background, and the static `<meta name="theme-color">`.
9
+ *
10
+ * It is the dark palette's `surface` — the zinc scale the 2026-10 design rebuild
11
+ * moved to, replacing the indigo shell color that stayed in the scaffold and kept
12
+ * showing on installed PWAs long after the app itself had changed color. One
13
+ * value because a native splash cannot follow a theme; `applyPalette()` writes
14
+ * the live palette onto `<meta name="theme-color">` at runtime, so the bars do.
15
+ */
16
+ export const SHELL_BRAND = "#18181b";
17
+
18
+ /** `SHELL_BRAND` as the channels the icon and splash scripts composite with. */
19
+ export const SHELL_BRAND_RGB = { r: 24, g: 24, b: 27 };
20
+
3
21
  export const indexHtml = (appName = "FletBox App") => `<!DOCTYPE html>
4
22
  <html lang="en">
5
23
  <head>
@@ -19,7 +37,7 @@ export const indexHtml = (appName = "FletBox App") => `<!DOCTYPE html>
19
37
  <meta property="og:description" content="${appName} built with Flet-Box.">
20
38
  <meta property="og:type" content="website">
21
39
 
22
- <meta name="theme-color" content="#1a1a2e">
40
+ <meta name="theme-color" content="${SHELL_BRAND}">
23
41
 
24
42
  <!-- ============================================================
25
43
  GOOGLE ADSENSE (optional — disabled by default)
@@ -904,7 +922,7 @@ export const capacitorConfig = (appName, appId) => `${JSON.stringify(
904
922
  appId,
905
923
  appName,
906
924
  webDir: "www",
907
- backgroundColor: "#1a1a2e",
925
+ backgroundColor: SHELL_BRAND,
908
926
  server: { androidScheme: "https", iosScheme: "https" },
909
927
  },
910
928
  null,
@@ -960,7 +978,7 @@ const densities = [
960
978
  ["xxhdpi", 144],
961
979
  ["xxxhdpi", 192],
962
980
  ];
963
- const background = { r: 26, g: 26, b: 46 };
981
+ const background = { r: ${SHELL_BRAND_RGB.r}, g: ${SHELL_BRAND_RGB.g}, b: ${SHELL_BRAND_RGB.b} };
964
982
 
965
983
  for (const [density, size] of densities) {
966
984
  const directory = path.join(androidRes, \`mipmap-\${density}\`);
@@ -998,7 +1016,7 @@ const backgroundColor = /(<color name="ic_launcher_background">)#(?:[A-Fa-f0-9]{
998
1016
  if (!backgroundColor.test(xml)) {
999
1017
  throw new Error(\`Invalid adaptive icon background resource: \${backgroundPath}\`);
1000
1018
  }
1001
- await writeFile(backgroundPath, xml.replace(backgroundColor, "$1#1a1a2e$2"));
1019
+ await writeFile(backgroundPath, xml.replace(backgroundColor, "$1${SHELL_BRAND}$2"));
1002
1020
 
1003
1021
  // SPLASH SCREENS
1004
1022
  // The launch theme (AppTheme.NoActionBarLaunch) shows @drawable/splash while the
@@ -1066,8 +1084,8 @@ const infoPlistPath = path.join(nativeAppDir, "Info.plist");
1066
1084
  const launchScreenPath = path.join(nativeAppDir, "Base.lproj", "LaunchScreen.storyboard");
1067
1085
  const logoPath = path.join(projectRoot, "assets", "logo.png");
1068
1086
 
1069
- // Brand background, the same #1a1a2e as theme-color in index.html and manifest.json.
1070
- const background = { r: 26, g: 26, b: 46 };
1087
+ // Brand background, the same value as theme-color in index.html and manifest.json.
1088
+ const background = { r: ${SHELL_BRAND_RGB.r}, g: ${SHELL_BRAND_RGB.g}, b: ${SHELL_BRAND_RGB.b} };
1071
1089
  const backgroundComponent = (value) => Number((value / 255).toFixed(6));
1072
1090
 
1073
1091
  const requireExists = async (target) => {
@@ -1245,8 +1263,8 @@ export const manifest = (appName = "FletBox App") => `{
1245
1263
  "scope": "./",
1246
1264
  "display": "standalone",
1247
1265
  "display_override": ["window-controls-overlay"],
1248
- "theme_color": "#1a1a2e",
1249
- "background_color": "#1a1a2e",
1266
+ "theme_color": "${SHELL_BRAND}",
1267
+ "background_color": "${SHELL_BRAND}",
1250
1268
  "orientation": "any",
1251
1269
  "icons": [
1252
1270
  {
@@ -1653,10 +1671,13 @@ framework from scratch:
1653
1671
 
1654
1672
  - \`AGENTS.md\` — the rules: FletBox syntax only, real widgets and props only, and the
1655
1673
  verification loop it must run after every edit.
1656
- - \`.claude/skills/fletbox-clean-ui/SKILL.md\` — the design rules themselves, numbered
1657
- 00 to 20 and measured: which token, which step of the scale, which contrast. The
1658
- same text is at \`.qoder/skills/fletbox-clean-ui/SKILL.md\` and as a Cursor rule in
1659
- \`.cursor/rules/fletbox-clean-ui.mdc\`.
1674
+ - \`skills/\` — four files, one per subject, mirrored into \`.claude/skills/\`,
1675
+ \`.qoder/skills/\` and \`.cursor/rules/\` so any assistant reads the same contract:
1676
+ \`fletbox-rules\` (FletBox only, look an API up before using it, the rem contract),
1677
+ \`fletbox-design\` (the numbered design rules — tokens, the scale, hierarchy, the
1678
+ four states, measured contrast, the dated tells), \`fletbox-motion\` (when a screen
1679
+ may move and through which widget) and \`fletbox-memory\` (the journal that hands
1680
+ progress from one AI to the next). \`AGENTS.md\` §0 is the index.
1660
1681
  - \`.claude/CLAUDE.md\`, \`.cursor/rules/fletbox.mdc\` — short pointers to \`AGENTS.md\` for
1661
1682
  Claude Code and Cursor.
1662
1683
  - \`.fletbox/api/cheatsheet.md\` — every widget and its real props, generated from the
@@ -1739,7 +1760,7 @@ run \`npm run ios:open\`.
1739
1760
 
1740
1761
  Replace \`assets/logo.png\` with a 1024×1024 logo before distributing; the icon,
1741
1762
  the launch images and the launch background are all generated from it. The
1742
- launch background is the app brand color \`#1a1a2e\`, which lives in
1763
+ launch background is the app brand color \`${SHELL_BRAND}\`, which lives in
1743
1764
  \`scripts/sync-ios-assets.mjs\`.
1744
1765
 
1745
1766
  Capacitor uses a local HTTPS origin (\`https://localhost\`) in the Android and
@@ -2417,6 +2438,26 @@ export const agentsMd = (appName, template, version) =>
2417
2438
  'fixes every size and color you may use, and the checker in section 5',
2418
2439
  'proves you right or wrong in seconds.',
2419
2440
  '',
2441
+ '## 0. Start here — the skills folder',
2442
+ '',
2443
+ 'Everything this framework knows about building a professional screen is grouped',
2444
+ 'in four files under `skills/`, one per subject. They are copied byte-for-byte',
2445
+ 'into `.claude/skills/` and `.qoder/skills/` so those assistants load them',
2446
+ 'automatically, and into `.cursor/rules/` as pointer rules — `skills/` is the',
2447
+ 'text, the rest are mirrors of it. Open the file your task touches before',
2448
+ 'writing code, not after:',
2449
+ '',
2450
+ '| Skill | What it owns | Read it when |',
2451
+ '| --- | --- | --- |',
2452
+ '| [fletbox-rules](skills/fletbox-rules/SKILL.md) | FletBox syntax only: no widget or prop from React, Vue, Svelte or Flutter; look an API up before using it; the rem contract; aliases; cleanup; the two gates | always, first |',
2453
+ '| [fletbox-design](skills/fletbox-design/SKILL.md) | the numbered design rules — tokens, the scale, hierarchy, the four states, measured contrast, the framework traps, the dated tells, density | any screen, form, list, dialog or hero |',
2454
+ '| [fletbox-motion](skills/fletbox-motion/SKILL.md) | whether a thing may move at all, and through which of `AnimatedBox`, `AnimatedText`, `ParallaxBox` or `animate` | any transition, entrance, pulse or parallax |',
2455
+ '| [fletbox-memory](skills/fletbox-memory/SKILL.md) | the journal that hands progress from one AI to the next | at the start and at the end of every session |',
2456
+ '',
2457
+ 'Sections 1 to 7 below are the short version of those files, kept here because a',
2458
+ 'session that stops reading early still gets the rules that break the build. When',
2459
+ 'a summary here and a skill disagree, the skill is the longer argument and wins.',
2460
+ '',
2420
2461
  '## 1. The API is a fact, not a guess',
2421
2462
  '',
2422
2463
  'Never invent a widget, prop, hook or helper. Look it up:',
@@ -2618,7 +2659,7 @@ export const agentsMd = (appName, template, version) =>
2618
2659
  'warning is allowed to stay only when you can justify it in one sentence.',
2619
2660
  '',
2620
2661
  '`npm run ui` proves what is *written*; the rules it cites are the numbered ones',
2621
- 'in [.claude/skills/fletbox-clean-ui/SKILL.md](.claude/skills/fletbox-clean-ui/SKILL.md),',
2662
+ 'in [skills/fletbox-design/SKILL.md](skills/fletbox-design/SKILL.md),',
2622
2663
  'and that file is the part a checker cannot do — hierarchy, copy, whether the',
2623
2664
  'screen solves the problem. Read it before writing a screen, not after.',
2624
2665
  '',
@@ -2631,12 +2672,14 @@ export const agentsMd = (appName, template, version) =>
2631
2672
  '',
2632
2673
  '## 6. Memory — do not relearn the same thing',
2633
2674
  '',
2634
- 'At the start of every session read `.fletbox/memory/MEMORY.md` and any entry it',
2635
- 'points at. That is how this agent remembers the framework between chats instead',
2636
- 'of rediscovering it each time.',
2675
+ 'The full format lives in [skills/fletbox-memory/SKILL.md](skills/fletbox-memory/SKILL.md).',
2676
+ 'The short version: at the start of every session read',
2677
+ '`.fletbox/memory/MEMORY.md` and the entries it points at, including',
2678
+ '`notes/current-status.md`. That is how this agent remembers the app between',
2679
+ 'chats — and between models — instead of rediscovering it each time.',
2637
2680
  '',
2638
2681
  '- When you learn something non-obvious about this app or the framework, write',
2639
- ' `.fletbox/memory/<kebab-case-topic>.md` with: what (fact or rule), **Why:**',
2682
+ ' `.fletbox/memory/notes/<kebab-case-topic>.md` with: what (fact or rule), **Why:**',
2640
2683
  ' (the incident or constraint behind it), **How to apply:** (when it kicks in),',
2641
2684
  ' and an absolute date for anything time-bound.',
2642
2685
  '- Add a one-line pointer to it in `MEMORY.md`. Keep the index short.',
@@ -2669,7 +2712,7 @@ export const claudeMd = () =>
2669
2712
  [
2670
2713
  '# CLAUDE.md',
2671
2714
  '',
2672
- 'The rules for this project live in [AGENTS.md](./AGENTS.md). Read it first and',
2715
+ 'The rules for this project live in [AGENTS.md](../AGENTS.md). Read it first and',
2673
2716
  'follow it exactly — FletBox syntax only, real props only.',
2674
2717
  '',
2675
2718
  'Two shortcuts replace guessing:',
@@ -2679,8 +2722,12 @@ export const claudeMd = () =>
2679
2722
  ' `--diff` lists the props that are documented but dead or used but undeclared.',
2680
2723
  ' `.fletbox/api/api.json` is the same surface for all widgets, as data.',
2681
2724
  '- Design is not improvised. The rules are a file: read',
2682
- ' [skills/fletbox-clean-ui/SKILL.md](skills/fletbox-clean-ui/SKILL.md) before',
2683
- ' writing a screen. `npm run ui` proves the part a checker can prove (tokens,',
2725
+ ' [skills/fletbox-design/SKILL.md](skills/fletbox-design/SKILL.md) before writing',
2726
+ ' a screen (the same text is mirrored to `.claude/skills/` and `.qoder/skills/`,',
2727
+ ' so those loaders find it by themselves). The set is four files: `fletbox-rules`',
2728
+ ' for the API contract, `fletbox-design` for the screen, `fletbox-motion` before',
2729
+ ' anything moves, `fletbox-memory` for the journal.',
2730
+ ' `npm run ui` proves the part a checker can prove (tokens,',
2684
2731
  ' the scale, 40px targets, labels, contrast) and cites the rule number it',
2685
2732
  ' broke; AGENTS.md §4 has the tables. Scale: 4 · 8 · 12 · 16 · 18 · 24 · 32 ·',
2686
2733
  ' 40 · 48 · 64 · 96 spacing, radii 4/8/12/16/999, type 12 · 14 · 16 · 18 · 24',
@@ -2689,8 +2736,9 @@ export const claudeMd = () =>
2689
2736
  'After every edit: `npm run check` (does it exist), `npm run ui` (is it clean),',
2690
2737
  'then look at the screen — the checker has no eyes.',
2691
2738
  '',
2692
- 'Memory: read `.fletbox/memory/MEMORY.md` before working, and write new entries',
2693
- 'there when you learn something the next session should not rediscover.',
2739
+ 'Memory: read `.fletbox/memory/MEMORY.md` and `notes/current-status.md` before',
2740
+ 'working, and write what you learn there — `fletbox-memory` is the format — when',
2741
+ 'the next session should not have to rediscover it.',
2694
2742
  '',
2695
2743
  ].join('\n');
2696
2744
 
@@ -2711,8 +2759,8 @@ export const cursorRules = () =>
2711
2759
  ' `.fletbox/api/cheatsheet.md`, look it up: `flet-box unpack <Widget>` (or',
2712
2760
  ' `npm run check -- --props <Widget>`). If it is not listed, it does not exist —',
2713
2761
  ' do not invent it. `unpack --example` prints a call that is safe to paste.',
2714
- '- Design rules: read [fletbox-clean-ui.mdc](./fletbox-clean-ui.mdc) in this',
2715
- ' folder — the numbered clean-UI rules the agent is expected to follow. One',
2762
+ '- Design rules: read [fletbox-design.mdc](./fletbox-design.mdc) in this',
2763
+ ' folder — the numbered design rules the agent is expected to follow. One',
2716
2764
  ' brand color per screen, taken from the `colors` tokens — never a hex literal.',
2717
2765
  ' Sizes come from the scale only: 4 · 8 · 12 · 16 · 18 · 24 · 32 · 40 · 48 · 64',
2718
2766
  ' · 96 spacing, radii 4/8/12/16/999, type 12 · 14 · 16 · 18 · 24 · 32 · 40 · 48.',
@@ -2725,6 +2773,45 @@ export const cursorRules = () =>
2725
2773
  '',
2726
2774
  ].join('\n');
2727
2775
 
2776
+ /**
2777
+ * The handover note every session rewrites instead of appending to. It ships
2778
+ * filled with the scaffold's own state, so the first real session has the shape
2779
+ * to copy, and `fletbox-memory` owns the rules for keeping it honest.
2780
+ *
2781
+ * @param {string} appName
2782
+ * @param {string} template
2783
+ * @returns {string}
2784
+ */
2785
+ export const memoryStatusMd = (appName, template) => {
2786
+ const today = new Date().toISOString().slice(0, 10);
2787
+ return [
2788
+ '# Status',
2789
+ '',
2790
+ 'The handover file. Rewrite these lines as you work; do not append to them.',
2791
+ 'Whoever opens this next may be a different model with no memory of this',
2792
+ 'session, so "done" has to mean "verified" and "next" has to be a sentence,',
2793
+ 'not a mood.',
2794
+ '',
2795
+ `**Doing:** nothing yet. This is the fresh \`${template}\` scaffold of \`${appName}\`.`,
2796
+ '',
2797
+ '**Done and verified:** the app boots and both gates pass on the template as',
2798
+ 'created — `npm run check` (only real APIs) and `npm run ui` (tokens, the scale,',
2799
+ 'tap targets, labels, contrast). That is the baseline; anything under it is',
2800
+ "whatever the next session changed.",
2801
+ '',
2802
+ '**Not done / half-done:** the screens and copy are the demo the template ships',
2803
+ 'with. They are placeholders until a real screen replaces them.',
2804
+ '',
2805
+ '**Next:** write one sentence about what this app is for, then delete the demo',
2806
+ 'screens it does not need.',
2807
+ '',
2808
+ '**Blocked:** none. Put the question to ask here the moment one exists.',
2809
+ '',
2810
+ `**Updated:** ${today} · scaffold.`,
2811
+ '',
2812
+ ].join('\n');
2813
+ };
2814
+
2728
2815
  export const memoryIndexMd = (appName) =>
2729
2816
  [
2730
2817
  '# Memory index',
@@ -2732,6 +2819,7 @@ export const memoryIndexMd = (appName) =>
2732
2819
  `Persistent notes for the AI agent working on \`${appName}\`. One line per entry.`,
2733
2820
  'Read this at the start of every session; open the files it points at.',
2734
2821
  '',
2822
+ '- [Current status](notes/current-status.md) — what is built now, what is verified, what is next: the handover between AIs',
2735
2823
  '- [Project baseline](notes/baseline.md) — template, flet-box version, verified commands',
2736
2824
  '',
2737
2825
  ].join('\n');
@@ -2805,500 +2893,44 @@ export const checkAppScript = (appName) =>
2805
2893
  ].join('\n');
2806
2894
 
2807
2895
  // ---------------------------------------------------------------------------
2808
- // Clean-UI skill
2896
+ // Skills
2809
2897
  // ---------------------------------------------------------------------------
2810
- // The design-system contract, merged from two sources and then measured against
2811
- // this framework: Angelene Wallis, "No bullshit guide to UX" (2022), and "The UI/
2812
- // UX Playbook" (uxpeak, 144 pages). Every number is either one the books state or
2813
- // one read off the installed palette; every prop named here exists in the API the
2814
- // app is generated with. The rules are numbered so `flet-box check-ui` can cite
2815
- // them, and so the agent can quote one back when it breaks one on purpose.
2816
- //
2817
- // Two halves, always kept in agreement: what the checker proves statically, and
2818
- // what only a person can see. The skill names both so the agent never claims the
2819
- // checker covers more than it does.
2820
- export const cleanUiSkill = () =>
2898
+ // The text lives in the package-root skills/ folder, one kebab-case directory per
2899
+ // subject (rules, design, motion, memory) with a SKILL.md inside. A real file keeps
2900
+ // the contract editable, diffable, and checkable by scripts/check-skills.mjs, which
2901
+ // proves every widget and prop a skill names actually exists. The design rules come
2902
+ // from Angelene Wallis, "No bullshit guide to UX" (2022), and "The UI/UX Playbook"
2903
+ // (uxpeak), measured against this framework: every number is read off the installed
2904
+ // palette or src/tools/scale.js, and they are numbered so `flet-box check-ui` can
2905
+ // cite the one it broke.
2906
+
2907
+ /**
2908
+ * Cursor has no skills folder, so every skill also ships as a pointer rule: its own
2909
+ * frontmatter description as the trigger, and the path an agent must open. One text,
2910
+ * three loaders, never three edits — and no summary that can drift from the skill.
2911
+ *
2912
+ * @param {string} name kebab-case skill folder name
2913
+ * @param {{alwaysApply?: boolean, globs?: string}} [options]
2914
+ * @returns {string}
2915
+ */
2916
+ export const skillCursorRule = (name, options = {}) =>
2821
2917
  [
2822
2918
  "---",
2823
- "name: fletbox-clean-ui",
2824
- "description: Design-system contract for a FletBox app - tokens only, one scale, three-tier hierarchy, a state for every interaction, measured contrast, destructive actions designed last. Use when creating, editing or reviewing any screen, form, list, dialog or action control.",
2919
+ `description: ${skills.skillDescription(name).split(" - ")[0]}`,
2920
+ `globs: ${JSON.stringify(options.globs || "src/**/*.js")}`,
2921
+ `alwaysApply: ${options.alwaysApply ? "true" : "false"}`,
2825
2922
  "---",
2826
2923
  "",
2827
- "# Clean UI — the system rules",
2828
- "",
2829
- "You are not decorating screens. You are extending a system that every later",
2830
- "screen will copy. A decision that cannot be restated as a rule is a defect, not",
2831
- "a style.",
2832
- "",
2833
- "When two goals conflict, take them in this order:",
2834
- "",
2835
- "1 Consistency · 2 Clarity · 3 Accessibility · 4 Usability · 5 Scalability",
2836
- "· 6 Maintainability · 7 Conversion",
2837
- "",
2838
- "Never optimize for aesthetics alone. Beauty is what is left when the system is",
2839
- "correct; it is an outcome, never a target you can hit directly.",
2840
- "",
2841
- "## 00 The two gates",
2842
- "",
2843
- "```bash",
2844
- "npm run check # the API is real: widgets, props, imports",
2845
- "npm run ui # the screen follows these rules (codes map to rule numbers)",
2846
- "npm run ui -- --tokens # measured contrast of every token, on both surfaces",
2847
- "npm run dev # then look at it: the checker has no eyes",
2848
- "```",
2849
- "",
2850
- "A finding you keep needs one sentence of justification, in the commit or in",
2851
- "`.fletbox/memory/`. If that sentence is \"the design wants it\", the design is",
2852
- "what needs writing down, because the next screen will copy it.",
2853
- "",
2854
- "Sources, cited as `NBG p.N` (No bullshit guide to UX) and `Playbook p.N`",
2855
- "(The UI/UX Playbook; the PDF page — the printed folio is one lower). Every",
2856
- "number below is either stated by one of them or measured on this palette.",
2857
- "Every prop in every call below exists in `.fletbox/api/api.json`.",
2858
- "",
2859
- "## 01 System before component",
2860
- "",
2861
- "Define the token, then the component, then the screen. In that order, always.",
2862
- "Components are outputs; the system is the source of truth.",
2863
- "",
2864
- "- A screen that needs a value the system does not have adds a token to",
2865
- " `src/database/themes.js`. It does not write the value inline.",
2866
- "- A component that needs a special exception: challenge the exception first, and",
2867
- " if it survives, change its siblings too. Two components solving one problem",
2868
- " differently get unified, not documented.",
2869
- "- If you cannot say which rule a decision follows, do not make it.",
2870
- "",
2871
- "## 02 Consistency is sacred",
2872
- "",
2873
- "No arbitrary differences. If a person learns one pattern here, they must not",
2874
- "relearn it anywhere else (Playbook p.038).",
2875
- "",
2876
- "- One button scheme for the whole app: the primary is `variant: \"filled\"`, the",
2877
- " secondary `variant: \"outlined\"`, the tertiary `variant: \"text\"`. Never a",
2878
- " per-card button color chosen to match the picture — people then wonder whether",
2879
- " each button does something different (p.040-041).",
2880
- " A filled `Button` defaults to `bgColor: colors.surface` with `colors.text` on",
2881
- " it, so the primary action must name the brand pair: `bgColor: colors.primary`",
2882
- " and `color: colors.onPrimary`. An outlined one must name its border (`color:`),",
2883
- " or it inherits the surface it sits on and disappears.",
2884
- "- One radius language per screen. A rounded picture next to a square button reads",
2885
- " as two products (p.039).",
2886
- "- One icon family, one weight, one size per screen. The one allowed mix is state:",
2887
- " a selected tab filled, unselected tabs outlined (p.045-046).",
2888
- "- Cards in the same row share a height. When the copy is uncontrollable, fix the",
2889
- " height and bottom-align the action; the empty space goes in the middle",
2890
- " (p.043-044).",
2891
- "- Same purpose, same shape: identical inputs get the same `height`,",
2892
- " `borderRadius`, states and validation behavior (rule 13).",
2893
- "- Images inside a repeated card sit in the same slot, same size, same crop",
2894
- " (`fit`, `shape`), whatever the picture is (p.042).",
2895
- "",
2896
- "## 03 Design tokens only",
2897
- "",
2898
- "No arbitrary values, no hex, no `px` strings. Every value comes from the scale.",
2899
- "",
2900
- "```",
2901
- "space 4 · 8 · 12 · 16 · 18 · 24 · 32 · 40 · 48 · 64 · 96",
2902
- "radius 4 · 8 · 12 · 16 · 999 (pill)",
2903
- "type 12 caption · 14 body-small · 16 body · 18 subtitle · 24 title",
2904
- " 32 headline · 40 display-sm · 48 display",
2905
- "weight 400 body · 500 label · 600 title · 700 headline",
2906
- "line 1.5-1.6 body · 1.2-1.3 heading",
2907
- "depth elevation 0 · 1 · 2 · 3 · 4 · 5",
2908
- "```",
2909
- "",
2910
- "- The base unit is 4 and everything is a multiple of it (Playbook p.028). A value",
2911
- " like 13, 19, 21 or 31 is not a design decision, it is drift.",
2912
- "- Never type a hex or `rgb()` outside `src/database/themes.js`",
2913
- " (`RAW_COLOR`). If a token is missing, add it there.",
2914
- "- Never build a color by appending alpha to a token — `colors.primary + \"15\"` is",
2915
- " a one-off shade the rest of the app cannot reuse (`HAND_MIXED_COLOR`). The",
2916
- " tints exist: `colors.primaryBg`, `colors.errorBg`, `colors.successBg`,",
2917
- " `colors.warningBg`, `colors.infoBg`.",
2918
- "- A frosted surface is `colors.glass` with `colors.glassBorder` and a",
2919
- " `backdropFilter`; it is translucent on purpose, so put it over imagery,",
2920
- " not over body text. A hand-written `rgba()` is a `RAW_COLOR` like any other.",
2921
- "- Text on a brand fill is `colors.onPrimary`, never a literal white.",
2922
- "- Tap targets are at least 40 on a side (`SMALL_TAP_TARGET`). Reach it with",
2923
- " `height`, not with padding. The books argue this qualitatively (Fitts, p.099);",
2924
- " 40 is the floor this system enforces and 44 is what a phone primary action",
2925
- " gets.",
2926
- "- `size: \"small\"` on a `Button` is for dense secondary actions, never for the one",
2927
- " thing a phone screen asks for.",
2928
- "",
2929
- "## 04 Hierarchy must be obvious in three seconds",
2930
- "",
2931
- "A person must answer three questions without reading: what is this, what",
2932
- "matters, what happens next. There are exactly four levers — size, color, weight,",
2933
- "position (Playbook p.007). If everything is emphasized, nothing is.",
2924
+ `Read [skills/${name}/SKILL.md](../../skills/${name}/SKILL.md) before the work it`,
2925
+ "describes. The same bytes sit at `.claude/skills/…` and `.qoder/skills/…` so the",
2926
+ "loaders find them automatically, and that mirror is generated — edit the file",
2927
+ "above and regenerate, never the copy.",
2934
2928
  "",
2935
- "- One primary action per screen. One secondary. Everything else is tertiary.",
2936
- " Never two filled buttons on one view (`MULTIPLE_PRIMARY_ACTIONS`).",
2937
- "- Actions rank by emphasis, information ranks by size: the secondary button keeps",
2938
- " the same `height` as the primary and loses color (p.008); the data gets the",
2939
- " size ladder (p.088). That is how p.008 and p.088 stop contradicting each other.",
2940
- "- In a stat card the value is the largest and darkest text and the label is",
2941
- " smaller and muted. Never the inverse (p.010).",
2942
- "- Darkness means importance: heading darker than body, body muted. Never let a",
2943
- " thumbnail outsize the price (p.009, p.011).",
2944
- "- Never render a detail panel as uniform label:value rows — it has no hierarchy",
2945
- " and cannot be scanned. Promote the one value that matters, demote the rest,",
2946
- " add an icon per row (p.012).",
2947
- "- Before building, list the elements and rank them by user importance; then map",
2948
- " size, color, weight and position onto that ranking (p.010).",
2929
+ "A summary of the skill here would only drift, so this rule is only a pointer.",
2949
2930
  "",
2950
- "## 05 One purpose per screen",
2931
+ "Never invent a widget or prop: `flet-box unpack <Widget>` prints the real ones.",
2951
2932
  "",
2952
- "Write the sentence first: \"this screen lets <who> do <what>\". If it needs an",
2953
- "\"and\", split the screen (NBG pp.40-43).",
2954
- "",
2955
- "- Conflicting goals reduce usability. A task screen carries nothing that does not",
2956
- " serve the task: no promo panel, no second call to action (Playbook p.127).",
2957
- "- Decorative imagery next to a form is allowed only when it is action-free — no",
2958
- " text overlay, no button — and it still has to be about this product, not merely",
2959
- " pretty (p.128).",
2960
- "- Navigation exposes what the job needs and nothing else. Every extra link is a",
2961
- " decision taken before the user made theirs.",
2962
- "",
2963
- "## 06 Reduce cognitive load",
2964
- "",
2965
- "People recognize; they must never memorize, guess or interpret.",
2966
- "",
2967
- "- Chunk to about four items per group and cap a visible group at 7; past that,",
2968
- " truncate and expose one action — \"Show all 21 amenities\" (Playbook p.101).",
2969
- " The 7±2 figure is a myth in its loosest form; plan on four and the group still",
2970
- " holds when someone adds a fifth.",
2971
- "- Recognition over recall: common icons, common words, state visible on screen",
2972
- " rather than in memory (p.104). \"Continue watching\" beats \"remember where you",
2973
- " stopped\".",
2974
- "- Do not hide choices behind a control that must be opened to be seen: variants",
2975
- " as swatches, quantity as a stepper, not a nested menu (p.107-108).",
2976
- "- Never oversimplify into vagueness either: a switch with an icon and no words is",
2977
- " not clean, it is unreadable (p.014).",
2978
- "- If no user has shown they need a feature, remove it rather than park it behind",
2979
- " a toggle (NBG p.136).",
2980
- "",
2981
- "## 07 Spacing communicates the relationship",
2982
- "",
2983
- "Whitespace is functional, not decorative. Related things sit closer than",
2984
- "unrelated things, and that difference is the whole message (Playbook p.013, p.029).",
2985
- "",
2986
- "- Field pattern: label to its own input `12`, that field to the next label `32`.",
2987
- " Equal spacing at both levels makes label ownership ambiguous (p.013).",
2988
- "- Card padding is `16`; the rhythm between cards is `16` or `24`; sections",
2989
- " separate at `24` or `32`; page blocks at `48`. Never mix two rhythms in one list.",
2990
- "- Start a layout with more room than you think you need and tighten it; clutter",
2991
- " is easier to see than cramp is to undo (p.025-027).",
2992
- "- Do not stretch a form or a checkout to the viewport. 1440 is a canvas size, not",
2993
- " a target; give the card the width it needs and let the margin carry the rest",
2994
- " (p.129-130). `Container({ maxWidth: 480 })` around a form, `fullWidth: true`",
2995
- " only on the button inside it.",
2996
- "- Layout is `useState` bindings, `flex`, `gap` and `wrap`. An absolute offset is",
2997
- " for overlays, and then through `stackPosition`, not raw coordinates.",
2998
- "",
2999
- "## 08 Typography is structure",
3000
- "",
3001
- "- Body is `size: 16` (Playbook p.090). Nothing that must be read goes below 12;",
3002
- " the book contradicts itself between 12 (p.090) and 10 (p.096) — 12 is the floor",
3003
- " here.",
3004
- "- Heading: bigger, heavier, darker, tighter. Body: smaller, regular, muted,",
3005
- " looser. Never the same weight for both, never extra-light for body (p.084-087).",
3006
- "- Line-height: 1.5-1.6 on body, 1.2-1.3 on headings; a 32px heading sits at about",
3007
- " 1.25 (p.091-092). A heading never gets more air than a paragraph.",
3008
- "- Measure: 45-75 characters per line on desktop, 30-40 on mobile. A paragraph",
3009
- " that runs the full width is unreadable at 1440 (p.076-078).",
3010
- "- One typeface; two at the absolute maximum, and then headings against body",
3011
- " (p.075-076). Declare it once in the theme, never per `Text`.",
3012
- "- `align: \"left\"` for every run of text and every list. `right` for numbers and",
3013
- " prices, so magnitudes compare. `center` only for a short title or a lone CTA,",
3014
- " never for a paragraph (p.018, p.094).",
3015
- "- Long copy becomes scannable copy: a short lead, a heading, then one item per",
3016
- " feature with an icon, a bold name and two lines of body; four or more items go",
3017
- " in a two-column grid (p.123-125).",
3018
- "",
3019
- "## 09 Color carries meaning",
3020
- "",
3021
- "- One brand color per screen, and it is the color of the one action the screen",
3022
- " asks for. A second accent on the same view means one of them is wrong.",
3023
- "- Reserve the brand for things you can click. Headers, labels and icons stay",
3024
- " neutral — brand color on a decorative surface teaches people that color means",
3025
- " nothing (Playbook p.066-067).",
3026
- "- Backgrounds are neutral (`colors.background`, `colors.surface`, `colors.card`);",
3027
- " color belongs in the action, not the wall (p.067-068). A dark theme is equally",
3028
- " valid; offer both, because dark mode is expected, not a bonus (p.070).",
3029
- "- Feedback colors are fixed and never redefined: `colors.success`,",
3030
- " `colors.warning`, `colors.danger`, `colors.info`. Red is error, green is",
3031
- " success, amber is warning; never pink for success, never green for delete.",
3032
- "- The signal red and the readable red are different tokens. `colors.danger`",
3033
- " (#ef4444) is for a badge, a border, an icon: as words on a white page it",
3034
- " measures 3.76:1 and that is not AA. `colors.dangerStrong` (#b91c1c) is the red",
3035
- " you may read and press — 6.47:1 as words on white, 6.47:1 with white written on",
3036
- " it, 5.42:1 inside `colors.errorBg`. Same for the others: `colors.warning`",
3037
- " (2.15:1 with white on it) and `colors.success` (2.54:1) are plates and dots,",
3038
- " never a sentence — `colors.warningStrong` (5.02:1) and `colors.successStrong`",
3039
- " (5.48:1) are the readable ones, in either direction. Measure any pair you are",
3040
- " about to ship: `npm run ui -- --tokens`.",
3041
- "- Never carry meaning in color alone — a color-blind person and a phone in",
3042
- " sunlight both lose it. Pair the color with an icon and a word (p.070): a status",
3043
- " chip is `Badge` plus text, a field error is `error` plus `showValidationMessage`.",
3044
- "- Hierarchy inside a fill comes from opacity, not from a second hue.",
3045
- "",
3046
- "## 10 Depth is a scale",
3047
- "",
3048
- "- `elevation: 0-5` is the shadow scale the framework ships (`SHADOW_LEVELS`), and",
3049
- " these widgets read it: `Accordion`, `AppBar`, `BottomNavigation`, `Button`,",
3050
- " `Card`, `Chip`, `Drawer`, `FloatingActionButton`, `ListTile`, `Modal`, `SnackBar`.",
3051
- " Elsewhere — `Container` and `ListView` included — the number reaches",
3052
- " `style.boxShadow` as a bare number, CSS drops it, and the box stays flat",
3053
- " without saying so: pass a `shadow: \"0 12px 32px rgba(15,23,42,0.12)\"` string",
3054
- " there instead (`DEAD_ELEVATION`).",
3055
- "- Anything that floats gets depth: a dropdown, a menu, a modal, a card on a map.",
3056
- " A shadowless layer merges with the page and the user cannot tell what is on top",
3057
- " (p.050-051).",
3058
- "- Soft, not harsh: depth comes from a wide blur at low opacity, and the shadow",
3059
- " is tinted toward the background hue, never pure grey or black (p.052-054).",
3060
- "- Do not put a white card on a white page — the interface goes flat. Page",
3061
- " `colors.background`, card `colors.card` (p.056-057).",
3062
- "- Borders are thin and rare. Separation comes from space and surface, not from a",
3063
- " rule under every row; a bordered list of everything reads as busy and dated",
3064
- " (p.059-061).",
3065
- "- Glass and blur are a brand decision, and they never survive a light background:",
3066
- " text on frosted glass over white loses the contrast war (p.063-065).",
3067
- "",
3068
- "## 11 Accessibility is a floor, not a feature",
3069
- "",
3070
- "When accessibility and aesthetics conflict, accessibility wins. Every time.",
3071
- "",
3072
- "- Text needs 4.5:1 against what it sits on; large text (24px, or 18px bold) and",
3073
- " meaningful graphics need 3:1. Disabled text is exempt. The book agrees: its",
3074
- " passing examples measure 4.8-6.54:1 and its failures 1.81-2.84:1 (p.021), and",
3075
- " #626262 is the lightest grey that survives on white (p.086).",
3076
- "- Measure instead of arguing: `npm run ui -- --tokens`. On this palette `text` is",
3077
- " 17.85:1, `textSecondary` 4.76:1, `textDisabled` 2.56:1 (decoration only), and",
3078
- " the brand pair `onPrimary` on `primary` is 4.55:1 — which is why `primary` may",
3079
- " carry a button label and not a paragraph. By hand:",
3080
- " `color(\"#0f172a\").contrastRatio(\"#ffffff\")` answers 17.85.",
3081
- "- Text over a photograph needs a scrim: a dark overlay or a blurred plate under",
3082
- " the words. Light text over one dark photo proves nothing about the next photo",
3083
- " (p.022).",
3084
- "- Every field has a visible `label`; a placeholder is a format hint, never a",
3085
- " substitute (p.115). Every switch and checkbox has one too (`UNLABELED_TOGGLE`).",
3086
- "- Every control that is only an icon gets a name: wrap it in",
3087
- " `Tooltip({ text, child })` or give it a visible label (`ICON_ONLY_CONTROL`).",
3088
- "- Every `Image` that carries information has `alt`; `alt: \"\"` is the correct",
3089
- " answer for a decoration (`IMAGE_NO_ALT`).",
3090
- "- Focus must be visible, keyboard must reach everything, and `Esc` must close",
3091
- " whatever opened (`Modal({ closeOnEsc: true, showCloseButton: true })`).",
3092
- "- Motion is optional content: respect a reduced-motion preference; never",
3093
- " auto-play a carousel or a banner.",
3094
- "",
3095
- "## 12 Every interaction has four states",
3096
- "",
3097
- "A control that handles only the happy path is unfinished (NBG pp.94-97). Write",
3098
- "all four, in the same component, before the screen counts as done.",
3099
- "",
3100
- "```js",
3101
- "Column({ gap: 16, children: [",
3102
- " loading ? Skeleton({ width: \"100%\", height: 48, count: 3 }) : null,",
3103
- " !loading && rows.length === 0",
3104
- " ? EmptyState() // headline + illustration + tip + CTA",
3105
- " : null,",
3106
- " failed",
3107
- " ? SnackBar({ message: \"Could not load the list.\", action: \"Retry\", onAction: retry })",
3108
- " : null,",
3109
- " !loading && rows.length > 0 ? ListView({ children: rows }) : null,",
3110
- "]})",
3111
- "```",
3112
- "",
3113
- "- Empty has four parts: a solution-oriented headline, an illustration, two",
3114
- " concrete tips, one primary action. \"You have no projects\" is a dead end, not a",
3115
- " state (Playbook p.135-136).",
3116
- "- Loading appears before the wait, not after it: a `Skeleton` at once beats a",
3117
- " spinner two seconds later (NBG p.134, Doherty).",
3118
- "- Error does exactly three things: says what went wrong in the user's words,",
3119
- " gives the way back, keeps the visual style of the app. Show the code, keep the",
3120
- " navigation, offer links (p.137-138). Never an error code alone, never a shrug.",
3121
- "- Success confirms in place — a `SnackBar`, not a new screen — and offers the",
3122
- " next step while it is there.",
3123
- "- Progress is honest. Show real progress or show a `Skeleton`; a bar that lies",
3124
- " buys one visit and costs the next one (NBG defends inflating them; do not).",
3125
- "",
3126
- "## 13 Forms: prevent the error, do not report it",
3127
- "",
3128
- "- Ask for 3 to 7 things at once. More than that is more than one step, and a step",
3129
- " the user can see: `Stepper({ steps, activeStep, onFinish })` (NBG pp.40-43).",
3130
- "- Width fits the data: CVC is 3 or 4 characters, so the field is short; card",
3131
- " number and name run full width; pair Expiry with CVC on one row (p.115-116).",
3132
- "- A column of three or more fields lives inside a cap — `Container({ maxWidth:",
3133
- " 480 })`. A field as wide as the window answers \"type anything\" and the eye",
3134
- " loses the next line (`UNCONSTRAINED_FORM_WIDTH`).",
3135
- "- A fixed-length code gets one box per character in enlarged type, not one long",
3136
- " field (p.114).",
3137
- "- `Input({ label, placeholder, required, maxLength, validation, type })`:",
3138
- " placeholder carries the format (\"MM/YY\", \"12345\"), `maxLength` and `type`",
3139
- " constrain the input, and validation runs inline as they type, not on submit",
3140
- " (p.119).",
3141
- "- No \"Confirm password\" field. It adds cost, repeats the same typo twice, and",
3142
- " buys a false sense of safety. One field, `passwordToggle: true`, and a strength",
3143
- " line under it (p.117-119).",
3144
- "- Good defaults and autofill remove keystrokes: prefill the country, the saved",
3145
- " address, the last card (p.105).",
3146
- "- Required fields are marked, and the label of the submit button names the",
3147
- " outcome — \"Pay $65\", not \"Submit\" (p.115).",
3148
- "- Never clear a form because one field failed. Keep what they typed.",
3149
- "",
3150
- "## 14 Destructive actions are designed last, and carefully",
3151
- "",
3152
- "- The button carries the verb: \"Delete 3 files\", never \"OK\" or \"Yes\"",
3153
- " (`GENERIC_ACTION_LABEL`) (Playbook p.121).",
3154
- "- Destructive is red — `colors.dangerStrong` for the words, `colors.danger` for",
3155
- " the dot beside them — because green reads safe and a person presses it twice",
3156
- " (`DESTRUCTIVE_COLOR`) (p.120). `colors.danger` alone is 3.76:1 as a label.",
3157
- "- Order in a two-button row: Cancel on the left, destructive on the right. Left",
3158
- " is what a reading eye hits first (`CONFIRM_ORDER`) (p.121-122).",
3159
- "- The dialog states reversibility: \"This action cannot be undone.\" Say it even",
3160
- " when it can, and then offer the way back.",
3161
- "- `AlertDialog({ title, message, confirmText, cancelText, showCancel, onCancel, onConfirm, onClose })`",
3162
- " always leaves an escape: a Cancel, and an X on any layer that can be opened.",
3163
- "- Undo is cheaper than a warning. If the action is reversible, let people undo it",
3164
- " instead of interrupting them to confirm it (NBG pp.116-118).",
3165
- "- On a phone, a destructive action is not in the thumb zone; the thing you do",
3166
- " often is (p.133-135).",
3167
- "",
3168
- "## 15 Reduce interaction cost",
3169
- "",
3170
- "Interaction cost is cognitive effort + physical effort + time (Playbook p.098).",
3171
- "Count it, then cut it: reading, scrolling, searching, deciding, clicking, typing,",
3172
- "waiting, remembering (p.099).",
3173
- "",
3174
- "- Count the steps in the main flow and delete every one that does not change the",
3175
- " outcome (p.105). Three is a target; one is better.",
3176
- "- Put the action next to the thing it acts on: the CTA beside the quantity",
3177
- " stepper, the row action inside the row (p.108, Fitts).",
3178
- "- Keep the control that runs all the time in a fixed, reachable place — a player",
3179
- " bar at the bottom, a primary tab at the thumb (p.100, p.133-135).",
3180
- "- Show the content instead of a door to the content: three real cards beat a",
3181
- " banner that says \"Explore now\" (p.111-113).",
3182
- "- One click where a confirmation is not needed. Two where it is.",
3183
- "",
3184
- "## 16 Respect the platform",
3185
- "",
3186
- "- Use the words, icons and gestures people already brought with them (NBG p.131,",
3187
- " Jakob's law). An invented gesture is a bug report waiting to be written.",
3188
- "- iOS, Android and web each have conventions; meet them instead of overriding",
3189
- " them with a custom pattern. A back that lands where the user expects, a sheet",
3190
- " that dismisses down, a form that advances on Enter.",
3191
- "- Break a convention only when the measurement says the convention is wrong here,",
3192
- " and write that measurement down.",
3193
- "",
3194
- "## 17 The review",
3195
- "",
3196
- "When asked to review a screen, answer in this order, and say why every time:",
3197
- "",
3198
- "1 Goal — what the screen is for, and whether it is one goal.",
3199
- "2 UX problems — cost, states, recall, flow.",
3200
- "3 UI problems — hierarchy, spacing, type, color, depth.",
3201
- "4 System violations — the values that are not tokens, the component that is an",
3202
- " exception.",
3203
- "5 Accessibility violations — measured ratios, targets, labels, focus.",
3204
- "6 Consistency violations — what this screen does differently for no reason.",
3205
- "7 Scalability risk — what breaks when this screen has eleven siblings.",
3206
- "8 Fix — the call, not the mood. Then the rule it establishes.",
3207
- "9 Score — see below.",
3208
- "",
3209
- "Score the seven axes 0-100, but only against evidence, never against taste:",
3210
- "an axis starts at 100 and loses 10 for every open finding of its own codes, so",
3211
- "the number is a count and not an opinion. Below 85 on any axis means the fix is",
3212
- "a rule change, not a pixel move. An axis with no findings and no evidence is",
3213
- "unmeasured, not perfect — say so.",
3214
- "",
3215
- "| Axis | Its codes (from `npm run ui`) |",
3216
- "| --- | --- |",
3217
- "| Consistency | OFF_SCALE_SPACING · OFF_SCALE_RADIUS · OFF_SCALE_TYPE · RAW_COLOR · HAND_MIXED_COLOR · DEAD_ELEVATION |",
3218
- "| Accessibility | LOW_CONTRAST · LOW_CONTRAST_UI · SMALL_TAP_TARGET · UNLABELED_FIELD · UNLABELED_TOGGLE · ICON_ONLY_CONTROL · IMAGE_NO_ALT |",
3219
- "| Usability | CROWDED_FORM · LIST_WITHOUT_STATE · UNCONSTRAINED_FORM_WIDTH |",
3220
- "| Hierarchy | MULTIPLE_PRIMARY_ACTIONS · CENTERED_BODY_TEXT · GENERIC_ACTION_LABEL · DESTRUCTIVE_COLOR · CONFIRM_ORDER |",
3221
- "| Scalability | every token that had to be added to make the screen pass |",
3222
- "| Conversion | the label of the primary action, counted in words and in steps |",
3223
- "| Visual quality | measured only by the axes above; state what you looked at |",
3224
- "",
3225
- "## 18 Where these books are wrong",
3226
- "",
3227
- "Both are worth more read than copied. The parts that do not survive measurement:",
3228
- "",
3229
- "- The Playbook bans pure black on white and pure white on dark (p.083). This",
3230
- " system puts white text on deep brand fills, and the ratio is what decides —",
3231
- " 4.55:1 there, not the rule of thumb.",
3232
- "- p.008 says a secondary button keeps the primary's size; p.088 says size is",
3233
- " the hierarchy lever. Both are right about different things: emphasis ranks",
3234
- " actions, size ranks information.",
3235
- "- p.079 marks center-aligned body as good; p.094 says center is for titles only.",
3236
- " The later rule is the readable one.",
3237
- "- p.103 bans pop-ups as distractions; p.120 requires one to confirm a deletion.",
3238
- " Reconciled: never unsolicited, always on destructive.",
3239
- "- p.019 (gutter 70, margin 79, overlay 17%) and p.052-054 (Y:12, blur:48,",
3240
- " #E9E9E9) are one designer's Figma fields in a screenshot, not a scale.",
3241
- " Do not harvest them as thresholds.",
3242
- "- The Playbook's own sign-up example (p.127) is white on a pale blue fill that",
3243
- " fails its own contrast chapter. Copy the rule, never the screenshot.",
3244
- "- \"7 ± 2\" (p.101) is Miller's number quoted loosely; chunk size is a design",
3245
- " choice, and four is the one that survives a fifth item.",
3246
- "- NBG defends inflating progress bars (its \"little lie\"). Do not.",
3247
- "- Neither book states a tap-target size in px. Fitts gives the direction; 40 is",
3248
- " this system's floor, and the number to defend if someone asks.",
3249
- "",
3250
- "## 19 What no checker can see",
3251
- "",
3252
- "`npm run ui` cannot tell you whether the screen is understood. For that:",
3253
- "",
3254
- "- Ask one person to do one task and stay quiet while they do it. Their first three",
3255
- " sentences are the specification.",
3256
- "- Watch where the pointer hesitates and where it misclicks: that is where the",
3257
- " layout is lying about what is tappable.",
3258
- "- Five people find most of what is broken. Two rounds of five beat one round of",
3259
- " ten.",
3260
- "- Write what you saw into `.fletbox/memory/`, or the next session designs this",
3261
- " screen again from taste.",
3262
- "",
3263
- "## 20 The loop",
3264
- "",
3265
- "```bash",
3266
- "npm run check",
3267
- "npm run ui",
3268
- "npm run dev # look at the screen, at 375px and at 1440px",
3269
- "```",
3270
- "",
3271
- "Fix the code, not the checker. Then make the rule reusable: if the fix was right",
3272
- "for this screen, it is a rule for every screen, and it belongs in this file.",
3273
- "",
3274
- ].join('\n');
3275
-
3276
- // Cursor has no skills folder, so the same rules ship as one always-apply rule
3277
- // that loads the skill file instead of duplicating it.
3278
- export const cleanUiCursorRule = () =>
3279
- [
3280
- '---',
3281
- 'description: Clean-UI rules for every screen - tokens, the 8-based scale, tap targets, states',
3282
- 'globs: "src/**/*.js"',
3283
- 'alwaysApply: true',
3284
- '---',
3285
- '',
3286
- 'Design a screen, do not decorate one. The full rules are in',
3287
- '[.claude/skills/fletbox-clean-ui/SKILL.md](../../.claude/skills/fletbox-clean-ui/SKILL.md)',
3288
- '- read it before writing a screen, form, list or dialog.',
3289
- '',
3290
- '- One screen, one job, one primary action; secondaries are `Button({ variant: "text" })`.',
3291
- '- Colors come from `colors.*` only. Never a hex literal outside `src/database/themes.js`.',
3292
- ' `colors.onPrimary` writes on a brand fill; `colors.primaryBg` is the brand tint.',
3293
- '- Sizes come from the scale: 4 - 8 - 12 - 16 - 18 - 24 - 32 - 48 space, 4 / 8 / 12 / 16 /',
3294
- ' 999 radius, 12 / 14 / 16 / 18 / 24 / 32 type.',
3295
- '- Anything pressable is at least 40px on a side, and 44 is the number to aim at.',
3296
- '- Every interaction shows loading, done, failed and empty; errors say the problem and',
3297
- ' the way out in the user\'s own words.',
3298
- '- Verify with `npm run check` then `npm run ui` (add `-- --tokens` to read the measured',
3299
- ' contrast table), and then look at the screen - the checker has no eyes.',
3300
- '',
3301
- ].join('\n');
2933
+ ].join("\n");
3302
2934
 
3303
2935
  /**
3304
2936
  * The app-side twin of scripts/check-app.mjs for the clean-UI gate. Same