moai-domain-html-report

modu-ai/moai-adk

Рендерер отчётов из Markdown в одиночный HTML: шесть режимов и три уровня аудитории.

Звёзды1 256
Авторmodu-ai

Установка

SKILL.md

html-report — Single-File HTML Report Renderer

Purpose and Scope

This skill is a terminal renderer that converts a markdown report into a single self-contained HTML file. It accepts any markdown body produced by a text, analysis, or reporting workflow and emits one .html file that opens directly in a browser, attaches to email, prints cleanly, and works offline.

Core principles:

  • Zero external JS libraries (no Chart.js, D3, htmx)
  • Zero external CSS frameworks (no Tailwind, Bootstrap)
  • Inline SVG renders all charts directly
  • A font-CDN <link> is permitted for Korean readability
  • A mermaid-CDN <script> is permitted only in the basic and learn audience tiers, always paired with a no-JS fallback (see § Diagram Policy). The expert tier remains strictly zero-JS.

This skill does not replace the markdown output. Markdown remains the single source of truth; HTML rendering is an additional branch that operates on it.

The asymmetry principle — HTML is rich, the markdown twin is lean

The two artifacts this skill produces serve different readers and therefore carry different amounts of content. They are not the same document in two syntaxes:

ArtifactReaderContent rule
.htmlthe humanEnriched. May carry MORE than the source markdown — plain-language primers, mermaid diagrams, worked examples, analogies, glossary callouts — scaled by the audience tier (§ Audience Tiers).
.md twinthe agent (context)Lean. Carries ONLY the load-bearing facts: findings, decisions, numbers, tables, action items. Never the tier enrichment.

[HARD] Audience-tier enrichment scales the HTML and NEVER the markdown twin. Raising the tier from expert to learn must not add a single primer, analogy, or worked example to the .md twin — that enrichment exists to teach a human, and it is pure token cost to an agent that already understands the domain. A learn-tier report and an expert-tier report of the same source produce markdown twins of substantially the same size; only their HTML differs.


Input

ArgumentRequiredDefaultDescription
markdownyes—The markdown body to convert
modeyes—status | incident | plan | explainer | financial | pr
audiencenoderived from the active output styleexpert | basic | learn — see § Audience Tiers
slugnoauto-derived from the titleOutput filename prefix
output_pathno<cwd>/reports/<slug>-<YYYYMMDD>.htmlOutput path
font_stacknoper-mode defaultFont mapping override

mode and audience are orthogonal: mode picks the report's structure (which sections exist), audience picks its depth (how much explanation each section carries). Every mode renders at every tier.


Output

Two files at <cwd>/reports/<slug>-<YYYYMMDD>.{html,md}:

The .html file — the human-facing artifact:

  • Size: ≤ 50KB at the expert tier; ≤ 120KB at the basic / learn tiers (the enrichment budget — diagrams and examples cost bytes)
  • External dependencies: one font-CDN <link> + two preconnect hints (Korean fonts), plus one mermaid-CDN <script> at the basic / learn tiers only
  • Self-contained: opens directly in a browser, email-attachable, print-clean, and readable offline (diagrams degrade to their fallback — see § Diagram Policy)

The .md twin — the agent-facing artifact (below).

Markdown twin (agent-context artifact)

Alongside every .html file, write a markdown twin at the same path with the .md extension (<slug>-<YYYYMMDD>.md). The HTML file is the human-viewing artifact; the markdown twin is the machine-context artifact, and per § The asymmetry principle it is deliberately leaner than the HTML, not merely the same content with tags stripped.

What the twin contains — the load-bearing facts only:

  • The findings, decisions, numbers, and conclusions
  • Tables (as markdown tables) and any figures the numbers depend on
  • Action items, owners, and open questions
  • The mermaid source of a diagram only when the diagram encodes information the prose does not (a real state machine, a real dependency graph). A diagram that merely re-illustrates a sentence for a beginner is enrichment — it is omitted.

What the twin OMITS — everything the audience tier added for the human:

  • Plain-language primers and jargon glossaries
  • Analogies and motivating narratives
  • Worked step-by-step examples that re-derive a stated result
  • Self-check questions, callout boxes, decorative diagrams
  • All HTML tags, inline CSS, <script> blocks, and SVG chart markup

