agentleFS
AgentCTOAgentCTO/claude-skills/skills/type-craft/SKILL.md

type-craft

Skill2 starsChanged 10 months agoMITView on GitHub

Builds mathematically-grounded CSS typography and layout systems for web projects. Generates type scales, spacing tokens, font pairings, and accessible color schemes as production-ready CSS custom properties. Use when the user wants to "set up typography for my site", "create a type system", "help me pick fonts", "generate CSS variables for typography", "make my site look more professional", "set up a fluid type scale", or any web typography, spacing, or layout task.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    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. Distinctive:

    Before starting, load references/typography-guide.md -- a comprehensive design reference covering type scales, golden ratio layouts, …

    line 18
  2. Distinctive:

    Follow steps 1-7 in order.

    line 28
  3. Distinctive:

    Ask the user about their project.

    line 32
  4. Distinctive:

    Keep discovery concise: 3-5 questions max in one message.

    line 40
  5. Distinctive:

    After discovery, identify the recommended type scale ratio range using the Ratios and when to use them table in typography-guide.md:

    line 42
  6. Distinctive:

    Run the generator with all chosen parameters:

    line 119
  7. Distinctive:

    Ask about brand personality, audience, performance preferences

    line 179
  8. Distinctive:

    Use 8px grid spacing, golden ratio layout

    line 182
  9. Distinctive:

    Verify WCAG AA contrast, check fluid zoom behavior

    line 184
  10. Very specific:

    Create styles/typography.css in the project

    line 185
  11. Distinctive:

    Use 8px grid spacing, 65ch max line width

    line 197
  12. Distinctive:

    Verify line length, line height, contrast

    line 199
  13. Distinctive:

    Use 8px grid spacing (Material Design alignment)

    line 212
  14. Very specific:

    Verify dark mode contrast ratios (especially --text-muted)

    line 214

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

Type Craft

A structured, human-in-the-loop workflow for building professional typography and layout systems for web projects. Every value traces back to mathematical relationships (modular scales, golden ratio, Fibonacci sequence) that produce visually harmonious results.

Before starting, load references/typography-guide.md -- a comprehensive design reference covering type scales, golden ratio layouts, typographic best practices, accessibility requirements, fluid typography, optical alignment, and a complete production-ready CSS system. Reference it throughout the workflow.

Workflow Overview

Discovery → Scale → Fonts → Spacing/Layout → Generate CSS → Accessibility → Deliver
    |                                              |
    └──────────── Refine ──────────────────────────┘

Follow steps 1-7 in order. The user may loop back from step 5 to refine choices.

Step 1: Discovery

Ask the user about their project. Gather these essentials:

  • Project type -- Marketing site, documentation, blog, dashboard, e-commerce, landing page, web app?
  • Content density -- Text-heavy (docs, blog), mixed (marketing), data-heavy (dashboard), minimal (landing)?
  • Brand personality -- Elegant, technical, playful, minimal, bold, luxurious?
  • Audience -- Developers, general consumers, enterprise, creative professionals?
  • Constraints -- Existing framework (Tailwind, Bootstrap)? Existing fonts? Dark mode needed? Performance budget (system fonts only)?

Keep discovery concise: 3-5 questions max in one message.

After discovery, identify the recommended type scale ratio range using the Ratios and when to use them table in typography-guide.md:

Project TypeRecommended Ratio
Dense dashboards, data UIsMinor Second (1.067) or Major Second (1.125)
Mobile apps, e-commerceMajor Second (1.125) or Minor Third (1.2)
Documentation, blogsMinor Third (1.2)
General websites (default)Major Third (1.25)
Editorial, mixed contentPerfect Fourth (1.333)
Landing pages, promotionalAugmented Fourth (1.414)
Banners, hero-heavy sitesPerfect Fifth (1.5)
Luxury brands, creativeGolden Ratio (1.618)

Step 2: Scale Selection

Based on discovery, recommend a type scale ratio with reasoning. Present the computed sizes by running the generator:

