jig-ui 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -116,13 +116,14 @@ overwrites a config or brand file you have edited.
116
116
  | `init [--yes]` | Sets the project up: CSS system, brand colour, token files, `jig.config.json`, wired imports, baseline check. The only command that writes into your repo. |
117
117
  | `check [--all] [--ci] [--json]` | Runs the rules a machine can decide. Reports findings by rule id. |
118
118
  | `update` | Refreshes an install to a newer version, leaving alone any file you have edited. |
119
- | `explain <rule-id>` | Prints a rule in full — what it forbids, what to do instead, the version it arrived in, and who checks it. Also resolves the `P-` pattern and `M-` mode specs, which no rule index contains. |
119
+ | `explain <rule-id \| word> [--list]` | Given an id, prints a rule in full — what it forbids, what to do instead, the version it arrived in, and who checks it. Also resolves the `P-` pattern and `M-` mode specs, which no rule index contains. Given a **word**, searches every title and body and lists what matches, so you can find a rule you cannot name. `--list` prints every id, or one section's. |
120
120
 
121
121
  Flags worth knowing:
122
122
 
123
123
  | Flag | Effect |
124
124
  | --- | --- |
125
125
  | `check --all` | Scan the whole repo instead of just changed files. Use on a first run. |
126
+ | `explain --list` | Every rule id and title. Add a section letter (`explain G --list`) for one section. |
126
127
  | `check --ci` | Mechanical bucket only — deterministic, and exits non-zero on any error. |
127
128
  | `check --json` | Machine-readable findings, for tooling or for reading every finding when the terminal output elides repeats. |
128
129
  | `init --yes` | Non-interactive; accept every derived default. |
@@ -144,6 +145,7 @@ on the result — the CLI reports, the agent applies the judgment half.
144
145
  | `/jig init` | `jig init` — then states the mode it chose and what it wired |
145
146
  | `/jig check` | `jig check` — then applies the 97 judgment rules and reports both halves |
146
147
  | `/jig explain C-19` | `jig explain C-19` — prints the rule as-is, without paraphrasing it |
148
+ | `/jig explain contrast` | `jig explain contrast` — every rule matching a word, when you do not have an id |
147
149
  | `/jig install --agent cursor` | `jig install --agent cursor` |
148
150
  | `/jig update` | `jig update` |
149
151
 
@@ -179,32 +181,6 @@ any UI, takes the mode from `jig.config.json`, loads the pattern section for
179
181
  whatever it is building, consumes tokens by name, and cites any rule it
180
182
  deliberately breaks.
181
183
 
182
- ### Slash commands
183
-
184
- `install` also writes a `/jig` command, so the CLI is reachable without leaving
185
- your session:
186
-
187
- ```
188
- /jig init /jig check --all /jig update
189
- ```
190
-
191
- It runs the CLI and then does the part the CLI cannot — for `/jig check` that
192
- means applying the 97 judgment rules to the same files and merging both halves
193
- into one report keyed by rule id.
194
-
195
- | Harness | Command file |
196
- | --- | --- |
197
- | Claude Code | `.claude/commands/jig.md` |
198
- | Cursor | `.cursor/commands/jig.md` |
199
- | opencode | `.opencode/command/jig.md` |
200
- | Gemini CLI | `.gemini/commands/jig.toml` |
201
- | Codex | — run the CLI directly; see below |
202
- | Generic | — no harness to register with |
203
-
204
- Codex's custom prompts are not written: `codex exec` does not expand them, so a
205
- command file could sit there and never fire. Codex users run
206
- `npx jig-ui@latest check` directly — the skill in `AGENTS.md` is unaffected.
207
-
208
184
  **You still prompt normally.** Ask for a settings page, a data table, an empty
209
185
  state — whatever you were going to ask for. What you no longer have to say is
210
186
  *how*: "use the design tokens", "handle the loading state", "don't invent a
@@ -301,21 +277,21 @@ treatment.
301
277
 
302
278
  ## Files
303
279
 
