Exploration & planning
Side-by-side approaches, visual directions, implementation plans with milestones, data flow, risky code, gates, rollback.
The htmlify decision model: which answers should leave the terminal as a self-contained HTML artifact, and which should stay as plain text. Distilled from the project's principles reference.
At least one of these five conditions must hold. If none do, stay in markdown.
Inverse rule: stay in markdown when the answer is short, linear, or command-like.
| Situation | Markdown | HTML | Verdict |
|---|---|---|---|
| Comparing options side by side | Sequential sections; the reader scrolls back and forth to hold both in mind. | Columns, matrices, and decision panels put tradeoffs in one viewport. | HTML |
| Work with shape / architecture | ASCII diagrams and nested lists approximate structure, poorly. | Inline SVG flowcharts, module maps, ownership lanes, dependency graphs. | HTML |
| Meeting, PDF, or archive use | Renders differently per viewer; no layout control for print. | One self-contained file with print CSS; opens anywhere, archives intact. | HTML |
| Interaction needs | Static by definition; no tabs, filters, or collapsible detail. | Browser-native tabs, toggles, accordions, and export controls (per profile). | HTML |
| Reusable tool | An answer you read once. | A local editor, triage board, or tuner you keep and reopen. | HTML |
| Short, linear, or command-like answer | Instant to read, trivial to copy, fits the terminal it was born in. | Overhead with no payoff; the file ceremony adds nothing. | MARKDOWN |
Side-by-side approaches, visual directions, implementation plans with milestones, data flow, risky code, gates, rollback.
Annotated diffs, module maps, file tours, call graphs, reviewer focus lists, severity tags, jump links.
Tokens, swatches, type scales, spacing systems, component variants, states, and accessibility notes as live surfaces.
Small clickable flows or animation sandboxes, only when interaction changes the decision. Exportable state if it edits.
Inline SVG flowcharts, architecture maps, lifecycle diagrams, figure sheets. Readable labels, no decorative complexity.
Section slides with arrow-key navigation, progress, print CSS, and dense meeting-ready copy.
Explainers with TL;DR boxes, collapsible path steps, tabbed code samples, examples, glossary, and FAQ.
Status cards, small charts, timelines, proof snippets, shipped/slipped/carryover columns, next-action boards.
Local-only UI for manipulating data: triage boards, flag editors, prompt tuners, ordering tools. Always with copy/export.
rich for script-free documents, app for artifacts with legitimate inline interactivity, deck for slide decks.Often you should — markdown is the correct format for short, linear, command-like answers, and htmlify says so explicitly. HTML replaces markdown only when the work is visual, spatial, comparative, interactive, or reusable in the browser. The five criteria in section 1.0 are the gate; if none apply, an HTML file is ceremony without payoff.
No — it is per profile. The rich profile forbids scripts: explainers, briefs, reports, and plans should not need them. The app profile allows inline scripts for artifacts that legitimately carry interactivity — editors, prototypes, triage boards — provided the script is authored directly in the artifact. The deck profile covers slide decks with keyboard navigation. In all cases generated HTML is treated as untrusted until validated.
Yes — print CSS is required for briefs, reports, plans, and decks, and recommended for anything meant to be shared, archived, or exported as PDF. Under Hardcopy, the paper turns white, crop marks render literally, the plate prints as the document header, and stamps stay grayscale-legible. This page carries its own @media print rules.
Yours wins. Hardcopy is the default visual identity, not a mandate: when a project supplies DESIGN.md, brand tokens, or an established design system, those are authoritative and the artifact should be styled with them instead.
With the bundled validator, run before the final response. It checks for a standalone doctype/html/body structure, inline-only assets, profile-appropriate interactivity, and structural soundness. Every reported error must be fixed before the artifact ships; remaining warnings are reported to the user.
npx -y @zakelfassi/htmlify htmlify-answer --validate artifact.html --profile rich