Stylesafe

io.github.Patrizzos由 GitHub 帳號 Patrizzos 發布v0.1.9更新於 Oct 27, 2026

MCP server and CLI that catches CSS cascade conflicts and Tailwind utility clashes before they ship.

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

概覽

AI 產生的概覽

本機 MCP 伺服器兼 CLI,在樣式上線前找出 CSS 層疊衝突與彼此衝突的 Tailwind 工具類別。

可以做什麼
  • 分析樣式表與元件檔案中的重複 CSS 宣告、因優先級衝突造成的無效規則,以及可能非刻意的無聲樣式覆寫
  • 找出彼此衝突的 Tailwind 工具類別,例如 padding、margin、background、shadow、opacity、border、ring 等
  • 辨識 cn()、clsx() 與 twMerge() 呼叫運算式,而不只是單純的 className 字串
  • 回傳結構化報告,包含 confidence、riskScore、nextStep 以及 passed、clean 標記
  • 可作為 CLI 分析單一檔案、目錄、git 變更檔案,或以監看模式持續執行
適用情境
適合在助理修改 JSX 或 CSS 後、提交變更前攔下樣式問題;也適合在拉取請求中阻擋層疊衝突或工具類別衝突,或對現有專案進行樣式稽核。
執行需求
以 stdio 本機程序方式執行,從 npm 套件安裝(需要 Node.js)。未宣告任何驗證、環境變數或標頭。可在專案根目錄放置 .styleintegrityrc 設定檔。
安裝前請注意
它會讀取專案原始檔進行分析,可透過 .styleintegrityrc 的 ignore 清單排除路徑。報告屬建議性質,附有信賴度與 requiresUserConfirmation 標記,被標記的衝突通常需要人工確認而非自動修正。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

StyleSafe - MCP and CLI

An MCP server and CLI that catches CSS cascade conflicts and Tailwind utility clashes before they ship — built for AI coding agents and CI workflows.

What it does

  • Detects duplicate CSS declarations and dead rules from specificity conflicts
  • Flags silent style overrides that may be accidental
  • Finds conflicting Tailwind utilities (padding, margin, background, shadow, opacity, border, ring, etc.)
  • Understands cn(), clsx(), and twMerge() call expressions, not just plain className strings
  • Returns structured agent-friendly reports with confidence, riskScore, and nextStep

Quick start

As a CLI tool

bash
npm install -g stylesafestylesafe src/components/Button.jsxstylesafe --changed --fail-on-issuesstylesafe --projectRoot srcstylesafe --watch src

As an MCP server

json
{  "mcpServers": {    "stylesafe": {      "command": "node",      "args": ["/absolute/path/to/server.js"]    }  }}

Example output

bash
stylesafe examples/tailwind-conflict.jsx

Returns a structured report:

json
{  "totalIssues": 5,  "riskScore": 275,  "averageRiskScore": 55,  "riskLevel": "medium",  "passed": true,  "clean": false,  "files": [    {      "filename": "examples/tailwind-conflict.jsx",      "issues": [        {          "type": "tailwind-conflict",          "category": "padding",          "classes": ["p-4", "px-8"],          "confidence": "medium",          "riskScore": 55,          "nextStep": "Choose one utility from the conflicting set or split the classes by scope.",          "requiresUserConfirmation": true        }      ]    }  ]}

passed: true means no hard errors. clean: true means zero issues of any kind.

Use cases

  • AI code generation: Catch style bugs before the agent commits changes
  • PR gate: Block merged changes that introduce cascade conflicts or utility clashes
  • Agent workflows: Integrate as a confirmation step in multi-turn coding tasks
  • Style audits: Run across a project to find existing issues

CLI options

  • stylesafe <file> — analyze a single file
  • stylesafe <dir> — analyze a directory recursively
  • stylesafe --projectRoot <dir> — same as above
  • stylesafe --changed — analyze git-changed files (for PR/CI)
  • stylesafe --changed --fail-on-issues — exit with code 1 if any issues found
  • stylesafe --watch src — re-run on every file change
  • npm test — run regression tests

Config

Place a .styleintegrityrc file in your project root:

json
{  "ignore": ["dist", "*.min.css"],  "failOn": ["error", "warning"]}

GitHub Actions

Add to .github/workflows/style-check.yml:

yaml
name: stylesafe
on:  pull_request:  push:    branches: [main]
jobs:  stylesafe:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - uses: actions/setup-node@v4        with:          node-version: 20      - run: npm install      - run: node server.js --changed --fail-on-issues

來源:README.md,提交 8d5978c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.9最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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