glyphfield — working here
Purpose
Use this skill when changing Glyphfield. It keeps the visual Studio, portable
documents, deterministic API, agent Browser API, docs, and exports aligned.
Mental model & key files
One identity flows through public tools in src/lib/studioCatalog.ts. Each tool is
rendered by StudioToolWorkspace.tsx and persists project-scoped state. Rich
layered work uses CanvasDocument (canvasDocument.ts); Design Lab adapts its UI
state through designLabDocument.ts. Agent discovery/generation lives in
agentApi.ts, agentCatalog.ts, and agentGeneration.ts. Browser parity lives in
studioAutomation.ts. Human and machine guidance share content/docs.
Read the directory skill before working deeply in src/app, src/components,
src/hooks, src/lib, or scripts.
This is the contributor skill. For tasks that operate Glyphfield as a product,
load the appropriate package under skills/: create, API, Studio, or export.
Patterns to follow / invariants
- Treat catalog IDs and current serialized source as authoritative.
- Keep preview, saved source, autosave, and export on one state model.
- Preserve stable element/asset IDs and unknown source fields.
- Add accessible labels before relying on generic Browser API control automation.
- Use a tool-specific Browser API action for long-running/export behavior.
- Keep deterministic HTTP output independent of browser-only APIs.
- Add documentation as part of the feature, including agent completion rules.
Common tasks → first action
- Add/change a Studio tool → inspect
studioCatalog.ts and StudioToolWorkspace.tsx.
- Change Design Lab layers → inspect
ShaderLabStudio.tsx, designLabDocument.ts,
canvasDocument.ts, and saved-design tests together.
- Change an export → inspect preview renderer, export helper, Browser API action,
MIME/filename checks, and artifact docs.
- Change agent HTTP generation → inspect
GET /api/generate, validation helpers,
manifest/OpenAPI, examples, and tests before implementation.
- Change docs → update MDX metadata/order, run Fumadocs generation, and confirm both
the page and
/llms-full.txt.
- Diagnose UI behavior → reproduce in the browser, identify the state owner, then
add a focused regression test before or with the fix.
Gotchas
material is the public Design Lab ID while logo-shader is a legacy storage
scope. Project/nav state uses localStorage; Design Lab saved designs and converted
assets use IndexedDB with recovery support. WebGL previews may degrade to a static
representative image, but authentic motion export must never be claimed from that
fallback. Browser exports share renderer resources and should not run concurrently.
1---2name: glyphfield-skill3description: How to work in this repository. Read before editing here.4---56# glyphfield — working here78## Purpose910Use this skill when changing Glyphfield. It keeps the visual Studio, portable11documents, deterministic API, agent Browser API, docs, and exports aligned.1213## Mental model & key files1415One identity flows through public tools in `src/lib/studioCatalog.ts`. Each tool is16rendered by `StudioToolWorkspace.tsx` and persists project-scoped state. Rich17layered work uses CanvasDocument (`canvasDocument.ts`); Design Lab adapts its UI18state through `designLabDocument.ts`. Agent discovery/generation lives in19`agentApi.ts`, `agentCatalog.ts`, and `agentGeneration.ts`. Browser parity lives in20`studioAutomation.ts`. Human and machine guidance share `content/docs`.2122Read the directory skill before working deeply in `src/app`, `src/components`,23`src/hooks`, `src/lib`, or `scripts`.2425This is the contributor skill. For tasks that operate Glyphfield as a product,26load the appropriate package under `skills/`: create, API, Studio, or export.2728## Patterns to follow / invariants2930- Treat catalog IDs and current serialized source as authoritative.31- Keep preview, saved source, autosave, and export on one state model.32- Preserve stable element/asset IDs and unknown source fields.33- Add accessible labels before relying on generic Browser API control automation.34- Use a tool-specific Browser API action for long-running/export behavior.35- Keep deterministic HTTP output independent of browser-only APIs.36- Add documentation as part of the feature, including agent completion rules.3738## Common tasks → first action3940- Add/change a Studio tool → inspect `studioCatalog.ts` and `StudioToolWorkspace.tsx`.41- Change Design Lab layers → inspect `ShaderLabStudio.tsx`, `designLabDocument.ts`,42 `canvasDocument.ts`, and saved-design tests together.43- Change an export → inspect preview renderer, export helper, Browser API action,44 MIME/filename checks, and artifact docs.45- Change agent HTTP generation → inspect `GET /api/generate`, validation helpers,46 manifest/OpenAPI, examples, and tests before implementation.47- Change docs → update MDX metadata/order, run Fumadocs generation, and confirm both48 the page and `/llms-full.txt`.49- Diagnose UI behavior → reproduce in the browser, identify the state owner, then50 add a focused regression test before or with the fix.5152## Gotchas5354`material` is the public Design Lab ID while `logo-shader` is a legacy storage55scope. Project/nav state uses localStorage; Design Lab saved designs and converted56assets use IndexedDB with recovery support. WebGL previews may degrade to a static57representative image, but authentic motion export must never be claimed from that58fallback. Browser exports share renderer resources and should not run concurrently.