New fonts: font-sf-pro-display, font-sf-pro-text, font-sf-pro-icons, font-apple-icons (171 files total).
2.7 KiB
2.7 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Is
A Homebrew tap for custom fonts. Users brew tap and then brew install --cask font-<name>. The repo contains font assets in font_files/ and generated Ruby cask files in Casks/.
Commands
# Add or update a font (cleanup + cask generation + tests + brew audit)
uv run add-font <path_or_name>
uv run add-font <path_or_name> --no-test --no-audit
# Run tests
uv run pytest tests/ -v --tb=short
# Run a single test file
uv run pytest tests/test_font_structure.py -v
# Run tests for a specific font
uv run pytest tests/ -v -k "font-acrylic-hand"
# Regenerate all casks (without the full add-font flow)
python3 .fontfoldercleanup/create_homebrew_formula.py
# Reorganize font folders only
python3 .fontfoldercleanup/cleanup_font_folders.py --path font_files
Architecture
font_files/font-<name>/— Each font has exactly 4 subdirs:ttf/,otf/,web/,other_files/. No other top-level files allowed.Casks/font-<name>.rb— Generated Ruby cask files. Never edit by hand. Edits go in.fontfoldercleanup/create_homebrew_formula.py.tap_cli/main.py— Theadd-fontCLI entry point. Copies font tofont_files/, runs cleanup script, runs cask generator, then runs tests andbrew audit..fontfoldercleanup/cleanup_font_folders.py— Sorts loose font files intottf/,otf/,web/,other_files/subdirs..fontfoldercleanup/create_homebrew_formula.py— Scansfont_files/font-*and writes one cask.rbper font inCasks/.tests/— Parametrized pytest suite. Tests validate: folder structure, cask existence, cask content (paths, identifier), no orphan casks, no duplicates.To Sort/— Staging area for new downloads not yet processed.
Cask Naming Convention
Cask files use kebab-case identifiers matching the font folder name: font-<name>.
font-acrylic-hand→cask "font-acrylic-hand" do
Fonts are installed to ~/Library/Fonts/ automatically via the font artifact.
Key Constraints
- Python 3, standard library only (pathlib, shutil, argparse, re). pytest is the sole dependency.
- Casks download from
http://clancy.genet-godzilla.ts.net:8085/clancy/homebrew-fonts/archive/main.tar.gzand expect the archive to unpack ashomebrew-fonts/. - CI runs
uv run pyteston push/PR to main, plusbrew auditon macOS (non-blocking). PROJECT.mdis the canonical project description. When updating project rules, updatePROJECT.mdfirst, then sync.cursorrules,.github/copilot-instructions.md, and.claude/skills/project-context/SKILL.md.