sisyo 1.6.8 → 1.7.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.
Files changed (42) hide show
  1. package/README.md +5 -1
  2. package/bin/known-hashes.json +95 -7
  3. package/bin/sisyo.js +285 -285
  4. package/package.json +30 -30
  5. package/templates/.claude/rules/agents-and-tests.md +24 -0
  6. package/templates/.claude/skills/g6-style/SKILL.md +125 -0
  7. package/templates/.claude/skills/g6-style/references/checks.md +58 -0
  8. package/templates/.claude/skills/g6-style/references/imagery.md +103 -0
  9. package/templates/.claude/skills/g6-style/references/motion.md +121 -0
  10. package/templates/.claude/skills/g6-style/references/sections.md +263 -0
  11. package/templates/.claude/skills/g6-style/references/tokens.md +197 -0
  12. package/templates/.claude/skills/hindsight/SKILL.md +13 -10
  13. package/templates/.claude/skills/i18n-multilang/SKILL.md +153 -0
  14. package/templates/.claude/skills/i18n-multilang/assets/languages.json +47 -0
  15. package/templates/.claude/skills/i18n-multilang/assets/plural-vectors.json +46 -0
  16. package/templates/.claude/skills/i18n-multilang/assets/project/README.md +17 -0
  17. package/templates/.claude/skills/i18n-multilang/assets/project/gitattributes.txt +6 -0
  18. package/templates/.claude/skills/i18n-multilang/assets/project/gitignore.txt +4 -0
  19. package/templates/.claude/skills/i18n-multilang/assets/project/glossary.json +6 -0
  20. package/templates/.claude/skills/i18n-multilang/assets/project/i18n.config.json +22 -0
  21. package/templates/.claude/skills/i18n-multilang/assets/project/locales/__source__/common.json +10 -0
  22. package/templates/.claude/skills/i18n-multilang/assets/project/notes/common.json +5 -0
  23. package/templates/.claude/skills/i18n-multilang/assets/project/style.md +20 -0
  24. package/templates/.claude/skills/i18n-multilang/references/format.md +100 -0
  25. package/templates/.claude/skills/i18n-multilang/references/languages.md +97 -0
  26. package/templates/.claude/skills/i18n-multilang/references/layout-and-versioning.md +256 -0
  27. package/templates/.claude/skills/i18n-multilang/references/numbers.md +161 -0
  28. package/templates/.claude/skills/i18n-multilang/references/platform-unity.md +142 -0
  29. package/templates/.claude/skills/i18n-multilang/references/platform-web.md +107 -0
  30. package/templates/.claude/skills/i18n-multilang/references/translation.md +143 -0
  31. package/templates/.claude/skills/i18n-multilang/references/voice.md +271 -0
  32. package/templates/.claude/skills/i18n-multilang/scripts/i18n.py +1041 -0
  33. package/templates/.claude/skills/i18n-multilang/scripts/numwords.py +1013 -0
  34. package/templates/.claude/skills/i18n-multilang/scripts/voice.py +478 -0
  35. package/templates/.claude/skills/neon-game-ui-ux-skill/COMPONENTS.md +490 -490
  36. package/templates/.claude/skills/neon-game-ui-ux-skill/GAMIFICATION.md +246 -246
  37. package/templates/.claude/skills/neon-game-ui-ux-skill/ICONS.md +249 -249
  38. package/templates/.claude/skills/neon-game-ui-ux-skill/LAYOUT-NAV.md +362 -362
  39. package/templates/.claude/skills/neon-game-ui-ux-skill/MOTION-A11Y.md +168 -168
  40. package/templates/.claude/skills/neon-game-ui-ux-skill/SKILL.md +137 -137
  41. package/templates/.claude/skills/neon-game-ui-ux-skill/TOKENS.md +323 -323
  42. package/templates/SISYO.md +1 -1
