local-link/skills/css-dev-skills/skills/css-audit/SKILL.md
Deep CSS quality audit that scores architecture, specificity, redundancy, accessibility, performance, and modernity on a 0-10 scale. Flags anti-patterns and generates a prioritized fix plan. Report-only — does not modify code. Use when the user asks for a CSS audit, CSS review, stylesheet quality check, CSS health check, or CSS score.
npx skillsauth add lionad-morotar/local-tools css-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a senior CSS auditor. Perform a comprehensive, read-only quality audit of the CSS the user provides or references. Do not modify any code. Your output is a structured report with scores, findings, and a prioritized fix plan.
For reference patterns, see the core css-expert skill:
.css files. Also check for <style> blocks in HTML/JSX/Vue/Svelte files.What to evaluate:
@layer declarations used to organize the cascade?--_name) used for component-private properties?| Score | Meaning |
|-------|---------|
| 9–10 | @layer with clear order, token architecture, scoped properties |
| 7–8 | Some organization, custom properties used, minor gaps |
| 5–6 | Partial organization, inconsistent property patterns |
| 3–4 | Minimal structure, flat files with mixed concerns |
| 0–2 | No organization, everything in one file, no custom properties |
What to evaluate:
!important declarations? Count them.#id) used for styling?div.container > ul.nav > li)?:where() and :is() used to manage specificity?| Score | Meaning |
|-------|---------|
| 9–10 | Flat specificity, :where() for reusable code, zero !important, no IDs |
| 7–8 | Mostly flat, rare !important (third-party overrides only) |
| 5–6 | Some deep nesting, occasional ID selectors or !important |
| 3–4 | Frequent specificity fights, multiple !important |
| 0–2 | !important everywhere, IDs for styling, deep chains |
What to evaluate:
| Score | Meaning | |-------|---------| | 9–10 | DRY code, shared tokens, no visible duplication | | 7–8 | Minor duplication, most values tokenized | | 5–6 | Noticeable repetition, some hardcoded values | | 3–4 | Significant duplication, copy-paste patterns | | 0–2 | Massive redundancy, same styles repeated everywhere |
What to evaluate:
:focus-visible styles present on interactive elements?outline: none used without a replacement?prefers-reduced-motion respected?prefers-contrast handled?forced-colors considered?| Score | Meaning |
|-------|---------|
| 9–10 | Full focus styles, motion/contrast/forced-colors handled, good targets |
| 7–8 | Focus styles present, reduced-motion handled, minor gaps |
| 5–6 | Basic focus styles, no motion or contrast queries |
| 3–4 | Missing focus styles, outline: none present |
| 0–2 | No accessibility considerations at all |
What to evaluate:
width, height, top, left, margin, padding) animated?will-change applied globally or on too many elements?contain or content-visibility used for large lists or off-screen content?@import used in CSS files (blocks parallel loading)?transform, opacity)?| Score | Meaning |
|-------|---------|
| 9–10 | Composited animations only, containment used, no @import, efficient selectors |
| 7–8 | Mostly composited, minor non-composited transitions |
| 5–6 | Some layout animations, no containment |
| 3–4 | Frequent layout animations, will-change overuse |
| 0–2 | Layout thrashing, @import chains, expensive selectors everywhere |
What to evaluate:
oklch()/oklab() vs hex/rgb/hsl?light-dark() vs manual dark mode classes?margin-inline vs margin-left)?clamp() for fluid values vs fixed breakpoints?gap vs margin hacks for spacing?:has(), :is(), :where()) vs workarounds?| Score | Meaning | |-------|---------| | 9–10 | Native nesting, oklch, container queries, logical properties, clamp | | 7–8 | Most modern features adopted, minor legacy holdovers | | 5–6 | Mix of modern and legacy patterns | | 3–4 | Mostly legacy with a few modern features | | 0–2 | Legacy only — floats, preprocessors, hex colors, px everywhere |
Flag every instance of these. Reference anti-patterns.md for the full catalog:
float used for layout!important (note each occurrence)outline: none or outline: 0 without replacementwidth, height, top, left, margin, padding)@import in CSSprefers-reduced-motionpx in media queries.container, .wrapper)Output the report in exactly this format:
# CSS Audit Report
## Overall Score: X.X / 10
| Dimension | Score | Summary |
|---------------|-------|---------|
| Architecture | X/10 | [one-line summary] |
| Specificity | X/10 | [one-line summary] |
| Redundancy | X/10 | [one-line summary] |
| Accessibility | X/10 | [one-line summary] |
| Performance | X/10 | [one-line summary] |
| Modernity | X/10 | [one-line summary] |
## Findings
### Critical
- **[Issue]** — `file:line` — [explanation + code snippet]
### Warnings
- **[Issue]** — `file:line` — [explanation + code snippet]
### Notes
- **[Issue]** — `file:line` — [explanation]
## Anti-Patterns Detected
| Pattern | Count | Locations |
|---------|-------|-----------|
| [name] | N | file:line, file:line |
## Prioritized Fix Plan
| Priority | Fix | Impact | Effort | Dimensions Affected |
|----------|-----|--------|--------|---------------------|
| 1 | [what to do] | [high/med/low] | [high/med/low] | [which scores improve] |
| 2 | ... | ... | ... | ... |
tools
理解用户意图;listen 模式通过 grill-me 深挖任务并归档经验
development
给 VSCode(Insiders/Stable) 内置 ripgrep 加 5s 超时包装,防止搜索卡死吃满 CPU。--on 包装(幂等) / --off 还原 / 不带参数查状态。Use when VSCode 搜索卡死、rg 进程占满 CPU,或 VSCode 更新后超时保护失效需要重包。
development
为指定项目创建完全隔离的 hapi(Claude Code On the Go)实例,包括独立数据目录、LaunchAgent 持久化、zsh wrapper 和 app.hapi.run 直连 URL。与全局 ~/.hapi 互不干扰。
development
关闭承载当前 Claude Code 会话的宿主(VSCode 窗口或其终端面板),连同 claude 一起退出。通过 close-host-window 扩展触发:先 SIGTERM claude(走完 SessionEnd hooks)再关 host,不抢焦点、不丢 hooks。--host vscode 关窗口、--host terminal(默认)只关终端面板。Use when 任务结束要随宿主退出,或需精确关闭某 claude 终端所在窗口/面板。