onsystem 0.4.0 → 0.6.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 +36 -15
- package/dist/cli.js +339 -180
- package/dist/config-lbfW91qB.d.ts +482 -0
- package/dist/{stdio-BcJth14k.js → design-system-A3pRX3Ka.js} +8439 -7212
- package/dist/eslint-worker.d.ts +36 -0
- package/dist/eslint-worker.js +95 -0
- package/dist/eslint.d.ts +23 -0
- package/dist/eslint.js +172 -0
- package/dist/index.d.ts +84 -387
- package/dist/index.js +3 -2
- package/dist/stdio-CEChNFLR.js +1396 -0
- package/dist/workspace-CHvUwgz9.js +227 -0
- package/package.json +22 -2
- package/schema.json +19 -1
package/README.md
CHANGED
|
@@ -2,19 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
**Keeps coding agents on your design system:** it knows your real components, props, variants and tokens, catches the moment an agent invents one and has it fix it, and the same check gates your PRs. Local, zero config, works alongside [@shadcn/lint](https://github.com/shadcn-ui/lint).
|
|
4
4
|
|
|
5
|
-
Built for design-system and platform teams with a React design-system package; a shadcn/ui app is the zero-config demo. Formerly `@dgesteves/design-system-mcp` ([what changed](https://
|
|
5
|
+
Built for design-system and platform teams with a React design-system package; a shadcn/ui app is the zero-config demo. Formerly `@dgesteves/design-system-mcp` ([what changed](https://onsystem.vercel.app/docs/migrating)).
|
|
6
6
|
|
|
7
7
|
[](https://github.com/dgesteves/onsystem/actions/workflows/ci.yml)
|
|
8
8
|
[](https://www.npmjs.com/package/onsystem)
|
|
9
|
+
[](https://www.npmjs.com/package/onsystem)
|
|
10
|
+
[](https://registry.modelcontextprotocol.io/?q=io.github.dgesteves%2Fonsystem)
|
|
11
|
+
[](https://cursor.directory/plugins/design-system-mcp)
|
|
9
12
|
[](LICENSE)
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
[](https://cursor.com/en/install-mcp?name=onsystem&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm9uc3lzdGVtIiwiLS1yb290IiwiJHt3b3Jrc3BhY2VGb2xkZXJ9Il19)
|
|
15
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=onsystem&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22onsystem%22%2C%22--root%22%2C%22%24%7BworkspaceFolder%7D%22%5D%7D)
|
|
16
|
+
[](https://onsystem.vercel.app/docs/plugin)
|
|
17
|
+
|
|
18
|
+
**Website and docs:** [onsystem.vercel.app](https://onsystem.vercel.app), with a [playground](https://onsystem.vercel.app/playground) that checks your own code.
|
|
12
19
|
|
|
13
20
|
<p align="center">
|
|
14
|
-
<a href="https://
|
|
21
|
+
<a href="https://onsystem.vercel.app"><img src=".github/assets/demo.webp" width="100%" alt="On the website, an agent drafts a settings card, check_ui finds 11 problems with a fix each and the agent applies them. Then a real Claude Code session with the plugin, where Claude looks the components up before writing and check_ui passes. Last, the benchmark: clean components go from 6 to 10 out of 10 with Claude Haiku 4.5 and from 8 to 10 with Claude Opus 5."></a>
|
|
15
22
|
</p>
|
|
16
23
|
|
|
17
|
-
<sub>On the <a href="https://
|
|
24
|
+
<sub>On the <a href="https://onsystem.vercel.app">website</a>, an agent drafts a settings card, <code>check_ui</code> finds 11 problems with a fix each, and the agent applies them. Then a real Claude Code session with the plugin: Claude looks the components up before writing, and <code>check_ui</code> passes. Last, the benchmark.</sub>
|
|
18
25
|
|
|
19
26
|
## The problem
|
|
20
27
|
|
|
@@ -22,7 +29,7 @@ Coding agents write UI from their training data, not from your design system. As
|
|
|
22
29
|
|
|
23
30
|
## What it checks
|
|
24
31
|
|
|
25
|
-
onsystem reads your components, `cva` and `tv` variants, parts and tokens from source with the TypeScript compiler, and checks `.tsx` and `.jsx` against them. Every finding has a rule id, a location and the fix.
|
|
32
|
+
onsystem reads your components, `cva` and `tv` variants, parts and tokens from source with the TypeScript compiler, and checks `.tsx` and `.jsx` against them. Every finding has a rule id, a location and the fix. Tokens come from your stylesheets, [DTCG 2025.10 files or a DESIGN.md](https://onsystem.vercel.app/docs/tokens), and `onsystem export` writes them out as either.
|
|
26
33
|
|
|
27
34
|
| Rule | Default | Catches |
|
|
28
35
|
| -------------------------------- | ------- | ------------------------------------------------------------------------------- |
|
|
@@ -35,11 +42,21 @@ onsystem reads your components, `cva` and `tv` variants, parts and tokens from s
|
|
|
35
42
|
| `no-hardcoded-spacing` | warn | Arbitrary padding, margin and gap (`p-[13px]` → `p-3`) |
|
|
36
43
|
| `no-hardcoded-radius` | warn | Arbitrary radius (`rounded-[7px]` → `rounded-sm`) |
|
|
37
44
|
|
|
38
|
-
**How often it is wrong.** The [corpus](corpus) job runs `check` on
|
|
45
|
+
**How often it is wrong.** The [corpus](corpus) job runs `check` on 12 public repositories pinned by commit (Documenso, Dub, Cal.com, midday, Flowise and others, the four monorepos also from their root, and Dub's app also with a config and with `@dub/ui` set up by `init`: 24 runs, 4,076 distinct findings) and compares the findings with hand labels. In a random sample of 149 findings, 88 are clearly right (59.1%), 56 are debatable and 5 are false positives (3.4%); weighted by each run's and rule's share of all findings, about 1.0% are false positives. Shipped code rarely invents components, props or variants: those three rules have 56 findings in the corpus, 55 of them in Flowise, an MUI app that passes props and values MUI's components do not take, and the 10 in the sample are all right. The [rules reference](https://onsystem.vercel.app/rules) shows each rule on an example and how to [suppress a finding](https://onsystem.vercel.app/rules#suppressing-findings).
|
|
39
46
|
|
|
40
47
|
## Quickstart
|
|
41
48
|
|
|
42
|
-
Run it from the app's folder or from the monorepo root, with Node.js 20.19 or later
|
|
49
|
+
Run it from the app's folder or from the monorepo root, with Node.js 20.19 or later:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
npx -y onsystem inspect # what it found; --explain says why
|
|
53
|
+
npx -y onsystem check . # the same check the agent and CI run
|
|
54
|
+
npx -y onsystem init # write the config, and offer a baseline
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
At a [monorepo root](https://onsystem.vercel.app/docs/configuration#monorepo-roots), `inspect` lists every app and design-system package, and `check` checks each file by its own project's design system. In a [design-system package](https://onsystem.vercel.app/docs/design-system-packages), `init` sets it up for every app that depends on it, workspace or npm, with no config in the apps.
|
|
58
|
+
|
|
59
|
+
In a new create-next-app, the template page's hardcoded colors already make the first `check .` fail; `init` offers to record them as a baseline, so only new findings fail.
|
|
43
60
|
|
|
44
61
|
**Claude Code.** The plugin brings the hook, the MCP server and a skill:
|
|
45
62
|
|
|
@@ -48,11 +65,13 @@ Run it from the app's folder or from the monorepo root, with Node.js 20.19 or la
|
|
|
48
65
|
/plugin install onsystem@dgesteves
|
|
49
66
|
```
|
|
50
67
|
|
|
51
|
-
After each Write or Edit of a `.tsx` or `.jsx` file, the hook runs `onsystem check` on it. Errors go back to Claude as a blocking error with the fix, so Claude corrects the file before it moves on; warnings go as a note. It stays quiet in projects without a design system. [What it runs and touches](https://
|
|
68
|
+
After each Write or Edit of a `.tsx` or `.jsx` file, the hook runs `onsystem check` on it. Errors go back to Claude as a blocking error with the fix, so Claude corrects the file before it moves on; warnings go as a note. It stays quiet in projects without a design system. [What it runs and touches](https://onsystem.vercel.app/docs/plugin).
|
|
52
69
|
|
|
53
|
-
**Cursor or VS Code.** [](https://cursor.com/en/install-mcp?name=onsystem&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm9uc3lzdGVtIiwiLS1yb290IiwiJHt3b3Jrc3BhY2VGb2xkZXJ9Il19) [](https://insiders.vscode.dev/redirect/mcp/install?name=onsystem&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22onsystem%22%5D%7D), or commit the [config](https://
|
|
70
|
+
**Cursor or VS Code.** [](https://cursor.com/en/install-mcp?name=onsystem&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm9uc3lzdGVtIiwiLS1yb290IiwiJHt3b3Jrc3BhY2VGb2xkZXJ9Il19) [](https://insiders.vscode.dev/redirect/mcp/install?name=onsystem&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22onsystem%22%2C%22--root%22%2C%22%24%7BworkspaceFolder%7D%22%5D%7D), or commit the [config](https://onsystem.vercel.app/docs/clients#cursor-and-vs-code). The agent gets the tools and runs `check_ui` on what it writes.
|
|
54
71
|
|
|
55
|
-
**
|
|
72
|
+
**Other agents.** `npx skills add dgesteves/onsystem` adds the skill to any agent with Agent Skills, and there are [plugins for Codex, GitHub Copilot CLI, VS Code and Cursor](https://onsystem.vercel.app/docs/clients#plugins-for-other-agents).
|
|
73
|
+
|
|
74
|
+
**Any MCP client.** Run `npx -y onsystem` as a stdio server. There are [configs for Claude Desktop, Codex CLI, GitHub Copilot CLI, Windsurf, JetBrains IDEs, Zed, Gemini CLI and Grok Build](https://onsystem.vercel.app/docs/clients#other-clients).
|
|
56
75
|
|
|
57
76
|
**CI.** Install it as a dev dependency, accept the findings the codebase already has once, and fail pull requests only on new ones:
|
|
58
77
|
|
|
@@ -65,7 +84,9 @@ npx onsystem check . --update-baseline # writes onsystem.baseline.json: commit
|
|
|
65
84
|
- run: npx onsystem check . --format github --require-design-system
|
|
66
85
|
```
|
|
67
86
|
|
|
68
|
-
Findings show up as annotations on the pull request, and `--require-design-system` fails the job when the design system is no longer found. [CI and baselines](https://
|
|
87
|
+
Findings show up as annotations on the pull request, and `--require-design-system` fails the job when the design system is no longer found. [CI and baselines](https://onsystem.vercel.app/docs/ci) has the whole workflow. The GitHub Action, `uses: dgesteves/onsystem@v0`, annotates only the lines a pull request changed: [make it a required check on agent pull requests](https://onsystem.vercel.app/docs/required-check).
|
|
88
|
+
|
|
89
|
+
**ESLint.** The same rules for ESLint 9 and 10: add `onsystem.configs.recommended` from `onsystem/eslint` to `eslint.config.mjs` ([ESLint plugin](https://onsystem.vercel.app/docs/eslint), with @shadcn/lint).
|
|
69
90
|
|
|
70
91
|
## Works with @shadcn/lint
|
|
71
92
|
|
|
@@ -84,11 +105,11 @@ It is small: one repository, Claude models only, 40 runs (one per task, model an
|
|
|
84
105
|
|
|
85
106
|
## Docs
|
|
86
107
|
|
|
87
|
-
On the [website](https://
|
|
108
|
+
On the [website](https://onsystem.vercel.app/docs), and as Markdown in [docs/](docs):
|
|
88
109
|
|
|
89
|
-
- [Quickstart](https://
|
|
90
|
-
- [Configuration](https://
|
|
91
|
-
- [How it works](https://
|
|
110
|
+
- [Quickstart](https://onsystem.vercel.app/docs), [Claude Code plugin](https://onsystem.vercel.app/docs/plugin), [CI and baselines](https://onsystem.vercel.app/docs/ci) and [Set up your agent](https://onsystem.vercel.app/docs/clients), with the config for each client
|
|
111
|
+
- [Configuration](https://onsystem.vercel.app/docs/configuration), [Rules](https://onsystem.vercel.app/rules), [MCP tools](https://onsystem.vercel.app/docs/tools) and [Troubleshooting](https://onsystem.vercel.app/docs/troubleshooting)
|
|
112
|
+
- [How it works](https://onsystem.vercel.app/docs/how-it-works), [FAQ](https://onsystem.vercel.app/docs/faq) and [Migrating from design-system-mcp](https://onsystem.vercel.app/docs/migrating)
|
|
92
113
|
|
|
93
114
|
[Contributing](CONTRIBUTING.md), [security](SECURITY.md) and the [changelog](CHANGELOG.md) are in the repository.
|
|
94
115
|
|