@@ -1,249 +1,249 @@
1
- # Icons
2
-
3
- How the duotone icon set is made, the rules that keep it even, and how to set up the same pipeline in another
4
- project. Nothing here is copied from a file: a project builds its own small generator from this description. The
5
- component that paints an icon (`<Icon name tone size glow />`) is described in `COMPONENTS.md`.
6
-
7
- ## 1. The method in one paragraph
8
-
9
- Base shapes come from **Lucide** (ISC licence), an open icon family drawn on a 24 px grid with round caps and joins.
10
- Each icon of the set is a short **recipe**: which Lucide icon, and which of its drawing nodes go into which **layer**
11
- (`main`, `detail`, `fine`, `solid`, `glint`, `cut`). A small **generator** reads the recipes and Lucide's node data
12
- and writes the **registry**: one data file with path data per layer per icon. The registry is generated and never
13
- edited by hand; the `Icon` component and any export script only read it. A **preview sheet** renders icons from the
14
- recipes at their real size, so every change is judged at 24 px before it is built.
15
-
16
- ```
17
- recipes (one per icon) + Lucide node data --generator--> icon registry --Icon component / export--> UI, SVG files
18
- ```
19
-
20
- LenS has 68 icons made this way: 67 on Lucide shapes and one drawing of its own (a treasure chest, which Lucide does
21
- not have).
22
-
23
- Start from an established family; do not type path coordinates by hand. A hand-typed set ends up with uneven visual
24
- weight between neighbours, no optical correction (round shapes look smaller than boxy ones, pointed shapes look
25
- off-centre) and a different corner radius on every icon. A family has already solved these, and the recipes add the
26
- project's identity (duotone fill, tones, one accent) on top of it.
27
-
28
- ## 2. The layer model
29
-
30
- Grid: 24x24 viewBox, 2 units of padding (live area 2..22), stroke 1.75, round caps and joins.
31
-
32
- Each registry entry is `{ tone, main?, detail?, fine?, solid?, glint?, cut?, vector? }`; every layer is one SVG path
33
- data string (several subpaths allowed). Layers are painted in this order:
34
-
35
- | Layer | Paint | Use |
36
- |---|---|---|
37
- | `main` | tone gradient **stroke 1.75** + the same gradient as **fill at 18 %** | The silhouette. This fill is what makes the set "duotone". Must be closed paths |
38
- | `detail` | gradient stroke 1.75, no fill | Inner lines, handles, check marks; whole glyphs that have no silhouette |
39
- | `fine` | gradient stroke 1.5 | Sparks, small sparkles, speed lines |
40
- | `solid` | gradient fill at 100 %, no stroke | Dots, pips, one filled accent shape |
41
- | `glint` | white stroke 1.25 at 60 % opacity | A short highlight "reflection". Dropped in mono |
42
- | `cut` | a slash stroked in the paint, **and** a mask that knocks a 4.25 unit wide gap out of every other layer | "Off" variants (mic-off): the slash gets 1.25 units of clearance on each side |
43
-
44
- The `cut` mask: a `<mask>` in user space covering the 24 grid, a white rectangle with the slash path stroked in black
45
- at width 4.25. Every other layer goes into a group that uses the mask; the slash itself is drawn after the group.
46
-
47
- ### Paint
48
-
49
- - One gradient per tone: 3 stops, *light tint → the tone → the neighbouring hue*. Each stop has a colour for the dark
50
- theme and an ink-safe colour for the light theme:
51
-
52
- | Tone | Offsets | Dark stops | Light stops | Glow channels |
53
- |---|---|---|---|---|
54
- | lime | 0 / .55 / 1 | `#F0FF9E` `#B8FF3D` `#3DF5D8` | `#4F9400` `#3D7A00` `#00786A` | 184 255 61 |
55
- | aqua | 0 / .5 / 1 | `#B9FFF6` `#3DF5D8` `#2E9BFF` | `#00957F` `#00786A` `#1D5FD0` | 61 245 216 |
56
- | iris | 0 / .5 / 1 | `#DAD4FF` `#8B7BFF` `#E056E8` | `#6E5CF5` `#5A45EE` `#A21FA0` | 139 123 255 |
57
- | flare | 0 / .5 / 1 | `#FFC4F0` `#FF4FD8` `#9D6BFF` | `#CC2FB0` `#B8129A` `#6A3FD8` | 255 79 216 |
58
- | amber | 0 / .5 / 1 | `#FFE7B0` `#FFB23E` `#FF7F3D` | `#B06A00` `#955800` `#C2410C` | 255 178 62 |
59
- | ember | 0 / .55 / 1 | `#FFE27A` `#FF9B3D` `#FF4D3D` | `#D9530F` `#C2410C` `#B3261E` | 255 106 43 |
60
- | gold | 0 / .5 / 1 | `#FFF2B0` `#FFD65A` `#E0A21F` | `#9C7000` `#8A6200` `#9A4F00` | 255 214 90 |
61
- | coral | 0 / .5 / 1 | `#FFC2CD` `#FF5C7A` `#F0407E` | `#E0355A` `#CC1A40` `#A8124F` | 255 92 122 |
62
- | spectral | 0 / .4 / .75 / 1 | `#B8FF3D` `#3DF5D8` `#8B7BFF` `#FF4FD8` | `#3D7A00` `#00786A` `#5A45EE` `#B8129A` | 61 245 216 |
63
-
64
- `spectral` is the 4-stop brand gradient, for the product's own mark only.
65
- - The gradient is a `linearGradient` in `userSpaceOnUse` from `(3,3)` to `(21,21)`. An icon can override the
66
- direction with `vector: [x1, y1, x2, y2]` (a flame runs bottom to top, a bolt tip to tip).
67
- - **Theme switch inside the SVG**: each `<stop>` carries the dark colour as its `stop-color` attribute and
68
- `style="stop-color: light-dark(<light>, <dark>)"`. The attribute is the fallback; `light-dark()` follows the
69
- `color-scheme` set on the root per theme (TOKENS.md §1). Without `color-scheme` the light stops never apply.
70
- - Gradient and mask ids must be unique per rendered icon (React: `useId()` with the colons removed). Two icons with
71
- the same hard-coded id share one gradient, and the second paints with the first one's colours.
72
- - `tone="mono"` paints every layer with `currentColor`, emits no gradient and drops the glint; the 18 % fill stays, so
73
- a mono icon is still duotone.
74
- - Keep the registry and the tone table as **pure data with no runtime imports**, so a build script can load the same
75
- files the app uses.
76
-
77
- ## 3. Recipes
78
-
79
- A recipe assigns Lucide nodes to layers. Each icon of the `lucide-react` package is one module,
80
- `lucide-react/dist/esm/icons/<kebab-name>.js`, that exports `__iconNode`: an ordered array of nodes
81
- (`[tag, attributes]`, tags `path`, `circle`, `rect`, `line`, `polyline`, `ellipse`). A node is referred to by its
82
- index in that array. Print the array once when writing a recipe (index, tag, attributes):
83
-
84
- ```bash
85
- node -e "import('lucide-react/dist/esm/icons/trophy.js').then(m => m.__iconNode.forEach((n, i) => console.log(i, n[0], JSON.stringify(n[1]))))"
86
- ```
87
-
88
- `__iconNode` and the module path are internals of the package, not a documented API: that is one more reason for the
89
- exact version pin (§5). If another version lays them out differently, read the node data from wherever that version
90
- keeps it and keep the rest of the method.
91
-
92
- ```js
93
- // one Lucide icon: node 3 is the closed book outline, 0-2 are the text lines
94
- reading: { tone: 'aqua', from: 'book-open-text', main: [3], detail: [0, 1, 2], glint: 'M4.5 7.5v-2' }
95
-
96
- // two Lucide icons: whole nodes are scaled and moved, never retyped
97
- level: { tone: 'iris', parts: [{ from: 'hexagon', main: 'all' },
98
- { from: 'chevrons-up', detail: 'all', scale: 0.75, dx: 3, dy: 3 }] }
99
-
100
- // a glyph with no silhouette: stroke only
101
- check: { tone: 'lime', from: 'check', detail: 'all' }
102
-
103
- // no Lucide equivalent (last resort): a drawing of the project's own
104
- chest: { tone: 'gold', custom: { main: '...', detail: '...', glint: '...' } }
105
- ```
106
-
107
- | Key | Meaning |
108
- |---|---|
109
- | `tone` | The default paint: one of the eight tones, `mono` or `spectral` |
110
- | `from` | The Lucide icon name (kebab-case) |
111
- | `main` `detail` `fine` `solid` `glint` `cut` | What goes into the layer: node indexes (`[0, 2]`), `'all'`, `'rest'` (the nodes no other layer took), raw path data (`'M6 8l1-1'`), or a list mixing indexes and path data |
112
- | `scale` `dx` `dy` | Uniform scale about the origin, then a translate: `p' = p * scale + (dx, dy)`. To scale about the centre of the grid use `dx = dy = 12 * (1 - scale)`. Applies to Lucide nodes only; **raw path data is never transformed** |
113
- | `parts` | A list of `{ from, scale, dx, dy, <layers> }` to combine icons. Layers written next to `parts` may only be raw path data |
114
- | `custom` | `{ <layer>: path data }`: a drawing of the project's own |
115
- | `vector` | Gradient vector override |
116
- | `openMain` | `true` once the preview has confirmed that an open `main` path fills correctly; silences the warning |
117
-
118
- A node may sit in two layers (three dots as `detail: 'all', solid: 'all'` stay solid at stroke 1.75). A helper
119
- `dot(cx, cy, r)` that returns the path of a circle keeps pips identical across the set.
120
-
121
- Three recipe techniques recur:
122
-
123
- - **Split**: the closed outer node → `main`, everything else → `detail` (`trophy`, `calendar`, `settings`).
124
- - **Combine**: a container from one icon and a mark from another, scaled and centred (a hexagon + a check for the
125
- quiz, a circle + a small solid sparkle for "new", a medal + a solid star for "mastered").
126
- - **Re-cut**: when Lucide draws one path that mixes a closed part and an open part (headphones: ear cups + band), the
127
- same coordinates are written as two path strings, the closed part in `main` and the open part in `detail`. The
128
- coordinates are Lucide's; nothing is redrawn.
129
-
130
- ## 4. The customisation rules
131
-
132
- 1. **One closed silhouette per object icon goes to `main`.** Closed shape = fill; open glyph = stroke only. Pure
133
- glyphs (check, cross, chevrons, arrows, plus, menu, more, search, link, edit, external, log-out) have no `main`.
134
- A filled lens or door bracket reads as a button at 13-18 px.
135
- 2. **At most one accent per icon**: a `solid` pip **or** a `glint`, never both. A pip is a dot of radius 1.25 (it
136
- keeps a 1.5 unit gap to its frame). A glint is 2 units long, sits top-left inside the silhouette and follows its
137
- contour; it is for glossy objects (bolt, flame, trophy, gem, book, bulb, chest).
138
- 3. **`fine` sparks only on game icons that celebrate.** In practice use them even less: LenS keeps a spark on a
139
- single icon, because the reward icons also run at 14-16 px inside chips, where a spark turns into noise, and every
140
- base shape already fills the 2..22 box.
141
- 4. **Keep Lucide's proportions and corner radii.** Combine icons with `scale` / `dx` / `dy`, never by retyping
142
- coordinates. A custom drawing uses the same vocabulary: 24 grid, 2 units of padding, corner radii 1 and 2, round
143
- joins.
144
- 5. **Equal visual weight at 22-24 px.** Icons that sit side by side (a navigation row, a transport set) must fill the
145
- same optical box. Lucide's play / pause / stop are 18 units tall and heavier than its other actions, so LenS
146
- scales them to about 15 units about the grid centre (`scale .78-.85`). Keep the inside open: at most 3-4 strokes
147
- inside the silhouette, gaps of at least 1.5 units (four half-size sound bars touch at 22 px; three at a 3.5 unit
148
- pitch do not).
149
- 6. **Every icon must read in mono and on the light theme.** No meaning carried by the gradient alone.
150
- 7. **A family of states shares one frame.** LenS's item states are built around one circle (or its medal) with a
151
- single mark each (sparkle, check, half disc, turning arrows, star), so they differ by the mark alone at 16-20 px.
152
-
153
- ## 5. The generator
154
-
155
- A script of a few hundred lines, run by a package script (`icons:build`). `lucide-react` is a **pinned development
156
- dependency**: an exact version, not a range (LenS: `"lucide-react": "1.7.0"`). Node indexes can change between
157
- versions, and a silent upgrade would reshuffle layers. The generator and the preview are its only readers. Two more
158
- development dependencies do the heavy lifting in LenS, as examples: `svgpath` (transform and rounding of path data)
159
- and `@resvg/resvg-js` (SVG to PNG for the preview sheet).
160
-
161
- What it does:
162
-
163
- 1. Reads an ordered **name list** (sections and icon names). The icon-name type of the app is derived from the
164
- registry keys, so renaming an icon is a breaking change that the type-checker finds.
165
- 2. For each recipe, loads the Lucide icon's nodes, converts every node to path data (circle, rect with rounded
166
- corners, line, polyline, ellipse → `M ... Z` paths), applies `scale` / `dx` / `dy`, rounds to two decimals and
167
- concatenates the nodes of each layer into one string. The path-data library does the transform and the rounding.
168
- 3. Validates, then writes the registry file with a "generated, do not edit" header that names the Lucide version and
169
- the licence file.
170
-
171
- It must **fail without writing** on: an unknown Lucide icon or node index; an unknown recipe key or tone; a name that
172
- is missing, duplicated, unlisted or out of order compared with the name list; a `'rest'` that selects nothing; a
173
- `from` that no layer uses; any coordinate outside the 0..24 grid (sample points along curves, not only end points).
174
-
175
- It **warns** on: an open subpath in `main` or `solid` (the fill would get a straight, unstroked closing edge; check
176
- the preview, then set `openMain`); a solid pip together with a glint.
177
-
178
- Unit-test the path helpers (node → path, transform, bounds, closed-subpath detection) and the resolver's failures.
179
-
180
- Adding an icon is three steps: add the name to its section in the name list; add the recipe at the same position;
181
- preview it, run the build, and commit the recipe together with the regenerated registry.
182
-
183
- ## 6. The preview sheet
184
-
185
- A second script renders a contact sheet PNG **straight from the recipes** (not from the registry), so an edit is
186
- visible before any build. It uses the same layer-to-paint function as the app and an SVG rasteriser (§5), and writes
187
- its output outside the repository, so many previews can run in parallel without touching tracked files.
188
-
189
- Per icon the sheet shows its name, tone and Lucide base, then the icon at **24 / 32 / 48 px** in three rows:
190
-
191
- - in its tone on the dark surface (`#0A0C14`);
192
- - in its tone on the light surface (`#F4F6FB`) with the light gradient stops;
193
- - in mono (ink `#D5DAE8` on dark).
194
-
195
- Options worth having: pick by section, by name or all; a compare mode that puts the previously committed icon next to
196
- the new one; the number of columns; the device scale (2 by default).
197
-
198
- How to judge: **look at the 24 px column first**, next to the icon's neighbours. Zoomed-in beauty is irrelevant.
199
- Keep a sheet to about 12 icons so an image viewer does not shrink it below real size.
200
-
201
- An export step can follow the build for consumers outside the app: one standalone SVG per icon in its default tone,
202
- PNGs at 2x, and a static gallery page with every icon at 48 / 24 / 16 px and a strip of all tones. Those files are
203
- regenerated from the registry and never edited.
204
-
205
- ## 7. Licence obligation
206
-
207
- Lucide is ISC licensed; parts of it derive from Feather, which is MIT. Both require that the copyright notice and the
208
- licence text accompany copies. Path data taken from Lucide and re-layered is a derived work, so:
209
-
210
- - **Ship the licence text next to the registry** (a `LICENSE-lucide.txt` beside the generated file), as a verbatim
211
- copy of `node_modules/lucide-react/LICENSE`, the licence file of the installed package.
212
- - Name the source and the version in the generated file's header.
213
- - Copy the licence again whenever the pinned version changes, then rebuild and check the preview.
214
-
215
- ## 8. Alternative routes
216
-
217
- | Route | What it is | Trade-off |
218
- |---|---|---|
219
- | **Another open stroke family** | Tabler (MIT, 24 grid, stroke 2), Iconoir (MIT, stroke 1.5), Heroicons outline (MIT, stroke 1.5), Material Symbols (Apache 2.0). The same recipe method applies: their SVGs are 24 grid, unfilled, round caps. Use **one** family for the whole set and one stroke width | The set looks like that family; node structure and coverage differ, so recipes are not portable between families. Read the licence of the release in use and ship it the same way |
220
- | **A ready-made duotone family** | Phosphor duotone (MIT, 256 grid, filled outlines + a 20 % background shape), Solar duotone (CC BY 4.0: **attribution required**) | Two-layer art out of the box, but the shapes are fills, not strokes: scale to 24, put outlines in `solid` and add a fill-only tint layer. The stroke width can no longer be tuned. Paid duotone sets (Font Awesome Pro) must not be copied |
221
- | **Drawing in a vector tool** | One 24x24 frame per icon, 20x20 live area, keyline shapes (circle 20, square 18, portrait 16x20, landscape 20x16), strokes not outlined, layers named after the layer model; export, optimise, copy each layer's path into the registry | Best quality and a unique look; needs a person with a designer's eye and is the slowest route |
222
- | **Image-model concepts, then redraw** | Generate one contact sheet so the style is shared, use it as a **reference** and redraw each icon on the grid | Good for finding metaphors quickly. Never ship traced output: tracing yields filled blobs with hundreds of nodes, no stroke and no layers. Check the model's terms for commercial use |
223
-
224
- The recipe method and a vector tool combine well: a family for the generic 90 %, `custom` drawings for the few icons
225
- that carry the product's identity.
226
-
227
- ## 9. Checklist before an icon is committed
228
-
229
- The drawing rules are §4 (silhouette in `main`, one accent, the family's radii, equal optical box, open insides); the
230
- generator enforces the grid and warns about open fills (§5). What is left to check by eye and by hand:
231
-
232
- - [ ] Judged at **22-24 px**, at 1x, on the dark canvas, next to its neighbours; then at 16 px where it is used small.
233
- - [ ] Reads in mono (toolbar, disabled, on a lime disc) and on the light theme.
234
- - [ ] One stroke width for the whole set (1.75); `fine` (1.5) only for sparks.
235
- - [ ] Names are nouns for the object or the job, kebab-case, stable.
236
- - [ ] Recipe, regenerated registry and exported files are committed together; nothing generated was hand-edited.
237
- - [ ] The licence text sits next to the registry and matches the pinned version.
238
-
239
- ## 10. Using icons in the UI
240
-
241
- - Sizes: 22 px in tabs and the rail, 16-20 px inside buttons, 18-36 px on round buttons by size, 26 px on the dial's
242
- menu items, 13-15 px in chips.
243
- - A tone is a meaning (TOKENS.md §4): an icon takes the tone of the thing it stands for, not a random pretty colour.
244
- Inactive, disabled and "on a neon fill" are `mono`.
245
- - `glow` only for the active navigation item, the current step, a just-earned reward.
246
- - Decorative by default; an icon-only control gets `aria-label` on the control.
247
- - Icon names that come from a server (a quest's icon) are looked up with a fallback: an unknown name must render a
248
- default icon, not crash the page.
249
- - Brand logos (a sign-in provider's mark) are used as supplied, unrecoloured, without glow.
1
+ # Icons
2
+
3
+ How the duotone icon set is made, the rules that keep it even, and how to set up the same pipeline in another
4
+ project. Nothing here is copied from a file: a project builds its own small generator from this description. The
5
+ component that paints an icon (`<Icon name tone size glow />`) is described in `COMPONENTS.md`.
6
+
7
+ ## 1. The method in one paragraph
8
+
9
+ Base shapes come from **Lucide** (ISC licence), an open icon family drawn on a 24 px grid with round caps and joins.
10
+ Each icon of the set is a short **recipe**: which Lucide icon, and which of its drawing nodes go into which **layer**
11
+ (`main`, `detail`, `fine`, `solid`, `glint`, `cut`). A small **generator** reads the recipes and Lucide's node data
12
+ and writes the **registry**: one data file with path data per layer per icon. The registry is generated and never
13
+ edited by hand; the `Icon` component and any export script only read it. A **preview sheet** renders icons from the
14
+ recipes at their real size, so every change is judged at 24 px before it is built.
15
+
16
+ ```
17
+ recipes (one per icon) + Lucide node data --generator--> icon registry --Icon component / export--> UI, SVG files
18
+ ```
19
+
20
+ LenS has 68 icons made this way: 67 on Lucide shapes and one drawing of its own (a treasure chest, which Lucide does
21
+ not have).
22
+
23
+ Start from an established family; do not type path coordinates by hand. A hand-typed set ends up with uneven visual
24
+ weight between neighbours, no optical correction (round shapes look smaller than boxy ones, pointed shapes look
25
+ off-centre) and a different corner radius on every icon. A family has already solved these, and the recipes add the
26
+ project's identity (duotone fill, tones, one accent) on top of it.
27
+
28
+ ## 2. The layer model
29
+
30
+ Grid: 24x24 viewBox, 2 units of padding (live area 2..22), stroke 1.75, round caps and joins.
31
+
32
+ Each registry entry is `{ tone, main?, detail?, fine?, solid?, glint?, cut?, vector? }`; every layer is one SVG path
33
+ data string (several subpaths allowed). Layers are painted in this order:
34
+
35
+ | Layer | Paint | Use |
36
+ |---|---|---|
37
+ | `main` | tone gradient **stroke 1.75** + the same gradient as **fill at 18 %** | The silhouette. This fill is what makes the set "duotone". Must be closed paths |
38
+ | `detail` | gradient stroke 1.75, no fill | Inner lines, handles, check marks; whole glyphs that have no silhouette |
39
+ | `fine` | gradient stroke 1.5 | Sparks, small sparkles, speed lines |
40
+ | `solid` | gradient fill at 100 %, no stroke | Dots, pips, one filled accent shape |
41
+ | `glint` | white stroke 1.25 at 60 % opacity | A short highlight "reflection". Dropped in mono |
42
+ | `cut` | a slash stroked in the paint, **and** a mask that knocks a 4.25 unit wide gap out of every other layer | "Off" variants (mic-off): the slash gets 1.25 units of clearance on each side |
43
+
44
+ The `cut` mask: a `<mask>` in user space covering the 24 grid, a white rectangle with the slash path stroked in black
45
+ at width 4.25. Every other layer goes into a group that uses the mask; the slash itself is drawn after the group.
46
+
47
+ ### Paint
48
+
49
+ - One gradient per tone: 3 stops, *light tint → the tone → the neighbouring hue*. Each stop has a colour for the dark
50
+ theme and an ink-safe colour for the light theme:
51
+
52
+ | Tone | Offsets | Dark stops | Light stops | Glow channels |
53
+ |---|---|---|---|---|
54
+ | lime | 0 / .55 / 1 | `#F0FF9E` `#B8FF3D` `#3DF5D8` | `#4F9400` `#3D7A00` `#00786A` | 184 255 61 |
55
+ | aqua | 0 / .5 / 1 | `#B9FFF6` `#3DF5D8` `#2E9BFF` | `#00957F` `#00786A` `#1D5FD0` | 61 245 216 |
56
+ | iris | 0 / .5 / 1 | `#DAD4FF` `#8B7BFF` `#E056E8` | `#6E5CF5` `#5A45EE` `#A21FA0` | 139 123 255 |
57
+ | flare | 0 / .5 / 1 | `#FFC4F0` `#FF4FD8` `#9D6BFF` | `#CC2FB0` `#B8129A` `#6A3FD8` | 255 79 216 |
58
+ | amber | 0 / .5 / 1 | `#FFE7B0` `#FFB23E` `#FF7F3D` | `#B06A00` `#955800` `#C2410C` | 255 178 62 |
59
+ | ember | 0 / .55 / 1 | `#FFE27A` `#FF9B3D` `#FF4D3D` | `#D9530F` `#C2410C` `#B3261E` | 255 106 43 |
60
+ | gold | 0 / .5 / 1 | `#FFF2B0` `#FFD65A` `#E0A21F` | `#9C7000` `#8A6200` `#9A4F00` | 255 214 90 |
61
+ | coral | 0 / .5 / 1 | `#FFC2CD` `#FF5C7A` `#F0407E` | `#E0355A` `#CC1A40` `#A8124F` | 255 92 122 |
62
+ | spectral | 0 / .4 / .75 / 1 | `#B8FF3D` `#3DF5D8` `#8B7BFF` `#FF4FD8` | `#3D7A00` `#00786A` `#5A45EE` `#B8129A` | 61 245 216 |
63
+
64
+ `spectral` is the 4-stop brand gradient, for the product's own mark only.
65
+ - The gradient is a `linearGradient` in `userSpaceOnUse` from `(3,3)` to `(21,21)`. An icon can override the
66
+ direction with `vector: [x1, y1, x2, y2]` (a flame runs bottom to top, a bolt tip to tip).
67
+ - **Theme switch inside the SVG**: each `<stop>` carries the dark colour as its `stop-color` attribute and
68
+ `style="stop-color: light-dark(<light>, <dark>)"`. The attribute is the fallback; `light-dark()` follows the
69
+ `color-scheme` set on the root per theme (TOKENS.md §1). Without `color-scheme` the light stops never apply.
70
+ - Gradient and mask ids must be unique per rendered icon (React: `useId()` with the colons removed). Two icons with
71
+ the same hard-coded id share one gradient, and the second paints with the first one's colours.
72
+ - `tone="mono"` paints every layer with `currentColor`, emits no gradient and drops the glint; the 18 % fill stays, so
73
+ a mono icon is still duotone.
74
+ - Keep the registry and the tone table as **pure data with no runtime imports**, so a build script can load the same
75
+ files the app uses.
76
+
77
+ ## 3. Recipes
78
+
79
+ A recipe assigns Lucide nodes to layers. Each icon of the `lucide-react` package is one module,
80
+ `lucide-react/dist/esm/icons/<kebab-name>.js`, that exports `__iconNode`: an ordered array of nodes
81
+ (`[tag, attributes]`, tags `path`, `circle`, `rect`, `line`, `polyline`, `ellipse`). A node is referred to by its
82
+ index in that array. Print the array once when writing a recipe (index, tag, attributes):
83
+
84
+ ```bash
85
+ node -e "import('lucide-react/dist/esm/icons/trophy.js').then(m => m.__iconNode.forEach((n, i) => console.log(i, n[0], JSON.stringify(n[1]))))"
86
+ ```
87
+
88
+ `__iconNode` and the module path are internals of the package, not a documented API: that is one more reason for the
89
+ exact version pin (§5). If another version lays them out differently, read the node data from wherever that version
90
+ keeps it and keep the rest of the method.
91
+
92
+ ```js
93
+ // one Lucide icon: node 3 is the closed book outline, 0-2 are the text lines
94
+ reading: { tone: 'aqua', from: 'book-open-text', main: [3], detail: [0, 1, 2], glint: 'M4.5 7.5v-2' }
95
+
96
+ // two Lucide icons: whole nodes are scaled and moved, never retyped
97
+ level: { tone: 'iris', parts: [{ from: 'hexagon', main: 'all' },
98
+ { from: 'chevrons-up', detail: 'all', scale: 0.75, dx: 3, dy: 3 }] }
99
+
100
+ // a glyph with no silhouette: stroke only
101
+ check: { tone: 'lime', from: 'check', detail: 'all' }
102
+
103
+ // no Lucide equivalent (last resort): a drawing of the project's own
104
+ chest: { tone: 'gold', custom: { main: '...', detail: '...', glint: '...' } }
105
+ ```
106
+
107
+ | Key | Meaning |
108
+ |---|---|
109
+ | `tone` | The default paint: one of the eight tones, `mono` or `spectral` |
110
+ | `from` | The Lucide icon name (kebab-case) |
111
+ | `main` `detail` `fine` `solid` `glint` `cut` | What goes into the layer: node indexes (`[0, 2]`), `'all'`, `'rest'` (the nodes no other layer took), raw path data (`'M6 8l1-1'`), or a list mixing indexes and path data |
112
+ | `scale` `dx` `dy` | Uniform scale about the origin, then a translate: `p' = p * scale + (dx, dy)`. To scale about the centre of the grid use `dx = dy = 12 * (1 - scale)`. Applies to Lucide nodes only; **raw path data is never transformed** |
113
+ | `parts` | A list of `{ from, scale, dx, dy, <layers> }` to combine icons. Layers written next to `parts` may only be raw path data |
114
+ | `custom` | `{ <layer>: path data }`: a drawing of the project's own |
115
+ | `vector` | Gradient vector override |
116
+ | `openMain` | `true` once the preview has confirmed that an open `main` path fills correctly; silences the warning |
117
+
118
+ A node may sit in two layers (three dots as `detail: 'all', solid: 'all'` stay solid at stroke 1.75). A helper
119
+ `dot(cx, cy, r)` that returns the path of a circle keeps pips identical across the set.
120
+
121
+ Three recipe techniques recur:
122
+
123
+ - **Split**: the closed outer node → `main`, everything else → `detail` (`trophy`, `calendar`, `settings`).
124
+ - **Combine**: a container from one icon and a mark from another, scaled and centred (a hexagon + a check for the
125
+ quiz, a circle + a small solid sparkle for "new", a medal + a solid star for "mastered").
126
+ - **Re-cut**: when Lucide draws one path that mixes a closed part and an open part (headphones: ear cups + band), the
127
+ same coordinates are written as two path strings, the closed part in `main` and the open part in `detail`. The
128
+ coordinates are Lucide's; nothing is redrawn.
129
+
130
+ ## 4. The customisation rules
131
+
132
+ 1. **One closed silhouette per object icon goes to `main`.** Closed shape = fill; open glyph = stroke only. Pure
133
+ glyphs (check, cross, chevrons, arrows, plus, menu, more, search, link, edit, external, log-out) have no `main`.
134
+ A filled lens or door bracket reads as a button at 13-18 px.
135
+ 2. **At most one accent per icon**: a `solid` pip **or** a `glint`, never both. A pip is a dot of radius 1.25 (it
136
+ keeps a 1.5 unit gap to its frame). A glint is 2 units long, sits top-left inside the silhouette and follows its
137
+ contour; it is for glossy objects (bolt, flame, trophy, gem, book, bulb, chest).
138
+ 3. **`fine` sparks only on game icons that celebrate.** In practice use them even less: LenS keeps a spark on a
139
+ single icon, because the reward icons also run at 14-16 px inside chips, where a spark turns into noise, and every
140
+ base shape already fills the 2..22 box.
141
+ 4. **Keep Lucide's proportions and corner radii.** Combine icons with `scale` / `dx` / `dy`, never by retyping
142
+ coordinates. A custom drawing uses the same vocabulary: 24 grid, 2 units of padding, corner radii 1 and 2, round
143
+ joins.
144
+ 5. **Equal visual weight at 22-24 px.** Icons that sit side by side (a navigation row, a transport set) must fill the
145
+ same optical box. Lucide's play / pause / stop are 18 units tall and heavier than its other actions, so LenS
146
+ scales them to about 15 units about the grid centre (`scale .78-.85`). Keep the inside open: at most 3-4 strokes
147
+ inside the silhouette, gaps of at least 1.5 units (four half-size sound bars touch at 22 px; three at a 3.5 unit
148
+ pitch do not).
149
+ 6. **Every icon must read in mono and on the light theme.** No meaning carried by the gradient alone.
150
+ 7. **A family of states shares one frame.** LenS's item states are built around one circle (or its medal) with a
151
+ single mark each (sparkle, check, half disc, turning arrows, star), so they differ by the mark alone at 16-20 px.
152
+
153
+ ## 5. The generator
154
+
155
+ A script of a few hundred lines, run by a package script (`icons:build`). `lucide-react` is a **pinned development
156
+ dependency**: an exact version, not a range (LenS: `"lucide-react": "1.7.0"`). Node indexes can change between
157
+ versions, and a silent upgrade would reshuffle layers. The generator and the preview are its only readers. Two more
158
+ development dependencies do the heavy lifting in LenS, as examples: `svgpath` (transform and rounding of path data)
159
+ and `@resvg/resvg-js` (SVG to PNG for the preview sheet).
160
+
161
+ What it does:
162
+
163
+ 1. Reads an ordered **name list** (sections and icon names). The icon-name type of the app is derived from the
164
+ registry keys, so renaming an icon is a breaking change that the type-checker finds.
165
+ 2. For each recipe, loads the Lucide icon's nodes, converts every node to path data (circle, rect with rounded
166
+ corners, line, polyline, ellipse → `M ... Z` paths), applies `scale` / `dx` / `dy`, rounds to two decimals and
167
+ concatenates the nodes of each layer into one string. The path-data library does the transform and the rounding.
168
+ 3. Validates, then writes the registry file with a "generated, do not edit" header that names the Lucide version and
169
+ the licence file.
170
+
171
+ It must **fail without writing** on: an unknown Lucide icon or node index; an unknown recipe key or tone; a name that
172
+ is missing, duplicated, unlisted or out of order compared with the name list; a `'rest'` that selects nothing; a
173
+ `from` that no layer uses; any coordinate outside the 0..24 grid (sample points along curves, not only end points).
174
+
175
+ It **warns** on: an open subpath in `main` or `solid` (the fill would get a straight, unstroked closing edge; check
176
+ the preview, then set `openMain`); a solid pip together with a glint.
177
+
178
+ Unit-test the path helpers (node → path, transform, bounds, closed-subpath detection) and the resolver's failures.
179
+
180
+ Adding an icon is three steps: add the name to its section in the name list; add the recipe at the same position;
181
+ preview it, run the build, and commit the recipe together with the regenerated registry.
182
+
183
+ ## 6. The preview sheet
184
+
185
+ A second script renders a contact sheet PNG **straight from the recipes** (not from the registry), so an edit is
186
+ visible before any build. It uses the same layer-to-paint function as the app and an SVG rasteriser (§5), and writes
187
+ its output outside the repository, so many previews can run in parallel without touching tracked files.
188
+
189
+ Per icon the sheet shows its name, tone and Lucide base, then the icon at **24 / 32 / 48 px** in three rows:
190
+
191
+ - in its tone on the dark surface (`#0A0C14`);
192
+ - in its tone on the light surface (`#F4F6FB`) with the light gradient stops;
193
+ - in mono (ink `#D5DAE8` on dark).
194
+
195
+ Options worth having: pick by section, by name or all; a compare mode that puts the previously committed icon next to
196
+ the new one; the number of columns; the device scale (2 by default).
197
+
198
+ How to judge: **look at the 24 px column first**, next to the icon's neighbours. Zoomed-in beauty is irrelevant.
199
+ Keep a sheet to about 12 icons so an image viewer does not shrink it below real size.
200
+
201
+ An export step can follow the build for consumers outside the app: one standalone SVG per icon in its default tone,
202
+ PNGs at 2x, and a static gallery page with every icon at 48 / 24 / 16 px and a strip of all tones. Those files are
203
+ regenerated from the registry and never edited.
204
+
205
+ ## 7. Licence obligation
206
+
207
+ Lucide is ISC licensed; parts of it derive from Feather, which is MIT. Both require that the copyright notice and the
208
+ licence text accompany copies. Path data taken from Lucide and re-layered is a derived work, so:
209
+
210
+ - **Ship the licence text next to the registry** (a `LICENSE-lucide.txt` beside the generated file), as a verbatim
211
+ copy of `node_modules/lucide-react/LICENSE`, the licence file of the installed package.
212
+ - Name the source and the version in the generated file's header.
213
+ - Copy the licence again whenever the pinned version changes, then rebuild and check the preview.
214
+
215
+ ## 8. Alternative routes
216
+
217
+ | Route | What it is | Trade-off |
218
+ |---|---|---|
219
+ | **Another open stroke family** | Tabler (MIT, 24 grid, stroke 2), Iconoir (MIT, stroke 1.5), Heroicons outline (MIT, stroke 1.5), Material Symbols (Apache 2.0). The same recipe method applies: their SVGs are 24 grid, unfilled, round caps. Use **one** family for the whole set and one stroke width | The set looks like that family; node structure and coverage differ, so recipes are not portable between families. Read the licence of the release in use and ship it the same way |
220
+ | **A ready-made duotone family** | Phosphor duotone (MIT, 256 grid, filled outlines + a 20 % background shape), Solar duotone (CC BY 4.0: **attribution required**) | Two-layer art out of the box, but the shapes are fills, not strokes: scale to 24, put outlines in `solid` and add a fill-only tint layer. The stroke width can no longer be tuned. Paid duotone sets (Font Awesome Pro) must not be copied |
221
+ | **Drawing in a vector tool** | One 24x24 frame per icon, 20x20 live area, keyline shapes (circle 20, square 18, portrait 16x20, landscape 20x16), strokes not outlined, layers named after the layer model; export, optimise, copy each layer's path into the registry | Best quality and a unique look; needs a person with a designer's eye and is the slowest route |
222
+ | **Image-model concepts, then redraw** | Generate one contact sheet so the style is shared, use it as a **reference** and redraw each icon on the grid | Good for finding metaphors quickly. Never ship traced output: tracing yields filled blobs with hundreds of nodes, no stroke and no layers. Check the model's terms for commercial use |
223
+
224
+ The recipe method and a vector tool combine well: a family for the generic 90 %, `custom` drawings for the few icons
225
+ that carry the product's identity.
226
+
227
+ ## 9. Checklist before an icon is committed
228
+
229
+ The drawing rules are §4 (silhouette in `main`, one accent, the family's radii, equal optical box, open insides); the
230
+ generator enforces the grid and warns about open fills (§5). What is left to check by eye and by hand:
231
+
232
+ - [ ] Judged at **22-24 px**, at 1x, on the dark canvas, next to its neighbours; then at 16 px where it is used small.
233
+ - [ ] Reads in mono (toolbar, disabled, on a lime disc) and on the light theme.
234
+ - [ ] One stroke width for the whole set (1.75); `fine` (1.5) only for sparks.
235
+ - [ ] Names are nouns for the object or the job, kebab-case, stable.
236
+ - [ ] Recipe, regenerated registry and exported files are committed together; nothing generated was hand-edited.
237
+ - [ ] The licence text sits next to the registry and matches the pinned version.
238
+
239
+ ## 10. Using icons in the UI
240
+
241
+ - Sizes: 22 px in tabs and the rail, 16-20 px inside buttons, 18-36 px on round buttons by size, 26 px on the dial's
242
+ menu items, 13-15 px in chips.
243
+ - A tone is a meaning (TOKENS.md §4): an icon takes the tone of the thing it stands for, not a random pretty colour.
244
+ Inactive, disabled and "on a neon fill" are `mono`.
245
+ - `glow` only for the active navigation item, the current step, a just-earned reward.
246
+ - Decorative by default; an icon-only control gets `aria-label` on the control.
247
+ - Icon names that come from a server (a quest's icon) are looked up with a fallback: an unknown name must render a
248
+ default icon, not crash the page.
249
+ - Brand logos (a sign-in provider's mark) are used as supplied, unrecoloured, without glow.