Consumption rule (token discipline): whenever a report is needed as context — an Agent() spawn prompt, a follow-up analysis turn, a cross-session Read of a past report — use the .md twin, NEVER the .html file. Raw HTML wastes tokens on tags, style blocks, and SVG paths that carry no information the markdown does not already have (typically 3-5x the tokens for identical content), and the tier enrichment on top of that is pure cost to an agent.

Legacy HTML without a twin: when only an .html file exists, extract the load-bearing facts into markdown first (strip tags, <style>, <script>, SVG chart markup, and the tier enrichment; convert <table> to markdown tables) and inject the extraction — not the raw HTML — into the agent prompt or context. Write the extraction next to the HTML as its .md twin so the cost is paid once.


After rendering — report back to the user

Once the .html file and its .md twin are written, the response MUST do two things:

  1. Summary — print a concise summary of what was rendered: the mode, the audience tier (and what it was derived from — the active output style, or an explicit audience argument), the report title, and the key sections or figures the file contains (a short paragraph or a few bullets). Do not paste the full HTML into the response.

  2. Auto-open — immediately open the rendered file in the user's default browser by running the platform-appropriate opener via the Bash tool. Do NOT ask the user to type ! open themselves; run the opener directly so the report appears in one step on macOS, Windows, and Linux alike:

    case "$(uname -s)" in
      Darwin) open "<output_path>" ;;
      Linux)  xdg-open "<output_path>" >/dev/null 2>&1 || echo "Open manually: <output_path>" ;;
      MINGW*|MSYS*|CYGWIN*) start "" "<output_path>" ;;
      *) echo "Open manually: <output_path>" ;;
    esac
    

    macOS uses open, Linux uses xdg-open (fall back to printing the absolute path when no opener/display is available — headless or WSL environments), Windows Git-Bash/MSYS uses start. If the opener command fails or the permission is denied, print the absolute path so the user can open the file manually.

Always auto-open the report (or, failing that, print its absolute path) — a rendered report the user cannot locate or open has no value.


Audience Tiers

The report adapts its depth to the reader. The tier is derived from the active output style unless an explicit audience argument overrides it.

Resolving the tier

Read outputStyle from the settings chain — .claude/settings.local.json (highest) → .claude/settings.json → ~/.claude/settings.json → hardcoded default — and map it:

Active output styleAudience tierReader
MoAIexpertAn engineer who knows the domain and wants the signal, fast
MoAI-EasybasicSomeone who codes occasionally; the jargon still costs them effort
MoAI-LearnlearnSomeone who wants to genuinely understand the concept, not just the outcome
(any other / unresolvable)expertSafe default — never enrich unasked

An explicit audience argument always wins over the derived value.

What each tier renders

Elementexpertbasiclearn
Section proseDense, terseDense + a one-paragraph plain-language lead per sectionSame as basic + why-it-matters framing
JargonUsed bareFirst use is defined inline — 함수 (function) style, term followed by a plain-language glossSame as basic + a glossary callout box
DiagramsInline SVG charts only (as today)+ one mermaid flowchart of the report's main flow+ multiple mermaid diagrams — flow, sequence, and/or state — one per concept that has structure worth seeing
ExamplesNone (numbers speak)One worked example per key claim, with concrete inputs and outputsSame as basic + a step-by-step walkthrough that derives the result, not just states it
AnalogiesNoneSparingly, where a concept is genuinely unfamiliarFreely — an everyday analogy per new concept
ClosingAction itemsAction items + "what to check yourself"Action items + self-check questions the reader can answer to confirm they understood
HTML size budget≤ 50KB≤ 120KB≤ 120KB
.md twinleanlean — identical rulelean — identical rule

The last row is the invariant, restated because it is the one that is easy to violate: no tier adds anything to the markdown twin. Enrichment is an HTML-only concern.

Authoring the enrichment (basic / learn)

  • Explain, then state. At basic / learn, a section that opens with a raw metric is a miss. Open with one sentence saying what the metric is and why the reader should care, then give the number.
  • Define every term on first use. Everyday-language gloss first, canonical English term in parentheses: 배포 (deployment) — 만든 코드를 실제 사용자에게 내보내는 일. After the first definition the bare term is fine.
  • Prefer a diagram to a paragraph when the content is a flow, a sequence, or a state machine. That is exactly what these tiers exist for.
  • Ground every example. A worked example uses real inputs from the report, not foo / bar.
  • Never pad. Enrichment means more understanding, not more words. A section a beginner already grasps needs no primer.

