onsystem

io.github.dgesteves由 GitHub 帳號 dgesteves 發布v0.12.1更新於 Oct 31, 2026

Catches palette colors, native elements and APIs your design system lacks in agent-written React.

已驗證STDIO僅桌面開發者工具媒體與設計

概覽

AI 產生的概覽

把 React 專案的設計系統(元件、props、變體與 token)提供給編碼助理,並檢查它寫出的 TSX/JSX 是否符合該系統。

可以做什麼
  • 依意圖列出與搜尋設計系統元件,含描述、變體、子元件與匯入方式
  • 讀取單一元件的完整契約:props、預設值、cva 變體、所用 token、使用指南與範例
  • 列出設計 token 的解析值與深色模式值,以及對應的 Tailwind 類別或 CSS 變數
  • 檢查 TSX/JSX 中的硬編碼顏色、間距與圓角、已有元件卻用原生元素、未知元件/props/變體,以及沒有無障礙名稱的圖示按鈕
適用情境
適合擁有 React 設計系統套件(shadcn/ui 應用可零設定使用)的團隊,尤其是編碼助理經常寫出調色盤顏色、任意像素值與系統中不存在的 props 或變體時。希望在助理動手前先查元件、寫完後再自我檢查的情境。
執行需求
以本機 stdio 程序透過 npx 執行,需要 Node.js 20.19 或更新版本。它從原始碼、型別宣告、樣式表、DTCG 檔案或 DESIGN.md 讀取元件與 token,因此須在應用程式資料夾或 monorepo 根目錄執行。不需 API 金鑰或帳號,搜尋排序在本機完成。
安裝前請注意
check_ui 只回報問題,仍需助理自行修正;README 指出其自測樣本約有 11% 誤報,多為硬編碼顏色類。在 monorepo 中應傳入檔案路徑,確保結果來自對應專案。從 shadcn registry 安裝的程式碼屬第三方,可能需要排除或另行檢查。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 onsystem,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

onsystem

Keeps coding agents on your design system: catches palette colors, native elements and APIs your system lacks, at every edit and pull request, with the fix. Set it up once in your design-system package; every app in your monorepo gets it. Runs locally and works alongside @shadcn/lint.

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).

Using the GitHub Action? uses: dgesteves/onsystem@v0 checks the lines a pull request changed: see CI and baselines.

[CI] [npm] [MCP Registry] [Cursor Directory] [License: MIT]

[Install in Cursor] [Install in VS Code] [Claude Code plugin] [GitHub Action]

Also works with [Codex CLI] [Gemini CLI] [Antigravity] [Grok Build] [GitHub Copilot CLI] [Claude Desktop] [Windsurf] [JetBrains] [Zed]

Website and docs: onsystem.vercel.app, with a playground that checks your own code.

Feedback wanted: say where it breaks in the launch feedback thread, see what's next in the roadmap, or pick up a good first issue. If onsystem is useful to you, a star helps other people find it.

https://github.com/user-attachments/assets/900cc1fa-387c-4e76-a524-a818521dd1a0

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: Claude looks the components up before writing, and check_ui passes. Last, the benchmark.

The problem

