Buoy

io.github.ahoybuoy由 GitHub 帳號 ahoybuoy 發布v0.8.15更新於 Nov 8, 2026

The design system your coding agents check before they ship: tokens plus exact UI fixes.

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

概覽

AI 產生的概覽

Buoy 把設計系統交給編碼助理:列出設計權杖、把硬編碼值對應到權杖,並標出程式碼中的介面偏差。

可以做什麼
  • 列出專案中找到的設計權杖
  • 把具體數值(例如十六進位顏色)對應到相符的權杖
  • 逐行檢查介面程式碼是否符合設計系統,並給出權杖與精確的行級修改
  • 回傳供助理遵循的設計系統脈絡
  • 可選擇檢查助理編輯的每個樣式檔,並在其繼續之前回傳修正建議
適用情境
適用於助理撰寫或修改前端元件、而你希望它使用權杖與間距刻度而非硬編碼值的情況。適合已有權杖或元件庫、希望在寫程式時就發現偏差而不是等到審查的團隊。
執行需求
以本機 stdio 程序執行,從 npm 套件 @buoy-design/cli 安裝(需要 Node.js),透過該 CLI 的 mcp install 指令裝入用戶端。無需設定,會自動辨識框架;選用的 .buoy.yaml 可宣告元件、權杖與負責人。
安裝前請注意
選用的 PostToolUse 掛鉤會對助理編輯的檔案執行偏差檢查並回傳結果,樣式檔上會有額外的本機活動。修正指令可能改動原始碼檔案,不過 Rescue 流程會把不確定的問題保留為僅供審閱,在新分支上操作,且不會提交、推送或上傳原始碼。登入、GitHub PR 機器人與帳務等雲端功能需要帳號,可能涉及付費訂閱。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

Buoy

[GitHub App]

Catch design drift before it ships.

AI coding tools are fast—but they don't know your design system. They'll write #3b82f6 when you have --color-primary. They'll use padding: 17px when your spacing scale is multiples of 4.

Buoy watches for these issues and helps you fix them.

src/components/Button.tsx:24  hardcoded-value: #3b82f6 → var(--color-primary) (92% match)

Code-first System Observability

Your shipped code is the design-system source of truth. Declare the packages you own, then use Buoy to map adoption, unmanaged UI surface area, and the blast radius of a component or token change. Figma and other design tools can remain optional inputs; they are not required for the system map.

