fonts

fonts is a skill for Claude Code, Codex from teamniteo/hakuto. It costs 139 tokens per session (2,569 once invoked), scanned A, original, MIT.

A guide for adding and configuring web fonts in an Astro website, including the font files, weights and CSS names the site uses.

In plain words
What is it for?
Use it when adding Google, Fontsource or local fonts, changing typography, or improving font loading; configuration changes require restarting the development server.
Why use it?
It helps the site load custom typography in a way Astro can optimize and serve from the site itself.

Skill for Claude CodeCodex

Part of the hakuto plugin — 14 skills, 1 command, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/teamniteo/hakuto/fonts
Any agent
npx skills add teamniteo/hakuto --skill fonts
Clone the repo
git clone --depth 1 https://github.com/teamniteo/hakuto

Made for: Claude Code, Codex.

Or install hakuto, the plugin that ships this one along with the rest of its 14 skills, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fonts

README.md
[![agentmods](https://agentmods.dev/badge/skills/teamniteo/hakuto/fonts.svg)](https://agentmods.dev/skills/teamniteo/hakuto/fonts)
Your own site
<a href="https://agentmods.dev/skills/teamniteo/hakuto/fonts"><img src="https://agentmods.dev/badge/skills/teamniteo/hakuto/fonts.svg" alt="Measured on agentmods" height="20"></a>
Per session 139 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,569 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00139 $0.02569
Opus 5 $0.00069 $0.01285
Sonnet 5 $0.00028 $0.00514
Haiku 4.5 $0.00014 $0.00257

Measured 4d ago against content hash 5e29a396a95b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fonts scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/fonts/SKILL.md · 330 lines

How it starts

The opening of the file, as written. The whole thing — 330 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fonts (Astro Fonts API)

Configure performant web fonts with automatic optimization, preloading, and privacy-focused delivery from your own site.

Critical Workflow Order

Font setup MUST follow this exact sequence. The <Font /> component and CSS variables are only available after the dev server processes the config.

Step 1: Configure astro.config.mjs (FIRST)

Add fonts to the top-level fonts array (Astro 6+ promoted from experimental.fonts):

import { defineConfig, fontProviders } from "astro/config";

export default defineConfig({
  fonts: [{
    provider: fontProviders.google(),
    name: "Crimson Pro",
    cssVariable: "--font-display",
    weights: [400, 600, 700],
    styles: ["normal"]
  }]
});

Note: Astro ≤ 5.x required experimental: { fonts: [...] }. Astro 6.x graduated the API; wrap in experimental only if you're on an older Astro.

Step 2: Restart the dev/preview server

The dev server reads astro.config.mjs once at startup. Without a restart, import { Font } from 'astro:assets' will fail and the CSS variables won't exist yet.

How to restart depends on how the server was started — pick the one that matches your setup:

  • Hakuto preview hook (this repo): the preview server is managed externally; ask the user to restart it, or wait for the next file-save hook trigger.
  • Manual bun run dev / bun run preview: stop the process (Ctrl-C) and re-run the same command.
  • PM2-managed (pm2 list shows it): pm2 restart <process-name> — typical names are preview or the package name.

Don't proceed to Step 3 until the server has restarted — the next step depends on the new config being live.

When invoked from website-builder's style-preview loop, always end by telling the user to restart their dev server before reviewing the preview — and encourage locking fonts early in the iteration, since every font swap repeats this restart cycle while palette/layout tweaks don't.

Step 3: Add Font declarations to .astro files (ONLY AFTER RESTART)

Read the full file on GitHub · 330 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 330 lines · 139 tokens per session scan A 5e29a396a95b

Subscribe to this mod's changes

fonts is a skill published in the GitHub repository teamniteo/hakuto (5 stars, last pushed 10d ago), licensed MIT. It adds 139 tokens to every session and 2,569 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

Shade ShadCN install

Guardrails for running pnpm dlx shadcn@latest add in Shade — never overwrite existing components, fresh branch first, swap raw colours for semantic tokens after integrating. Trigger when the user proposes a shadcn add, or when a fresh ShadCN-shaped file lands in apps/shade/src/components/ui.

TryGhost/Ghost · 72 tokens

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

frontend-visual-qa

Audits already-rendered web, landing-page, HTML deck/slide, browser tool/game, dashboard/admin, design-system, and desktop UIs using real-browser or native-app journeys, inspected screenshots, DOM geometry, responsive or projection viewports, and a bundled Playwright sweep. Use after UI implementation to find…

daymade/claude-code-skills · 145 tokens

prototype-web

可点击的功能性 Web 原型, 含导航、英雄区、特性区、CTA.

nexu-io/html-anything · 24 tokens

waitlist-page

【模板: 等候名单页 / Waitlist】 【意图】为新产品 / 早鸟内测做一张极简等候页。 【布局】.

nexu-io/html-anything · 25 tokens

design-frontend-dev

Clean Impeccable frontend design skill. Use when the user wants to design, redesign, critique, audit, polish, harden, optimize, adapt, clarify, colorize, animate, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, onboarding, empty states…

The-Vibe-Company/companion · 127 tokens