{
  "markdown": "# StyleSafe - MCP and CLI\n\nAn MCP server and CLI that catches CSS cascade conflicts and Tailwind utility clashes before they ship — built for AI coding agents and CI workflows.\n\n## What it does\n\n- Detects duplicate CSS declarations and dead rules from specificity conflicts\n- Flags silent style overrides that may be accidental\n- Finds conflicting Tailwind utilities (padding, margin, background, shadow, opacity, border, ring, etc.)\n- Understands `cn()`, `clsx()`, and `twMerge()` call expressions, not just plain `className` strings\n- Returns structured agent-friendly reports with `confidence`, `riskScore`, and `nextStep`\n\n## Quick start\n\n### As a CLI tool\n\n```bash\nnpm install -g stylesafe\nstylesafe src/components/Button.jsx\nstylesafe --changed --fail-on-issues\nstylesafe --projectRoot src\nstylesafe --watch src\n```\n\n### As an MCP server\n\n```json\n{\n  \"mcpServers\": {\n    \"stylesafe\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/server.js\"]\n    }\n  }\n}\n```\n\n## Example output\n\n```bash\nstylesafe examples/tailwind-conflict.jsx\n```\n\nReturns a structured report:\n\n```json\n{\n  \"totalIssues\": 5,\n  \"riskScore\": 275,\n  \"averageRiskScore\": 55,\n  \"riskLevel\": \"medium\",\n  \"passed\": true,\n  \"clean\": false,\n  \"files\": [\n    {\n      \"filename\": \"examples/tailwind-conflict.jsx\",\n      \"issues\": [\n        {\n          \"type\": \"tailwind-conflict\",\n          \"category\": \"padding\",\n          \"classes\": [\"p-4\", \"px-8\"],\n          \"confidence\": \"medium\",\n          \"riskScore\": 55,\n          \"nextStep\": \"Choose one utility from the conflicting set or split the classes by scope.\",\n          \"requiresUserConfirmation\": true\n        }\n      ]\n    }\n  ]\n}\n```\n\n`passed: true` means no hard errors. `clean: true` means zero issues of any kind.\n\n## Use cases\n\n- **AI code generation**: Catch style bugs before the agent commits changes\n- **PR gate**: Block merged changes that introduce cascade conflicts or utility clashes\n- **Agent workflows**: Integrate as a confirmation step in multi-turn coding tasks\n- **Style audits**: Run across a project to find existing issues\n\n## CLI options\n\n- `stylesafe <file>` — analyze a single file\n- `stylesafe <dir>` — analyze a directory recursively\n- `stylesafe --projectRoot <dir>` — same as above\n- `stylesafe --changed` — analyze git-changed files (for PR/CI)\n- `stylesafe --changed --fail-on-issues` — exit with code 1 if any issues found\n- `stylesafe --watch src` — re-run on every file change\n- `npm test` — run regression tests\n\n## Config\n\nPlace a `.styleintegrityrc` file in your project root:\n\n```json\n{\n  \"ignore\": [\"dist\", \"*.min.css\"],\n  \"failOn\": [\"error\", \"warning\"]\n}\n```\n\n## GitHub Actions\n\nAdd to `.github/workflows/style-check.yml`:\n\n```yaml\nname: stylesafe\n\non:\n  pull_request:\n  push:\n    branches: [main]\n\njobs:\n  stylesafe:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 20\n      - run: npm install\n      - run: node server.js --changed --fail-on-issues\n```\n",
  "bytes": 3023,
  "sha": "6ec2d76ae9a3d1866868be19cc0fdbdffdf5393e30ce9743d0975fdc749a6137",
  "repo_slug": "patrizzos/stylesafe",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_patrizzos_stylesafe_159db363/readme"
}