cosmiciron/vmprint/documents
Claude Code and agent skill by cosmiciron/vmprint
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Practitioner's guide for constructing documents with the VMPrint JSON AST 1.1. Use when creating or editing vmprint JSON documents. Covers page geometry, element types (story, table, zone-map, strip, image), floats, drop caps, column spans, headers/footers with strip layouts, multilingual text, pagination control, and the document scripting system.
Install
npx vskill@latest install cosmiciron/vmprint/documentsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as cosmiciron/vmprint/documents.
VMPrint AST Layout Skill
A practitioner's guide to constructing sophisticated layouts with the VMPrint JSON AST version 1.1. Use this alongside the regression fixtures in engine/tests/fixtures/regression/ and engine/tests/fixtures/scripting/ (working examples for every feature).
Schema authority: The interfaces embedded in this skill (§ "Exact … interface" blocks) are the canonical contracts for allowed keys. Do not guess at key names — if a key is not listed in one of those interface blocks, it does not exist. The pitfalls section documents keys that have been hallucinated in the past.
AST 1.1 breaking changes from 1.0:placementreplacesproperties.layout;image,dropCap,columnSpan,tableare now top-level element keys instead of nested insideproperties.
1. Root Structure
Every document is a single JSON object:
documentVersion— always"1.1"layout— page geometry and typographic defaultsfonts— optional; only needed for custom font filesstyles— maps elementtypestrings to base styles; anything not here defaults to layout valueselements— the content treeheader/footer— optional running regions
Optional scripting keys at root level: methods, scriptVars, onBeforeLayout, onAfterSettle.
2. Page Geometry
pageSize accepts "A4", "LETTER", or { "width": N, "height": N } in points. Standard sizes:
| Name | Points | |
|---|---|---|
| A4 portrait | 595 × 842 | |
| LETTER portrait | 612 × 792 | |
| 16:9 landscape | 720 × 405 |
pageTemplates can override pageSize, orientation, and/or margins for matching pages. pageIndex is zero-based; selectors such as "first", "odd", "even", and "all" are also supported. The engine resolves the active page geometry before measuring that page, so odd-sized pages change real flow space and render as matching PDF media boxes.
Content area math (critical for fitting content on page):
For a 720 × 405 page with margins {top:34, right:50, bottom:34, left:50}:
contentWidth = 720 - 50 - 50 = 620 ptcontentHeight = 405 - 34 - 34 = 337 pt
In a 3-column story with gutter 12:
columnWidth = (620 - 12 × 2) / 3 = 198.67 pt
Line height in points = fontSize × lineHeight. For 10pt / 1.35: 13.5 pt per line.
Lines per column = floor(contentHeight / lineHeightPt).
3. Fonts
Built-in font families available without registration: Arimo, Tinos, Cousine, Caladea, Carlito, Noto Sans JP (CJK), Noto Sans Arabic, Noto Sans Thai, Noto Sans Devanagari.
Reference a built-in family by name in fontFamily; no fonts block needed:
For custom font files, register by role:
The engine maps fontWeight/fontStyle to these slots at render time. For named non-system fonts in inline spans use fontFamily on properties.style of a "text" child.
Standard PDF 1.4 built-in fonts (zero-embed, Latin-only docs via StandardFontManager): Helvetica, Times New Roman, Courier — common aliases like Arial → Helvetica resolve automatically.
4. Styles Table
Every type string is a key into styles. Style resolution: styles[element.type] (base) merged with properties.style (override).
Any element type you invent is valid — just add it to styles.
5. Block Element Types
Special structural types handled by the engine:
type | Role | |
|---|---|---|
"story" | Multi-column DTP zone; carries columns, gutter, balance as top-level keys | |
"table" | Table container; optional table top-level key for config | |
"table-row" | Row inside a table | |
"table-cell" | Cell inside a row; supports colSpan, rowSpan in properties | |
"zone-map" | Independent-region layout; zoneLayout + zones[] at top level | |
"strip" | Horizontal slot layout; stripLayout + slots[] at top level | |
"image" | Block or inline image; image data at top level |
All other type strings are user-defined and look up styles only.
Use "content": "" (empty string) on container elements (table, story, zone-map, strip). Container elements and image elements do not require content but it's harmless to include it.
6. Top-Level Element Keys (AST 1.1)
In AST 1.1, several configuration objects moved out of properties and became top-level keys on the element. This is the most important change from 1.0.
| Key | Element type(s) | Purpose | |
|---|---|---|---|
content | all | Text content string | |
children | all block | Inline runs or child block elements | |
name | any | Scripting target name | |
type | all | Element type string | |
image | "image" | Image data (data, mimeType, fit) | |
table | "table" | Table config (headerRows, repeatHeader, columns, etc.) | |
dropCap | any block | Drop cap config | |
columnSpan | story children | "all" or number | |
placement | story children | Float/absolute placement directive | |
columns | "story" | Column count | |
gutter | "story" | Inter-column gap | |
balance | "story" | Equal-height column balancing | |
zones | "zone-map" | Array of zone definitions | |
zoneLayout | "zone-map" | Column sizing + gap config | |
slots | "strip" | Array of slot definitions | |
stripLayout | "strip" | Track sizing + gap config | |
properties | all | style, sourceId, colSpan, rowSpan, semanticRole, etc. |
Exact `ElementProperties` interface (no other keys are valid):
colSpan and rowSpan remain inside properties (not top-level).
7. Inline Runs (Rich Text)
When a paragraph has mixed styling, use children instead of content. Set "content": "" at the paragraph level.
Inline styles quick-reference
| Effect | Style property | |
|---|---|---|
| Bold | "fontWeight": 700 or "bold" | |
| Italic | "fontStyle": "italic" | |
| Color | "color": "#rrggbb" | |
| Highlight | "backgroundColor": "#rrggbb" | |
| Monospace | "fontFamily": "Cousine" | |
| Larger/smaller | "fontSize": N | |
| Letter spacing | "letterSpacing": N | |
| Padding (code span) | "paddingLeft": N, "paddingRight": N |
Inline box (pill / badge)
Inline image
image is a top-level key in AST 1.1. Size and alignment go in properties.style.
verticalAlign options: "baseline", "text-top", "middle", "text-bottom", "bottom".
GOTCHA: Do NOT use\u202f(narrow no-break space U+202F) in content strings — it is not in most font glyph sets and renders as □. Use a regular spaceor omit it.
8. Story: Multi-Column DTP Layout
columns— number of columns (default1)gutter— gap between columns in pointsbalance— iftrue, distributes content evenly across columns (avoid with float obstacles)
Column flow: depth-first. Col 1 fills completely before col 2 begins.
Story height = height of the tallest column. Adding more text to fill empty columns is safe — it flows into subsequent columns without increasing story height, as long as col 1 is already at max.
Estimating content fill:
- Lines per column ≈
columnHeight / (fontSize × lineHeight) - Words per line ≈
columnWidth / (fontSize × 0.55)(rough estimate for proportional fonts) - Use the layout snapshot (
--emit-layout) to measure actual column heights
9. Floats and Obstacles
Any block element inside a story can be floated using the top-level placement key.
Block floats — both properties.style.width and properties.style.height are required; if either is missing the element renders as a normal block instead.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdocuments/SKILL.md
Popularity
- Repository stars
- 630
- Repository forks
- 34
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cosmiciron/vmprint/documents)