KS
Killer-Skills

audit-style — how to use audit-style how to use audit-style, what is audit-style, audit-style alternative, audit-style vs css linter, audit-style install, audit-style setup guide, BEM methodology tutorial, css audit tools, css refactor techniques

v1.0.0
GitHub

About this Skill

Perfect for Frontend Agents needing CSS normalization and BEM methodology compliance. audit-style is a skill that audits and refactors CSS code to comply with the Block–Element–Modifier (BEM) methodology and design system.

Features

Identifies non-compliant CSS selectors
Detects design token violations and naming collisions
Proposes BEM-aligned refactorings for overly-specific rules
Normalizes CSS code for maintainability and consistency
Ensures architectural consistency across the Game Loopers application
Applies BEM methodology for scalable and consistent design

# Core Topics

njculpin njculpin
[0]
[0]
Updated: 3/6/2026

Quality Score

Top 5%
57
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add njculpin/BudgetZero/audit-style

Agent Capability Analysis

The audit-style MCP Server by njculpin is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use audit-style, what is audit-style, audit-style alternative.

Ideal Agent Persona

Perfect for Frontend Agents needing CSS normalization and BEM methodology compliance.

Core Value

Empowers agents to refactor CSS selectors, identify design token violations, and propose BEM-aligned solutions using BEM methodology, ensuring maintainability, consistency, and scalability across CSS files and design systems.

Capabilities Granted for audit-style MCP Server

Auditing CSS codebases for BEM compliance
Normalizing CSS selectors for consistency
Refactoring CSS to prevent naming collisions and overly-specific rules

! Prerequisites & Limits

  • Requires CSS codebase access
  • BEM methodology knowledge required
  • CSS-specific, not applicable to other styling languages
Project
SKILL.md
18.3 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Game Loopers CSS BEM Audit & Refactor Skill

Skill Name

css-bem-auditor

Purpose

Audit, normalize, and refactor CSS across the Game Loopers application to comply with the project's BEM (Block–Element–Modifier) methodology and design system, ensuring maintainability, consistency, and scalability.

This skill identifies non-compliant selectors, design token violations, naming collisions, overly-specific rules, and architectural inconsistencies, then proposes or applies BEM-aligned fixes specific to Game Loopers.

Critical: This project uses strict BEM with NO utility-first CSS (no Tailwind, no inline utilities). All styles must use component-scoped CSS with BEM naming.


Scope

This skill operates on:

  • Astro component styles (.astro files with <style> blocks)
  • SolidJS component stylesheets (.tsx files with co-located .css files)
  • Global stylesheets (/src/styles/global.css)
  • Component-specific CSS files (e.g., product-files-form.css)

It does not redesign UI or change visual intent unless explicitly requested.


Design System Reference

Game Loopers has a comprehensive design system defined in DESIGN_SYSTEM.md (co-located in this directory). All CSS must comply with:

Color System (CSS Custom Properties)

Semantic Colors:

css
1--primary /* Black in light mode */ 2--primary-foreground /* White text on primary */ 3--secondary /* Light gray */ 4--secondary-foreground 5--destructive /* Red for errors/delete */ 6--destructive-foreground 7--accent /* Highlights, hover states */ 8--accent-foreground 9--background /* Page background */ 10--foreground /* Primary text */ 11--card /* Card backgrounds */ 12--card-foreground 13--muted /* Low emphasis backgrounds */ 14--muted-foreground /* Secondary text */ 15--border /* Default borders */ 16--input /* Input borders */ 17--ring /* Focus ring color */

Status Colors:

css
1--color-success /* Green - confirmations */ 2--color-success-foreground 3--color-warning /* Yellow - cautions */ 4--color-warning-foreground 5--color-error /* Red - failures */ 6--color-error-foreground 7--color-info /* Blue - notifications */ 8--color-info-foreground

Typography Scale

css
1--text-xs: 0.75rem; /* 12px */ 2--text-sm: 0.875rem; /* 14px */ 3--text-base: 1rem; /* 16px */ 4--text-lg: 1.125rem; /* 18px */ 5--text-xl: 1.25rem; /* 20px */ 6--text-2xl: 1.5rem; /* 24px */ 7--text-3xl: 1.875rem; /* 30px */ 8--text-4xl: 2.25rem; /* 36px */ 9--text-5xl: 3rem; /* 48px */ 10 11--font-weight-normal: 400; 12--font-weight-medium: 500; 13--font-weight-semibold: 600; 14--font-weight-bold: 700; 15 16--leading-tight: 1.25; 17--leading-snug: 1.375; 18--leading-normal: 1.5; 19--leading-relaxed: 1.625;

