- FontOps
- Automate
AI skills and agent API
Let Unity AI Assistant, Claude Code, Cursor or any coding agent drive FontOps for you: search, install, audit, build palettes and apply roles through one JSON request and response.
What ships in the package
FontOps bundles five SKILL.md files under Packages/dev.davgtz.fontops/AIAssistantSkills/.
Each one teaches an agent when a task is a FontOps task and exactly which JSON request to send — no UI clicking, no guessing at asset paths.
| Skill | Teaches the agent to… |
|---|---|
fontops-overview | Recognise a font/typography task, pick a transport, send a request, read the response (start here) |
fontops-search-install | Search Google Fonts / Fontshare / Fontsource and install weights as .ttf + TMP SDF assets |
fontops-audit-texts | Inventory every text component, audit against a palette, grade usage A–F, diff before/after |
fontops-palette | Create or edit a Font Palette (roles) from JSON |
fontops-apply-role | Apply a palette role to text components and verify the change |
Point your agent at the skills
- Unity AI Assistant — discovers the folder automatically. Allow it under
Edit → Preferences → AI → Assistant → Skills. - Claude Code — press INSTALL AI SKILLS on the Ask an AI agent card of Get started. It copies the skills into
.claude/skills/, where Claude Code loads them on its own. - Cursor / Codex / Copilot — add one line to your rules file (
.cursor/rules,AGENTS.md,.github/copilot-instructions.md): FontOps skills live in Packages/dev.davgtz.fontops/AIAssistantSkills/ — read the matching SKILL.md before any font task.
The JSON contract
Every action is one flat JSON request and one JSON response. command is required; other fields are read only by the commands that need them.
Paths are project-relative Unity asset paths with forward slashes.
| Command | Fields | Result |
|---|---|---|
help | – | Command list and file paths |
config | googleApiKey (optional; "-" clears) | Providers, download folders, SDF settings (including staticAtlasCharset: ascii or latin1), tmpEssentialsImported |
import-tmp-essentials | – | Imports TMP Essential Resources without the dialog, returns config |
fetch | forceRefresh | Refreshes the catalogs (disk-cached otherwise) |
search | query, category, source, limit | Families with variants, licence, specimen URL, installed (true when at least one style is at its FontOps install path) |
install | family, variants, source, createSdf, staticAtlas, characters | Installed .ttf paths, sdfAssets, per-variant errors. staticAtlas bakes the Settings tab’s static character set (printable ASCII, or ASCII + Latin-1); characters bakes exactly that set instead. Fontsource installs also add the extra subsets chosen in Settings; the result doesn’t list them. |
installed | – | Every font file / TMP asset in the project, by family |
inspect | path (.ttf/.otf or TMP_FontAsset) | Licence, copyright, designer, embedding permission, and metrics read from the font file itself |
scan | folders (default ["Assets"]) | Every TMP and legacy text with font, size, style, hierarchy path |
audit | palettePath, folders | Compliant / non-compliant / ignored per text, plus the closest role. complianceRate = compliant ÷ (compliant + non-compliant); ignored texts count on neither side. |
usage | folders, palettePath (optional, applies its ignore list) | Palette-less health grade A–F with flags; each flag has a Kind (Placeholder, Sprawl, UnusedFonts, NoPalette or Info). Texts with FontComplianceIgnore are skipped |
palette-export / palette-save | palettePath, palette | Palette roles as JSON, or the saved asset path. The window’s EXPORT / IMPORT use the same JSON. |
apply | palettePath, roleName, targets or fontFilter (+ folders), mode, properties | Before/after snapshot per target, the saved scenes/prefabs, and unsavedAssets (open scenes that already had unsaved edits: changed in memory, left for you to save) |
Responses look like this:
{"ok": true, "command": "install", "result": { ... }}
{"ok": false, "command": "apply", "error": "Role 'Title' not in palette. Roles: Header, Body, Caption, Button"}
A warning field appears when a provider fetch failed but cached data was used, or when a scan skipped a scene it could not open.
Three ways to send a request
Editor closed — batch mode (CI, scripts)
"<UnityEditor>/Unity.exe" -batchmode -projectPath "<project>" -logFile - ^
-executeMethod dev.davgtz.fontops.Editor.FontOpsCli.Run ^
-fontopsRequest "<abs>/request.json" -fontopsOut "<abs>/response.json"
Exit codes: 0 ok, 1 command error, 2 missing request file, 3 timeout (300 s).
-quit. Downloads finish asynchronously; FontOps waits for them and exits the editor itself.Editor open — MCP script runner (fastest)
When the agent can run C# in the open editor (an MCP execute_code tool or similar), call FontOps directly.
Script runners that compile a method body reject using directives, so fully qualify every type:
dev.davgtz.fontops.Editor.FontOpsCli.Execute("{\"command\":\"scan\"}",
json => System.IO.File.WriteAllText("Temp/fontops-scan.json", json));
Then poll for the file you named. Use a different file per request so responses never overwrite each other.
From C#
FontOpsCli.Execute("{\"command\":\"scan\"}", json => Debug.Log(json));
// Strongly typed alternative
var texts = FontOpsAgent.ScanTexts(folders: new[] { "Assets/UI" });
A typical session
Six requests take a project from a placeholder font to a compliant screen. Each block is one request.
- Which providers are on, where fonts install, whether TMP essentials exist.
{"command":"config"} - Pick a family.
{"command":"search","query":"grotesk","category":"sans-serif"} - TTFs land in
Assets/Fonts/<Provider>/Space Grotesk/with SDF assets and a.fontops.jsonmanifest that records the licence. Every install also drops the fullOFL.txt/LICENSE.txt, Google Fonts included.{"command":"install","family":"Space Grotesk","variants":["regular","700"]} - Point the Body role at the new SDF asset.
{"command":"palette-save","palettePath":"Assets/Fonts/Palettes/Main.asset","palette":{ ... }} - Every text still on the placeholder font gets a
FontPaletteApplierfor Body; the response lists each before/after.{"command":"apply","palettePath":"Assets/Fonts/Palettes/Main.asset","roleName":"Body","fontFilter":"LiberationSans"} - Confirm
nonCompliantdropped.{"command":"audit","palettePath":"Assets/Fonts/Palettes/Main.asset"}
Good to know
- One request at a time. Requests queue; a second
installsent mid-download waits and answers later. - Scans stay inside
Assets/. Package scenes are never opened. Text-less scenes are detected from their YAML and skipped, so scans do not touch lighting data for them. Passfoldersto skip vendor content such as TMP examples or SDK demo scenes. - Legacy
UnityEngine.UI.Textis reported byscan/auditbutapplyonly modifies TextMeshPro. - Open scenes follow palette edits. After
palette-save, texts with aFontPaletteApplierin open scenes and the open prefab update by themselves; the scenes are left for you to save. Closed scenes and prefab assets don’t: rerunapplyfor them, or press Apply to Text Component on the applier. - Renaming a role through
palette-savedoes not rebind texts. Their appliers keep the old name and show the role as missing. Rerunapplywith the newroleNameon those texts, or rename the role in the FontOps window, which rebinds texts in open scenes. A window IMPORT that renames roles has the same limit. - Compliance is font-only.
auditchecks which font a text uses; a text with the right font at the wrong size still counts as compliant.matchedRoleis the text’s applier role when the palette has it, or else the closest role (by size and style) among those using its font.suggestedRoleand its score tell you how close a non-compliant text is to a role. - No APPLY… command. The window’s APPLY… recognises each text’s role and shows a before/after render. The agent applies one role per
applyrequest. - Same settings as the window. Download folders (saved per project), SDF atlas settings, and the Google Fonts key come from the FontOps Settings tab.
- Commercial-safe stays on. Agents only ever see the OFL / Apache / MIT / UFL catalogs the window shows.
Troubleshooting
The agent doesn't use the skills
Unity AI Assistant needs them allowed under Edit → Preferences → AI → Assistant → Skills. Claude Code finds them after INSTALL AI SKILLS on Get started’s Ask an AI agent card copies them to .claude/skills/. Other agents need the one-line pointer in their rules file (see Point your agent at the skills).
Batch mode exits with code 3
The request timed out after 300 seconds. Code 2 means the request file wasn't found and 1 is a command error: read error in the response file. Don't pass -quit: FontOps waits for downloads and exits the editor itself.
A text with the wrong size counts as compliant
The agent's audit checks the font only. Use suggestedRole and its score to see how close a text is to a role, or the Text Auditor in the window, which also names size and style differences.
After a role rename, texts show the role as missing
A rename through palette-save doesn't rebind texts. Rerun apply with the new roleName on them, or rename the role in the FontOps window, which rebinds texts in open scenes.