# CSS Auditor

> Audit CSS for unused selectors, high specificity, and inconsistent design tokens across web frameworks.

CSS Auditor is a paid AI agent skill on Agensi by aingram702, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $1 (one-time purchase)
- Creator: [aingram702](https://www.agensi.io/creators/aingram702)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.0
- Last updated: 2026-10-21
- Security: scan passed (2026-10-12); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/css-auditor
- Tags: code-review, devops, web-design, scss, frontend-engineering, refactoring

## About this skill

Bloated stylesheets slow down builds and increase production bundle sizes. This skill audits CSS, SCSS, and Less files to identify unused selectors, maintainability issues, and inconsistent design tokens across your codebase.

### What it does
- **Unused Selector Detection** scans HTML, JSX, TSX, Vue, Svelte, and PHP files to find dead class and ID selectors.
- **Specificity Analysis** flags high-risk selectors like IDs, overqualified elements, and long descendant chains that cause style overrides.
- **Maintainability Audit** counts `!important` usage, duplicate declarations, obsolete vendor prefixes, and @import chains.
- **Token Extraction** lists unique colors, font sizes, spacing, and z-index values to identify near-duplicate variables.
- **Breakpoint Inventory** aggregates media queries to help standardize responsive design break-points.

### How it works
1. **Target Styles** by providing paths to CSS, SCSS, or Less files for analysis.
2. **Scan Content** by pointing the auditor to your component or template directory for usage matching.
3. **Apply Safelists** for dynamic classes like `is-active` or `js-*` patterns that static analysis might miss.
4. **Review Report** to identify specific lines for refactoring or deletion based on the generated audit logs.

### Frameworks & tools
Works with CSS, SCSS, and Less syntax. Supports content scanning for HTML, React (JSX/TSX), Vue, Svelte, Angular, and PHP templates.

### Why this beats prompting it yourself
Generic LLM prompts often hallucinate selector usage or miss complex specificity rules. this skill uses targeted logic to normalize colors and detect exact duplicate declarations that manual reviews overlook in large files.

### Use cases
- **Dead Code Elimination** during a refactor to safely remove hundreds of lines of unused CSS.
- **Design System Migration** by extracting existing colors and spacing to define new design tokens.
- **Performance Optimization** to reduce the CSS payload by removing vendor prefixes and duplicate rules.
- **Code Review** to catch `!important` flags or ID selectors before they reach production.

### Known limitations
Unused selector detection is static. Dynamic classes built via string concatenation require manual safelisting to avoid false positives.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the CSS Auditor skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What specific problems does the CSS Auditor solve for my frontend workflow?

The CSS Auditor performs static analysis across your styles and component templates to identify unused classes, high-specificity overrides, and inconsistent design tokens that bloat your production bundles. It solves the problem of 'CSS debt' by flagging exactly which selectors are safe to delete and which properties violate best practices.

### Which AI agents are compatible with this skill?

It is compatible with all major AI agents that have filesystem or code repository access. Simply provide the agent with your project paths, and it will use the skill's logic to generate a structured audit report.

### Can I prevent the auditor from flagging dynamic classes used in my JavaScript?

Yes, you can define safelists for dynamic class names—such as those generated by state changes or JavaScript—to ensure the auditor doesn't flag them as unused. This allows you to maintain the accuracy of the report even when using complex logic in frameworks like React or Vue.

### How does the Token Extraction feature help with design system migration?

The tool extracts and groups all unique hex codes, RGB values, and spacing units found in your stylesheets. This helps you identify 'near-misses' (e.g., #FFFFFF vs #FFFFFE) so you can consolidate them into a unified design system or set of CSS variables.

### What is included in the purchase of the CSS Auditor skill?

Your purchase includes the full skill configuration, documentation for integration, and lifetime access to any future logic updates or new framework support added to the auditor.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
