Files
last30days-skill/skills/last30days/scripts/lib
Trevin Chow b1773be8f3 feat(emit): --emit=html for shareable self-contained briefs (#332)
Adds a one-command shareable HTML mode to /last30days. The skill detects
HTML intent (explicit --emit=html / --emit:html / --html flag in
$ARGUMENTS, or natural-language asks like "give me a shareable brief",
"for Slack", "export as HTML"), runs the normal research + chat synthesis
flow, then saves a self-contained HTML file to
~/Documents/Last30Days/{topic}-brief.html. The synthesis appears in chat
as usual; the HTML is an additional artifact for sharing.

User experience:

  /last30days OpenClaw --emit=html
  /last30days OpenClaw, give me an HTML brief for Slack

Synthesis prints to chat. Last line of the response: "📎 Shareable brief
saved to ~/Documents/Last30Days/openclaw-brief.html". Open it, drag it
into a message, browser-print to PDF, email it.

Architecture:

  - SKILL.md gets a small detection block (triggers + early exit +
    MUST/MUST NOT rules + rationale) that points to a reference file.
  - references/save-html-brief.md owns the implementation: capture the
    synthesis verbatim into a temp file via heredoc, invoke the engine
    with --emit=html --synthesis-file, save to disk, append the
    confirmation line to chat.
  - lib/render.py exposes render_for_html(report, synthesis_md=None) and
    render_for_html_comparison(...) -- clean markdown for HTML
    conversion. Omits debug file header, model-facing safety note, and
    data quality warnings (those stay in engine stderr; recipients can't
    act on them in a shared artifact).
  - lib/html_render.py is a new module: ~200-line CSS template (dark
    mode default, prefers-color-scheme switch, print stylesheet, mobile
    breakpoint), stdlib-regex markdown-to-HTML converter, marker-based
    META + engine-footer wrapping, PROSE_LABELS registry promoting plain
    -text labels to <h2>, colophon builder.
  - last30days.py adds --emit=html argparse choice and --synthesis-file
    PATH flag (engine still callable directly without the skill in the
    loop).

Design:

  - Voice-led research brief, not corporate report. Inter + JetBrains
    Mono via Google Fonts with full system fallbacks (no FOIT, works
    offline). Brand purple #a855f7 (#7c3aed in light mode). Type ramp:
    body 17px/400/muted, bold lead-in 17px/600/fg, h2 + .prose-label
    20px/600/fg, monospace badge/meta/footer/colophon at 13-13.5px.
  - 720px max-width, generous whitespace, no card layouts or shadows.
  - Print stylesheet: light theme, A4 margins, [href]::after URL
    footnotes, page-break-inside:avoid on the engine footer.

Templated (locked) shell:

  - HTML5 boilerplate, Google Fonts <link> with preconnect, all CSS
    inline.
  - .badge / .meta / .engine-footer / .colophon containers.

Flexible (role-based):

  - <h2> rendering covers BOTH plain ## headers (comparison mode per
    LAW 4 exception) AND promoted prose labels via PROSE_LABELS
    registry. Adding a new SKILL.md prose label is a one-line tuple
    addition; no CSS or template changes.
  - Marker-based engine boundaries (<!-- META: ... -->,
    <!-- PASS-THROUGH FOOTER -->) survive the markdown converter and
    get promoted post-conversion. Robust to engine output format
    changes.
  - Generic markdown-to-HTML for body content; future SKILL.md additions
    (new sections, tables, blockquotes) render correctly without code
    changes.

Tests: 30 new tests in tests/test_html_render.py covering snapshots
(rich/thin/comparison), CLI parsing, --synthesis-file end-to-end, prose
label promotion, warning exclusion from artifact, parseability via
html.parser, no-script self-containment.

No SKILL.md voice contract changes, no LAWs 1-8 changes, no new pip
dependencies, no JavaScript anywhere.
2026-05-02 11:30:22 -07:00
..
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00
2026-04-23 20:15:02 -04:00