Review existing CSS against established Tailwind + semantic component patterns, checking naming, dark mode, tests, and documentation
/plugin marketplace add 2389-research/claude-plugins/plugin install css-development@2389-research-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Reviews existing CSS code against established patterns and provides specific, actionable feedback:
@apply compositionThis is a sub-skill of css-development - typically invoked automatically via the main skill.
Use when:
This skill validates against patterns documented in the main css-development skill:
Semantic naming: .button-primary not .btn-blue
Tailwind composition: Use @apply to compose utilities
Dark mode: Include dark: variants
Test coverage: Static CSS + component rendering tests
Documentation: Usage comments above classes
When this skill is invoked, create a TodoWrite checklist and work through validation systematically.
"I'm using the css-development:validate skill to review this CSS against established patterns."
Use the TodoWrite tool:
Validating CSS:
- [ ] Read CSS files (load components.css and related styles)
- [ ] Check semantic naming (verify descriptive class names)
- [ ] Verify @apply usage (ensure Tailwind composition)
- [ ] Check dark mode coverage (confirm dark: variants present)
- [ ] Look for composition opportunities (identify reusable patterns)
- [ ] Verify test coverage (check static and rendering tests exist)
- [ ] Check documentation (ensure usage comments present)
- [ ] Report findings (provide file:line references and suggestions)
Action: Use Read tool to load CSS files for review
Files to check:
styles/components.css (main semantic components)What to capture:
@apply vs. inline utilitiesMark as completed when files are loaded and understood.
Action: Review all class names for semantic, descriptive naming
Good patterns:
.button-primary, .card-header, .form-field, .empty-state.session-card, .marketing-hero.badge-success, .button-dangerBad patterns (report these):
.btn-blue, .card-sm, .text-big.btn, .hdr, .desc.component, .item, .thing.style1, .custom, .specialFor each issue:
Mark as completed when all class names reviewed.
Action: Check that Tailwind utilities are composed via @apply, not scattered in markup
Good patterns:
.button-primary {
@apply bg-indigo-500 hover:bg-indigo-700 px-6 py-3 rounded-lg;
}
Bad patterns (report these):
<!-- Utilities in markup instead of semantic class -->
<button class="bg-indigo-500 hover:bg-indigo-700 px-6 py-3 rounded-lg">
Click me
</button>
Check:
@apply?For each issue:
@applyMark as completed when @apply usage is reviewed.
Action: Verify colored and interactive elements have dark: variants
What needs dark mode:
What typically doesn't need dark mode:
Pattern to check:
/* Good - has dark mode */
.card {
@apply bg-white dark:bg-gray-800 text-gray-900 dark:text-white;
}
/* Bad - missing dark mode */
.card {
@apply bg-white text-gray-900;
}
For each issue:
dark: utilities to addMark as completed when dark mode coverage is checked.
Action: Identify repeated patterns that could use existing classes or be extracted
Look for:
Example issue:
/* Repeated pattern */
.card-primary {
@apply bg-white dark:bg-gray-800 rounded-lg shadow-md p-6;
}
.card-secondary {
@apply bg-white dark:bg-gray-800 rounded-lg shadow-md p-6;
@apply border-2 border-gray-200;
}
/* Suggestion: Extract base .card class, add variants */
.card {
@apply bg-white dark:bg-gray-800 rounded-lg shadow-md p-6;
}
.card-secondary {
@apply border-2 border-gray-200;
}
For each opportunity:
Mark as completed when composition opportunities are identified.
Action: Check that CSS classes have test coverage
Static CSS tests - Check styles/__tests__/components.test.ts:
it('should have button-primary class', () => {
expect(content).toContain('.button-primary');
});
Component rendering tests - Check component test files:
it('applies button-primary class', () => {
render(<Button variant="primary">Click</Button>);
expect(screen.getByRole('button')).toHaveClass('button-primary');
});
For classes without tests:
Mark as completed when test coverage is checked.
Action: Verify components have usage documentation
Required documentation:
Example:
/* Button component - Primary action button with hover lift effect
Usage: <button className="button-primary">Click me</button> */
.button-primary {
...
}
For classes without documentation:
Mark as completed when documentation is checked.
Action: Compile all findings into structured report
Report format:
## CSS Validation Report
### ✅ Good Patterns Found
- `.button-primary` follows semantic naming (components.css:15)
- Dark mode variants present on interactive elements (components.css:17-19)
- Tests cover className application (Button.test.tsx:23)
- Documentation comments present (components.css:14)
### ⚠️ Issues Found
#### Semantic Naming Issues
**components.css:45** - `.btn-blue` uses utility naming
- Current: `.btn-blue`
- Suggestion: Rename to `.button-secondary` for consistency with `.button-primary`
- Impact: Update 3 component files
**components.css:67** - `.card-sm` uses size in name
- Current: `.card-sm`
- Suggestion: Extract size to utility or rename to `.card-compact` for semantic meaning
- Impact: Update 5 usages
#### Missing Dark Mode Variants
**components.css:78** - `.card-header` missing dark mode
- Current: `@apply bg-gray-100 text-gray-900`
- Suggestion: Add `dark:bg-gray-800 dark:text-white`
- Impact: Visual bug in dark mode
**components.css:92** - `.badge` missing dark mode
- Current: `@apply bg-indigo-100 text-indigo-800`
- Suggestion: Add `dark:bg-indigo-900 dark:text-indigo-200`
- Impact: Low contrast in dark mode
#### Missing Test Coverage
**components.css:102** - `.empty-state` has no tests
- Missing: Both static CSS test and component rendering test
- Suggestion: Add tests to verify class exists and renders correctly
#### Missing Documentation
**components.css:115** - `.session-card` lacks usage comment
- Suggestion: Add comment explaining purpose and usage example
### 📊 Summary
- **Total classes reviewed:** 12
- **Issues found:** 7
- **Priority:** 2 high (dark mode bugs), 3 medium (naming), 2 low (docs)
### 🎯 Recommended Actions
1. **High priority:** Add dark mode variants to `.card-header` and `.badge` (visual bugs)
2. **Medium priority:** Rename `.btn-blue` → `.button-secondary` for consistency
3. **Medium priority:** Add test coverage for `.empty-state`
4. **Low priority:** Add documentation comments to undocumented classes
Would you like me to fix these issues, or would you prefer to address them manually?
Mark as completed when report is generated and presented.
After generating the validation report:
Ask user what they want to do next:
Offer to invoke refactor skill if there are structural issues that need refactoring
Suggest committing any fixes made
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 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 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.