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.
In this repository4 other files it gives its agents.
- brand-scoutSkill
- incremental-writesSkill
- jest-testSkill
- llms-txtSkill
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
- Distinctive: line 18
Before starting, load references/typography-guide.md -- a comprehensive design reference covering type scales, golden ratio layouts, …
- Distinctive: line 28
Follow steps 1-7 in order.
- Distinctive: line 32
Ask the user about their project.
- Distinctive: line 40
Keep discovery concise: 3-5 questions max in one message.
- Distinctive: line 42
After discovery, identify the recommended type scale ratio range using the Ratios and when to use them table in typography-guide.md:
- Distinctive: line 119
Run the generator with all chosen parameters:
- Distinctive: line 179
Ask about brand personality, audience, performance preferences
- Distinctive: line 182
Use 8px grid spacing, golden ratio layout
- Distinctive: line 184
Verify WCAG AA contrast, check fluid zoom behavior
- Very specific: line 185
Create styles/typography.css in the project
- Distinctive: line 197
Use 8px grid spacing, 65ch max line width
- Distinctive: line 199
Verify line length, line height, contrast
- Distinctive: line 212
Use 8px grid spacing (Material Design alignment)
- Very specific: line 214
Verify dark mode contrast ratios (especially --text-muted)
≈ “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.
Files
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 Type | Recommended Ratio |
| Dense dashboards, data UIs | Minor Second (1.067) or Major Second (1.125) |
| Mobile apps, e-commerce | Major Second (1.125) or Minor Third (1.2) |
| Documentation, blogs | Minor Third (1.2) |
| General websites (default) | Major Third (1.25) |
| Editorial, mixed content | Perfect Fourth (1.333) |
| Landing pages, promotional | Augmented Fourth (1.414) |
| Banners, hero-heavy sites | Perfect Fifth (1.5) |
| Luxury brands, creative | Golden 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 --jsonShow 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 --jsonExpected 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:
| System | Character | Best For |
| 8px grid | Even, predictable steps | Most projects (default), Material Design |
| Fibonacci | Accelerating steps (tight small, expansive large) | Organic, editorial layouts |
| Golden ratio | Phi-based proportions | Luxury, 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 --fluidFor custom fonts:
scripts/generate_type_system.py --ratio 1.25 --fonts custom --heading-font "'Playfair Display', serif" --body-font "Inter, sans-serif" --fluidExpected 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:
| Check | Requirement | How to Verify |
| Body font size | At least 16px (1rem) | Confirm --text-base is 1rem or larger |
| Body line height | At least 1.5 | Confirm --leading-normal is 1.5 |
| Text contrast (AA) | 4.5:1 for body, 3:1 for large text | Check generated color values |
| Line length | Max 75ch | Confirm --measure-wide is 80ch or less |
| Fluid type zoom | clamp() includes rem component | Confirm no pure-vw preferred values |
| Font weight | 400+ for body text | Confirm --weight-normal is 400 |
Flag any issues and suggest fixes. Common problems:
- Dark mode colors failing contrast -- adjust
--text-mutedto 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:
- Where to put it -- Create a
typography.cssor 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. - How to use the flow utility -- Explain the
.flow > * + *pattern for automatic vertical rhythm. - Google Font loading (if applicable) -- Provide the
<link>tag or@importfor chosen fonts. Recommendfont-display: swapand preconnect hints:<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> - 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:
- Ask about brand personality, audience, performance preferences
- Recommend Perfect Fourth (1.333) for strong editorial hierarchy
- Suggest Playfair Display + Montserrat for elegance
- Use 8px grid spacing, golden ratio layout
- Generate with
--ratio perfect-fourth --fonts playfair-montserrat --fluid --color-mode light - Verify WCAG AA contrast, check fluid zoom behavior
- Create
styles/typography.cssin 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:
- Identify: text-heavy, technical audience, readability priority
- Recommend Minor Third (1.2) for compact, clear hierarchy
- Suggest system fonts (zero load time) or Source family (sans + serif + mono)
- Use 8px grid spacing, 65ch max line width
- Generate with
--ratio minor-third --fonts system --fluid - Verify line length, line height, contrast
- Deliver with emphasis on the
--measure-base: 65chconstraint
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:
- Identify: data-dense, professional audience, dark mode required
- Recommend Major Second (1.125) for subtle steps that don't overwhelm data
- Suggest Inter (designed for UI) or system stack
- Use 8px grid spacing (Material Design alignment)
- Generate with
--ratio major-second --fonts inter --spacing 8px-grid --color-mode dark - Verify dark mode contrast ratios (especially
--text-muted) - 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.
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
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.

