MCP SERVER

XHTML-TOOLS

YAML page specs in, Confluence storage-format XHTML out. Pure functions — no API calls, no side effects.

18
Tools
20+
Block types
33
Lint checks
0
Side effects
TOOLS
ToolPurposeReturns
compileCompile a YAML page spec into Confluence storage-format XHTML. Accepts inline YAML or file path. Writes to disk or returns inline.XHTML string + diagram manifest
decompileReverse-engineer Confluence XHTML back into a YAML page spec. Classifies blocks, detects color scheme.YAML page spec
spec_lintVisual rhythm analysis on YAML specs — 20 checks covering prose density, section variety, color intent, layout monotony, and migration warnings.Issue list with severity and block index
lintValidate XHTML structure — 13 checks for tag balance, macro attributes, column consistency, encoding corruption, WCAG AA contrast.Issue list with severity and line numbers
heroFull-width thesis block with category eyebrow, large title, body text, and accent border on dark background.XHTML fragment
tableStructured data table with headers, alternating row colors, column alignment, and scheme-aware header coloring.XHTML fragment
flow_chainColored badge pills connected by arrows. Supports dual-scheme accent steps and auto-color assignment.XHTML fragment
section_labelFull-width divider label — centered small-caps text on a surface-aware background bar.XHTML fragment
badgeInline colored status pills. Scheme auto-assigns colors; per-item overrides supported.XHTML fragment (inline)
headingh2 or h3 with optional Confluence anchor macro for in-page linking.XHTML fragment
tocTable of contents with anchor links, indent levels, and scheme-aware surface background.XHTML fragment
info_boxConfluence structured macro box — note, info, warning, or tip with rich-text body.XHTML fragment
dividerLightweight horizontal rule. Configurable color, weight, and margin.XHTML fragment
swatch_stripHorizontal color swatch strip for palette visualization. Hue mode or custom cells.XHTML fragment
scheme_compareRender identical content across multiple color schemes for visual comparison. One call replaces N×3 fragment calls.XHTML fragment
extract_sectionsIdentify structural sections in XHTML — labels, headings, card rows, tables, macros — with line ranges.Section list with types and ranges
inject_stylesBulk-apply CSS properties to XHTML elements by tag name. Merges into existing inline styles.Transformed XHTML
convertFormat conversion between markdown, HTML, and Confluence storage format. Pure library, no LLM.Converted content
THE ROUND-TRIP
Compile: spec → XHTML

A YAML page spec declares blocks, scheme, density, and separation. The compiler walks each block, resolves colors from chromata, generates Confluence storage-format XHTML with inline styles, and returns a diagram manifest for any embedded SVGs. The spec is the source of truth — XHTML is a disposable build artifact.

Decompile: XHTML → spec

Given raw Confluence XHTML, the decompiler classifies every DOM region into typed blocks — hero, cards, prose, flow_chain, table, heading, section_label, info_box, divider, badge. It detects the color scheme by reverse-mapping RGB values to palette shades. The output is a valid YAML spec ready for editing and recompilation.

The round-trip is the core design constraint. Every block type the compiler emits must be recognizable by the decompiler. This forces structural discipline — no ad-hoc HTML, no one-off styling. If the decompiler can't classify it, the compiler shouldn't produce it.

33 LINT CHECKS
XHTML lint (S1–S13)

Structural validation of compiled output. Tag balance, macro attribute correctness, column width sums, empty style attributes, missing font-family declarations, inherited color leaks, implicit font-weight, WCAG AA color contrast, double-encoded entities, U+FFFD replacement characters, and background ownership without !important on child text colors.

Spec lint (V1–V20)

Visual rhythm analysis before compilation. Prose density ratios, section variety scoring, block type diversity, color intent validation, thin card detection, stubby flow chains, missing opening blocks, frame gaps, anemic sections, section balance, layout monotony, deprecated knob migration, caption stacking, section density, scheme fragmentation, identical consecutive blocks, diagram scheme consistency, and title field hygiene.

Two lint passes, two concerns. The spec lint catches design problems while the YAML is still editable. The XHTML lint catches rendering defects after compilation. Run both — a page can have perfect structure and broken encoding.

INTEGRATION
chromata →
Color system

Every color in compiled XHTML comes from chromata's OKLCH palette. Scheme resolution, shade lookups, semantic role mapping, and color function distribution all flow through chromata at compile time.

→ wiki
Publishing

The wiki server imports compile, decompile, and DOM operations directly as library modules. wiki_publish_file compiles specs internally. wiki_edit_page uses the operations engine. wiki_retheme_page uses the scheme-swap core.

→ gutenberg
Static sites

The gutenberg build pipeline uses the same compile function to render YAML specs into standalone HTML pages. Same spec format, different output target — Cloudflare Pages instead of Confluence.

This page was compiled from a YAML spec by the server it describes.