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 分