Diagram Policy

Charts and diagrams follow two different rules depending on what they are.

Inline SVG charts (all tiers)

Quantitative charts — bar, variance, timeline — are hand-authored inline SVG, exactly as today. They work everywhere: browser, email, print, offline. This is unchanged and applies at every tier.

Mermaid diagrams (basic / learn tiers only)

Structural diagrams — flowcharts, sequences, state machines — are rendered with mermaid, and mermaid needs JavaScript. To keep the single-file, offline-capable promise, mermaid is emitted in a hybrid form: the CDN renders it richly in a browser, and a no-JS fallback keeps it readable everywhere else.

Emit all three parts together:

  1. The mermaid source, in a <pre class="mermaid"> block — this is what the CDN renders, and it stays human-readable as plain text when it does not.
  2. One mermaid-CDN <script type="module"> — placed once per document, at the end of <body>, initialized with the design-token palette so diagrams match the report (--clay accent on --ivory background).
  3. A <noscript> fallback — either a hand-authored inline SVG of the same diagram, or, when the diagram is simple enough that its source reads clearly, a short prose summary of the flow. Never leave <noscript> empty.
<pre class="mermaid">
flowchart TD
  A[Markdown source] --> B{Audience tier}
  B -->|expert| C[Dense HTML]
  B -->|basic / learn| D[Enriched HTML + diagrams]
  C --> E[Lean .md twin]
  D --> E
</pre>

<noscript>
  <!-- inline SVG of the same flow, or a prose summary -->
  <p>Flow: the markdown source branches on audience tier — expert renders dense HTML,
     basic/learn render enriched HTML with diagrams. Both paths emit the same lean .md twin.</p>
</noscript>

<script type="module">
  import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";
  mermaid.initialize({
    startOnLoad: true,
    theme: "base",
    themeVariables: {
      primaryColor:      "#FAF9F5",  /* --ivory  */
      primaryTextColor:  "#141413",  /* --slate  */
      primaryBorderColor:"#D97757",  /* --clay   */
      lineColor:         "#87867F",  /* --g500   */
      secondaryColor:    "#E3DACC",  /* --oat    */
      tertiaryColor:     "#F0EEE6"   /* --g100   */
    }
  });
</script>

Degradation matrix (what the reader actually sees)

Contextexpertbasic / learn
Browser, onlineSVG chartsSVG charts + rendered mermaid diagrams
Browser, offlineSVG chartsSVG charts + <noscript> fallback (SVG or prose)
Email client (JS stripped)SVG chartsSVG charts + <noscript> fallback
PrintSVG chartsSVG charts + fallback (mermaid does not render to print reliably)

The expert tier's strict zero-JS guarantee is untouched — the mermaid exception is tier-gated and never fires there.

Diagram selection

Content shapeDiagram
A process with branches or decisionsflowchart
An ordered exchange between actors / systemssequenceDiagram
A thing that occupies one of several statesstateDiagram-v2
A quantity compared across categories or timeinline SVG chart (not mermaid)
A one-liner with no structureprose (no diagram — resist the urge)

Six Modes

Implemented modes

ModeStructure sections
status4 metric cards · highlights · completed table · velocity SVG bar chart · carryover
incidentTL;DR dark banner · timeline · log excerpts in <details> · code diff panel · impact table · action checklist
plansummary KPI strip · vertical milestone timeline · data-flow SVG · slice table · risk grid · success metrics
explainerside nav · collapsible <details> steps · tabbed code blocks (vanilla JS) · FAQ accordion · callout boxes
financial4 KPI cards · income-statement table (item / current / prior / delta / delta-%) · variance SVG horizontal bar chart · notes panel
prTL;DR · PR meta row (files / +− / branch) · before/after two-column cards · file tour <details> · key points · test checklist · rollout steps

Per-mode input fields

The main fields each template fills (template-internal variable names):

