fonts
Skill3 starsChanged 36 days agoMITView on GitHub
Add, swap, or remove a self-hosted web font (latin variable woff2 from fontsource, localized via next/font/local). Use when adding a font role, or debugging font loading, preload, or CLS.
4 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- decentraland/sdk-skillstheir own version, first seen Oct 25, 2026
- nrjdalal/zerostarteredited, first seen Oct 8, 2026
- aspose-words/agentic-net-examplestheir own version, first seen Sep 9, 2026
- adeluise/fontstheir own version, first seen Apr 10, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- nrjdalal/zerostarter★ 6593% same
Wrote their own version · 3
- aspose-words/agentic-net-examples★ 4same name
- decentraland/sdk-skills★ 4same name
- adeluise/fonts★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-packageSkill
- agent-browserSkill
- api-endpointSkill
- auditSkill
- codebase-mapSkill
- db-migrationSkill
- designSkill
- devSkill
- docker-testSkill
- doc-syncSkill
- gh-commitSkill
- iceboxSkill
- ignore-syncSkill
- portlessSkill
- releaseSkill
- runtime-apisSkill
- shadcn-syncSkill
- shipSkill
- skills-managerSkill
- ui-verifySkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Verify loading: dev CSS emits hashed /_next/static/media/*.woff2 urls plus the generated "<family> Fallback" faces, and a production build …
- Distinctive: line 34
If a public page changed, check CLS and LCP for layout shift before shipping.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
[!CAUTION] Synced from https://github.com/nrjdalal/zerostarter. Customize this skill or remove this note to stop syncing.
Fonts
Every font is self-hosted through next/font/local. That loader is what generates the metric-adjusted "<family> Fallback" faces that keep CLS near zero, so it is not optional. Do NOT switch to fontsource CSS imports: the bundler resolves their url() references to node_modules paths that 404 in dev, and they emit no compiler-only fallback metrics.
Layout
web/next/src/fonts/*.woff2, the vendored latin variable filesweb/next/src/lib/fonts.ts, onelocalFontper family, each exporting a CSS variableweb/next/src/app/layout.tsx, where the variables are applied on<html>web/next/src/app/globals.css@theme inline, where roles chain to the font variables (--font-sans: var(--font-dm-sans), sans-serif)
Add or swap a font
Fetch the latin variable file from the fontsource CDN directly, no dependency needed:
curl -L -o web/next/src/fonts/<name>-latin-wght-normal.woff2 \ https://cdn.jsdelivr.net/npm/@fontsource-variable/<name>/files/<name>-latin-wght-normal.woff2- Declare it in
web/next/src/lib/fonts.ts:localFont({ src: "../fonts/<file>", variable: "--font-<name>", weight: "<min> <max>" }). The weight range is MANDATORY for a variable font: omit it and the face pins to 400, so every bold glyph becomes faux-bold synthesis. Read the range from the fontsource CSS,curl -s https://cdn.jsdelivr.net/npm/@fontsource-variable/<name>/index.css | grep font-weight. A serif also setsadjustFontFallback: "Times New Roman"(the metrics default to Arial). - Apply the export's
.variableon<html>inlayout.tsx. - Wire the role in
globals.css@theme inline:--font-<role>: var(--font-<name>), <generic>. - Verify loading: dev CSS emits hashed
/_next/static/media/*.woff2urls plus the generated"<family> Fallback"faces, and a production build (Vercel preview, protection-bypass header) emits one<link rel="preload" as="font">per file, with no font 404s. - If a public page changed, check CLS and LCP for layout shift before shipping.
Notes
- The data table measures header labels from bundled metrics of the sans woff2, generated by
packages/scripts/src/data-table-metrics.tsinto.generated/data-table-metrics.json(in the web build, dev, and check-types chains). Swapping the sans re-measures automatically on the next run, but the script'sFONTpath must point at the new file: update it when the filename changes. - Preload is scoped by import. Any font in
web/next/src/lib/fonts.tspreloads on every page, because the root layout imports it. To scope a font to specific routes, declare it in a module only those routes import: author-only fonts live inweb/next/src/lib/marketing/fonts.ts, with woff2 underweb/next/src/fonts/marketing/. - DM Sans vendors its italics:
srcis an array of{ path, style }entries under one top-levelweight. Mono renders synthetic oblique for italics, by choice. - A non-variable font takes the per-weight files, with
srcas an array carrying aweightper entry. - To remove a font, delete the woff2, its
localFontdefinition, the<html>variable, and theglobals.cssrole, then grep the variable name to catch stragglers.
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.