yaml
# .buoy.yamlproject:  name: acme
system:  components:    - packages/ui/src/**  tokens:    - packages/tokens/src/**  owners:    - name: Checkout      paths:        - apps/checkout/**
bash
buoy system map                 # Canonical system vs unmanaged surface areabuoy system impact Button       # Consumers and migration risk for a changebuoy system impact color-primary --kind token

This is the foundation for cloud adoption trends, deprecation planning, and AI-assisted iteration reporting: every result is derived from code and can be attributed to a repository path and owner.

Quick Start

bash
# See your design system immediately (zero config)npx ahoybuoy show all
# Add project configuration and local integrations when readynpx ahoybuoy dock

No config needed. Buoy auto-detects your framework and starts working immediately.

What It Catches

IssueExample
Hardcoded colors#ff0000 instead of var(--color-primary)
Arbitrary spacingpadding: 17px instead of design scale
Tailwind escape hatchesp-[13px] instead of p-4
Naming inconsistenciesButtonNew, ButtonV2, ButtonOld
Unused componentsDefined but never imported or rendered
Semantic mismatchesSame prop typed string in one, number in another
Repeated patternsSame Tailwind classes copy-pasted 5+ times
Framework sprawlReact + Vue + jQuery in same codebase
Detached componentsInstances without main component

Commands

buoy├── show                    # Read design system info (for AI agents)│   ├── components          # Components in codebase│   ├── tokens              # Design tokens found│   ├── drift               # Design system violations│   ├── health              # Health score│   ├── history             # Scan history│   ├── config              # Current .buoy.yaml configuration│   ├── skills              # AI agent skill files│   ├── agents              # Configured AI agents│   ├── context             # Design system context in CLAUDE.md│   ├── hooks               # Configured hooks│   ├── commands            # Installed slash commands│   ├── graph               # Knowledge graph stats│   ├── plugins             # Available scanners│   └── all                 # Everything combined├── drift                   # Drift detection and fixing│   ├── scan                # Scan codebase for components/tokens│   ├── check               # Pre-commit drift check│   ├── fix                 # Suggest/apply fixes│   └── ignore              # Ignore existing drift│       ├── all             # Ignore all current drift (requires --reason)│       ├── show            # View ignored drift signals│       ├── add             # Add new drift to ignore list (requires --reason)│       └── clear           # Remove ignore list├── rescue                  # Complete measure → repair → guard → prove journey│   ├── plan                # Build a local baseline and repair plan│   ├── apply               # Apply reviewed safe fixes on a new branch│   ├── verify              # Run detected typecheck/test scripts│   ├── guard               # Record reviewed legacy drift with reasons│   ├── report              # Generate JSON, Markdown, and HTML evidence│   └── rollback            # Restore local pre-Rescue backups├── dock                    # Dock tools into your project│   ├── config              # Create .buoy.yaml│   ├── skills              # Create AI agent skills│   ├── agents              # Set up AI agents│   ├── context             # Generate CLAUDE.md context│   ├── hooks               # Set up hooks (--claude for self-validating AI)│   ├── commands            # Install Claude slash commands│   ├── plugins             # Show available scanners│   ├── tokens              # Generate/export design tokens│   │   ├── compare         # Compare token sources│   │   └── import          # Import tokens from Figma/CSS│   └── graph               # Build design system knowledge graph│       └── learn           # Learn patterns from codebase└── ahoy                    # Cloud features    ├── login               # Authenticate    ├── logout              # Sign out    ├── status              # Account + bot + sync status    ├── github              # Set up GitHub PR bot    ├── gitlab              # Set up GitLab PR bot (soon)    ├── billing             # Manage subscription    └── plans               # Compare pricing

For AI Agents

Coding agents hardcode values because they never read your token file. Give them Buoy as an MCP server:

bash
npx @buoy-design/cli mcp install claude   # or cursor, codex, windsurf, all

Claude Code (and any MCP client) gets four tools: list_design_tokens, find_token_for_value (#1a73e8 → --color-primary), check_ui_against_design_system (line-level, with the token and an exact line edit) and design_system_context. Claude Code also gets a PostToolUse hook that checks every style file it edits and hands the fixes back before it moves on. See docs/integrations/mcp.

In Claude Code, the plugin bundles all of it: /plugin marketplace add ahoybuoy/buoy, then /plugin install buoy@buoy.

To review every pull request as well, install the free GitHub App; no Buoy account is needed.

The show command outputs JSON for AI agents to consume:

bash
# Get everything an AI agent needsbuoy show all --json
# Just drift signalsbuoy show drift --json
# Components inventorybuoy show components --json

Example output:

json
{  "components": [...],  "tokens": [...],  "drift": {    "signals": [...],    "summary": { "total": 12, "critical": 2, "warning": 7, "info": 3 }  },  "health": { "score": 78 }}

Getting Started

Complete a Rescue journey

bash
buoy rescue plan# Review .buoy/rescue/runs/<run-id>/report.htmlbuoy rescue apply --run <run-id> --approvebuoy rescue guard --run <run-id> --reason "Reviewed legacy baseline" --actor "Design systems team"buoy rescue report --run <run-id>

Rescue keeps ambiguous findings review-only, runs detected project checks after applying high-confidence changes, and retains local backups for rollback. It does not commit, push, open a pull request, or upload source code. See docs/rescue.md for the complete workflow.

Configure Your Project

bash
buoy dock

Smart walkthrough that sets up:

  1. .buoy.yaml — Project configuration
  2. AI agent skills — For Claude Code, Copilot, etc.
  3. CLAUDE.md context — Design system documentation
  4. Git hooks — Pre-commit drift checking

Configure severities per drift type

yaml
# .buoy.yamlproject:  name: my-app
drift:  severity:    hardcoded-value: critical    naming-inconsistency: warning
  # Ignore specific drift (filter by type, file, component, token, value, severity)  ignore:    - type: hardcoded-value      file: "src/legacy/**"    - severity: info
  # Promote matching drift to a higher severity  promote:    - type: hardcoded-value      file: "src/components/**"      to: critical      reason: "Design system components must use tokens"
  # Enforce — always treat matching drift as critical  enforce:    - type: naming-inconsistency      component: "^Button"      reason: "Button naming is standardized"
health:  # CI gate — exit code 1 if health score falls below threshold  failBelow: 70

Drift Detection

Quick Check

bash
buoy drift check

Fast pre-commit hook friendly. Exits with error code if drift found.

Detailed Analysis

bash
buoy show drift
json
{  "drifts": [    {      "type": "hardcoded-value",      "severity": "warning",      "file": "src/components/Button.tsx",      "line": 24,      "message": "#3b82f6 should use var(--color-primary)",      "suggestion": "var(--color-primary)"    }  ]}

Fix Issues

bash
buoy drift fix                    # Interactive fix suggestionsbuoy drift fix --dry-run          # Preview changesbuoy drift fix --apply            # Apply reviewed high-confidence fixes

Ignore Existing Drift

For brownfield projects, ignore existing issues and only flag new ones:

bash
buoy drift ignore all -r "Legacy code before design system"     # Ignore all current drift with reasonbuoy drift ignore add -r "Third-party components"               # Add new drift to ignore listbuoy drift ignore show                                          # View ignored drift with reasonsbuoy drift check                                                # Only fails on new drift

A reason is required when ignoring drift to maintain accountability.

CI Integration

GitHub Actions

yaml
name: Design System Checkon: [pull_request]
jobs:  buoy:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - uses: actions/setup-node@v4        with:          node-version: "20"      - run: npx ahoybuoy drift check

Design health badge

Repos scanned by Buoy Cloud get a live score badge for the README:

markdown
[![design health](https://api.buoy.design/badges/OWNER/REPO.svg)](https://buoy.design)

Green at 80+, yellow at 60+, red below. It updates within five minutes of each scan.

PR Comments with Buoy Cloud

bash
# Set up GitHub PR botbuoy ahoy loginbuoy ahoy github

The GitHub bot automatically comments on PRs with drift analysis.

AI Guardrails

Keep AI coding assistants (Copilot, Claude, Cursor) aligned with your design system:

bash
# Set up AI agents with design system contextbuoy dock agents

Creates:

  • AI Skills — Design system knowledge for Claude Code
  • Claude Hooks — Auto-inject context at session start
  • CLAUDE.md — Project-specific AI instructions

Self-Validating Agents (Claude Code)

Turn Claude Code into a self-correcting agent. When Claude writes a component, Buoy checks it and feeds corrections back automatically:

bash
buoy mcp install claude     # MCP server + line-level hook (recommended)buoy dock hooks --claude    # hook only, component-level

This installs a PostToolUse hook that:

  1. Claude writes/edits a component file
  2. Hook runs buoy drift check on the modified file
  3. If drift detected, feedback returns to Claude
  4. Claude self-corrects without prompting

Example feedback Claude receives:

⚠️ Design drift detected in Button.tsx:
• hardcoded-value: Component "Button" has 3 hardcoded colors: #3b82f6, #ffffff, #1e40af
Run `buoy show drift` for full details.

Works with React, Vue, Svelte, and Angular components. Skips test files and configs.

Configuration

Works without config, but you can save settings:

bash
buoy dock config

Creates .buoy.yaml:

yaml
project:  name: my-app
sources:  react:    enabled: true    include:      - src/**/*.tsx    exclude:      - "**/*.test.*"  tokens:    enabled: true    files:      - design-tokens.css