Spacing Scale (8px Grid)

css
1--spacing-xs: 0.25rem; /* 4px */ 2--spacing-sm: 0.5rem; /* 8px */ 3--spacing-md: 1rem; /* 16px */ 4--spacing-lg: 1.5rem; /* 24px */ 5--spacing-xl: 2rem; /* 32px */ 6--spacing-2xl: 3rem; /* 48px */ 7--spacing-3xl: 4rem; /* 64px */ 8--spacing-4xl: 6rem; /* 96px */ 9 10--gap-xs: 0.25rem; 11--gap-sm: 0.5rem; 12--gap-md: 1rem; 13--gap-lg: 1.5rem; 14--gap-xl: 2rem; 15--gap-2xl: 3rem;

Border Radius

css
1--radius-sm: 0.125rem; /* 2px */ 2--radius-md: 0.375rem; /* 6px */ 3--radius-lg: 0.5rem; /* 8px */ 4--radius-xl: 0.75rem; /* 12px */ 5--radius-2xl: 1rem; /* 16px */ 6--radius-full: 9999px; /* Fully rounded */

Shadows

css
1--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05); 2--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); 3--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 4--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

BEM Rules Enforced

Naming Convention

css
1.block {} 2.block__element {} 3.block--modifier {} 4.block__element--modifier {}

Block Naming:

  • Lowercase only
  • Hyphens for word separation (e.g., .product-card, .browse-cta)
  • Describes component purpose

Element Naming:

  • Double underscore (__) separates block from element
  • Lowercase with hyphens (e.g., .button__text, .card__header)

Modifier Naming:

  • Double hyphen (--) separates block/element from modifier
  • Lowercase with hyphens (e.g., .button--primary, .card--elevated)

Existing BEM Blocks (Reference)

Core Components:

  • .button (Button.astro)
  • .card (Card.astro)
  • .page-header (PageHeader.astro)
  • .navigation (Navigation.astro)
  • .browse-cta (BrowseCTA.astro)

Browse Components (global.css):

  • .browse-search
  • .browse-tags
  • .browse-grid
  • .browse-card
  • .browse-empty
  • .browse-pagination

Product Components:

  • .product-chat
  • .add-to-cart
  • .add-to-cart-modal
  • .product-documents-form
  • .document-list
  • .product-contributors
  • .price-breakdown
  • .status-editor
  • .status-badge
  • .revenue-preview
  • .royalty-breakdown
  • .product-files-form
  • .product-royalty-breakdown
  • .product-status-editor
  • .product-embeddable-toggle
  • .product-embedded-products

Document Components:

  • .document-chat

Interactive Components:

  • .confirm-dialog
  • .modal-overlay, .modal-content, .modal-header, .modal-body

Prohibited Patterns

Strictly Forbidden:

css
1/* NO Tailwind-style utilities */ 2.flex { display: flex; } 3.text-center { text-align: center; } 4.mt-4 { margin-top: 1rem; } 5 6/* NO chained selectors (breaks BEM) */ 7.card .title { } 8.button .icon { } 9 10/* NO tag-qualified classes */ 11div.card { } 12a.button { } 13 14/* NO ID selectors */ 15#header { } 16 17/* NO deep nesting beyond 2 levels */ 18.card__header__title__icon { } /* Too deep */ 19 20/* NO generic state classes without block context */ 21.is-active { } /* Use .button--active instead */ 22.has-error { } /* Use .input--error instead */ 23 24/* NO hardcoded colors/sizes (use design tokens) */ 25.card { 26 color: #333; /* ❌ Use var(--foreground) */ 27 padding: 24px; /* ❌ Use var(--spacing-lg) */ 28 border-radius: 8px; /* ❌ Use var(--radius-lg) */ 29}

Allowed Patterns

Correct Usage:

css
1/* Flat class selectors with design tokens */ 2.card { 3 background-color: var(--card); 4 border: 1px solid var(--border); 5 border-radius: var(--radius-lg); 6 padding: var(--spacing-3xl); 7} 8 9/* Explicit block ownership */ 10.card__title { 11 font-size: var(--text-xl); 12 font-weight: var(--font-weight-semibold); 13 color: var(--card-foreground); 14} 15 16/* Boolean and value modifiers */ 17.button--primary { } 18.button--lg { } 19.card--elevated { } 20 21/* Pseudo-states on BEM classes */ 22.button:hover { } 23.button:focus-visible { } 24.button:disabled { } 25 26/* Global page utilities (limited exceptions) */ 27.page { } 28.page__container { } 29 30/* Third-party libraries (unmodifiable) */ 31.tiptap { } 32.astro-* { }

