--- name: loam-html description: Create or edit readable, continuous Loami HTML notes, reports, dashboards, research essays, scroll presentations and interactive explainers with a single import, themes and offline export. Use when the user asks for Loami or a shareable interactive HTML document; not for unrelated application development. --- # Loami HTML Author for a reader, not a component showcase. Decide the main point and evidence before choosing a layout. Use concrete titles and headings, put the deciding evidence and its caveat beside the claim, and remove filler, duplicated explanations and decorative UI. Align shared edges and numeric values; use accent, bold and motion selectively to direct attention. A note can be mostly prose; do not force charts or an unrelated Anatomy figure into it. Density comes from prioritization and clear relationships, not tiny type or clipping. Compute examples and keep chart, table, illustration and narrative consistent. The full authoring reference includes the editorial quality checks; apply them before delivery. Read the current authoring reference at https://loami.dev/llms.txt before choosing APIs. If unavailable, preserve an existing document's pinned import and inspect its runtime; do not invent components. Create a complete `.html` file with a title, language, charset, viewport, and one versioned runtime import: ```html ``` Use ordinary semantic HTML inside `main`. The runtime provides editorial serif body typography, Geist Serif headings, quiet themes and chapter navigation, native element styles and custom elements. The first release supports `loam-chart`, `loam-table`, `loam-range`, `loam-tabs`, `loam-anatomy` and the `loam-figure` theme bridge. JSON data lives in a separate `script type="application/json" id="data"`; reference it with `data-source="data"`. Share one source across charts and tables. Use finite numeric values. Escape user content as text and escape `<` as `\u003c` in serialized JSON embedded in HTML. Default to a light, continuous article. Body text is 18px/1.6 Geist Serif, with Geist Sans controls and data and a 720px reading column. Use semantic sections and descriptive h2 headings; the runtime builds a clickable chapter rail and tracks the current chapter. For labelled chapter groups use div class="reading-chapters" with labelled child sections. All content stays visible on one page. Keep paragraphs compact, avoid decorative cards, and use charts/tables only when they clarify the idea. Use a short p.loam-lead after the title. The runtime embeds Geist Serif Regular and variable Geist Sans/Mono, so these fonts also travel in offline exports; other scripts use the fallback stack. Use the runtime typography tokens instead of importing another font, except for the opt-in research essay style below. On phones the rail becomes a sticky chapter bar. Check 1280px and 390px views. Prefer native `table data-loam-table` with `caption`, `thead`, `tbody` and scoped headers for directly readable/searchable tabular evidence. Loami supplies filtering, keyboard sorting and CSV export without author CSS. Use `data-sort-value` on cells with formatted values. Offline export restores filtered rows. Complex spanning headers retain native rendering. JSON-backed `loam-table` remains available for generated datasets. Use `details/summary`, `dl/dt/dd`, `aside`, labelled `progress`/`meter` and native checkboxes before inventing components. Checkboxes are local document state, not shared tasks. Prefer inline SVG inside `figure` with `viewBox`, accessible `title`/`desc` and `figcaption` for diagrams. Mermaid is an optional authoring format: compile it to SVG and embed the result, optionally retaining the source in a disclosure. Loami does not ship a live Mermaid renderer. See ten complete illustrative documents at https://loami.dev/play/#samples. Geist Serif currently supplies Regular only and is designed as a display face. Keep dense data and controls in Geist Sans and code in Geist Mono; do not invent missing font weights. Check readability at body sizes and all themes. ## Research essays (opt-in) For research essays and scientific explainers, request `get_example` or `create_document` with `preset: "research"`, or inspect https://loami.dev/examples/research.html. Preserve other styles and existing documents. This preset uses Source Sans 3 for body/headings, JetBrains Mono for code, a narrow comfortable column, deliberate hierarchy/spacing, pale sage surfaces and emerald accents in every theme. Its licensed font data and scoped CSS are embedded for portability: retain them instead of adding CDN dependencies. Reuse this native HTML vocabulary rather than building another CSS system. Visual inspiration is https://rikiyat.github.io/blog/weight-space-programming/ ; do not copy its content, artwork or code, or treat its claims as evidence for your own essay. Connect a precise question, answer, methods, evidence, interpretation and limitations through semantic sections with stable IDs. Place original scientific graphics beside the relevant claims, with readable labels, units, accessible title/description and captions. Compute graphics and table equivalents from one dataset. Label synthetic calculations beside the figure; never present them as experiments. Keep labels readable on phones using labelled scroll regions when needed, not tiny text or page overflow. Use numbered citations with real canonical source URLs and stable entries in an ordered bibliography. Read each source, cite the specific claim it supports and distinguish your calculations/inferences. Omit uncertain metadata. Never invent references, DOI values, measurements or claims; when sources cannot be checked, flag the uncertainty for review. A source preview is an ordinary reference anchor plus a labelled native `button popovertarget="source-1"` and matching `aside id="source-1" popover="auto"` with title, original support summary, source link and a close button using `popovertargetaction="hide"`. Keep keyboard/touch activation, visible focus, Escape/light-dismiss and direct fallback links. Avoid hover-only behavior and remote HTML injection. Unsupported browsers show inline notes and hide preview buttons. Private workspace safe previews intentionally disable external navigation; internal citations/native popovers still work. Export/open standalone HTML to follow sources. Preserve the sandbox. Verify desktop/mobile, all offered themes, reduced motion, keyboard/touch previews, Escape, reference return links, static graphics without scripts and offline reopening. The research preset is an original illustrative statistics essay, not independent research or a promise of factual model output. Preserve verified provenance when replacing its content. Use language classes such as `language-html`, `language-css`, `language-javascript`, `language-json` or `language-bash` on code inside pre for bundled syntax highlighting and a copy toolbar. Call `Loami.enhanceCodeBlocks()` after inserting dynamic code. The existing `Loam` JavaScript alias and `loam-*` elements remain compatible. Choose `data-theme="light"`, `dark`, `sepia`, `forest` or `auto` on `html`. Theme with `--loam-*` CSS variables rather than rewriting components. Check both modes and retain readable contrast. A `select` with `data-loam-theme` switches themes. Include a button with `data-loam-action="export"` for offline export. For interactive values use `loam-range name="factor"` and `loam-bind="factor"`; a chart's `multiplier="factor"` uses that same state. Use ordinary JavaScript for richer behavior and initialize on `DOMContentLoaded` (or run immediately when the document is already ready). Loami exports markup and source scripts, not attached event listeners. Avoid duplicating initialization. For existing interactive Anatomy figures, use ``. Supported names: `watch`, `message-queue`, `lru-cache`. Loami loads the official MIT bundle only when used and includes it in offline exports. Theme changes and reopening exports reset the model. Do not substitute a placeholder for an available figure. For new custom Anatomy requests, use the separately installed Anatomy skill by Ryan, https://skills.wheresryan.sh/anatomy . Ask for framework-free SVG/HTML, then place the figure inside `loam-figure`. Preserve its own model, depth ordering, controls, accessible description and reduced motion behavior. Compile TypeScript to browser JavaScript before embedding. Loami supplies document structure and shared `--anatomy-*` colors; it does not generate Anatomy figures, bundle third-party modules or run React. Do not install Anatomy without a user request to install it. Before delivering, open the file in a browser, exercise each interaction, check narrow screens and both themes, export it, then reopen the exported HTML with network disabled. External fonts, images, modules, stylesheets and data are not bundled by the exporter; inline or bundle them if full offline portability is required. State any remaining dependency. Keep sample data labelled and do not add invented adoption claims. Public authoring MCP: https://loami.dev/mcp (Streamable HTTP). It returns documentation and source, not published documents. Private publishing uses a separate OAuth connection at https://loami.dev/mcp/publish . Read https://loami.dev/install.txt for agent-specific connection steps. Verify list_workspaces, list_destinations and publish_document are present before promising publication. Let the user choose their private Personal/team workspace, use returned destination IDs, submit complete HTML with a fresh UUID publicationId, reuse that ID on retries, and return only a confirmed tool result URL. Never share Clerk secrets or guess a published URL. Keep a local HTML copy. For custom explanatory illustrations, use the Anatomy skill and its complete references/examples rather than a decorative substitute. When the user's setup includes Anatomy authorization, install it project-locally when needed; otherwise follow the user's installation preference. Use a truthful model for motion and readouts, accessible keyboard controls, a reduced-motion still state and offscreen pause. Include a static SVG fallback: authored JavaScript does not execute in the private workspace safe preview. Custom animation must be verified in the standalone browser file. Publishing into Loami never authorizes posting to Anatomy's public gallery. Custom figure fallback is part of the document: static SVG and its caption must convey the point without scripts. Hide interactive controls/hints until successful initialization; add focusability and keyboard instructions only when they work. Keep the complete object in frame on phones, with readable model-driven text for tiny essential readouts. Check tonal separation in dark and light. Pause idle tours on hover/focus and when offscreen or the page is hidden. Do not misrepresent a static private preview as an interactive one. Mark custom script-only controls and keyboard hints with `data-loam-live`. Use `data-loam-live="focus"` on a custom figure focus container, with a labelled SVG/static caption inside it. Workspace safe previews remove the marked UI and interactive focus attributes even when the imported file is an offline export with live DOM state. These annotations leave standalone files interactive; approved Loami components keep their own runtime behavior. Test importing the exported file as well as opening it offline. Give important headings or semantic section/article containers explicit, unique native HTML IDs. Preserve those IDs when editing, renaming or reorganizing a document; do not regenerate them from changed heading text. Loami workspace search can copy a durable section link for an eligible ID. Use 1–160 characters without whitespace/control characters; the loami- prefix is reserved. A copied link requires the recipient's existing access and resolves the current section. Removing/changing the ID breaks that section reference. Plain #id links also remain native browser anchors in portable HTML. ## Linked workspace sections For authenticated Loami workspace documents, use Search contents → Copy linked section HTML to reuse an addressed section. Native markup remains readable outside the workspace: ```html
Read source section
``` The workspace renders an isolated safe excerpt only when the current reader can access both pages. Each source carries its live/checkpoint revision; set data-loam-version to an existing checkpoint UUID to pin it. A source link opens the current source. Preserve section IDs and source UUIDs through edits/moves. Missing, private, archived or pruned references remain unavailable without copied-content fallback. Keep the fallback generic; do not automatically copy private source text/titles into a shared parent. Nesting/count/byte limits apply. Sources refresh periodically while open or with Refresh sources; already viewed content cannot be recalled. Save offline HTML keeps the original fallback markup. Export linked snapshot separately reviews and materializes authorized excerpts with attribution and disables authored custom scripts. People with that file can read the included snapshots, which cannot be revoked. Do not place secrets, tokens or browser session state in the document. This enhancement belongs to the authenticated workspace; a standalone runtime import does not provide authenticated fetching. ## Scroll presentations: a second document format For a presentation, pitch, keynote or visual narrative, use get_example/create_document with preset "presentation", or /examples/presentation.html. Ordinary documents keep their existing reading format. Your connected coding agent (including Claude Opus 5.5 when selected by the user) supplies the model; Loami does not require another model key or invoke Claude for this format. Do not claim a model or third-party skill ran unless it did. Use the built-in motion design playbook below as part of this installed skill. Read the presentation example, then storyboard an opening idea, a mechanism, inspectable evidence and a clear close. Each section is a slide with a stable id and data-loam-slide, an h1/h2 and meaningful HTML. Use the versioned /v0.3.0/presentation.js layer alongside /v0.2.0/loami.js. Set class="loami-presentation" and data-loam-presentation on html. Keep slide content in document order on one naturally scrolling page. Never trap the wheel, pin the whole document, force scroll snapping, hide the only copy of content or make scrolling require JavaScript. Motion direction: one coherent visual mechanism across the story, not a sequence of identical fade-ins. Design original diagrams, typography, scale, spatial relationships and transitions around the actual content. Vary composition: a strong opening, a generous graphic, evidence beside its interpretation, and a concise closing action. Use data-loam-motion="rise", "scale" or "trace" on nonessential graphic groups for the approved scroll-progress treatments; --slide-progress and --slide-focus are available to scoped CSS. Semantic copy stays still and readable. Keep SVG labels readable, provide title/description and captions, and derive data graphics from real data or explicitly labelled illustrative calculations. Avoid invented results, logos, testimonials or sources. Preserve the static SVG/HTML meaning before adding motion. The example's .presentation-rail is a native anchor navigation: quiet side markers reveal labels on hover or focus; clicking jumps smoothly to a real slide id and updates the URL. Keyboard focus exposes labels too. Phones expose the slide list through a labelled native disclosure. Preserve focus rings, browser history, touch scrolling and direct hash links. All slides remain searchable, printable and available without scripts. Reduced motion freezes graphics and uses immediate jumps. Pause/offscreen-budget animation; never animate hidden tabs or run an endless renderer for a static scene. For richer standalone custom motion, use your coding agent's available motion/design skills with framework-free HTML/SVG/CSS and progressive JavaScript. Bundle dependencies and fonts, retain original asset attribution, and verify exported offline HTML. Loami's private/public safe previews do not run authored JavaScript; only the approved presentation layer runs there. Provide a meaningful static fallback and use the built-in progress hooks for safe-preview motion. Never weaken CSP/sandbox to make custom code run. Do not load unrelated skills or promise that pasting this prompt installs an external plugin. Verify 1280px and 390px, keyboard/focus/hover slide navigation, direct links and history, natural scrolling, all themes, reduced motion, no-script reading, safe preview, print and offline reopening. The page itself is the presentation; a separate slide viewer or canvas-only deck is unnecessary. ## Public editions and discovery Workspace documents are private until a person with Share AND Export permission explicitly reviews and publishes a public edition. Agent publication via /mcp/publish still creates PRIVATE documents; it is not public web publishing. Public editions are reviewed snapshots, not live mirrors of private edits. Use the public URL returned by the workspace publishing panel, never a guessed /p URL. Republish deliberately after edits; unpublishing removes the server copy but cannot erase copies already made by others. For discoverable documents write a concise accurate title/description, relevant tags, an answer-first opening, semantic headings, useful alt text/captions and traceable sources. Public HTML has a canonical URL, Article JSON-LD matching visible content, Open Graph and social-card metadata, an original PNG preview, a text version and sitemap inclusion when indexing is enabled. These support SEO, answer-engine and generative-engine discovery; no markup guarantees rankings, citations or unfurls on every platform. Never invent author/date credentials or keyword-stuff hidden content. Public editions do not expose comments, history, workspace identities or unresolved private linked sections.