
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 分