Coding agents write UI from their training data, not from your design system. Ask for a settings card and you get bg-[#ef4444], p-[13px], a native <button>, variant="danger" on a Button that only has destructive, and <Card.Header> where the system exports CardHeader. On the demo draft above, tsc reports 3 of the 11 problems, and review catches the rest when someone has the time. Describing the design system to the agent helps; what holds is checking what it actually wrote, at the edit and at the pull request.

What it checks

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, and onsystem export writes them out as either.

RuleDefaultCatches
no-unknown-componenterrorComponents and parts that don't exist (<Card.Header>, typos)
no-unknown-properrorProps a component doesn't take (tone, isDisabled)
no-unknown-varianterrorValues outside a variant (variant="danger")
prefer-design-system-componenterrorNative elements the design system has a component for (<button> → <Button>)
no-hardcoded-colorerrorHex, rgb, hsl, oklch and Tailwind palette colors (bg-gray-100 → bg-muted)
icon-button-accessible-nameerrorIcon-only buttons without an accessible name
no-hardcoded-spacingwarnArbitrary padding, margin and gap (p-[13px] → p-3)
no-hardcoded-radiuswarnArbitrary radius (rounded-[7px] → rounded-sm)

How often it is wrong. The corpus job runs check on 12 public repositories pinned by commit (Documenso, Dub, Cal.com, midday, Flowise and others: 24 runs, 14,539 distinct findings), without their dependencies installed (the two MUI apps get MUI). A seeded random sample of 80 of those findings, stratified by rule, was labelled from the code alone: blind labels by an AI reviewer (Claude Opus 5.5), not by a person. 57 are right, 14 debatable and 9 false positives: 11.2% (95% Wilson interval 6.0-20.0%), about the same when weighted by each rule's share of all findings (11.0%). Most come from no-hardcoded-color (7 of 65 sampled). Counting values a project's own design system already uses as debatable, 6 of 80 are false positives (7.5%, 3.5-15.4%). The sample has each label with its reason, the labeller's notes and the script behind these numbers. Shipped code rarely invents components, props or variants, and without dependencies no-unknown-prop skips components whose props do not resolve: those three rules have 56 findings in the corpus, 55 of them in Flowise, an MUI app, and 3 in the sample, all right but too few for a rate of their own. The corpus's older labels, made by an AI reviewer who could see the finding and so not blind, fail the job when one of their true positives stops being reported or a fixed false positive comes back. Code installed from a shadcn registry, such as the chatbot's components/ai-elements, has no labels yet (Code from shadcn registries). The rules reference shows each rule on an example and how to suppress a finding.

Quickstart

Run it from the app's folder or from the monorepo root, with Node.js 20.19 or later:

sh
npx -y onsystem inspect   # what it found; --explain says whynpx -y onsystem check .   # the same check the agent and CI runnpx -y onsystem init      # write the config, and offer a baseline

At a monorepo root, 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, init sets it up for every app that depends on it, with no config in the apps: as a workspace package, or installed from npm. Installed apps read the components from the sources the package publishes, or from its type declarations (.d.ts) when it publishes only compiled dist/, and get every rule either way (init checks its files list). From a package that publishes compiled code and no type declarations, they get the token rules but no component, prop, variant or native-element checks.

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. Folders installed from a shadcn registry, such as components/ai-elements, are someone else's code: Code from shadcn registries says how to check them or leave them out.

Claude Code. The plugin brings the hook, the MCP server and a skill:

text
/plugin marketplace add dgesteves/onsystem/plugin install onsystem@dgesteves

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. Codex installs the same plugin, and the hook checks the files its apply_patch changes. What it runs and touches.

Cursor or VS Code. [Install in Cursor] [Install in VS Code], or commit the config. The agent gets the tools and runs check_ui on what it writes.

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.

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, Antigravity and Grok Build.

CI. Install it as a dev dependency, accept the findings the codebase already has once, and fail pull requests only on new ones:

sh
npm install --save-dev onsystemnpx onsystem check . --update-baseline   # writes onsystem.baseline.json: commit it
yaml
- run: npx onsystem check . --format github --require-design-system

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 has the whole workflow.

GitHub Action. The action runs the same check, honours the baseline and annotates only the lines a pull request changed. It goes after the checkout and the install, so it can read your design system:

yaml
steps:  - uses: actions/checkout@v7  - uses: actions/setup-node@v7    with:      node-version: 24      cache: npm  - run: npm ci  - uses: dgesteves/onsystem@v0

Make it a required check on agent pull requests has the whole workflow and its inputs.

ESLint. The same rules for ESLint 8.57, 9 and 10: add onsystem.configs.recommended from onsystem/eslint to eslint.config.mjs (ESLint plugin, with @shadcn/lint).

Works with @shadcn/lint

@shadcn/lint checks the Tailwind classes written against a component and the theme (restyling, raw colors, arbitrary and unknown classes) as ESLint or Oxlint rules on Tailwind v4. onsystem checks that the components, props and variant values exist and flags native elements and unnamed icon buttons, on Tailwind v3 or v4. Its MCP server shows the agent your components and tokens before it writes, and in Claude Code its hook checks every edit. Run both. Benchmark v2 also scores every output with @shadcn/lint: see the independent scorer's table.

Does it help?

Benchmark v2 gave 6 models from 3 providers (Anthropic, OpenAI and Google) 20 single-file UI tasks in 5 open-source repositories, without onsystem, with its skill, MCP server or hook, and with all three: 1,200 runs, 240 per arm. Counted by onsystem 0.5.0's own check, design-system errors per run went from 0.85 without onsystem to 0.00 with all three, with no measurable change in the tsc pass rate (93% → 92%).

That count is onsystem's own, and the MCP server and the hook show the agent the same errors to fix. In tasks that ask for a green status label in a design system with no success token, agents with onsystem often used chart-* tokens, which it counts as clean. The blind labels by an AI reviewer, 12 files per arm, are too few to confirm the count either way, and every violation they found with the hook or all three is a palette color in Dub, whose tokens 0.5.0 did not read. The benchmark page has every table, and bench/v2 the method, the per-run data and every generated file.

Compatibility

What package.json declares and CI runs:

WithSupported
Node.jsNode.js 20.19 or later (engines). CI runs the tests on Node.js 22, 24 and 26, and the built package on 20.19
Operating systemLinux, macOS and Windows: CI runs the tests and the pack test on each
ESLintESLint 8.57, 9 and 10, for the ESLint plugin only: eslint is an optional peer, and the CLI, the MCP server, the hook and the Action do not need it
TypeScriptYour project's TypeScript is not used, and a JavaScript project needs none: onsystem reads .tsx and .jsx with its own TypeScript 6.0, a dependency, not a peer
ReactComponents written for React 18 (forwardRef) or React 19 (ref as a prop), read from source or type declarations. onsystem does not depend on React
Tailwind CSSv4 (@theme) and v3 (tailwind.config, read without running it). Without Tailwind, tokens come from CSS custom properties, DTCG files or a DESIGN.md
shadcn/uiBoth bases, Radix (asChild) and Base UI (render), on Tailwind v3 or v4, with no config
MCP clientsAny client that starts a stdio server; CI connects on the 2025-11-25 and 2026-07-28 protocols. Set up your agent has each client's config and support tier

Docs

On the website, and as Markdown in docs/:

Contributing, security and the changelog are in the repository.

License

MIT © Diogo Esteves

來源:README.md,提交 3c74d21

工具

5

list_components

List design-system components

List every component in the project design system with a one-line description, the native element it renders, its variant values, its parts and its import. Icons (components that render an <svg>) are named on one line per import, or per folder for icons with a module each, five or more to a line. Call this before writing UI in this project. `query`, `kind` and `limit` narrow a long list. At a monorepo root, pass `path` for the project of the file you are editing; without it, every project is listed, each component with its package.

輸入參數kindpathlimitquery

get_component

Get a component contract

Get the full contract of one component: import, props with types and defaults, cva variants and the classes each applies, parts (sub-components), design tokens it uses, usage guidelines and examples from its docs. Call it before using a component. Accepts "Button", "CardHeader" or "Card.Header". At a monorepo root, pass `path` (the file you are editing) to get the component its project uses.

輸入參數name必填path

search_components

Search components by intent

Find components by what you want to build, e.g. "confirm a destructive action", "status label", "text field with validation". Ranks names, descriptions, docs, props and variant values with BM25 (local, no API key). When no component clearly matches, it says so and lists the nearest, marked `weak`. Use it when you do not know which component fits.

輸入參數pathlimitquery必填

get_tokens

Get design tokens

List design tokens with resolved values, dark-mode values and how to use each (Tailwind class or CSS variable). Filter by category (color, spacing, radius, typography, shadow, other) or a substring. Use these instead of hex codes, px values or Tailwind default palette classes. Chart and sidebar colors are listed under their own headings: they are for charts and the sidebar, not for status colors.

輸入參數pathquerycategory

check_ui

Check UI code against the design system

Lint TSX/JSX against the design system. Reports hardcoded colors, spacing and radius (with the nearest token), native elements that have a design-system component, unknown components, props and variant values, and icon-only buttons without an accessible name. Each diagnostic has line/column, a rule id, a message and a suggested fix. Run it on every snippet or file you write and fix all errors. Pass `path` for a file in the project, or `code` for unsaved code, with `path` (or `filename`) naming the file it is for or its project folder.

輸入參數codepathlimitfilename

版本歷史

9
  1. v0.12.1最新Oct 30, 2026
  2. v0.11.1Oct 29, 2026
  3. v0.10.0Oct 24, 2026
  4. v0.9.0Oct 21, 2026
  5. v0.8.0Oct 16, 2026
  6. v0.7.0Oct 16, 2026
  7. v0.6.0Oct 12, 2026
  8. v0.5.0Oct 11, 2026
  9. v0.4.0Oct 10, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分