Glyphs mcp litsquare metadata
Skill thierryc/Glyphs-mcp/skills/glyphs-mcp-litsquare-metadata
Inspect, explain, dry-run, and safely change LitSquare metadata and semantic path roles in Glyphs. Use when a task mentions com.litsquare metadata, LitSquare settings, memory, status, notes, inheritance, selected-path roles, icon centering, or metadata preservation across outline operations.From its SKILL.md
npx -y skills add thierryc/Glyphs-mcp --skill glyphs-mcp-litsquare-metadataAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
6.1 KB, as published. Nobody here has run it
LitSquare Metadata for Glyphs MCP
Use the typed LitSquare tools. Treat Glyphs' native dictionaries and path attributes as authoritative; JSON is only their transport projection.
The Glyphs MCP Metadata Inspector uses Glyphs' native Palette disclosure control; the plug-in does not force or persist its open/closed state. Every tab uses the same compact JSON text area. Font, Glyph, and Layer edit only the direct com.litsquare value; Paths projects com.litsquare.role as {\"role\": \"body\"} and shows blank text when unassigned. A changed valid value commits once when the text area loses focus. Invalid JSON remains visible and causes no mutation; Escape restores the native baseline. The text.magnifyingglass footer control toggles the active tab into a read-only JSON projection of complete Font/Glyph/Layer userData or every selected path's complete attributes; multiple targets are listed separately with compact identifiers. Diagnostic markers represent native values JSON cannot express directly. The remaining footer controls provide Help, Copy, and Refresh. Palette edits are document-bound, undoable, and never save a font.
Read references/metadata-contract.md before any mutation or role recommendation. The canonical repository copy is metadata-contract.md.
Workflow
- Resolve the exact
font_index, glyph name, layer ID, and selected paths. Stop on ambiguous glyph or layer selection. - Call
get_litsquare_metadatawith inheritance enabled. Read the direct Font, Glyph, and Layer scopes plus effective settings and provenance. - When paths matter, call
get_selected_litsquare_path_roles. Retain every returned glyph name, layer ID, path index, fingerprint, and expected role. - Validate schema support and property-list compatibility. Do not mutate invalid data or a future schema.
- Propose the smallest change. Preserve unknown LitSquare fields, unrelated
userDatanamespaces, and every unrelated path attribute. - Call
patch_litsquare_metadataorset_litsquare_path_rolesin dry-run mode. Present every replacement explicitly. - Confirm only after the user approves the dry-run. Never infer a low-confidence role and never copy inherited values into a narrower scope merely to make them explicit.
- Read the affected metadata or roles again. Report verified results and
fontSaved: false; never save automatically.
IconGrid fixed-centering requests
IconGrid centering is independent from semantic roles. For “center the grid on the selected paths”:
- Read the selected paths with
get_selected_litsquare_path_roles; use each returned finiteboundsvalue only, and ignore its role for centering. - Compute the midpoint of the selected paths' union bounds. This coordinate is a one-time snapshot and must not be recalculated after artwork moves.
- Read the layer with
get_icon_grid_horizontal_centerand retain its freshstateFingerprint. - Preview
set_icon_grid_horizontal_centerwith the explicit finitecenter_x, then apply only the identical confirmed preview. - Read back the stored and resolved x. Never save.
For layer-content or advance centering, use the corresponding candidate from
get_icon_grid_horizontal_center and pass its x explicitly to the same Set
tool. Reset removes only the layer's IconGrid policy. No IconGrid operation
reads, assigns, removes, or edits semantic roles.
Palette multi-selection is a direct replacement workflow: identical selected roots display once, differing roots display mixedvalue, and committing valid JSON replaces every selected direct root atomically. This is intentionally distinct from the agent-facing merge-patch tool.
Safety Rules
- Use
com.litsquarefor general Font, Glyph, or Layer metadata,com.litsquare.rolefor path semantics, andcom.litsquare.icongridonly for the separately owned layer IconGrid policy. Never usecom.leetsquare, an unnamespaced key, or an IconGrid-specific path attribute. - Never persist the root metadata object as a JSON string.
- Never change
schemaVersionthrough a patch. Run only an explicit, supported migration path. - Use JSON null only as a merge-patch deletion instruction. Native stored values cannot be null.
- A role may be any non-empty string. Leading and trailing whitespace is trimmed; internal whitespace and case are preserved. Remove a role with null or an empty string. Never store the presentation values
unassigned,mixed, orinvalidautomatically. - Keep semantic
hiddenanderaseindependent from Glyphs' built-inhiddenormaskattributes. - IconGrid v1 stores one finite absolute x coordinate in
centerXcoordinate mode. Artwork, selection, roles, and later advance-width changes never update it. - Reject IconGrid writes to future schemas. A malformed known-v1
centerXmay be removed safely without replacing unrelated supported-schema fields. - Warn before Boolean operations, overlap removal, stroke expansion, decomposition, or other outline recreation. Snapshot roles first, compare afterward, and report losses without guessing transfers.
- Reject secrets, credentials, tokens, private keys, and complete conversation histories. Store only concise, task-relevant, non-sensitive memory or notes.
Role Decisions
Recommend a role only when the contour's purpose is clear from the outline and task context. Explain uncertain cases instead of writing them. Custom role strings are valid and case-sensitive. Semantic roles never control IconGrid positioning.
The contract reference lists common roles as guidance, not an allowlist. Path-role writes must use the exact read-time targets so stale or replaced paths fail atomically.