roast-my-design-system 5.2.3 → 5.3.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
@@ -1,6 +1,6 @@
1
1
  # roast-my-design-system
2
2
 
3
- [![npm](https://img.shields.io/npm/v/roast-my-design-system?color=2dd4bf&label=npm)](https://www.npmjs.com/package/roast-my-design-system) [![downloads](https://img.shields.io/npm/dm/roast-my-design-system?color=2dd4bf&label=downloads)](https://www.npmjs.com/package/roast-my-design-system) [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
3
+ [![npm](https://img.shields.io/npm/v/roast-my-design-system?color=2dd4bf&label=npm)](https://www.npmjs.com/package/roast-my-design-system) [![downloads](https://img.shields.io/npm/dm/roast-my-design-system?color=2dd4bf&label=downloads)](https://www.npmjs.com/package/roast-my-design-system) [![Socket](https://badge.socket.dev/npm/package/roast-my-design-system)](https://socket.dev/npm/package/roast-my-design-system) [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE) [![zero dependencies](https://img.shields.io/badge/dependencies-0-2dd4bf)](https://www.npmjs.com/package/roast-my-design-system?activeTab=dependencies) [![no telemetry](https://img.shields.io/badge/no-telemetry-2dd4bf)](https://github.com/gregkozakiewicz/roast-my-design-system#what-makes-the-numbers-trustworthy)
4
4
 
5
5
  ## Your AI can write the UI. This makes sure it writes *your* UI.
6
6
 
@@ -28,8 +28,8 @@ One scan powers all of it; the flags decide what lands on disk. Combine freely.
28
28
 
29
29
  | Command                                                             | What you get |
30
30
  |---|---|
31
- | <code>npx&nbsp;roast-my-design-system</code> | The scan and `design-system-roast.html`, opened in your browser |
32
- | <code>npx&nbsp;roast-my-design-system&nbsp;&lt;path&gt;</code> | Scan a different repo than the current directory |
31
+ | <code>npx&nbsp;roast-my-design-system@latest</code> | The scan and `design-system-roast.html`, opened in your browser |
32
+ | <code>npx&nbsp;roast-my-design-system@latest&nbsp;&lt;path&gt;</code> | Scan a different repo than the current directory |
33
33
  | `... --apply` | The generated agent rules injected straight into every agent file you have: `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, `.cursor/rules/`, `.windsurfrules` and `.github/copilot-instructions.md`, inside a marked block. Re-running replaces only that block, never your own text. Windsurf and Copilot get a compact variant sized for their limits |
34
34
  | `... --rules` | The same rules written to `design-system-rules.md` instead, for pasting by hand |
35
35
  | `... --card` | `roast-card.svg`: a shareable 1200x630 card with the score and worst findings. Pure SVG, embeds in a README |
@@ -76,7 +76,7 @@ The same report in light mode (one file, built-in toggle):
76
76
  Some repos host more than one visual world on purpose: the product plus a marketing site, a playground, a batch of experiments. Blending them produces a score that describes none of them. Scope the scan to the design system you are actually judging:
77
77
 
78
78
  ```bash
79
- npx roast-my-design-system --exclude lab/ --exclude playground/
79
+ npx roast-my-design-system@latest --exclude lab/ --exclude playground/
80
80
  ```
81
81
 
82
82
  Or make it permanent with a `.roastignore` file at the repo root, one repo-relative folder per line:
@@ -117,7 +117,7 @@ The scanner already speaks SARIF, so wiring it into GitHub code scanning is six
117
117
 
118
118
  ```yaml
119
119
  - uses: actions/checkout@v4
120
- - run: npx roast-my-design-system . --sarif --no-open
120
+ - run: npx roast-my-design-system@latest . --sarif --no-open
121
121
  - uses: github/codeql-action/upload-sarif@v3
122
122
  with:
123
123
  sarif_file: design-system-roast.sarif
@@ -128,7 +128,7 @@ The scanner already speaks SARIF, so wiring it into GitHub code scanning is six
128
128
  **No install, no Claude needed — just try it:**
129
129
 
130
130
  ```bash
131
- npx roast-my-design-system
131
+ npx roast-my-design-system@latest
132
132
  ```
133
133
 
134
134
  Run it inside any repo. Same scanner, same report, straight from npm. The Claude Code skill below adds the conversation on top: the roast in chat, then a punch list you can actually work through with Claude.
package/bin/roast.mjs CHANGED
@@ -5,7 +5,7 @@
5
5
  * diagnose it against Ideal Design System norms and the 29-repo benchmark,
6
6
  * write design-system-roast.html, open it, print the score.
7
7
  *
8
- * npx roast-my-design-system [path] [--theme dark|light] [--out report.html] [--no-open]
8
+ * npx roast-my-design-system@latest [path] [--theme dark|light] [--out report.html] [--no-open]
9
9
  * [--rules] [--json] [--exclude <path>]
10
10
  */
11
11
  import { spawnSync } from 'node:child_process';
@@ -61,7 +61,7 @@ if (flag('version') || flag('v')) { console.log(VERSION); process.exit(0); }
61
61
  if (flag('help') || flag('h')) {
62
62
  console.log(`roast-my-design-system ${VERSION}
63
63
 
64
- Usage: npx roast-my-design-system [path] [options]
64
+ Usage: npx roast-my-design-system@latest [path] [options]
65
65
 
66
66
  path repo to scan (default: current directory)
67
67
  --theme <t> dark | light (default: dark)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roast-my-design-system",
3
- "version": "5.2.3",
3
+ "version": "5.3.0",
4
4
  "mcpName": "io.github.gregkozakiewicz/roast-my-design-system",
5
5
  "description": "Your AI can write the UI. This makes sure it writes your UI. A deterministic scanner scores your design system 0-100 against 34 public repos, writes rules for Claude, Cursor, Copilot and Windsurf with --apply, and runs as a local MCP server with --mcp.",
6
6
  "keywords": [
@@ -75,7 +75,7 @@ const svg = `<svg width="1200" height="630" viewBox="0 0 1200 630" xmlns="http:/
75
75
  ${rows}
76
76
 
77
77
  <line x1="96" y1="486" x2="1104" y2="486" stroke="#272c37" stroke-width="1.5"/>
78
- <text x="96" y="536" font-family="${MONO}" font-size="20" fill="#8b93a7">npx roast-my-design-system</text>
78
+ <text x="96" y="536" font-family="${MONO}" font-size="20" fill="#8b93a7">npx roast-my-design-system@latest</text>
79
79
  <text x="1104" y="536" font-family="${MONO}" font-size="17" fill="#5a6172" text-anchor="end">scanned ${date} · ver. ${esc(s.version ?? '')}</text>
80
80
  </svg>
81
81
  `;
@@ -516,6 +516,28 @@ function spacingTrap() {
516
516
  }
517
517
  return '';
518
518
  }
519
+ function coloursTrap() {
520
+ if (nearPairs.length < 6) return '';
521
+ return trapBox(`This palette holds ${nearPairs.length} pairs of colours a screen can barely tell apart. An agent asked for the brand grey cannot see the difference either, so it copies whichever twin is nearest, and when unsure it invents a third between them. Twins breed triplets.`);
522
+ }
523
+ function inlineTrap() {
524
+ if (inline.count < 50) return '';
525
+ return trapBox(`${n(inline.count)} inline styles live where the system should. An agent learns a codebase by example, and every inline style is an example that says the system is optional. Each exception it copies becomes the precedent for the next one.`);
526
+ }
527
+ function importantTrap() {
528
+ if (important.count < 20) return '';
529
+ return trapBox(`${n(important.count)} !important declarations, and each one is a shouting match a previous developer decided to win by force. An agent whose style will not apply does what the repo taught it and shouts louder. The volume in this codebase only goes up.`);
530
+ }
531
+ function orphansTrap() {
532
+ if (neverImported.length < 10) return '';
533
+ return trapBox(`${neverImported.length} components are never imported anywhere. An agent searching for a Button finds the abandoned ones alongside the canonical one with nothing to tell them apart, so yesterday's dead end becomes today's example.`);
534
+ }
535
+ // At most three traps per report, in severity order: scarcity is what makes
536
+ // the marker readable as a warning rather than wallpaper.
537
+ function trapsBlock() {
538
+ return [dupesTrap(), spacingTrap(), coloursTrap(), inlineTrap(), importantTrap(), orphansTrap()]
539
+ .filter(Boolean).slice(0, 3).join('');
540
+ }
519
541
 
520
542
  function spacingBars() {
521
543
  const hasTw = twSpacing.length > 0;
@@ -1379,7 +1401,7 @@ ${whereToStartSection()}
1379
1401
 
1380
1402
  ${giftSection()}
1381
1403
 
1382
- ${dupesTrap()}${spacingTrap()}
1404
+ ${trapsBlock()}
1383
1405
 
1384
1406
  <div class="stats">${bigStats.map((s) => statTile(s)).join('')}</div>
1385
1407
 
@@ -1,4 +1,4 @@
1
1
  // Single version constant for the engine — imported by diagnose (report
2
2
  // footer) and rules (generated-by line). This is the bump spot that used to
3
3
  // live as a const inside diagnose/index.mjs.
4
- export const VERSION = '5.2.3';
4
+ export const VERSION = '5.3.0';
@@ -62,7 +62,7 @@ export function getContext(k, { path = null } = {}) {
62
62
  const faces = distinctTypefaces(t.fontFamilies ?? []);
63
63
  if (faces.length) L.push(`TYPE: ${faces.slice(0, 3).join(', ')}. No new typefaces, no hand-declared font stacks.`);
64
64
  L.push('DISCIPLINE: no static style={{ }}, no !important, no new arbitrary values. Match the neighbouring component.');
65
- if (k.agentFiles.length === 0) L.push('NOTE: this repo has no agent rules file; these lines are the only guardrail. Suggest running npx roast-my-design-system --apply.');
65
+ if (k.agentFiles.length === 0) L.push('NOTE: this repo has no agent rules file; these lines are the only guardrail. Suggest running npx roast-my-design-system@latest --apply.');
66
66
  L.push('Before finishing: call roast_validate on what you wrote, then roast_review.');
67
67
 
68
68
  let text = L.join('\n');
@@ -30,7 +30,7 @@ const repoName = h.profile?.name ?? 'this repo';
30
30
  if (!compact) {
31
31
  lines.push(`<!-- Generated by roast-my-design-system from a scan of ${repoName} on ${scanDate}.`);
32
32
  lines.push(' Paste into CLAUDE.md, .cursor/rules or AGENTS.md. Regenerate after big refactors:');
33
- lines.push(' npx roast-my-design-system --rules -->');
33
+ lines.push(' npx roast-my-design-system@latest --rules -->');
34
34
  lines.push('');
35
35
  }
36
36
  // Mirror of the report's "no design system" banner: with almost no colour or