Buoy Cloud

Ship your drift detection to the cloud:

bash
buoy ahoy login             # Authenticatebuoy ahoy status            # View account, bot, sync statusbuoy ahoy github            # Set up GitHub PR botbuoy ahoy billing           # Manage subscription

Features:

  • PR Bot — Automatic comments on pull requests
  • Dashboard — View drift trends over time
  • Team sync — Share results across team members

Supported Frameworks

Components: React, Vue, Svelte, Angular, Lit, Stencil, Alpine, HTMX

Templates: Blade, ERB, Twig, Razor, Jinja, Handlebars, EJS, Pug

Tokens: CSS variables, SCSS, Tailwind config, JSON, Style Dictionary

Design Tools: Figma (plugin + API integration)

Philosophy

Inform by default, block by choice.

Buoy shows you what's happening without getting in your way. Teams adopt enforcement when they're ready:

bash
buoy show drift             # Just show mebuoy drift check            # Pre-commit check (fails on critical)buoy drift check --fail-on warning    # Fail on warning or abovebuoy drift check --fail-on none       # Never fail (report only)buoy drift check --staged             # Only check staged files

Development

bash
# Install dependenciespnpm install
# Build all packagespnpm build
# Run testspnpm test
# Run CLI locallynode apps/cli/dist/bin.js show all