304
- | File | Contents | Load |
305
- | --- | --- | --- |
306
- | `rules/00-anti-patterns.md` | 87 universal rules with corrections | **Always** |
307
- | `rules/01-modes.md` | `editorial` / `product` / `operator` profiles | **Always** |
308
- | `rules/02-tokens.md` | Token contract, naming, consumption | On setup, or when adding a token |
309
- | `rules/03-patterns.md` | Component anatomy and behaviour | When building a covered pattern |
310
- | `rules/04-principles.md` | Five frames + seven tiebreakers | Novel decisions, or rule conflicts |
311
- | `rules/05-copy.md` | Interface text rules | Writing any user-facing string |
312
- | `.jig/tokens/brand.*.css` | Identity. One per project. | Imported by the app |
313
- | `.jig/tokens/mode.*.css` | Density, scale, rhythm, motion | One per surface |
280
+ | File | Contents |
281
+ | --- | --- |
282
+ | `rules/00-anti-patterns.md` | 87 universal rules with corrections |
283
+ | `rules/01-modes.md` | `editorial` / `product` / `operator` profiles |
284
+ | `rules/02-tokens.md` | Token contract, naming, consumption |
285
+ | `rules/03-patterns.md` | Component anatomy and behaviour |
286
+ | `rules/04-principles.md` | Five frames + seven tiebreakers |
287
+ | `rules/05-copy.md` | Interface text rules |
288
+ | `.jig/tokens/brand.*.css` | Identity. One per project. |
289
+ | `.jig/tokens/mode.*.css` | Density, scale, rhythm, motion |
314
290
 
315
291
  `rules/*` and `rules.index.json` live beside your installed skill file, not
316
292
  in the project — see above.
317
293
 
318
- `00` and `01` are the always-loaded core and are sized to stay cheap in context. `03` is the largest file and should be loaded per-pattern rather than wholesale.
294
+ Which of these an agent loads, and when, is `AGENTS.md`.
319
295
 
320
296
  ## Per-project declaration
321
297
 
@@ -344,36 +320,7 @@ Without this file, follow the selection procedure in `rules/01-modes.md`: infer,
344
320
 
345
321
  Then `var(--color-text-strong)`, `var(--spacing-card)`, `var(--text-body)` in any framework. For Tailwind v4, wrap both imports in `@theme` to generate utilities. See `rules/02-tokens.md`.
346
322
 
347
- ## Testing that the rules work
348
-
349
- The system is only worth its context cost if it changes output. Test it rather than assuming.
350
-
351
- 1. Pick a task with known failure modes — a form with validation, or a data table with an empty state.
352
- 2. Run it twice: once with the system loaded, once without.
353
- 3. Diff the output against the self-check in `00`.
354
-
355
- A rule that does not change the output is either already the model's default (delete it) or too vague to act on (make it specific). Both are fixes to this system, not to the prompt.
356
-
357
- Re-run after any significant edit to `00` or `03`.
358
-
359
- ## Changing a rule
360
-
361
- - Values change in the token files, never at the call site.
362
- - Rules change in `00`–`03`, never by exception in a project.
363
- - A rule that needs an exception in two projects is wrong; fix the rule.
364
- - Anything mode-dependent belongs in a mode profile, not in `00`.
365
- - A new pattern earns a place in `03` after being built three times.
366
-
367
- ## Sources
368
-
369
- Written from general UI and accessibility practice, plus the constraints specific to agent-generated output — which is where most of the structure comes from: the anti-patterns-first ordering, the mode split, the brand × mode token architecture, and the decidability test applied to every rule.
370
-
371
- **The numeric defaults are being reconciled.** Type scale, spacing steps, control sizes
372
- and motion durations started as internally consistent guesses and are being checked, row by
373
- row, against an external reference on interface design. `RECONCILE.md` tracks the status of
374
- each: adopted, deliberately kept different, or still open. The accessibility floors are
375
- outside that process — contrast ratios and target sizes come from WCAG 2.1 AA and are not
376
- adjustable.
323
+ ---
377
324
 
378
- principles.design informed the rules-versus-principles split, and the standard
379
- `rules/04-principles.md` is held to.
325
+ Working on Jig itself rather than with it: `AGENTS.md` for how an agent should
326
+ change the rules, `RECONCILE.md` for where each numeric default came from.