agentleFS
aaddrickaaddrick/claude-pipeline/.claude/skills/bulletproof-frontend/SKILL.md

bulletproof-frontend

Skill129 starsChanged 9 months agoMITView on GitHub

Bulletproof CSS and frontend design principles from "Handcrafted CSS" by Dan Cederholm. Apply when writing CSS, HTML, Blade templates, or reviewing frontend code. CSS is king — refactor Tailwind when encountered.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test with varying text sizes and content lengths

    line 20
  2. Distinctive:

    Use relative units (em, %, rem) over fixed pixels

    line 21
  3. Distinctive:

    Use modern CSS with appropriate fallbacks

    line 26
  4. Distinctive:

    Always consult the style guide when implementing UI to ensure consistency with existing patterns.

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bulletproof Frontend Design

CSS is king. Semantic, maintainable CSS over utility-class frameworks. When you encounter Tailwind, refactor it to proper CSS.

Design Values: For spacing scales, typography sizes, color palettes, contrast ratios, and component specifications, see ui-design-fundamentals. This skill focuses on CSS implementation patterns.

Core Philosophy

"Always ask: What happens if...?" — Design for the unexpected. Build interfaces that remain functional and readable regardless of content length, text size, browser, or device.

The Three Pillars

1. Bulletproof Design

  • Design for flexibility, not fixed scenarios
  • Test with varying text sizes and content lengths
  • Use relative units (em, %, rem) over fixed pixels

2. Progressive Enrichment

  • Reward capable browsers with advanced CSS
  • Websites don't need to look identical in every browser — they need to be functional
  • Use modern CSS with appropriate fallbacks

3. Reevaluate Past Methods

  • Question whether old hacks are still necessary
  • Simplify where new CSS features allow
  • Refactor utility frameworks to semantic CSS

Quick Reference

PatternWhen to Use
CSS custom propertiesTheming, spacing, colors
BEM namingComponent class structure
Cascade layersManaging specificity
Container queriesComponent-based responsiveness
:has() selectorParent/sibling selection
CSS nestingOrganizing related styles

Modern CSS Essentials

/* :has() — Style based on children */
.card:has(img) { padding-top: 0; }
.form:has(:invalid) { border-color: var(--color-error); }

/* Container queries — Component responsiveness */
.container { container-type: inline-size; }
@container (min-width: 400px) { .card { display: flex; } }

/* CSS nesting — Clean organization */
.card {
    padding: var(--space-md);
    &:hover { box-shadow: var(--shadow-lg); }
    & .card__title { font-weight: var(--font-bold); }
}

/* Cascade layers — Controlled specificity */
@layer reset, base, components, utilities;

Tailwind → Semantic CSS

{{-- BEFORE: Utility classes --}}
<div class="flex items-center p-4 bg-white rounded-lg shadow">

{{-- AFTER: Semantic CSS --}}
<div class="card">
.card {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
CSS ApproachTailwind
Readable HTMLBloated class attributes
Styles in one placeScattered in markup
Easy to refactorFind-and-replace nightmare
Cacheable stylesheetsRepeated classes

Reference Files

FileContent
css-architecture.mdCustom properties, BEM, layers, file organization
accessibility-patterns.mdFocus, screen readers, motion, dark mode
responsive-patterns.mdBreakpoints, container queries, fluid sizing
reference.mdComplete patterns and Blade components

Project Style Guide

Project-specific implementation: docs/STYLEGUIDE.md

Contains the complete design system for the application:

  • Design tokens (colors, spacing, typography)
  • Component patterns (buttons, cards, alerts, tables)
  • Blade component documentation
  • Dark mode implementation
  • Accessibility requirements

Always consult the style guide when implementing UI to ensure consistency with existing patterns.

Related Skills

  • ui-design-fundamentals — Design values: spacing scales, type scales, colors, contrast ratios, component anatomy (buttons, forms, cards, etc.)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.