css-modules

css-modules is a skill for Claude Code, Codex from MadAppGang/claude-code. It costs 52 tokens per session (3,333 once invoked), scanned A, original, MIT.

A guide to CSS Modules, where each component's CSS gets locally scoped names so styles do not accidentally affect other components. It also covers Vite, Lightning CSS, PostCSS, TypeScript, and CSS composition.

In plain words
What is it for?
Use it to build scoped component styles, complex animations, third-party customizations, or to migrate a legacy stylesheet.
Why use it?
It reduces style conflicts and makes complex component styling easier to maintain, especially when working with third-party components or older CSS.

Skill for Claude CodeCodex

Part of the dev plugin — 47 skills, 12 commands, 14 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/madappgang/claude-code/css-modules
Any agent
npx skills add MadAppGang/claude-code --skill css-modules
Clone the repo
git clone --depth 1 https://github.com/MadAppGang/claude-code

Made for: Claude Code, Codex.

Or install dev, the plugin that ships this one along with the rest of its 47 skills, 12 commands, 14 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for css-modules

README.md
[![agentmods](https://agentmods.dev/badge/skills/madappgang/claude-code/css-modules.svg)](https://agentmods.dev/skills/madappgang/claude-code/css-modules)
Your own site
<a href="https://agentmods.dev/skills/madappgang/claude-code/css-modules"><img src="https://agentmods.dev/badge/skills/madappgang/claude-code/css-modules.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,333 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00052 $0.03333
Opus 5 $0.00026 $0.01666
Sonnet 5 $0.00010 $0.00667
Haiku 4.5 $0.00005 $0.00333

Measured yesterday against content hash 0a5178b82cd8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

css-modules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/dev/skills/frontend/css-modules/SKILL.md · 600 lines

How it starts

The opening of the file, as written. The whole thing — 600 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CSS Modules

Overview

CSS Modules provide locally-scoped CSS by automatically generating unique class names at build time. This prevents style conflicts and enables true component encapsulation.

When to Use CSS Modules

Use Case CSS Modules Tailwind
Complex animations Best Good
Third-party component styling Best Harder
Legacy CSS migration Best Refactor needed
Rapid prototyping Slower Best
Design system utilities Not ideal Best
Component encapsulation Best N/A
Team with CSS expertise Best Either

Hybrid Approach: Use both together - Tailwind for utilities, CSS Modules for complex components.


Documentation Index

Vite Integration

Topic URL Description
CSS Modules in Vite https://vite.dev/guide/features#css-modules Vite's built-in support
Lightning CSS https://vite.dev/guide/features#lightning-css Fast CSS transforms
PostCSS https://vite.dev/guide/features#postcss PostCSS configuration

Lightning CSS

Topic URL Description
Documentation https://lightningcss.dev/docs.html Official docs
CSS Modules https://lightningcss.dev/css-modules.html Module support
Transpilation https://lightningcss.dev/transpilation.html Browser targeting
Bundling https://lightningcss.dev/bundling.html CSS bundling

CSS Modules Spec

Topic URL Description
CSS Modules https://github.com/css-modules/css-modules Specification
Composition https://github.com/css-modules/css-modules#composition Composing classes
Scoping https://github.com/css-modules/css-modules#naming Local vs global

TypeScript Integration

Topic URL Description
typed-css-modules https://github.com/Quramy/typed-css-modules Generate .d.ts files
vite-plugin-css-modules-dts https://github.com/mrcjkb/vite-plugin-css-modules-dts Vite plugin

Read the full file on GitHub · 600 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 600 lines · 52 tokens per session scan A 0a5178b82cd8

Subscribe to this mod's changes

css-modules is a skill published in the GitHub repository MadAppGang/claude-code (279 stars, last pushed 5mo ago), licensed MIT. It adds 52 tokens to every session and 3,333 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

Shade ShadCN install

Guardrails for running pnpm dlx shadcn@latest add in Shade — never overwrite existing components, fresh branch first, swap raw colours for semantic tokens after integrating. Trigger when the user proposes a shadcn add, or when a fresh ShadCN-shaped file lands in apps/shade/src/components/ui.

TryGhost/Ghost · 72 tokens

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

frontend-visual-qa

Audits already-rendered web, landing-page, HTML deck/slide, browser tool/game, dashboard/admin, design-system, and desktop UIs using real-browser or native-app journeys, inspected screenshots, DOM geometry, responsive or projection viewports, and a bundled Playwright sweep. Use after UI implementation to find…

daymade/claude-code-skills · 145 tokens

prototype-web

可点击的功能性 Web 原型, 含导航、英雄区、特性区、CTA.

nexu-io/html-anything · 24 tokens

waitlist-page

【模板: 等候名单页 / Waitlist】 【意图】为新产品 / 早鸟内测做一张极简等候页。 【布局】.

nexu-io/html-anything · 25 tokens

design-frontend-dev

Clean Impeccable frontend design skill. Use when the user wants to design, redesign, critique, audit, polish, harden, optimize, adapt, clarify, colorize, animate, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, onboarding, empty states…

The-Vibe-Company/companion · 127 tokens