ModeKey input fields
status{{title}}, {{#metrics}}, {{#highlights}}, {{#completed_rows}}, {{#chart_bars}}
incident{{inc_id}}, {{severity}}, {{title}}, {{#tl_entries}}, {{#impact_rows}}, {{#actions}}
plan{{title}}, {{#kpis}}, {{#milestones}}, {{diagram_svg}}, {{#slices}}, {{#risks}}, {{#metrics}}
explainer{{title}}, {{lead}}, {{#steps}}, {{#config_tabs}}, {{#faq_items}}
financial{{title}}, {{period}}, {{#kpis}}, {{#statement_rows}}, {{chart_height}}, {{#variance_bars}}
pr{{pr_ref}}, {{title}}, {{author}}, {{branch}}, {{files_changed}}, {{additions}}, {{deletions}}, {{#focus_items}}, {{#test_items}}, {{#rollout_steps}}

Korean Font Policy

This skill permits a single font-CDN <link> как единственная внешняя зависимость, ради читаемости корейского текста.

Рендеринг только системными шрифтами нарушил бы единообразие между операционными системами (macOS: Apple SD Gothic Neo, Windows: Malgun Gothic), поэтому для предсказуемой корейской типографики требуется CDN шрифтов.

Сопоставление шрифтов по режимам

Режимsans (основной текст)serif (заголовки)mono (код)
status / financial / prPretendardPretendard 700JetBrains Mono
incidentPretendardPretendard 700JetBrains Mono
planPretendardNoto Serif KRJetBrains Mono
explainerNoto Sans KRNoto Serif KRJetBrains Mono
editorialPretendardChosunilbo MyungjoJetBrains Mono
legalKoPubWorld BatangKoPubWorld Batang BoldJetBrains Mono

URL-адреса CDN и шаблон preconnect находятся в references/fonts.md.


Design Tokens (контракт CSS-переменных)

Каждый режим объявляет одни и те же 8 CSS-переменных в :root.

:root {
  /* palette */
  --ivory: #FAF9F5;   /* background warm off-white */
  --paper: #FFFFFF;   /* card / panel background */
  --slate: #141413;   /* body text warm black */
  --clay:  #D97757;   /* accent / link terracotta */
  --clay-d:#B85C3E;   /* clay hover state */
  --oat:   #E3DACC;   /* secondary background / divider light tan */
  --olive: #788C5D;   /* secondary accent sage green */

  /* fonts */
  --sans:  "Pretendard", system-ui, -apple-system, sans-serif;
  --serif: "Pretendard", ui-serif, Georgia, serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* layout */
  --max-width:    860px;
  --radius-panel: 12px;
  --radius-row:   8px;
  --border:       1.5px solid var(--g300);
}

Оттенки серого: --g100: #F0EEE6, --g300: #D1CFC5, --g500: #87867F, --g700: #3D3D3A

Полная проверка контраста и токены для печати: references/design-tokens.md


Рекомендуемый шаблон цепочки

Этот рендерер находится в конце конвейера создания текста. Источник markdown может поступать из любого вышестоящего навыка работы с текстом, анализа или подготовки отчётов.

[text skill] → (optional review / humanize step) → html-report (mode selection)

Минимальная цепочка (быстрый рендеринг):

[text skill] → html-report (mode selection)

Примеры использования

Пример 1: еженедельный отчёт о статусе

Render the executive summary result as an HTML report for Hanul Engineering week 11.

Пример 2: финансовая отчётность

Convert the financial-statement result into an HTML report.

Пример 3: отчёт об инциденте

Summarize the payment-gateway 502 outage as an HTML incident report. Severity is SEV-2.

Пример 4: документ с описанием PR

Turn the realtime notification channel integration pull request into an HTML review document.

Пример 5: уровень, производный от активного стиля вывода

Render the caching-layer design as an HTML report.

При активном MoAI-Easy это разрешается в basic уровень: каждый раздел открывается вводным абзацем простым языком, блок-схема mermaid показывает путь чтения/записи кэша, и каждое ключевое утверждение сопровождается разобранным примером. При активном MoAI тот же запрос разрешается в expert и рендерится плотно. Парный .md в любом случае представляет собой тот же лаконичный артефакт.

Пример 6: явное переопределение уровня

Render the incident report as HTML for the expert audience — the on-call engineers already know the system.

Явный audience: expert имеет приоритет над производным уровнем, поэтому никакие вводные материалы или диаграммы не добавляются даже при MoAI-Learn.


Нецели

  • Не заменяет вывод markdown по умолчанию — HTML является дополнительной ветвью рендеринга.
  • Не подключает внешние библиотеки, такие как React, Vue, Tailwind CDN, Chart.js или D3. Единственные разрешённые внешние зависимости — это CDN шрифтов (все уровни) и CDN mermaid (basic / learn уровни, всегда с <noscript> запасным вариантом — § Политика диаграмм). Построение графиков остаётся встроенным SVG на каждом уровне; mermaid никогда не заменяет график.
  • Не вводит этап сборки (webpack, vite, esbuild).
  • Не разделяет человеческий артефакт на несколько файлов — отчёт представляет собой единый .html. Парный .md — это другой артефакт для другого читателя, а не вторая половина отчёта.
  • Не обогащает парный markdown. Глубина, зависящая от аудитории, — это исключительно вопрос HTML (§ Принцип асимметрии).
  • Внешнее тематическое оформление дизайн-системы (применение брендовых токенов на основе Tailwind CDN) выходит за рамки встроенных шаблонов, которые строго не имеют зависимостей. Параметр design_system не поддерживается этими шаблонами.

Ссылки

Проектные документы

  • references/design-tokens.md — контракт CSS-переменных, палитра, доступность
  • references/fonts.md — сопоставление шрифтов, URL-адреса CDN, шаблон preconnect

Шаблоны

  • references/templates/status.html.mustache — режим статуса
  • references/templates/incident.html.mustache — режим инцидента
  • references/templates/plan.html.mustache — режим плана
  • references/templates/explainer.html.mustache — режим объяснения
  • references/templates/financial.html.mustache — финансовый режим
  • references/templates/pr.html.mustache — режим pr

Проектная справка: Thariq Shihipar, "The Unreasonable Effectiveness of HTML" — источник подхода к однофайловому HTML без зависимостей.

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: moai-domain-html-report](https://darkplay.ru/ai/skills/modu-ai-moai-adk-moai-domain-html-report)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

mattpocock-skillsmattpocock · Агентские навыки Matt Pocock для настоящей инженерии: разбор задач, потоки спецификаций и…
41 комп.
core-skillsheygen-com · Базовый набор HyperFrames — устанавливайте именно его: роутер /hyperframes, доменные…
27 комп.
hyperframesheygen-com · Все навыки HyperFrames в одном статическом наборе. В большинстве случаев лучше…
27 комп.
ruflo-dddruvnet · Каркас Domain-Driven Design: ограниченные контексты, агрегатные корни, доменные события и…
240 комп.
diagram-designcathrynlavery · Технические и продуктовые диаграммы редакционного качества: 27 типов в виде автономного…
2 комп.
Presentation Claude Codeshanraisshan · Агент для обновления и правки презентации CLAUDE-CODE-BEST-PRACTICE: слайды, структура…
61 912 ★
Presentation Claude Geminishanraisshan · Агент для обновления и правки презентации CLAUDE-GEMINI: слайды, структура, стили, уровни…
61 912 ★
Presentation Vibe Codingshanraisshan · Агент для обновления и правки презентации VIBE-CODING: слайды, структура, стили, переходы…
61 912 ★
cockroachdbanthropics · Подключение Claude Code к кластерам CockroachDB для работы с базой данных: изучение схем…
100 комп.
hostingeranthropics · Развёртывание, управление и мониторинг сервисов Hostinger: сайты, домены, ecommerce…
100 комп.

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации изображений

Генерация изображений

Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты

MagviMagvi
По запросу
5.0
DALL-E 3OpenAI
По подписке
5.0
SupaLabSupalab
По запросу
5.0
Freestyling.aiFreestyling
Есть бесплатный тариф
4.9
ArtGeneration.meArtgeneration
Есть бесплатный тариф
4.9
BigjpgBigjpg
По запросу
4.9
Художник от VKVK
Бесплатно
4.9
Wonderink — ИИ-книги
Есть бесплатный тариф
4.8
Avato AI12ai
По запросу
4.8
Virton AIVirton
По запросу
4.8