Implement scalable CSS architecture patterns - BEM, SMACSS, ITCSS, design tokens
Provides scalable CSS architecture patterns (BEM, ITCSS, SMACSS) and design tokens for maintainable codebases. Claude uses this when organizing styles for medium to enterprise projects or refactoring CSS.
/plugin marketplace add pluginagentmarketplace/custom-plugin-css/plugin install css-assistant@pluginagentmarketplace-cssThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyImplement scalable CSS architecture patterns for maintainable, organized codebases.
This skill provides atomic, focused guidance on CSS architecture methodologies with practical implementation patterns and migration strategies.
| Property | Value |
|---|---|
| Category | Organization |
| Complexity | Intermediate to Expert |
| Dependencies | css-fundamentals |
| Bonded Agent | 04-css-architecture |
Skill("css-architecture")
parameters:
methodology:
type: string
required: true
enum: [bem, smacss, oocss, itcss, atomic, css-modules]
description: CSS architecture methodology
project_size:
type: string
required: false
default: medium
enum: [small, medium, large, enterprise]
description: Project scale for appropriate recommendations
include_tokens:
type: boolean
required: false
default: true
description: Include design token patterns
validation:
- rule: methodology_required
message: "methodology parameter is required"
- rule: valid_methodology
message: "methodology must be one of: bem, smacss, oocss, itcss, atomic, css-modules"
retry_config:
max_attempts: 3
backoff_type: exponential
initial_delay_ms: 1000
max_delay_ms: 10000
logging:
entry_point: skill_invoked
exit_point: skill_completed
metrics:
- invocation_count
- methodology_distribution
- project_size_distribution
/* Block */
.card { }
/* Element */
.card__header { }
.card__body { }
.card__footer { }
/* Modifier */
.card--featured { }
.card--compact { }
.card__header--large { }
/styles
├── 1-settings/ → $variables, tokens
├── 2-tools/ → @mixins, functions
├── 3-generic/ → reset, normalize
├── 4-elements/ → h1, p, a (bare HTML)
├── 5-objects/ → .o-grid, .o-container
├── 6-components/ → .c-card, .c-button
└── 7-utilities/ → .u-hidden, .u-text-center
/* 1. Primitive Tokens */
:root {
--color-blue-500: #3b82f6;
--color-gray-900: #111827;
--space-4: 1rem;
--font-size-lg: 1.125rem;
}
/* 2. Semantic Tokens */
:root {
--color-primary: var(--color-blue-500);
--color-text: var(--color-gray-900);
--spacing-md: var(--space-4);
}
/* 3. Component Tokens */
.button {
--button-bg: var(--color-primary);
--button-padding: var(--spacing-md);
}
styles/
├── base.css
├── components.css
├── utilities.css
└── main.css
styles/
├── base/
│ ├── reset.css
│ └── typography.css
├── components/
│ ├── button.css
│ └── card.css
├── layouts/
│ └── grid.css
├── utilities/
│ └── helpers.css
└── main.css
styles/
├── settings/
│ ├── _tokens.scss
│ └── _breakpoints.scss
├── tools/
│ ├── _mixins.scss
│ └── _functions.scss
├── generic/
│ └── _reset.scss
├── elements/
│ └── _typography.scss
├── objects/
│ └── _grid.scss
├── components/
│ ├── _button.scss
│ └── _card.scss
├── utilities/
│ └── _helpers.scss
└── main.scss
| Methodology | Example | Best For |
|---|---|---|
| BEM | .block__element--modifier | Component systems |
| SMACSS | .l-grid, .is-active | Multi-page sites |
| OOCSS | .media, .media-body | Reusable patterns |
| Atomic | .flex, .p-4, .text-center | Utility-first |
describe('CSS Architecture Skill', () => {
test('validates methodology parameter', () => {
expect(() => skill({ methodology: 'invalid' }))
.toThrow('methodology must be one of: bem, smacss...');
});
test('returns BEM examples for bem methodology', () => {
const result = skill({ methodology: 'bem' });
expect(result).toContain('__');
expect(result).toContain('--');
});
test('scales recommendations based on project_size', () => {
const smallResult = skill({ methodology: 'itcss', project_size: 'small' });
const largeResult = skill({ methodology: 'itcss', project_size: 'large' });
expect(largeResult.layers).toBeGreaterThan(smallResult.layers);
});
});
| Error Code | Cause | Recovery |
|---|---|---|
| INVALID_METHODOLOGY | Unknown methodology | Show valid options |
| SIZE_MISMATCH | Methodology too complex for project size | Suggest simpler alternative |
| TOKEN_CONFLICT | Conflicting token names | Show naming resolution |
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.