Audit Process

1. Inventory Phase

  • Extract all class selectors from .astro and .css files
  • Map class usage across templates (Astro pages, SolidJS islands)
  • Identify design token violations (hardcoded colors, spacing, typography)
  • Detect duplicates and collisions
  • Find orphaned selectors (defined but not used)

2. Classification Phase

Each selector is categorized as:

  • Block (component root)
  • Element (component part)
  • Modifier (component variation)
  • Global Utility (allowed: .page, .page__container)
  • Third-party (allowed: .tiptap, .astro-*)
  • Invalid (Tailwind-style utilities, non-BEM patterns)

3. Violation Detection

Naming Violations:

  • Incorrect separator usage (_ instead of __, - instead of --)
  • CamelCase or snake_case naming
  • Too-deep element nesting (.block__element__subelement)

Design Token Violations:

  • Hardcoded colors instead of var(--primary), var(--muted-foreground), etc.
  • Hardcoded spacing instead of var(--spacing-*) or var(--gap-*)
  • Hardcoded font sizes instead of var(--text-*)
  • Hardcoded border radius instead of var(--radius-*)
  • Hardcoded shadows instead of var(--shadow-*)

Structural Violations:

  • Cross-block element access (.card .button__text)
  • Tag-qualified classes (div.button)
  • ID selectors
  • Utility-first patterns (Tailwind-style)

4. Refactor Strategy

For each violation:

  1. Propose canonical BEM block name (check existing blocks first)
  2. Replace hardcoded values with design tokens
  3. Flatten selector structure (convert nested to explicit elements)
  4. Normalize modifiers (ensure -- separator)
  5. Update markup (Astro/TSX files) to match new class names

5. Design Token Compliance

Ensure all CSS uses design tokens:

css
1/* BEFORE (violations) */ 2.card { 3 color: #333; 4 background: #fff; 5 padding: 24px; 6 margin-bottom: 32px; 7 border-radius: 8px; 8 font-size: 18px; 9 box-shadow: 0 4px 6px rgba(0,0,0,0.1); 10} 11 12/* AFTER (compliant) */ 13.card { 14 color: var(--foreground); 15 background: var(--card); 16 padding: var(--spacing-lg); 17 margin-bottom: var(--spacing-xl); 18 border-radius: var(--radius-lg); 19 font-size: var(--text-lg); 20 box-shadow: var(--shadow-md); 21}

6. Validation Phase

  • Ensure no orphaned selectors remain
  • Confirm visual intent preservation (run dev server, check pages)
  • Verify class usage consistency across Astro/SolidJS components
  • Check accessibility (focus states, ARIA compatibility)

Example Transformations

Example 1: Tailwind-style Utilities → BEM

BEFORE (Violation):

html
1<!-- Astro component using Tailwind-style classes --> 2<div class="flex gap-4 p-6 rounded-lg bg-white"> 3 <h2 class="text-xl font-bold">Title</h2> 4 <p class="text-gray-600">Description</p> 5</div> 6 7<style> 8.flex { display: flex; } 9.gap-4 { gap: 1rem; } 10.p-6 { padding: 1.5rem; } 11.rounded-lg { border-radius: 0.5rem; } 12.bg-white { background: white; } 13.text-xl { font-size: 1.25rem; } 14.font-bold { font-weight: bold; } 15.text-gray-600 { color: #666; } 16</style>

AFTER (BEM Compliant):

html
1<div class="product-card"> 2 <h2 class="product-card__title">Title</h2> 3 <p class="product-card__description">Description</p> 4</div> 5 6<style> 7.product-card { 8 display: flex; 9 gap: var(--gap-md); 10 padding: var(--spacing-lg); 11 border-radius: var(--radius-lg); 12 background: var(--card); 13} 14 15.product-card__title { 16 font-size: var(--text-xl); 17 font-weight: var(--font-weight-bold); 18 color: var(--card-foreground); 19} 20 21.product-card__description { 22 color: var(--muted-foreground); 23} 24</style>

Example 2: Nested Selectors → Flat BEM

BEFORE (Violation):

css
1.card .header .title { 2 font-size: 20px; 3} 4 5.card.active { 6 border-color: blue; 7} 8 9.card .footer button { 10 padding: 12px 24px; 11}

AFTER (BEM Compliant):

css
1.card__title { 2 font-size: var(--text-xl); 3} 4 5.card--active { 6 border-color: var(--primary); 7} 8 9.card__footer-button { 10 padding: var(--spacing-sm) var(--spacing-lg); 11}
html
1<div class="card card--active"> 2 <div class="card__header"> 3 <h2 class="card__title">Title</h2> 4 </div> 5 <div class="card__footer"> 6 <button class="card__footer-button">Action</button> 7 </div> 8</div>

Example 3: Hardcoded Values → Design Tokens

BEFORE (Violations):

css
1.product-card { 2 background: #ffffff; 3 color: #333333; 4 border: 1px solid #e0e0e0; 5 padding: 16px 24px; 6 margin-bottom: 32px; 7 border-radius: 8px; 8 font-size: 16px; 9 line-height: 1.5; 10 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 11} 12 13.product-card__title { 14 color: #000000; 15 font-size: 24px; 16 font-weight: 600; 17 margin-bottom: 8px; 18} 19 20.product-card__description { 21 color: #666666; 22 font-size: 14px; 23 line-height: 1.6; 24} 25 26.product-card:hover { 27 box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); 28}

AFTER (Design Token Compliant):

css
1.product-card { 2 background: var(--card); 3 color: var(--card-foreground); 4 border: 1px solid var(--border); 5 padding: var(--spacing-md) var(--spacing-lg); 6 margin-bottom: var(--spacing-xl); 7 border-radius: var(--radius-lg); 8 font-size: var(--text-base); 9 line-height: var(--leading-normal); 10 box-shadow: var(--shadow-sm); 11} 12 13.product-card__title { 14 color: var(--foreground); 15 font-size: var(--text-2xl); 16 font-weight: var(--font-weight-semibold); 17 margin-bottom: var(--spacing-sm); 18} 19 20.product-card__description { 21 color: var(--muted-foreground); 22 font-size: var(--text-sm); 23 line-height: var(--leading-relaxed); 24} 25 26.product-card:hover { 27 box-shadow: var(--shadow-md); 28}

Component-Specific Patterns

Button Component Pattern

css
1/* Base button block */ 2.button { 3 display: inline-flex; 4 align-items: center; 5 justify-content: center; 6 padding: var(--spacing-sm) var(--spacing-lg); 7 border-radius: var(--radius-md); 8 font-size: var(--text-base); 9 font-weight: var(--font-weight-medium); 10 transition: background-color 150ms; 11} 12 13/* Variant modifiers */ 14.button--primary { 15 background-color: var(--primary); 16 color: var(--primary-foreground); 17} 18 19.button--secondary { 20 background-color: var(--secondary); 21 color: var(--secondary-foreground); 22} 23 24.button--destructive { 25 background-color: var(--destructive); 26 color: var(--destructive-foreground); 27} 28 29/* Size modifiers */ 30.button--sm { 31 padding: var(--spacing-xs) var(--spacing-md); 32 font-size: var(--text-sm); 33} 34 35.button--lg { 36 padding: var(--spacing-md) var(--spacing-xl); 37 font-size: var(--text-lg); 38} 39 40/* Elements */ 41.button__icon { 42 margin-right: var(--spacing-xs); 43} 44 45.button__text { } 46 47/* States */ 48.button:hover { 49 opacity: 0.9; 50} 51 52.button:focus-visible { 53 outline: 2px solid var(--ring); 54 outline-offset: 2px; 55} 56 57.button:disabled { 58 opacity: 0.5; 59 pointer-events: none; 60}

Modal Component Pattern

css
1.modal-overlay { 2 position: fixed; 3 inset: 0; 4 background: rgb(0 0 0 / 0.5); 5 display: flex; 6 align-items: center; 7 justify-content: center; 8 padding: var(--spacing-lg); 9 z-index: 50; 10} 11 12.modal-content { 13 background: var(--card); 14 border-radius: var(--radius-xl); 15 box-shadow: var(--shadow-xl); 16 max-width: 32rem; 17 width: 100%; 18 max-height: 90vh; 19 overflow-y: auto; 20} 21 22.modal-header { 23 display: flex; 24 justify-content: space-between; 25 align-items: center; 26 padding: var(--spacing-lg); 27 border-bottom: 1px solid var(--border); 28} 29 30.modal-title { 31 font-size: var(--text-xl); 32 font-weight: var(--font-weight-semibold); 33 color: var(--foreground); 34} 35 36.modal-close { 37 padding: var(--spacing-xs); 38 color: var(--muted-foreground); 39} 40 41.modal-close:hover { 42 color: var(--foreground); 43} 44 45.modal-body { 46 padding: var(--spacing-lg); 47}

Accessibility Compliance

All CSS must support accessibility standards:

Focus States

css
1/* All interactive elements MUST have visible focus indicators */ 2.button:focus-visible, 3.browse-tags__tag:focus-visible, 4.navigation__link:focus-visible { 5 outline: 2px solid var(--ring); 6 outline-offset: 2px; 7}

Color Contrast

  • Body text: 4.5:1 minimum contrast ratio
  • Large text: 3:1 minimum contrast ratio
  • UI components: 3:1 against adjacent colors

All semantic color tokens meet WCAG 2.1 Level AA standards.

Screen Reader Compatibility

css
1/* Hidden but accessible to screen readers */ 2.sr-only { 3 position: absolute; 4 width: 1px; 5 height: 1px; 6 padding: 0; 7 margin: -1px; 8 overflow: hidden; 9 clip: rect(0, 0, 0, 0); 10 white-space: nowrap; 11 border-width: 0; 12} 13 14/* Decorative elements should be hidden from screen readers via aria-hidden="true" */ 15/* No CSS-only hiding for interactive elements */

File Organization

CSS files must follow this structure:

src/
├── styles/
│   └── global.css              # Global styles, shared .browse-* classes
├── components/
│   ├── Button.astro            # <style> block in component
│   ├── Card.astro              # <style> block in component
│   ├── products/
│   │   ├── ProductFilesForm.tsx          # SolidJS component
│   │   ├── product-files-form.css        # Co-located CSS
│   │   ├── ProductRoyaltyBreakdown.tsx
│   │   └── product-royalty-breakdown.css

Rules:

  • Astro components: Use <style> blocks in .astro files
  • SolidJS islands: Use co-located .css files with matching names
  • Shared browse styles: Use .browse-* classes in global.css
  • Page-specific styles: Use <style> blocks in page .astro files

Output Modes

Report Mode

Generates:

  • BEM compliance score (0-100%)
  • Design token compliance score (0-100%)
  • List of violations by severity (critical, high, medium, low)
  • Suggested renames and restructures
  • Hardcoded value inventory (colors, spacing, typography)
  • Unused selector report
  • Missing design token opportunities

Patch Mode

Generates:

  • Diff-style rename suggestions
  • Design token replacement mapping
  • Refactored selector examples
  • Migration mapping table (old → new)
  • Markup update requirements (.astro and .tsx files)

Auto-fix Mode

Generates:

  • Updated CSS files with BEM-compliant selectors
  • Design token replacements applied
  • Updated markup class names in Astro/TSX files
  • Migration notes for breaking changes
  • Before/after screenshots (if possible)

Safety & Constraints

  • Never rename without updating all references (search across .astro, .tsx, .css)
  • Avoid visual regressions - test in dev server before committing
  • Preserve comments and documentation
  • Flag breaking changes clearly
  • Verify accessibility - ensure focus states, contrast ratios, ARIA compatibility
  • Test responsive behavior - check mobile, tablet, desktop breakpoints

Success Criteria

Pass Conditions:

  • All selectors follow valid BEM syntax (.block__element--modifier)
  • No cross-block coupling remains
  • No hardcoded colors, spacing, typography (all use design tokens)
  • No utility-first CSS patterns (Tailwind-style)
  • Reduced specificity and nesting
  • Clear, predictable class semantics
  • Accessibility standards maintained (focus states, contrast, ARIA)
  • Responsive design patterns preserved

Summary

This skill enforces Game Loopers' strict BEM architecture and design system compliance. It ensures:

  1. Consistent BEM naming across all components
  2. Design token usage for theming and maintainability
  3. No utility-first CSS (Tailwind prohibition)
  4. Accessibility compliance (WCAG 2.1 Level AA)
  5. Scalable architecture for long-term maintenance

This is critical for a product-market fit focused MVP where consistency and maintainability enable rapid iteration.

Related Skills

Looking for an alternative to audit-style or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication