better-design 0.20.0 → 0.24.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,124 +1,34 @@
1
1
  # Better Design
2
2
 
3
- ## Give your AI real design skills
4
-
5
- Better Design connects your coding agent to design systems, UI and UX guidance, icons, and quality reviews.
6
-
7
- Use it to design and build for web, mobile, Shopify, 3D, and product video.
8
-
9
- ```bash
10
- npx better-design
11
- ```
12
-
13
- Run it once. The installer detects your supported coding tools and adds Better Design without overwriting their existing configuration.
14
-
15
- Free. No account required.
3
+ Give your coding agent design systems, UI and UX guidance, icons, and code reviews through MCP.
16
4
 
17
5
  Works with Codex, Claude Code, Cursor, VS Code, Windsurf, and other MCP clients.
18
6
 
19
- ## What your agent can do
20
-
21
- - Find, generate, or extract a design system.
22
- - Build with consistent, editable components and styles.
23
- - Apply guidance for interfaces, interactions, motion, mobile, Shopify, and 3D.
24
- - Find and install a matching icon library.
25
- - Review accessibility, usability, content, and visual quality, against the guidance the session already loaded.
26
-
27
- Your code stays in your repo and remains yours to change.
28
-
29
- ## Tools
30
-
31
- | Tool | Purpose |
32
- | --- | --- |
33
- | `find-design-system` | Find a catalog system for a requested interface. |
34
- | `get-design-system-kit` | Retrieve installable React, HTML, Shopify, or DTCG design-token output. |
35
- | `get-design-system-status` | Check a generated system's progress and result. |
36
- | `create-design-system` | Generate a custom design system for a product. Pass an extracted token sheet as `brandCss` to build from the user's own brand instead of a catalog look-alike. |
37
- | `preview-design-system` | Show a token-true preview for a system. |
38
- | `get-ui-principle` | Load visual guidance for layout, type, color, polish, and accessibility. |
39
- | `get-ux-principle` | Load guidance for flows, forms, navigation, errors, onboarding, behavior, and landing page positioning. |
40
- | `get-react-native-guide` | Load React Native and Expo build guidance. |
41
- | `get-three-js-guide` | Load Three.js and React Three Fiber build guidance. |
42
- | `get-motion-guide` | Load animation and motion guidance. |
43
- | `get-review-rules` | Review UI output for visual, UX, content, accessibility, and motion issues. Names the principles this session already loaded and orders their rules first. |
44
- | `check-comprehension` | Check whether a finished interface communicates clearly. Names the principles this session already loaded. |
45
- | `extract-design-system` | Extract a brand from any mix of sources: pasted CSS, a computed-style sample from the live site, or a design-tokens export (W3C or Figma variables). |
46
- | `extract-from-url` | Point it at a public URL: the server fetches the site's stylesheets, renders the page in a headless browser, and returns the brand as an oklch token sheet. |
47
- | `find-icon-library` | Pick an icon library that fits the project. |
48
- | `find-icons` | Find icons inside a selected library. |
49
- | `install-icons` | Install selected icons into the local project. |
50
- | `detect-icon-library` | Detect an existing icon library in the project. |
51
- | `review-illustration` | Review illustration output against Better Design rules. |
52
- | `review-ui-code` | Deterministic review of React source: design-system drift, generated-UI tells, WCAG basics. |
7
+ ## Install
53
8
 
54
- ## Review UI code like a PR bot
55
-
56
- The `review` command checks React code against deterministic UI and UX rules: native elements your design system already replaces, hardcoded colors and raw palette classes, `dark:` forks, generated-UI tells (letter-spaced capital labels, left-border callout boxes, gradient text, labels above titles, em dashes in copy), and WCAG basics. The same input always produces the same findings.
9
+ Run these commands in your project:
57
10
 
58
11
  ```bash
59
- npx better-design review # review changed files (vs HEAD, plus untracked)
60
- npx better-design review src/components # review specific files or folders
61
- npx better-design review --base main # review a branch, like a PR diff
62
- npx better-design review --json # machine-readable output for CI
12
+ npx skills add marvkr/better-design --skill better-design
13
+ npx better-design
63
14
  ```
64
15
 
65
- The command exits 1 when it finds critical or serious issues, so it works as a CI gate. Tune the threshold with `--fail-on critical|serious|moderate|none`.
66
-
67
- Put your agent on rails: install the Claude Code hook and every file write is checked in real time, with violations fed back to the agent so it self-corrects without your intervention.
16
+ The first installs the agent skill. The second connects Better Design to your coding tools. Restart your agent after setup.
68
17
 
69
- ```bash
70
- npx better-design review --install-hook
71
- ```
18
+ ## Try it
72
19
 
73
- Override the default rules per project in `.better-design/review.config.json`. For example, point element rules at your own component paths, or turn a rule group off:
20
+ Ask your agent:
74
21
 
75
- ```json
76
- {
77
- "rules": {
78
- "elements": {
79
- "button": { "use": "Button", "from": "@/ui/button" }
80
- },
81
- "semanticTokens": { "enabled": false }
82
- }
83
- }
84
- ```
22
+ > Use Better Design to build a settings page with my project's design system, then review it for accessibility and consistency.
85
23
 
86
- Agents can run the same checks through the `review-ui-code` MCP tool and fix the findings before presenting the result.
24
+ ## Review UI code
87
25
 
88
- ### Review every pull request
26
+ Check changed JSX and TSX files in your project:
89
27
 
90
- Add this workflow to review UI code on each pull request. It fails the check when it finds critical or serious issues:
91
-
92
- ```yaml
93
- name: UI review
94
- on: pull_request
95
- jobs:
96
- review:
97
- runs-on: ubuntu-latest
98
- steps:
99
- - uses: actions/checkout@v4
100
- with:
101
- fetch-depth: 0
102
- - uses: actions/setup-node@v4
103
- with:
104
- node-version: "lts/*"
105
- - name: Review the changed UI code
106
- env:
107
- BASE_REF: ${{ github.base_ref }}
108
- run: npx -y better-design@^0.19 review --base "$(git merge-base "origin/${BASE_REF}" HEAD)"
28
+ ```bash
29
+ npx better-design review
109
30
  ```
110
31
 
111
- The `review` command needs version 0.19.0 or later, which the version range pins. Pass the branch through the environment rather than interpolating it into the script: a branch name is text a contributor controls, and `${{ }}` would place it straight into your shell.
112
-
113
- To post the findings as review comments instead of failing the check, add `--json`, write the output to a file, and hand it to a script that calls the GitHub API. Better Design's own repository does this in `.github/workflows/ui-review.yml`.
114
-
115
- ## Explore Better Design
116
-
117
- [Design systems](https://better-design.com/design-systems) ·
118
- [Templates](https://better-design.com/templates) ·
119
- [Slides](https://better-design.com/slides) ·
120
- [Shopify](https://better-design.com/shopify) ·
121
- [Video](https://better-design.com/video)
32
+ Run `npx better-design review --help` for options.
122
33
 
123
- [See Better Design](https://better-design.com) ·
124
- [Installation guide](https://better-design.com/mcp/install)
34
+ [Installation guide](https://better-design.com/mcp/install) · [Design systems](https://better-design.com/design-systems) · [Website](https://better-design.com)