
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.
概覽
本機 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 設定檔。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Stylesafe,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
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(), andtwMerge()call expressions, not just plainclassNamestrings - Returns structured agent-friendly reports with
confidence,riskScore, andnextStep
Quick start
As a CLI tool
As an MCP server
Example output
Returns a structured report:
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 filestylesafe <dir>— analyze a directory recursivelystylesafe --projectRoot <dir>— same as abovestylesafe --changed— analyze git-changed files (for PR/CI)stylesafe --changed --fail-on-issues— exit with code 1 if any issues foundstylesafe --watch src— re-run on every file changenpm test— run regression tests
Config
Place a .styleintegrityrc file in your project root:
GitHub Actions
Add to .github/workflows/style-check.yml:
來源:README.md,提交 8d5978c
工具
0版本歷史
1- v0.1.9最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分