agentleFS
MicrosoftKnown publishermicrosoft/vscode/src/vs/sessions/skills/html-preview/SKILL.md

html-preview

Skill195k starsChanged 3 days agoMITView on GitHub

Create visual reports, implementation plans, code-review explainers, comparisons, diagrams, and static UI mockups as inline HTML previews in the Agents window. Use when the user asks for visual or rendered output, not ordinary HTML code examples.

2 other projects use a version of this.

Trending

More talk lately.about the whole repository

Dec 2025: 2 mentionsJan 2026: 2 mentionsFeb 2026: 2 mentionsMar 2026: 1 mentionApr 2026: 3 mentionsMay 2026: 5 mentionsJun 2026: 2 mentionsJul 2026: 3 mentionsAug 2026: 2 mentionsSep 2026: 3 mentionsOct 2026: 3 mentionsNov 2026: 2 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/vscode repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about microsoft/vscode

The biggest 5 of 145 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 145

Talked about on Bluesky, Hacker News, Stack Overflow, YouTube, GitHub and the web (145 times).

On Bluesky · 48

43 more on Bluesky

On Hacker News · 39

34 more on Hacker News

On Stack Overflow · 24

19 more on Stack Overflow

On YouTube · 16

11 more on YouTube

On GitHub · 9

4 more on GitHub

On the web · 9

4 more on the web

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use HTML when layout helps the user understand or review the result.

    line 9
  2. Very specific:

    Use self-contained HTML and CSS, tables, simple inline SVG, and native details/summary disclosures.

    line 19
  3. Distinctive:

    Use headings, text labels, meaningful image descriptions, and readable contrast.

    line 20
  4. Distinctive:

    Prefer fluid layouts and wrapping text.

    line 22
  5. Very specific:

    Use semantic VS Code theme variables instead of hardcoded light/dark colors.

    line 25
  6. Distinctive:

    Use VS Code spacing, radius, and type-role variables where applicable, with standalone fallbacks.

    line 27
  7. Distinctive:

    Keep each preview below 64,000 characters and the overall response concise.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. -->

HTML previews

Use HTML when layout helps the user understand or review the result. Keep short explanations and ordinary code examples in Markdown. Honor the user's requested format; do not turn every answer into HTML.

This is on-demand authoring guidance bundled with the Agents window, available across workspaces when HTML previews and AI features are enabled. Rendering does not depend on invoking this skill.

Produce a preview

Return the document in a closed Markdown code fence with the language html-preview. Ordinary html fences remain source code. The preview appears after its closing fence arrives.

The chat.htmlPreview.enabled setting controls inline rendering in the Agents window and is off by default. While it is off, these fences display as source code. Do not change the user's setting unless asked.

  • Use self-contained HTML and CSS, tables, simple inline SVG, and native details/summary disclosures.
  • Use headings, text labels, meaningful image descriptions, and readable contrast. Do not rely on color alone to convey findings or status.
  • For long reports, provide a table of contents with links such as <a href="#risks">Risks</a> and matching element IDs. Only links within the same document work. Put external citations and workspace source links in Markdown outside the preview.
  • Prefer fluid layouts and wrapping text. Keep wide tables and code samples scrollable rather than clipping them.
  • Inline previews expand to fit their content and scroll with the transcript. Prefer content-based heights over viewport-height layouts.
  • Inline previews have no surrounding title bar, border, or permanent buttons. Leave html and body backgrounds, typography, and outer padding unset so the renderer can match the surrounding chat. Use explicit backgrounds only for meaningful inner surfaces.
  • Use semantic VS Code theme variables instead of hardcoded light/dark colors. Prefer inherited text color, var(--vscode-descriptionForeground, GrayText) for secondary text, var(--vscode-editorWidget-background, Canvas) for an inner panel, var(--vscode-widget-border, currentColor) for its border, and var(--vscode-textLink-foreground, LinkText) for links.
  • For charts, use the --vscode-charts-blue, --vscode-charts-green, and other chart palette variables with currentColor fallbacks. Include labels or patterns and a data table or text explanation; color alone is not sufficient.
  • Use VS Code spacing, radius, and type-role variables where applicable, with standalone fallbacks. Keep chrome quiet, make the main finding lead, and avoid giving every section a competing card or accent color.
  • Scripts, JavaScript event handlers, forms, inputs, buttons, embedded frames, canvas applications, external links, remote images, stylesheets, fonts, and network requests are not supported. Do not promise sliders, draggable boards, live charts, or working export buttons.
  • For interaction, use native disclosures and section links instead of script-dependent tabs or controls. If the user needs a running application, explain that it requires a separate application workflow.
  • Embedded PNG, JPEG, GIF, and WebP data images are supported; prefer simple inline SVG for diagrams so output stays compact.
  • Keep each preview below 64,000 characters and the overall response concise. Split a large explanation into focused sections or previews instead of embedding large assets.

Example:

Here are the options:

```html-preview
<style>
  .options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--vscode-spacing-size120, 12px); }
  .option { border: var(--vscode-strokeThickness, 1px) solid var(--vscode-widget-border, currentColor); border-radius: var(--vscode-cornerRadius-medium, 6px); padding: var(--vscode-spacing-size120, 12px); }
</style>
<h1>Choose an approach</h1>
<nav aria-label="Contents"><a href="#comparison">Comparison</a> | <a href="#risks">Risks</a></nav>
<div class="options" id="comparison">
  <section class="option"><h2>Small change</h2><p>Reuse the existing renderer.</p></section>
  <section class="option"><h2>Separate runtime</h2><p>Supports a full interactive application.</p></section>
</div>
<details id="risks"><summary>Risks and trade-offs</summary><p>The smaller change does not execute scripts.</p></details>
```

Read, save, and iterate

When rendering is enabled, right-click the preview or focus it and press Shift+F10 for Show Source, Open Preview, and Save HTML. Open Preview opens a larger reading surface. Save HTML exports a sanitized, self-contained HTML file with the current theme and opens it through the normal file-preview behavior. Expanded and exported documents retain their own background and padding. It does not save hidden JavaScript or unsupported controls from the original source.

Do not claim a file was created merely because a preview rendered. The user can choose Save HTML, or explicitly ask you to create an HTML artifact using the available file tools. Only create a file when the requested deliverable calls for one; keep it self-contained and script-free, and use the existing artifact-registration tool when available.

For revisions, use the existing response or the saved file supplied by the user as context. Preserve its structure, factual content, section IDs, and intended format while making the requested changes. Keep any raw-source export distinct from a sanitized preview export; never suggest that preview restrictions automatically apply to arbitrary HTML opened elsewhere.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.