Html report

From Lingtai-AI/lingtai · View interactive version

Html report is an AI agent skill from the GitHub repository Lingtai-AI/lingtai. Nested swiss-knife reference for standalone HTML deliverables. Produce polished, self-contained HTML deliverables (research memos, literature maps, dashboards, audit reports, side-by-side comparisons) that humans open in a browser or receive as Telegram/email attachments. Covers a standalone HTML sk

How to use this skill

Skill file

HTML Report — Standalone Artifacts for Humans

You are writing an HTML file a human will open in a browser or receive as an attachment. This skill exists because agents repeatedly ship HTML with unrendered LaTeX inside <pre>/<code> blocks and other recoverable presentation gaps. Follow the checklist below before declaring the file ready.

When to use HTML

Reach for HTML — instead of plain text, Markdown, or a PDF — when the human will benefit from:

If the content is short and equation-free, plain text or Markdown is usually enough.

Standalone HTML skeleton

Start from the bundled template — it already wires up typography reset, cards,

callouts, tables, anchor nav, print styles, and MathJax. Copy it, fill in the

<!-- TODO --> markers, drop unused sections, and save under a project-local

path (paper/drafts/<topic>-$(date -u +%Y-%m-%d).html):

cp ~/.lingtai-tui/utilities/swiss-knife/reference/html-report/assets/template.html \
   paper/drafts/<your-topic>-$(date -u +%Y-%m-%d).html

Key rules for any HTML you produce, whether from the template or freshly authored:

Math rendering checklist

<pre> and <code> render LaTeX as literal text. They do not render math. This is the most common failure mode for HTML deliverables.

If the artifact contains equations:

  1. Add MathJax in <head> — once, near the top:

```html

<script>

window.MathJax = {

tex: {

inlineMath: [['\\(', '\\)']],

displayMath: [['\\[', '\\]'], ['$$', '$$']],

processEscapes: true

},

svg: { fontCache: 'global' }

};

</script>

<script defer src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>

```

  1. Write inline math as \( ... \) and display math as \[ ... \]. Avoid $...$ — it conflicts with currency in prose. Avoid $$...$$ unless you really want a centered display block and trust the source has no stray $.
  1. Do not wrap equations in <pre> or <code>. Put them in <p>, <div>, or directly in <section>. MathJax scans the DOM body for \(...\) and \[...\] and replaces them with rendered SVG.
  1. Escape LaTeX backslashes correctly if you are templating from a programming language — \\( in a Python f-string becomes \( in the output.
  1. Online vs offline tradeoff. CDN MathJax is one line and works everywhere with network. For fully offline artifacts (air-gapped reader, archival), either:

Pick the offline path explicitly if the human said "must work offline." Otherwise CDN is the default.

Source-derived study notes

For study notes, agree the source, goal, scope/order and lesson granularity with

the human before generating a batch of artifacts. These source boundaries also

apply to research memos and literature maps. For citation-bearing claims, read

the academic evidence gate before drafting.

These boundaries are not optional. They apply from intake onward.

own examples. Do not copy the author's prose, do not paste chapters or long

passages, and do not recreate the book's figures/tables verbatim. Short quotes

for commentary are fine; wholesale reproduction is not.

I don't have to buy/read it" or "give me the full text." Offer legitimate

distillation (concepts, your own worked examples, study aids) instead.

the page/section range it draws from, plus a provenance caveat that these are

re-explained study notes, not the original.

legitimate source for (owned copy, library/institutional access, open-access,

their own notes). If they cannot, stop and say so.

rather than the specific source (e.g. you only have the ToC), label it clearly

so the learner knows what is the book's treatment vs. general background. Note

that your knowledge has a cutoff and the edition may differ — tell the human to

verify specifics against the actual source.

numbers, no confidently wrong technical claims. If unsure of a fact, say so and

point the learner to the source section to confirm.

Artifact hygiene

Validation checklist (before sending)

Run through these every time, in order. They are cheap and the failure modes are common.

  1. File exists and is non-empty. ls -lh <path> — sanity check the byte count is plausible (a research memo is typically 10–80 KB).
  2. If math is present, MathJax is wired in. grep -l "MathJax" <path> must match. If it does not, math will not render — fix it now.
  3. No equations stuck in <pre> or <code>. grep -nE '<(pre|code)>.*\\\\[\(\[]' <path> — any hits are bugs.
  4. No stray control characters from programmatic generation. LC_ALL=C grep -nP '[\x00-\x08\x0B\x0C\x0E-\x1F]' <path> should be empty. If you generated HTML from a Python string with raw user input, this can silently break rendering.
  5. HTML parses. Optional but cheap: python3 -c "from html.parser import HTMLParser as H; p=H(); p.feed(open('<path>').read())" — raises on malformed tags.
  6. External links are absolute. grep -nE 'href="(arxiv:|doi:|//)' <path> — relative or scheme-less hrefs break when the file is downloaded.
  7. Open it locally if a browser is available: open <path> (macOS) or xdg-open <path> (Linux). Eyeball the equations and headings.
  8. When sending via Telegram/email, attach the actual HTML file (not paste its contents) and include the path in the message so the human can find the source later.

Found a bug or issue? If you encounter any problems with this skill, load the lingtai-issue-report skill and follow its instructions to report it.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.