scripts/generate_type_system.py --ratio major-third --json

Show the user the step-by-step scale (step, pixel size, rem value, typical use) and explain why the ratio fits their project. If the user wants fluid (responsive) type, add --fluid:

scripts/generate_type_system.py --ratio major-third --fluid --json

Expected output: A JSON object with the type scale array showing each step's name, size, and recommended use.

Let the user confirm or request a different ratio before proceeding.

Step 3: Font Selection

Recommend font pairings based on the project personality identified in Step 1. Present 2-3 options from these categories.

System stacks (zero network cost, best performance):

  • Sans-serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, ...
  • Neo-Grotesque: Inter, Roboto, 'Helvetica Neue', ...
  • Best for: dashboards, web apps, performance-critical projects

Google Font pairings (see the Font pairing section in typography-guide.md):

  • Playfair Display + Montserrat -- editorial elegance
  • Montserrat + Merriweather -- geometric + reading comfort
  • Poppins + Lora -- contemporary + warm
  • Best for: marketing sites, blogs, brand-heavy projects

Superfamilies (designed as matching sets):

  • Source family (Sans/Serif/Code) by Adobe
  • Roboto family (Sans/Slab/Mono) by Google
  • Best for: projects needing serif, sans, and mono in one cohesive system

Available presets for the generator: system, inter, playfair-montserrat, montserrat-merriweather, poppins-lora, source-family, roboto-family, or custom with --heading-font and --body-font.

Step 4: Spacing and Layout

Choose a spacing system based on the project needs. Refer to the Layout Grids and Golden Ratio and Fibonacci sections in typography-guide.md.

Spacing systems:

SystemCharacterBest For
8px gridEven, predictable stepsMost projects (default), Material Design
FibonacciAccelerating steps (tight small, expansive large)Organic, editorial layouts
Golden ratioPhi-based proportionsLuxury, high-end designs

Layout patterns:

  • 12-column grid -- Standard, maximum flexibility (divisible by 1, 2, 3, 4, 6)
  • Golden ratio split -- 1.618fr 1fr (~61.8% / ~38.2%) for content + sidebar
  • Fibonacci columns -- 5fr 8fr (2-col), 2fr 3fr 5fr (3-col)

Apply Gestalt proximity rules (from the Gestalt proximity section in typography-guide.md):

  • Internal spacing must always be less than external spacing
  • Heading margin-top should be 2-3x larger than heading margin-bottom
  • Card padding must be less than the gap between cards

Step 5: Generate CSS

Run the generator with all chosen parameters:

scripts/generate_type_system.py --ratio major-third --fonts system --spacing 8px-grid --color-mode light --fluid

For custom fonts:

scripts/generate_type_system.py --ratio 1.25 --fonts custom --heading-font "'Playfair Display', serif" --body-font "Inter, sans-serif" --fluid

Expected output: A complete :root { ... } CSS block with custom properties for type scale, line heights, tracking, weights, measure, spacing tokens, layout proportions, and colors, followed by base styles for body, headings, prose, and the flow utility.

Present the output to the user. If they want adjustments, re-run with different parameters.

Step 6: Accessibility Check

Review the generated system against WCAG requirements. Consult the Accessibility section in typography-guide.md.

Verify these minimums:

CheckRequirementHow to Verify
Body font sizeAt least 16px (1rem)Confirm --text-base is 1rem or larger
Body line heightAt least 1.5Confirm --leading-normal is 1.5
Text contrast (AA)4.5:1 for body, 3:1 for large textCheck generated color values
Line lengthMax 75chConfirm --measure-wide is 80ch or less
Fluid type zoomclamp() includes rem componentConfirm no pure-vw preferred values
Font weight400+ for body textConfirm --weight-normal is 400

Flag any issues and suggest fixes. Common problems:

  • Dark mode colors failing contrast -- adjust --text-muted to a lighter shade
  • Heading sizes too large on mobile when not using --fluid -- recommend switching to fluid
  • Line height too tight on small text -- verify captions use --leading-loose (1.8)

