css-architecture — Claude Code skill: CSS that stays organized
A skill that gives your coding agent conventions for structuring CSS with BEM, SMACSS and CSS-in-JS. Handy when stylesheets outgrow the naming scheme you started with.
npx skills add aj-geddes/useful-ai-prompts --skill css-architecture -a claude-codeWhat css-architecture does
The skill hands the agent a framework for styling work: BEM, SMACSS and CSS-in-JS patterns instead of class names invented on the spot. It ships a short starter example with a block, an element and a modifier, plus reference guides in references/ covering BEM, SMACSS, styled components, CSS custom properties and a utility-first Tailwind-style approach.
It fits large stylesheets, component-based markup and projects where several people touch the same CSS. Because the agent gets naming conventions up front, a new class lands inside the existing scheme rather than beside it.
One caveat: the skill describes methodologies, it does not lint your code. If your project already follows its own style guide, expect to reconcile the two yourself — worth checking the conventions before you ask the agent to rewrite anything.
What it helps with
- split styles into blocks, elements and modifiers
- pick between BEM, SMACSS and CSS-in-JS for a new project
- settle on class naming across a team
- move hardcoded colors and spacing onto CSS custom properties
- turn a sprawling stylesheet into a component structure
Example prompts for the agent
- Refactor this component's styles into BEM and show me the class names
- Help me choose between SMACSS and CSS-in-JS for this project
- Convert these hardcoded colors to CSS custom properties
How to install css-architecture
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill css-architecture -a claude-code2Manually: put the files in place
~/.claude/skills/css-architecture/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/css-architecture/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill css-architecture -a codex2Manually: put the files in place
.agents/skills/css-architecture/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill css-architecture -a cursor2Manually: put the files in place
.cursor/skills/css-architecture/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts css-architecture2Manually: put the files in place
.github/skills/css-architecture/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill css-architecture -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/css-architectureManually: put the files in place
.devin/skills/css-architecture/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill css-architecture -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about css-architecture
How do I install css-architecture in Claude?
Run npx skills add aj-geddes/useful-ai-prompts --skill css-architecture -a claude-code. The skill file then lives at ~/.claude/skills/css-architecture/SKILL.md.
What does css-architecture do?
It gives the agent conventions for organizing CSS: BEM, SMACSS, CSS-in-JS, custom properties and a utility-first approach. The agent follows them when writing or renaming styles.
Does the skill check my CSS on its own?
No. It is a set of methodologies and examples for the agent, not a linter. It reviews and edits only when you ask.
Source text
SKILL.md · MIT
---
name: css-architecture
description: >
Organize CSS using BEM, SMACSS, and CSS-in-JS patterns. Use when building
scalable, maintainable styling systems with proper naming conventions.
---
# CSS Architecture
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Build maintainable CSS systems using methodologies like BEM (Block Element Modifier), SMACSS, and CSS-in-JS patterns with proper organization and conventions.
## When to Use
- Large-scale stylesheets
- Component-based styling
- Design system development
- Multiple team collaboration
- CSS scalability and reusability
## Quick Start
Minimal working example:
```css
/* Block - standalone component */
.button {
display: inline-block;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: all 0.3s ease;
}
/* Element - component part */
.button__icon {
margin-right: 8px;
vertical-align: middle;
}
/* Modifier - variant */
.button--primary {
background-color: #007bff;
color: white;
}
.button--primary:hover {
background-color: #0056b3;
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [BEM (Block Element Modifier) Pattern](references/bem-block-element-modifier-pattern.md) | BEM (Block Element Modifier) Pattern |
| [SMACSS (Scalable and Modular Architecture for CSS)](references/smacss-scalable-and-modular-architecture-for-css.md) | SMACSS (Scalable and Modular Architecture for CSS) |
| [CSS-in-JS with Styled Components](references/css-in-js-with-styled-components.md) | CSS-in-JS with Styled Components |
| [CSS Variables (Custom Properties)](references/css-variables-custom-properties.md) | CSS Variables (Custom Properties) |
| [Utility-First CSS (Tailwind Pattern)](references/utility-first-css-tailwind-pattern.md) | Utility-First CSS (Tailwind Pattern) |
## Best Practices
### ✅ DO
- Follow established patterns and conventions
- Write clean, maintainable code
- Add appropriate documentation
- Test thoroughly before deploying
### ❌ DON'T
- Skip testing or validation
- Ignore error handling
- Hard-code configuration values
© aj-geddes · MIT · aj-geddes/useful-ai-prompts