/harness-claude:css-css-modulesfrom harness-claude
Scopes CSS to components using CSS Modules for collision-free class names and co-located styles. Covers naming conventions, imports, composes, dynamic classes, and TypeScript type generation.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:css-css-modules still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Scope CSS to components with CSS Modules for collision-free class names and co-located styles
.module.css suffix: Button.module.css. The bundler generates unique class names.import styles from './Button.module.css'.className={styles.button}.composes to inherit styles from other classes or modules.styles[variant].:global(.class) to escape scoping./* Button.module.css */
.button {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.5rem 1rem;
border-radius: 0.375rem;
font-weight: 500;
transition: all 0.2s;
}
.primary {
composes: button;
background-color: var(--color-primary);
color: white;
}
.primary:hover {
filter: brightness(1.1);
}
.secondary {
composes: button;
background-color: var(--color-gray-100);
color: var(--color-gray-900);
}
.large {
padding: 0.75rem 1.5rem;
font-size: 1.125rem;
}
.fullWidth {
width: 100%;
}
// Button.tsx
import styles from './Button.module.css';
import clsx from 'clsx';
interface ButtonProps {
variant?: 'primary' | 'secondary';
size?: 'default' | 'large';
fullWidth?: boolean;
children: React.ReactNode;
}
function Button({ variant = 'primary', size = 'default', fullWidth, children }: ButtonProps) {
return (
<button
className={clsx(
styles[variant],
size === 'large' && styles.large,
fullWidth && styles.fullWidth
)}
>
{children}
</button>
);
}
How it works: The bundler (Webpack, Vite, Next.js) transforms class names from .button to .Button_button_a1b2c (component name + class name + hash). This guarantees no collisions between components.
TypeScript support: Generate type declarations for CSS Modules:
# typed-css-modules
npm install -D typed-css-modules
tcm src/
# Or use the Vite plugin
npm install -D vite-plugin-css-modules-typescript
This creates .module.css.d.ts files:
// Button.module.css.d.ts
declare const styles: {
readonly button: string;
readonly primary: string;
readonly secondary: string;
readonly large: string;
readonly fullWidth: string;
};
export default styles;
composes keyword: Inherit styles from other classes:
.base {
padding: 1rem;
border-radius: 0.5rem;
}
.error {
composes: base;
border: 2px solid red;
}
/* .error gets both base and error styles */
/* Compose from another module */
.card {
composes: surface from './shared.module.css';
}
:global escape hatch: Apply a class globally (useful for overriding library styles):
.wrapper :global(.third-party-class) {
color: red;
}
CSS Modules + Tailwind: Use CSS Modules for complex styles and Tailwind for utilities:
<div className={clsx(styles.card, 'p-4 flex gap-2')}>
When to use CSS Modules vs Tailwind: CSS Modules are better for complex pseudo-selectors, animations with many keyframes, and teams that prefer traditional CSS. Tailwind is better for rapid iteration and design consistency.
https://github.com/css-modules/css-modules
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
CSS, TypeScript, React, Next.js, Vite
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job