@greenharness/greenrack-cli 0.0.0-stage → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +335 -2
  2. package/agents/design-system-lookup.md +59 -0
  3. package/dist/bin.d.ts +3 -0
  4. package/dist/bin.d.ts.map +1 -0
  5. package/dist/bin.js +145 -0
  6. package/dist/bin.js.map +1 -0
  7. package/dist/catalog.d.ts +13 -0
  8. package/dist/catalog.d.ts.map +1 -0
  9. package/dist/catalog.js +67 -0
  10. package/dist/catalog.js.map +1 -0
  11. package/dist/commands/context.d.ts +17 -0
  12. package/dist/commands/context.d.ts.map +1 -0
  13. package/dist/commands/context.js +110 -0
  14. package/dist/commands/context.js.map +1 -0
  15. package/dist/commands/doctor.d.ts +75 -0
  16. package/dist/commands/doctor.d.ts.map +1 -0
  17. package/dist/commands/doctor.js +1008 -0
  18. package/dist/commands/doctor.js.map +1 -0
  19. package/dist/commands/hook.d.ts +10 -0
  20. package/dist/commands/hook.d.ts.map +1 -0
  21. package/dist/commands/hook.js +323 -0
  22. package/dist/commands/hook.js.map +1 -0
  23. package/dist/commands/list.d.ts +4 -0
  24. package/dist/commands/list.d.ts.map +1 -0
  25. package/dist/commands/list.js +59 -0
  26. package/dist/commands/list.js.map +1 -0
  27. package/dist/commands/lookup.d.ts +13 -0
  28. package/dist/commands/lookup.d.ts.map +1 -0
  29. package/dist/commands/lookup.js +66 -0
  30. package/dist/commands/lookup.js.map +1 -0
  31. package/dist/commands/manifest.d.ts +5 -0
  32. package/dist/commands/manifest.d.ts.map +1 -0
  33. package/dist/commands/manifest.js +33 -0
  34. package/dist/commands/manifest.js.map +1 -0
  35. package/dist/commands/mcp.d.ts +159 -0
  36. package/dist/commands/mcp.d.ts.map +1 -0
  37. package/dist/commands/mcp.js +235 -0
  38. package/dist/commands/mcp.js.map +1 -0
  39. package/dist/commands/mockup.d.ts +80 -0
  40. package/dist/commands/mockup.d.ts.map +1 -0
  41. package/dist/commands/mockup.js +714 -0
  42. package/dist/commands/mockup.js.map +1 -0
  43. package/dist/commands/skill.d.ts +15 -0
  44. package/dist/commands/skill.d.ts.map +1 -0
  45. package/dist/commands/skill.js +398 -0
  46. package/dist/commands/skill.js.map +1 -0
  47. package/dist/disambiguation.d.ts +24 -0
  48. package/dist/disambiguation.d.ts.map +1 -0
  49. package/dist/disambiguation.js +56 -0
  50. package/dist/disambiguation.js.map +1 -0
  51. package/dist/extension-pointer.d.ts +7 -0
  52. package/dist/extension-pointer.d.ts.map +1 -0
  53. package/dist/extension-pointer.js +30 -0
  54. package/dist/extension-pointer.js.map +1 -0
  55. package/dist/format.d.ts +19 -0
  56. package/dist/format.d.ts.map +1 -0
  57. package/dist/format.js +213 -0
  58. package/dist/format.js.map +1 -0
  59. package/dist/hook-script.d.ts +73 -0
  60. package/dist/hook-script.d.ts.map +1 -0
  61. package/dist/hook-script.js +165 -0
  62. package/dist/hook-script.js.map +1 -0
  63. package/dist/index.d.ts +7 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +6 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/legacy-names.d.ts +26 -0
  68. package/dist/legacy-names.d.ts.map +1 -0
  69. package/dist/legacy-names.js +26 -0
  70. package/dist/legacy-names.js.map +1 -0
  71. package/dist/manifest.d.ts +51 -0
  72. package/dist/manifest.d.ts.map +1 -0
  73. package/dist/manifest.js +229 -0
  74. package/dist/manifest.js.map +1 -0
  75. package/dist/registry-types.d.ts +106 -0
  76. package/dist/registry-types.d.ts.map +1 -0
  77. package/dist/registry-types.js +2 -0
  78. package/dist/registry-types.js.map +1 -0
  79. package/dist/registry.d.ts +52 -0
  80. package/dist/registry.d.ts.map +1 -0
  81. package/dist/registry.js +95 -0
  82. package/dist/registry.js.map +1 -0
  83. package/dist/scan.d.ts +19 -0
  84. package/dist/scan.d.ts.map +1 -0
  85. package/dist/scan.js +29 -0
  86. package/dist/scan.js.map +1 -0
  87. package/dist/search.d.ts +16 -0
  88. package/dist/search.d.ts.map +1 -0
  89. package/dist/search.js +75 -0
  90. package/dist/search.js.map +1 -0
  91. package/dist/skill-template.d.ts +24 -0
  92. package/dist/skill-template.d.ts.map +1 -0
  93. package/dist/skill-template.js +140 -0
  94. package/dist/skill-template.js.map +1 -0
  95. package/greenharness.toml +38 -0
  96. package/package.json +76 -3
  97. package/registry.json +12893 -0
  98. package/skills/colors/LICENSE +21 -0
  99. package/skills/colors/NOTICE.md +36 -0
  100. package/skills/colors/SKILL.md +101 -0
  101. package/skills/colors/color-formats.md +90 -0
  102. package/skills/colors/color-usage.md +109 -0
  103. package/skills/colors/contrast.md +70 -0
  104. package/skills/colors/palette-generation.md +108 -0
  105. package/skills/colors/palette-structure.md +72 -0
  106. package/skills/colors/token-naming.md +99 -0
  107. package/skills/greenrack-mockup/SKILL.md +115 -0
  108. package/skills/typography/LICENSE +21 -0
  109. package/skills/typography/NOTICE.md +36 -0
  110. package/skills/typography/SKILL.md +171 -0
  111. package/skills/typography/choosing-fonts.md +53 -0
  112. package/skills/typography/css-cheat-sheet.md +67 -0
  113. package/skills/typography/details-and-accessibility.md +84 -0
  114. package/skills/typography/spacing-and-sizing.md +87 -0
  115. package/skills/typography/variable-fonts-and-opentype.md +100 -0
  116. package/skills/typography/wrapping-and-punctuation.md +23 -0
  117. package/skills/ui/LICENSE +21 -0
  118. package/skills/ui/NOTICE.md +38 -0
  119. package/skills/ui/SKILL.md +141 -0
  120. package/skills/ui/animations.md +170 -0
  121. package/skills/ui/enter-exit.md +157 -0
  122. package/skills/ui/icon-transitions.md +72 -0
  123. package/skills/ui/icons.md +105 -0
  124. package/skills/ui/performance.md +63 -0
  125. package/skills/ui/surfaces.md +166 -0
package/README.md CHANGED
@@ -1,3 +1,336 @@
1
- # Temporary Holding Version
1
+ # @greenharness/greenrack-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Machine-queryable docs for the greenrack design system. One lookup verb over a
4
+ generated registry: component props and usage guidance, runnable recipes,
5
+ design tokens, and the critical rules — as human output, `--json`, or an MCP
6
+ server. Zero runtime dependencies.
7
+
8
+ ```
9
+ npx @greenharness/greenrack-cli manifest --json # the one-call agent bootstrap
10
+ npx @greenharness/greenrack-cli Button # props, usage, example, related
11
+ npx @greenharness/greenrack-cli Select --part Root
12
+ npx @greenharness/greenrack-cli login-form --source-only > src/LoginForm.tsx
13
+ npx @greenharness/greenrack-cli spacing # token scale + the deep import to copy
14
+ npx @greenharness/greenrack-cli rules # critical rules + what the lint plugin enforces
15
+ npx @greenharness/greenrack-cli "tags that wrap" # free text falls back to a need-search
16
+ npx @greenharness/greenrack-cli list
17
+ npx @greenharness/greenrack-cli hook install # wire the Claude Code session + plan-mode hooks
18
+ npx @greenharness/greenrack-cli skill install # /greenrack-mockup plus the colors, typography and ui skills
19
+ npx @greenharness/greenrack-cli mockup seed --out docs/mockups/approvals # token-seeded artboard
20
+ npx @greenharness/greenrack-cli mockup check docs/mockups/approvals/*.dc.html
21
+ npx @greenharness/greenrack-cli mockup canvas docs/mockups/approvals # one review page
22
+ ```
23
+
24
+ Install for the short bin: `pnpm add -D @greenharness/greenrack-cli` → `greenrack Button`.
25
+
26
+ Exit codes: `0` ok · `1` not found (with "did you mean") · `2` usage error ·
27
+ `3` unreadable/incompatible registry.
28
+
29
+ ## MCP server
30
+
31
+ ```
32
+ claude mcp add greenrack -- npx -y -p @greenharness/greenrack-cli -p @modelcontextprotocol/sdk greenrack mcp
33
+ ```
34
+
35
+ Tools: `greenrack_lookup` (same fallback-to-search behavior as the CLI),
36
+ `greenrack_list`, `greenrack_manifest`, `greenrack_mockup_check` (an artboard's HTML
37
+ in, findings out — see below), `greenrack_mockup_canvas` (artboards' HTML in, the
38
+ review page out). Resources: `greenrack://component/<Name>`,
39
+ `greenrack://recipe/<name>`. Prompt: `greenrack/build-ui` primes a session with the
40
+ critical rules and the component index. The SDK is an optional peer — plain
41
+ CLI use never loads it.
42
+
43
+ ## The registry
44
+
45
+ `registry.json` is generated from the monorepo sources by
46
+ `scripts/build-registry.mjs` (ts-morph, build-time only) and committed: it
47
+ aggregates the 57 `*.meta.ts` files, per-component prop tables extracted from
48
+ the TypeScript source, recipe sources rewritten to publishable imports, the
49
+ token scales, and the lint-rule metadata. It is a pure function of the source
50
+ tree — sorted keys, no timestamps — so `--check` (run in prebuild, CI, and
51
+ the amont pre-push hook) is a byte comparison. The same script maintains the
52
+ generated regions of the repo's CLAUDE.md (`--write-docs` / `--check-docs`).
53
+
54
+ The CLI and `@greenharness/greenrack-ui` are released in lockstep; a version mismatch with
55
+ a locally installed ui prints a one-line stderr warning.
56
+
57
+ ### Authoring `relatedTo`
58
+
59
+ Every `relatedTo` entry declares a `kind`, and the type makes it required:
60
+
61
+ ```ts
62
+ relatedTo: [
63
+ {
64
+ component: 'Menu',
65
+ kind: 'contrast',
66
+ relationship: 'Menu triggers actions; Select picks a value',
67
+ },
68
+ {component: 'Field', kind: 'composition', relationship: 'Place Select inside Field.Root'},
69
+ ]
70
+ ```
71
+
72
+ - **`contrast`** — the two are alternatives; you pick one _instead of_ the
73
+ other. These become the session-start neighbors table, so write the
74
+ relationship so it decides in **either** direction: `X for A; Y for B`, not
75
+ "Vertical equivalent" (which of the two is vertical?).
76
+ - **`composition`** — one goes _inside_ the other, or is _built on_ it.
77
+ React composes, so this covers "wraps", "renders" and "built on" too, not
78
+ just literal nesting. These get their own table: rendered as "Input vs
79
+ Field" they would read as the opposite advice.
80
+
81
+ Filing an edge under the wrong kind puts it under a heading that contradicts
82
+ it, which is why the field is not optional and not inferred. Write the
83
+ relationship to match: a `contrast` edge decides ("X for A; Y for B"), a
84
+ `composition` edge says what wraps what.
85
+
86
+ ## Claude Code session hook
87
+
88
+ `greenrack hook session-start` prints a consult-first preamble, the full catalog,
89
+ and two neighbour tables, designed to be injected into agent context by a
90
+ Claude Code `SessionStart` hook — so "check the design system before building
91
+ UI" stops being a remembered step an agent can skip.
92
+
93
+ The catalog answers "what exists". The tables answer the two questions it
94
+ doesn't, which is where agents actually go wrong:
95
+
96
+ - **PICKING BETWEEN NEIGHBORS** — a Menu built out of a Select, a Card where
97
+ Panel was meant
98
+ - **COMPOSE — DO NOT HAND-ROLL THE WRAPPER** — a hand-rolled label beside an
99
+ Input that should have been wrapped in `Field.Root`
100
+
101
+ All three ship in one injection, so none waits on a `greenrack <Component>` call
102
+ the agent may never make. The tables are the `contrast` and `composition`
103
+ edges of each component's `relatedTo` — see above.
104
+
105
+ Every consuming repo wires it the same way, and the CLI does the wiring:
106
+
107
+ ```
108
+ npx -y @greenharness/greenrack-cli hook install # wire this repo
109
+ npx -y @greenharness/greenrack-cli hook install --check # CI: exit 1 if it drifted
110
+ ```
111
+
112
+ `install` is idempotent, and touches exactly four files:
113
+
114
+ | File | What install does |
115
+ | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
+ | `.claude/hooks/greenrack-catalog.sh` | Writes the generated hook: fetches the catalog, caches it for 7 days (npx resolution dominates session start; the catalog only changes on upgrade), stays silent when offline with no cache. Then runs [`greenrack doctor --session`](#greenrack-doctor), re-run only when a file it reads changes. |
117
+ | `.claude/hooks/greenrack-plan.sh` | Writes the generated [plan-mode nudge](#plan-mode-nudge). |
118
+ | `.claude/settings.json` | Adds the `SessionStart` and `UserPromptSubmit` entries. Existing hooks, permissions and skill overrides are preserved; a hand-renamed greenrack command is migrated in place rather than duplicated. Unparseable JSON is reported, never clobbered. |
119
+ | `.gitignore` | Ignores `.claude/.greenrack-session.cache*` — a glob, because a hook killed mid-`npx` leaves the staging `.tmp` behind. |
120
+
121
+ Do not hand-edit the generated scripts — `--check` is a byte comparison, so an
122
+ edit shows up as drift and the next `install` overwrites it. **Repo-specific
123
+ caveats go in `.claude/greenrack-hook.local.md`**: the hook appends that file after
124
+ the catalog, and regeneration leaves it alone. Use it for the things the
125
+ generic preamble can't know — local styling conventions, what NOT to convert,
126
+ which packages are off-limits:
127
+
128
+ ```markdown
129
+ This repo specifically (see CLAUDE.md): the raw-markup convention licenses
130
+ raw div/span MARKUP around greenrack components — it is NOT a license to
131
+ hand-roll widgets the DS ships.
132
+ ```
133
+
134
+ Wire `--check` into the repo's lint or CI job to catch a stale hook after a
135
+ CLI upgrade. The generated script pins `@greenharness/greenrack-cli@^7` — a floating
136
+ pin, so patch releases never read as drift, but a **floor**: a repo whose
137
+ script still pins `^3.4.0` never resolves a 4.x payload and never sees what
138
+ the session-start injection gained since. The release refuses a tag whose
139
+ major differs from that floor (`scripts/check-pin-major.mjs`). After a major,
140
+ re-run `hook install` (and `skill install`, which also refreshes the colors, typography and ui skills) in every consumer: the cache
141
+ records the floor it was fetched with, so the next session refetches it on its
142
+ own, and a failed refetch says so on stderr.
143
+
144
+ ### Plan-mode nudge
145
+
146
+ The second hook runs on Claude Code's `UserPromptSubmit`. While the session is
147
+ in plan mode (the event's `permission_mode` is `"plan"`) it adds five lines to
148
+ the planner's context: a plan that adds a new screen, or makes a material
149
+ choice in layout, hierarchy or interaction, starts by picking a direction —
150
+ load the `greenrack-mockup` skill and draw 2–4 directions with `greenrack mockup` before
151
+ `ExitPlanMode` (fleet decision `handoff.fresh-directions-trigger`). A fix that
152
+ restores an existing design reuses the picked artboard; any other UI change
153
+ needs no mockup. So fresh directions come up while planning without anyone
154
+ typing `/greenrack-mockup`.
155
+
156
+ Outside plan mode, and on any payload it cannot read, it prints nothing. It
157
+ runs on every prompt, so it is plain `sh` and one `grep` over the event JSON —
158
+ no npx, no node, no network — and every path exits 0: it can never block or
159
+ fail a prompt. Existing `UserPromptSubmit` hooks in `settings.json` are kept;
160
+ the greenrack entry joins the array.
161
+
162
+ ## Extension (Green Harness)
163
+
164
+ `@greenharness/greenrack-cli` is also the `design` extension of [grh](https://github.com/fredericrous/grh),
165
+ the Green Harness installer. `greenharness.toml` at the package root is a grh manifest v1; install
166
+ it from a repository that depends on the CLI:
167
+
168
+ ```
169
+ grh install --extension node_modules/@greenharness/greenrack-cli
170
+ ```
171
+
172
+ or, without a local dependency:
173
+
174
+ ```
175
+ npm pack @greenharness/greenrack-cli@^7 && tar -xzf greenharness-greenrack-cli-7*.tgz && grh install --extension package
176
+ ```
177
+
178
+ What each manifest entry does:
179
+
180
+ | Entry | What grh places |
181
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
182
+ | `[[skill]]` ×4 | the `colors`, `typography`, `ui` and `greenrack-mockup` skills, copied to `~/.claude/skills/` |
183
+ | `[[agent]]` | `design-system-lookup`: given a plan, answers what its UI needs from the catalog as a `design-lookup` block |
184
+ | `[[mcp]]` | the `greenrack` MCP server (`greenrack mcp`, through `npx`), registered for the user |
185
+ | `[[session_context]]` | `greenrack context`: the catalog, then the doctor block; silent outside a greenrack consumer and where `greenrack hook install` already ran |
186
+ | `[[doctor]]` | `greenrack doctor`, shown by `grh status`; silent outside a greenrack consumer |
187
+
188
+ The skills gate themselves: each opens by saying it applies only in a repository whose `package.json`
189
+ depends on `@greenharness/greenrack-ui` (a `workspace:` dependency counts), and to stop anywhere else, so a
190
+ user-level install costs other repositories nothing. The two session commands are `sh -c` guards
191
+ that exit at once unless the root `package.json`, or a `package.json` one or two directories below it, names
192
+ `@greenharness/greenrack-`.
193
+
194
+ `greenrack context` prints the catalog `greenrack hook session-start` prints (which now delegates to
195
+ `greenrack context --catalog-only`) and then the `doctor --session` block, re-run only when the build files'
196
+ key changes. Its cache is `${XDG_CACHE_HOME:-~/.cache}/greenrack/<repo path hash>`: written to a temporary
197
+ file and renamed, a failed write is silent, and nothing is ever created in the repository's `.claude/`.
198
+ `greenrack hook install` and `greenrack skill install` still work as before and print one extra line on stderr
199
+ pointing here.
200
+
201
+ ## greenrack doctor
202
+
203
+ The design system's stylesheet is layered: `reset`, then StyleX's
204
+ `priority1`…`priority5`, so a component's `padding-left` beats the reset's
205
+ `padding: 0`. An app can break that without touching a component, and the
206
+ symptom is always the same — buttons, inputs and page wrappers rendered with
207
+ almost no padding while `@greenharness/greenrack-ui`'s CSS is fine. `greenrack doctor` checks the
208
+ app's wiring, statically, from its package root (or a repo root: it follows
209
+ pnpm/npm workspaces, else looks one directory down):
210
+
211
+ | Rule | Severity | What breaks |
212
+ | -------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
213
+ | `runtime-injection` | error | `runtimeInjection: true` in a vite/babel config. StyleX injects react-strict-dom's element reset into an unlayered `<style>`, and unlayered beats every layer. A warning in `vitest.*` (jsdom only). |
214
+ | `layered-extraction` | error | `useCSSLayers: false` in postcss.config: the app's extracted rules — react-strict-dom's reset included — land unlayered. |
215
+ | `css-imported` | error | The entry (`app/root.tsx`, `src/main.tsx`, …) never imports `@greenharness/greenrack-ui/dist/index.css`. The JavaScript does not load it; components render unstyled. |
216
+ | `css-load-order` | error | A stylesheet declares the `priority*` layers before `reset`. The first declaration fixes layer order for the page, which puts the reset on top. |
217
+ | `unlayered-reset` | warn | `* { padding: 0 }` (or on `button`, `input`, `main`, …) outside any `@layer` in the app's own CSS. |
218
+ | `version-skew` | warn | The installed `@greenharness/greenrack-ui` is not the version this CLI checks. |
219
+ | `tokens-compiled` | warn, or error | A vite/babel config compiles with StyleX but nothing routes `@greenharness/greenrack-tokens` through `react-strict-dom/babel-preset` (or, in an SSR app, `ssr.noExternal` misses it). `css.create` then cannot import `@greenharness/greenrack-tokens/tokens/*.css`: StyleX fails with "…ensure the theme file has a .stylex.js or .stylex.ts extension". An error once a `css.create` file in `app/`/`src/` deep-imports the tokens; until then a warning, since that is the import the design system prescribes. `noExternal` may be inline, a const in the config, the `{noExternal}` shorthand or a const a sibling module exports; a declared list never counts as routing. When the binding cannot be resolved, a warning names it. |
220
+ | `media-var` | error | Built CSS (`build/`, `dist/`) holds an `@media` whose condition reads a `var(--…)`: a media query cannot read a custom property, so it never matches. The breakpoint consts reached the CSS uncompiled. Reads only output newer than every config and source file (capped scan); with none, the check is reported as `skipped (no fresh build)` and left out of `--json` `checked`. A path it cannot read (anything but a missing one) is a warning that names it and the error code. |
221
+
222
+ **Exit codes:** `0` when there are no findings or only warnings, `1` when
223
+ there is at least one error, so it gates on errors only. `--session` always
224
+ exits 0. `--json` prints `{ok, findings, checked, skipped, packages}`.
225
+
226
+ Two places run it, and a consuming repo wires both:
227
+
228
+ - **Every agent session** — the [session hook](#claude-code-session-hook)
229
+ runs `doctor --session`, which prints nothing when the repo is healthy and
230
+ an agent-facing block when it is not. `hook install` wires it.
231
+ - **Every commit that touches the wiring** — an [amont](https://github.com/fredericrous/amont)
232
+ row in `greengate.conf`. Add any custom config file the app has (a
233
+ `vite.strict-dom.ts`) to the scope:
234
+
235
+ ```
236
+ # stage name scope severity command
237
+ pre-commit greenrack-doctor *.css,package.json,root.tsx,main.tsx,vite.config.ts,vitest.config.ts,postcss.config.js,postcss.config.mjs,babel.config.js block npx -y @greenharness/greenrack-cli@^7 doctor
238
+ ```
239
+
240
+ ## Mockups that speak the design system
241
+
242
+ A mockup drawn outside the token system has to be translated when it is
243
+ implemented, and the translation drifts — one four-direction canvas used
244
+ 485 distinct colours, 15 of them in the palette, and the implementation
245
+ carried `marginTop: 23` and a raw `768px` query past every lint rule. Three
246
+ commands and one skill make the artboard the contract instead.
247
+
248
+ ```
249
+ npx -y @greenharness/greenrack-cli mockup seed --out docs/mockups/<screen> --name Main
250
+ npx -y @greenharness/greenrack-cli mockup check docs/mockups/<screen>/*.dc.html # exit 1 on findings
251
+ npx -y @greenharness/greenrack-cli mockup canvas docs/mockups/<screen> # the page to pick from
252
+ npx -y @greenharness/greenrack-cli skill install # /greenrack-mockup + colors, typography, ui
253
+ ```
254
+
255
+ `seed` writes a `.dc.html` whose `<style>` opens with the tokens as **resolved** custom properties for
256
+ every theme (`--gr-color-bg`, `--gr-spacing-md`, … — the same names as
257
+ `@greenharness/greenrack-tokens/vars.css`, generated from the same sources). `--theme
258
+ light|high-contrast` stamps `<html data-theme>` so the block switches.
259
+
260
+ `--overrides <file.json>` seeds an artboard for an app that themes with tokens. The file is the object
261
+ `ThemeProvider` takes as `tokens`, so an app passes the same file to both:
262
+
263
+ ```json
264
+ {
265
+ "colors": {"bg": "#020803", "success": "#39ff7a"},
266
+ "typography": {
267
+ "fontFamily": "'JetBrains Mono', ui-monospace, Menlo, monospace",
268
+ "fontFamilyMono": "'JetBrains Mono', ui-monospace, Menlo, monospace"
269
+ },
270
+ "radii": {"xs": "2px", "sm": "4px", "md": "6px", "lg": "8px"},
271
+ "sizes": {"dialogSm": "360px"}
272
+ }
273
+ ```
274
+
275
+ Every group is optional. The groups are `colors`, `shadows`, `typography`, `typeScale`, `spacing`,
276
+ `layoutSpacing`, `radii`, `sizes`, `borders`, `duration`, `easing` and `effects`; each holds a partial map
277
+ of that group's token keys (camelCase, as in `greenrack list`), and each value is checked by the rule of its
278
+ kind (a colour, a font-family list, a non-negative `px`/`rem` length, a fluid `clamp()` length, a weight,
279
+ a shadow list, a duration, an easing, a blur). `layers`, `breakpoints`, `microSpacing`, `radii.px6` and
280
+ `radii.full` are refused, and `sizes.touchTarget` (44px), `borders.focusRing` (2px) and
281
+ `borders.focusOffset` keep their floors. A font list starts with a face the app loads. A file with no
282
+ group is the earlier flat map of colour keys (`{"bg": "#020803"}`) and still works; a file that has a group
283
+ and any other top-level key is refused (`bg: unknown group (expected colors | shadows | …)`). The validation
284
+ is `@greenharness/greenrack-tokens/theme`, the module `ThemeProvider` uses, so the CLI refuses what the app would drop.
285
+
286
+ The overrides are written inside the token block as `--gr-<group>-<key>` rules (`--gr-color-bg`,
287
+ `--gr-typography-font-family`, `--gr-radius-md`, `--gr-size-dialog-sm`, … for `:root` and for both
288
+ `data-theme` selectors, so they win whatever the theme), and `check` accepts them there while still refusing
289
+ a raw colour anywhere else. The success line lists the groups that have entries, in the group table's order (`with overrides from
290
+ theme.json: colors 1, typography 2, radii 4`). A missing or non-JSON file, an unknown key or a refused
291
+ value exits 2 with `<group>.<key>: <reason>` on stderr (`radii.md: "-1px" must be 0 or a non-negative
292
+ px/rem length`); nothing is written, and with `--json` the result (`kind`, `problems`) is still printed on
293
+ stdout. The artboard is written to `<path>.tmp` and renamed, so an interrupted run leaves nothing that
294
+ blocks the next seed.
295
+
296
+ `check` reads an artboard back and refuses, with `file:line rule: message`:
297
+
298
+ | Rule | Finding |
299
+ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
300
+ | `raw-color` | A hex / `rgb()` / `hsl()` literal anywhere outside the token block, in a rule or an inline `style`. |
301
+ | `raw-length` | A literal on a spacing, radius, font, shadow or motion property (`padding: 23px`, `font-weight: 600`, `transition: opacity 150ms`). Widths, heights and positions are geometry, not tokens — never reported. |
302
+ | `raw-breakpoint` | A `@media` / `@container` width off the breakpoint scale (480 / 640 / 768 / 1024 / 1280). Queries cannot read a variable, so a literal on the scale is the right spelling. |
303
+ | `unknown-component` | `data-gr="<Name>"` or `<Name>.<Part>` the registry does not know, with suggestions. |
304
+ | `no-component-map` | No `data-gr` anywhere. An artboard names the component behind every control or it cannot be implemented from. |
305
+ | `unannotated-control` | An element that draws like a control but names none. Canvas artboards draw controls as `div`/`span`, so the tag is not the signal: a class is a control when the union of every rule that mentions it has a pointer cursor, a `:hover`/`:active`/`:focus` state, or a padded rounded fill. A named parent covers only a bare native control inside it. |
306
+
307
+ When the app's installed `@greenharness/greenrack-ui` differs from the CLI, `check` and
308
+ `canvas` say so under their findings (doctor's `version-skew`): npx reuses any
309
+ cached CLI that satisfies a range, and a checker older than the app reports a
310
+ newer component as `unknown-component`.
311
+
312
+ `canvas <dir>` writes `<dir>/canvas.html` (`--out`, `--title`): one
313
+ self-contained page with every `*.dc.html` in the directory, grouped into
314
+ lettered directions by file stem (`Tree.dc.html` and `Tree-Phone.dc.html` are
315
+ direction `Tree`, `Main` first), each artboard inlined by `srcdoc` and scaled
316
+ to its frame. It refuses, writing nothing, while any artboard fails `check`.
317
+ Publish it as the Artifact the person picks from, or open it from disk.
318
+
319
+ `skill install` writes `.claude/skills/greenrack-mockup/SKILL.md` and every file of
320
+ the packaged `colors`, `typography` and `ui` skills to `.claude/skills/<name>/`
321
+ (byte-compared by `--check`, like the hook; a file the package does not ship is
322
+ stale, and install removes it only where the directory carries the shipped
323
+ `NOTICE.md`). Install refuses to write into an existing `colors`, `typography`
324
+ or `ui` directory without that `NOTICE.md` (a skill of your own) unless you pass
325
+ `--force`, which also removes the files of the overwritten directory that the
326
+ package does not ship. The same three skills are served by the MCP server as guides:
327
+ `greenrack_lookup guide:colors`, or `guide:colors/contrast.md` for a reference
328
+ file. The skill runs the whole path — seed directions,
329
+ check, publish the canvas, implement the picked direction from its
330
+ `data-gr` map, screenshot the built route and put artboard and screenshot
331
+ side by side in the PR — with nothing outside the CLI, and it explicitly
332
+ overrides the `design` skill's "lift resolved values" step. Repo notes go in `.claude/greenrack-mockup.local.md`.
333
+ Its description triggers on a request for a screen, page or mockups, and also
334
+ while planning (plan mode) a new screen or a material layout, hierarchy or
335
+ interaction change — the moment the [plan-mode nudge](#plan-mode-nudge) points
336
+ at it.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: design-system-lookup
3
+ description: Given a plan, answers what its UI needs from the greenrack catalog (components and props, tokens, recipes, gaps) as a design-lookup block. Use before a plan that adds or changes UI in a repository consuming @greenharness/greenrack-ui.
4
+ tools: Read, Grep, Glob, mcp__greenrack__greenrack_lookup
5
+ ---
6
+
7
+ You answer one question for a plan: what does its UI need from the greenrack design
8
+ system? You read the plan and the repository, ask the catalog, and return a
9
+ `design-lookup` block. You write no code and change no file.
10
+
11
+ ## Scope check first
12
+
13
+ Look for a `package.json` (the root, or a workspace package) that depends on
14
+ `@greenharness/greenrack-ui`, or on the old `@duro-app/ui` it replaces; a `workspace:`
15
+ dependency counts. If none does, answer exactly
16
+ `no design system in this repository` and stop.
17
+
18
+ ## greenrack's own rules
19
+
20
+ Say these back in the block when they bear on the plan; they are the design
21
+ system's, stated here in my own words.
22
+
23
+ - Elements come from react-strict-dom: `html.div`, `html.button`, never a raw
24
+ `<div>` or `<span>`.
25
+ - Every measure is a token. A width, height, border width, spacing, radius,
26
+ colour or duration comes from a token group (`sizes`, `borders`, `spacing`,
27
+ `microSpacing`, `radii`, `colors`, `duration`). Raw values allowed are `0`,
28
+ relative units, keywords and a `calc()` of tokens. When no token fits, that is
29
+ a gap to report, never the nearest token.
30
+ - Layout is built from greenrack components (`Stack`, `Inline`, `Cluster`, `Grid`,
31
+ `PageShell`, `AppShell`), not hand-rolled flex or grid styles.
32
+ - The interface guides are served by the catalog: `greenrack_lookup guide:colors`,
33
+ `guide:typography`, `guide:ui`. Fetch the one that matches what the plan touches.
34
+
35
+ ## How to look things up
36
+
37
+ Call `greenrack_lookup` with a component name (props and usage), a recipe name
38
+ (runnable source), a token group (`spacing`, `sizes`, `colors`), `rules`, or free
39
+ text to search. Read the repository's own UI code with Read, Grep and Glob only
40
+ to learn what already exists there.
41
+
42
+ ## Decisions
43
+
44
+ The brief may carry a decisions block. Cite a decision only by its key, as "when the
45
+ decisions part is installed, `aval resolve <key>` outranks this". When the brief carries no decisions block, say that no decision was
46
+ checked. Never run or require a decisions tool yourself.
47
+
48
+ ## Answer
49
+
50
+ Return one block and nothing after it:
51
+
52
+ ```design-lookup
53
+ components: <name — props the plan needs, one line each>
54
+ recipes: <recipe — what it covers, or none>
55
+ tokens: <group.key — where the plan needs a measure, colour or duration>
56
+ guides: <guide:<name> — read when the plan touches it, or none>
57
+ gaps: <what the plan needs that the catalog does not have, or none>
58
+ decisions: <keys cited, or "no decision was checked">
59
+ ```
package/dist/bin.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
package/dist/bin.js ADDED
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from 'node:util';
3
+ import { loadRegistry } from './registry.js';
4
+ import { runLookup } from './commands/lookup.js';
5
+ import { runList } from './commands/list.js';
6
+ import { runHook } from './commands/hook.js';
7
+ import { runContext } from './commands/context.js';
8
+ import { extensionPointer } from './extension-pointer.js';
9
+ import { runMockup } from './commands/mockup.js';
10
+ import { runSkill } from './commands/skill.js';
11
+ import { runDoctor, SCOPES, uiVersionSkew } from './commands/doctor.js';
12
+ import { runManifest, cliVersion } from './commands/manifest.js';
13
+ function emit(result, json) {
14
+ if (result.exitCode === 2) {
15
+ process.stderr.write(result.text.endsWith('\n') ? result.text : result.text + '\n');
16
+ // A --json caller still gets its result on stdout; the failure is the exit status and stderr.
17
+ if (json)
18
+ process.stdout.write(JSON.stringify(result.data, null, 2) + '\n');
19
+ }
20
+ else if (json) {
21
+ process.stdout.write(JSON.stringify(result.data, null, 2) + '\n');
22
+ }
23
+ else {
24
+ process.stdout.write(result.text.endsWith('\n') ? result.text : result.text + '\n');
25
+ }
26
+ process.exit(result.exitCode ?? 0);
27
+ }
28
+ function usageError(message) {
29
+ process.stderr.write(`${message}\nUsage: greenrack <name|list|manifest|hook|skill|context|mockup|doctor|mcp> [flags] — greenrack manifest for details\n`);
30
+ process.exit(2);
31
+ }
32
+ function pointToExtension() {
33
+ process.stderr.write(extensionPointer(process.cwd(), process.env.PATH ?? '') + '\n');
34
+ }
35
+ async function main() {
36
+ let parsed;
37
+ try {
38
+ parsed = parseArgs({
39
+ allowPositionals: true,
40
+ options: {
41
+ json: { type: 'boolean', default: false },
42
+ part: { type: 'string' },
43
+ props: { type: 'boolean', default: false },
44
+ 'source-only': { type: 'boolean', default: false },
45
+ 'no-color': { type: 'boolean', default: false },
46
+ check: { type: 'boolean', default: false },
47
+ force: { type: 'boolean', default: false },
48
+ session: { type: 'boolean', default: false },
49
+ 'catalog-only': { type: 'boolean', default: false },
50
+ out: { type: 'string' },
51
+ name: { type: 'string' },
52
+ theme: { type: 'string' },
53
+ overrides: { type: 'string' },
54
+ title: { type: 'string' },
55
+ help: { type: 'boolean', short: 'h', default: false },
56
+ version: { type: 'boolean', short: 'v', default: false },
57
+ },
58
+ });
59
+ }
60
+ catch (error) {
61
+ usageError(`greenrack: ${error instanceof Error ? error.message : String(error)}`);
62
+ }
63
+ const { values, positionals } = parsed;
64
+ if (values.version) {
65
+ process.stdout.write(cliVersion() + '\n');
66
+ process.exit(0);
67
+ }
68
+ const registry = loadRegistry();
69
+ const [first, ...rest] = positionals;
70
+ // Version-skew guard: the registry documents the lockstep-released ui
71
+ // version; warn (stderr only) when a locally installed ui differs. doctor
72
+ // reports the same skew as one of its findings instead, and mockup under the
73
+ // findings it may explain (an unknown-component newer than the checker).
74
+ if (!values.json && first !== 'doctor' && first !== 'mockup') {
75
+ const skew = uiVersionSkew(process.cwd(), SCOPES);
76
+ if (skew) {
77
+ process.stderr.write(`greenrack: docs are for @greenharness/greenrack-ui@${skew.own}, you have ${skew.ui}@${skew.installed} — npm i -D ${skew.cli}@${skew.installed}\n`);
78
+ }
79
+ }
80
+ if (values.help || first === undefined) {
81
+ emit(runManifest(registry), values.json);
82
+ }
83
+ if (first === 'manifest') {
84
+ emit(runManifest(registry), values.json);
85
+ }
86
+ if (first === 'list') {
87
+ if (rest.length > 1)
88
+ usageError('greenrack list takes at most one kind');
89
+ emit(runList(registry, rest[0]), values.json);
90
+ }
91
+ if (first === 'hook') {
92
+ if (rest.length > 1)
93
+ usageError('greenrack hook takes exactly one event');
94
+ const hookResult = runHook(registry, rest[0], { check: values.check });
95
+ if (rest[0] === 'install')
96
+ pointToExtension();
97
+ emit(hookResult, values.json);
98
+ }
99
+ if (first === 'skill') {
100
+ if (rest.length > 1)
101
+ usageError('greenrack skill takes exactly one action');
102
+ const skillResult = runSkill(rest[0], { check: values.check, force: values.force });
103
+ if (rest[0] === 'install')
104
+ pointToExtension();
105
+ emit(skillResult, values.json);
106
+ }
107
+ if (first === 'context') {
108
+ if (rest.length > 0)
109
+ usageError('greenrack context takes no arguments — run it from the repo root');
110
+ emit(runContext(registry, { catalogOnly: values['catalog-only'] }), values.json);
111
+ }
112
+ if (first === 'mockup') {
113
+ const [sub, ...files] = rest;
114
+ emit(runMockup(registry, sub, files, {
115
+ out: values.out,
116
+ name: values.name,
117
+ theme: values.theme,
118
+ overrides: values.overrides,
119
+ title: values.title,
120
+ }), values.json);
121
+ }
122
+ if (first === 'doctor') {
123
+ if (rest.length > 0)
124
+ usageError('greenrack doctor takes no arguments — run it from the package root');
125
+ emit(runDoctor({ session: values.session }), values.json);
126
+ }
127
+ if (first === 'mcp') {
128
+ const { runMcp } = await import('./commands/mcp.js');
129
+ await runMcp(registry);
130
+ return;
131
+ }
132
+ // Everything else is a lookup — multiple positionals become a search query.
133
+ const query = [first, ...rest].join(' ');
134
+ emit(runLookup(registry, query, {
135
+ part: values.part,
136
+ propsOnly: values.props,
137
+ sourceOnly: values['source-only'],
138
+ }), values.json);
139
+ }
140
+ main().catch((error) => {
141
+ const exitCode = error.exitCode ?? 1;
142
+ process.stderr.write(`greenrack: ${error instanceof Error ? error.message : String(error)}\n`);
143
+ process.exit(exitCode);
144
+ });
145
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAC,SAAS,EAAqB,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAA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,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAA;QAClD,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAA;QACtB,OAAM;IACR,CAAC;IAED,4EAA4E;IAC5E,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACxC,IAAI,CACF,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE;QACzB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,SAAS,EAAE,MAAM,CAAC,KAAK;QACvB,UAAU,EAAE,MAAM,CAAC,aAAa,CAAC;KAClC,CAAC,EACF,MAAM,CAAC,IAAI,CACZ,CAAA;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,MAAM,QAAQ,GAAI,KAA6B,CAAC,QAAQ,IAAI,CAAC,CAAA;IAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9F,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AACxB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { Registry } from './registry-types.js';
2
+ export declare const PREAMBLE: string;
3
+ /** The catalog session context: preamble, screens, index, guides, neighbour tables. */
4
+ export declare function renderCatalog(registry: Registry): {
5
+ text: string;
6
+ data: {
7
+ preamble: string;
8
+ entries: unknown;
9
+ contrast: import("./disambiguation.js").RelatedPair[];
10
+ composition: import("./disambiguation.js").RelatedPair[];
11
+ };
12
+ };
13
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAUjD,eAAO,MAAM,QAAQ,QAaT,CAAA;AA0BZ,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ;;;;;;;;EAkB/C"}