Step 7: Deliver

Present the final CSS system with integration guidance:

  1. Where to put it -- Create a typography.css or add to the project's existing CSS custom properties file. For Tailwind projects, extend the theme config. For CSS-in-JS, convert to a theme object.
  2. How to use the flow utility -- Explain the .flow > * + * pattern for automatic vertical rhythm.
  3. Google Font loading (if applicable) -- Provide the <link> tag or @import for chosen fonts. Recommend font-display: swap and preconnect hints:
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  4. Responsive notes -- If fluid type is used, explain that the scale adjusts automatically between ~360px and ~1240px viewports. If static, suggest breakpoint overrides.

Offer to create the CSS file directly in the user's project directory.

Examples

Example 1: Marketing site

User says: "Set up typography for my Next.js marketing site"

Actions:

  1. Ask about brand personality, audience, performance preferences
  2. Recommend Perfect Fourth (1.333) for strong editorial hierarchy
  3. Suggest Playfair Display + Montserrat for elegance
  4. Use 8px grid spacing, golden ratio layout
  5. Generate with --ratio perfect-fourth --fonts playfair-montserrat --fluid --color-mode light
  6. Verify WCAG AA contrast, check fluid zoom behavior
  7. Create styles/typography.css in the project

Result: A complete fluid type system with serif headings, sans body, and golden-ratio content/sidebar split.

Example 2: Documentation site

User says: "I need a type scale for our docs site, it's very text-heavy"

Actions:

  1. Identify: text-heavy, technical audience, readability priority
  2. Recommend Minor Third (1.2) for compact, clear hierarchy
  3. Suggest system fonts (zero load time) or Source family (sans + serif + mono)
  4. Use 8px grid spacing, 65ch max line width
  5. Generate with --ratio minor-third --fonts system --fluid
  6. Verify line length, line height, contrast
  7. Deliver with emphasis on the --measure-base: 65ch constraint

Result: A tight, readable scale optimized for long-form technical content.

Example 3: Dashboard

User says: "Help me with typography for a fintech dashboard, needs dark mode"

Actions:

  1. Identify: data-dense, professional audience, dark mode required
  2. Recommend Major Second (1.125) for subtle steps that don't overwhelm data
  3. Suggest Inter (designed for UI) or system stack
  4. Use 8px grid spacing (Material Design alignment)
  5. Generate with --ratio major-second --fonts inter --spacing 8px-grid --color-mode dark
  6. Verify dark mode contrast ratios (especially --text-muted)
  7. Deliver with notes on data table typography and monospace for numbers

Result: A compact dark-mode scale with subtle hierarchy suited to data-dense interfaces.

Troubleshooting

Error: Fluid type not scaling on resize

Cause: The clamp() preferred value uses pure vw units without a rem component, which also breaks browser zoom (WCAG 1.4.4 failure).

Solution: Always use the --fluid flag which generates rem + vw formulas. Never write clamp(1rem, 2vw, 2rem) -- use clamp(1rem, 0.95rem + 0.25vw, 1.125rem) instead.

Error: Fonts not loading / FOUT flash

Cause: Missing preconnect hints or no font-display strategy.

Solution: Add preconnect links in <head> before the font stylesheet. Use font-display: swap to show system fallback immediately while the web font loads. The generated system includes system font fallbacks in every stack for this reason.

Error: Spacing looks inconsistent across components

Cause: Mixing multiple spacing systems (e.g., 8px grid in some places, arbitrary values in others).

Solution: Use only the generated --space-* tokens for all padding, margin, and gap values. The flow utility (.flow > * + *) handles vertical rhythm automatically. Never use hardcoded pixel values for spacing.

Error: Headings appear disconnected from their content

Cause: Equal spacing above and below headings violates Gestalt proximity.

Solution: Heading margin-top should be 2-3x margin-bottom. The generated flow utility handles this: h2 gets --space-xl above and --space-xs below. See the Gestalt proximity section in typography-guide.md.

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.