Packages

PackageDescription
@buoy-design/cliCommand-line interface
@buoy-design/coreDomain models and drift detection engine
@buoy-design/scannersFramework-specific code scanners
ahoybuoyCLI wrapper (npx ahoybuoy)
buoy-designCLI wrapper (npx buoy-design)

License

MIT

來源:README.md,提交 6aa1a62

工具

5

list_design_tokens

List design tokens

Get this repository's design system: the colors, spacing, typography, radius, shadow and motion values it defines (CSS custom properties, Tailwind theme, tokens.json, Sass variables, DESIGN.md). Without arguments it returns a short summary (counts plus a few tokens per category) to keep context small; pass a category or name substring for the full list. When you are about to edit a specific file, prefer context_for_file, which returns only what that file needs. Repos with no tokens get the values their code already uses most. Categories: color, spacing, typography, shadow, border, sizing, motion, zIndex.

輸入參數limitquerycategory

find_token_for_value

Find the token for a literal value

Before you write a literal CSS value (for example '#1a73e8', '16px', '0.5rem'), find the design token in this repository that already holds it, and write the token instead. An empty result means no token has that value; pick the nearest one from list_design_tokens rather than inventing a new value.

輸入參數value必填category

context_for_file

Design context for the file you are editing

Before you edit a UI file, get only the design context it needs: tokens the file already uses, tokens its neighbours use, the scale steps for the kinds of values it contains (spacing, type, radius), components in the same folder or already imported that you should reuse, the drift already in it, and the team's decisions (values they chose to keep, which you must not replace, and values they always want flagged). Much smaller than the full token list. Then write values from it and run check_ui_against_design_system on the file.

輸入參數file必填

check_ui_against_design_system

Check UI code against the design system

After you edit UI code, check it against this repository's design system before you finish. Returns every hardcoded color, spacing, font, radius or shadow that should be a token, with the token to use. When an issue has an `edit`, replace line `edit.line` (currently `edit.before`) with `edit.after` exactly; it is a verified one-line swap. Pass the files you edited to check only those (fast); omit files to check the whole repository. Re-run until it reports no issues.

輸入參數files

design_system_context

Design system overview

Read this once at the start of any task that builds or changes UI. A Markdown summary of this repository's design system: token categories with example names, the existing components to reuse before creating new ones, and the patterns to avoid.

輸入參數detail

版本歷史

8
  1. v0.8.13Nov 7, 2026
  2. v0.8.12Oct 20, 2026
  3. v0.8.11Oct 15, 2026
  4. v0.8.10Oct 14, 2026
  5. v0.8.9Oct 14, 2026
  6. v0.8.8Oct 14, 2026
  7. v0.8.7Sep 24, 2026
  8. v0.8.1Sep 24, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分