agentleFS
BostonOrangeBostonOrange/claude-code-framework/skills/scaffold-design-system/SKILL.md

scaffold-design-system

Skill2 starsChanged 6 months agoMITView on GitHub

Bootstrap design system infrastructure — detect or create theme tokens, base components, icon library, and CLAUDE.md design conventions

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If .claude/rules/design-system.md doesn't exist, create it from the framework template.

    line 78
  2. Distinctive:

    Read the theme/token files and extract:

    line 91
  3. Distinctive:

    Run a quick check to verify the design system is documented:

    line 101
  4. Very specific:

    Verify at least 4 of 5 design sections are filled (not placeholder {{...}} values).

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Scaffold Design System

Bootstrap design system infrastructure for a project. Detects existing design patterns or creates new ones.

Usage

/scaffold-design-system                    — Auto-detect and scaffold (interactive)
/scaffold-design-system detect             — Detect existing design system, document in CLAUDE.md
/scaffold-design-system untitled-ui        — Scaffold Untitled UI conventions
/scaffold-design-system shadcn             — Scaffold shadcn/ui conventions

Process

Phase 1: Discovery

Scan the project to understand what design infrastructure already exists.

1.1 — Theme/Token files:

find . -type f \( -name "theme.css" -o -name "tokens.*" -o -name "design-tokens.*" -o -name "globals.css" -o -name "variables.css" \) -not -path "*/node_modules/*" 2>/dev/null

1.2 — Component library:

# Check for base/ui component directories
find . -type d \( -name "base" -o -name "ui" -o -name "primitives" -o -name "atoms" \) -path "*/components/*" -not -path "*/node_modules/*" 2>/dev/null
# Count component files in those directories
find . -path "*/components/base/*" -o -path "*/components/ui/*" | grep -E "\.(tsx|jsx|vue)$" | wc -l

1.3 — Icon library from package.json:

grep -E "untitledui|lucide|heroicons|phosphor|tabler|ionicons|feather" package.json 2>/dev/null

1.4 — CSS framework:

grep -E "tailwindcss|@tailwindcss|styled-components|emotion|vanilla-extract|css-modules" package.json 2>/dev/null

1.5 — Existing color patterns in components:

# Count raw vs semantic color usage
echo "Raw Tailwind colors:"
grep -rn "text-gray-\|bg-gray-\|border-gray-\|text-blue-\|bg-blue-" --include="*.tsx" --include="*.jsx" . | grep -v node_modules | wc -l

echo "Semantic tokens:"
grep -rn "text-primary\|text-secondary\|text-tertiary\|bg-primary\|bg-secondary\|fg-primary" --include="*.tsx" --include="*.jsx" . | grep -v node_modules | wc -l

1.6 — Accessibility library:

grep -E "react-aria|radix-ui|headlessui|ariakit" package.json 2>/dev/null

Phase 2: Assess Current State

Based on discovery, classify the project:

StateCriteriaAction
No design systemNo theme tokens, no component library, raw Tailwind everywhereFull scaffold
Partial design systemSome tokens or components exist but gaps remainFill gaps, document existing
Mature design systemComplete tokens, component library, icon libraryDocument in CLAUDE.md only

Phase 3: Scaffold (if needed)

Based on the chosen design system type:

3.1 — Design System Rule: If .claude/rules/design-system.md doesn't exist, create it from the framework template. Customize the rule's guidance to match the project's specific tokens and component names.

3.2 — Document in CLAUDE.md: Fill the design system section in CLAUDE.md:

  • ## Design System → ### Color Usage: Document which semantic tokens to use, with examples from the actual theme file
  • ### Component Imports: List the base components with their import paths and key props
  • ### Icon Usage: Document the icon library, import pattern, and sizing convention
  • ### Card & Layout Patterns: Document the project's card styling pattern (border, background, shadow, radius)
  • ### Dark Mode: Document how dark mode works (tokens, class-based, media query)

3.3 — Fill CLAUDE.md from actual project state:

Read the theme/token files and extract:

  • The semantic color token names that exist (e.g., text-primary, bg-brand-solid)
  • The component library import paths
  • The icon library name and import pattern
  • The card/layout patterns in use

Replace any {{DESIGN_*}} placeholders with concrete, project-specific values.

Phase 4: Validate

Run a quick check to verify the design system is documented:

# Check CLAUDE.md has design section filled
grep -c "Color Usage\|Component Imports\|Icon Usage\|Card.*Pattern\|Dark Mode" CLAUDE.md

Verify at least 4 of 5 design sections are filled (not placeholder {{...}} values).

Phase 5: Report

## Design System Scaffold Report

### Project State
- **Theme tokens**: {found/created/missing}
- **Component library**: {found/none} — {count} components in {path}
- **Icon library**: {name or "none"}
- **Accessibility library**: {name or "none"}
- **Color usage**: {X}% semantic, {Y}% raw Tailwind

### Changes Made
| File | Change | Reason |
|------|--------|--------|
| CLAUDE.md | Filled design system section | Document conventions |
| .claude/rules/design-system.md | Created/updated | Enforce token/component usage |

### Design System Health
- Token coverage: {X}% of components use semantic tokens
- Component library usage: {X}% of interactive elements use base components
- Icon library usage: {X}% of icons use the library vs inline SVGs

### Recommendations
- {what to improve — e.g., "Add semantic tokens for status colors"}
- {what to add — e.g., "Create a Badge base component"}

### Next Steps
1. Review the design conventions in CLAUDE.md
2. Run `/validate` to check existing code against the new rules
3. Run `/team review` to get a full UI/UX assessment

Edge Cases

ScenarioBehavior
Backend-only project (Go, Python, Java)Skip — report "No frontend, design system not applicable"
Project has no package.jsonTry to detect framework from other config files
Multiple CSS frameworksDocument the primary one, note the others
Component library exists but isn't documentedDocument it in CLAUDE.md without creating new components
CLAUDE.md has {{DESIGN_*}} placeholdersFill them with discovered values
CLAUDE.md already has design section filledUpdate with any new findings, don't overwrite existing documentation

Related Skills

  • /improve — General self-improvement (includes design section, but less thorough)
  • /validate — Code validation (includes design consistency checks after this skill runs)
  • /team review — Full review including UI/UX agent (enhanced with design compliance)

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.