SkillAtlasSkill 详情

html-artifact

Essays and writing behind this toolkit live at vexjoy.com.

审核状态:已审核Quality 72Security 70

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年8月31日

VexJoy Agent

VexJoy Agent

Essays and writing behind this toolkit live at vexjoy.com.

AI agents skip steps.

"Looks correct" replaces running tests. "Trivial change" replaces verification. The agent confidently ships broken code because nothing structurally prevented it from skipping the work.

Harnesses have a second problem: given only a skill list, they do not route eagerly enough, or correctly enough. Good skills sit unused. So this toolkit connects the skills, agents, and workflows we want directly into the harness, automatically. You don't have to understand what is here. Say what you want in plain English and you get all the value we have put into it: the right specialist with the right methodology, behind gates that demand exit codes, not assertions.

44 domain agents, 122 workflow skills, 78 hooks, 136 scripts. Agents carry knowledge, skills enforce methodology, hooks block incomplete work, scripts handle determinism.

Works across Claude Code (/do), Codex ($do), Factory (/do), Reasonix (/do).

What It Looks Like

$ claude

> /do debug this Go test

  Routing: go-engineer + systematic-debugging
  Phase 1/4: Reproduce: running test, capturing failure...
  Phase 2/4: Hypothesize: 3 candidates from stack trace...
  Phase 3/4: Verify: isolated root cause in connection pool timeout
  Phase 4/4: Fix: patch applied, test passing, PR opened

  ✓ Delivered: PR #847, fix connection pool timeout in health check

The router reads intent, picks a Go agent paired with a debugging skill, and runs the full lifecycle. You typed one sentence. The system did the rest.

The Pipeline

  ROUTE        PLAN         EXECUTE      VERIFY       DELIVER      RECORD
 ┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐
 │ /do  │───▶│ Task │───▶│Agent │───▶│Tests │───▶│  PR  │───▶│Route │
 │Router│    │ Plan │    │+Skill│    │Gates │    │Branch│    │Result│
 └──────┘    └──────┘    └──────┘    └──────┘    └──────┘    └──────┘

Anti-Rationalization

This is the single thing that separates it from "agent with a system prompt."

Agent SaysWhat Happens
"Code looks correct, skip tests"Exit gate requires test output. Blocked.
"Trivial change, no verification"Hook blocks completion without evidence.
"Similar to before"Skill demands case-specific proof.
"User is in a hurry"Protocol overrides time pressure.
"I'm confident"Gate demands exit code, not assertion.

Hooks fire automatically. Gates block completion. Skills encode counter-arguments at every skip-worthy step. The agent verifies or it doesn't finish.

For what I do, the difference is enormous. If you're doing simple single-file edits, maybe less so.

Knowledge Work Is First-Class

The same routing serves knowledge work. The content engine researches, drafts in a calibrated voice, validates against 397 AI patterns, and repurposes finished pieces for each platform. /html turns any request into a single self-contained HTML file: report, slide deck, prototype, data viz, diagram. Non-engineers who try the toolkit consistently name the HTML artifacts as the thing they love. No code, no setup beyond the installer.

It Proves Its Own Changes

Changes to the toolkit itself ship with evidence. New skills get blind A/B tests against a no-skill baseline before merge. Routing and writing-standard decisions carry measured verdicts; PHILOSOPHY.md cites the numbers. Experiments that lost go into the negative-results registry, what-didnt-work.md; the registry now covers routing reversals, unvalidated A/B citations, and disabled lint rules alongside the original program refutations.

The automated nightly evolution loop (/evolve, writes to evolution-reports/) ran regularly through mid-May 2026. It is currently dormant; recent evidence has come from manual PRs instead.

Installation

git clone https://github.com/notque/vexjoy-agent.git ~/vexjoy-agent
cd ~/vexjoy-agent
./install.sh

Links into ~/.claude/ and mirrors into ~/.codex/, ~/.factory/, ~/.reasonix/ — each mirror only when that runtime is detected (its command on PATH or its home dir already exists). The installer asks symlink (live updates via git pull) or copy (stable snapshot).

Want only part of the toolkit? Run ./install.sh --configure to pick which skills, agents, and hooks install, or copy .local.example/profile.yaml to .local/profile.yaml and edit. No profile file = full install, unchanged behavior. Credit: @thomasvan. Details: .local.example/README.md.

CLIEntry Point
Claude Code/do
Codex$do
Factory/do
Reasonix/do

Full setup: docs/start-here.md

Codex CLI Parity

Mirrors agents, skills, and supported hooks into ~/.codex/. The original six-hook allowlist was correct for Codex v0.114, when tool hooks only intercepted Bash. Current support requires Codex v0.144.1+ and classifies the 74 Claude hook registrations as 26 native, 35 adapter-backed, and 13 unsupported (61 supported). These are registration counts, not unique hook files. The installer also preserves explicit per-subagent model routing for GPT-5.6 Sol by setting the MultiAgent V2 compatibility keys documented in openai/codex#31814.

Codex now exposes apply_patch to tool hooks. VexJoy's adapter converts each patch operation into the Write/Edit payload expected by existing guards, but it cannot intercept writes performed through unified_exec, unmatched MCP tools, WebSearch, or other unsupported tool paths. PreCompact and Stop adapters also receive less telemetry than Claude Code: Codex does not provide Claude's conversation_history or session_data. This is expanded compatibility, not full Claude parity.

After install or any hook-definition change, run /hooks in Codex and review the new definitions before trusting them. Codex hash-trusts hook commands and skips changed, unreviewed definitions.

Gemini CLI / Antigravity CLI Support (removed)

Gemini CLI support removed (deprecated upstream, transitioned to Antigravity CLI); Antigravity support pending CLI maturity. Per Google's transition announcement, Gemini CLI stops serving requests on 2026-06-18 for Google AI Pro / Ultra and free Gemini Code Assist for individuals. Gemini API integrations (image-gen backends, sprite pipeline, GEMINI_API_KEY) are unaffected and stay in the toolkit.

If a prior install mirrored into ~/.gemini/, remove the stale mirrors with:

rm -rf ~/.gemini/skills ~/.gemini/agents ~/.gemini/hooks ~/.gemini/scripts ~/.gemini/antigravity/plugins/vexjoy-agent
Factory CLI Support

Mirrors agents (as "droids"), skills, and all hooks into ~/.factory/. Hook config merges into ~/.factory/settings.json with paths rewritten.

Reasonix Support

Mirrors skills, scripts, and the allowlisted hooks (scripts/reasonix-hooks-allowlist.txt) into ~/.reasonix/ (no agent or custom-command surface, so neither is installed; the /do router rides in as a skill). Reasonix fires only 4 events (PreToolUse, PostToolUse, UserPromptSubmit, Stop), so only hooks for those events are allowlisted. Hook config is written to the hooks key of ~/.reasonix/settings.json in Reasonix's native flat shape (one entry per hook, match regex over the tool name); the generator builds absolute python3 commands, so no path rewrite is applied. MCP/model/permissions in ~/.reasonix/config.json are user-owned and left untouched.

Token-saving mode

The toolkit supplies its own routing, domain knowledge, methodology, and enforcement. The default system prompt duplicates most of that.

claude --system-prompt "."

Strips built-in tool-use instructions. The toolkit's agents, skills, hooks, and CLAUDE.md provide equivalent coverage.

Four Layers

LayerCountDoes
Agents44Domain knowledge: idiom tables, failure mode catalogs, error-to-fix mappings
Skills122Phased methodology with gates. Can't skip steps. Each phase has exit criteria requiring evidence.
Hooks78Fire on lifecycle events. Block incomplete work. Zero LLM cost.
Scripts136Determinism: test runners, linters, validators. No LLM judgment.

Full skill catalog: docs/skills.md.

┌─────────────────────────────────────────────────┐
│  SKILL.md                                       │
│  ┌─ Frontmatter ─────────────────────────────┐  │
│  │ triggers, pairs_with, success-criteria     │  │
│  └────────────────────────────────────────────┘  │
│  Reference Loading Table (conditional imports)   │
│  Phased Instructions (numbered, with gates)      │
│  Verification (evidence requirements)            │
└─────────────────────────────────────────────────┘

Built with the Toolkit

A game built entirely by Claude Code using these agents, skills, and pipelines:

Choose Your Path

I just want to use it Install, learn /do, done.

I do knowledge work Writing, research, data analysis, moderation, HTML artifacts. No code.

I'm a developer Architecture, extension points, adding agents and skills.

I'm an AI power user Routing tables, pipelines, hooks, telemetry DB.

I'm an AI agent Machine-dense inventory. Tables, paths, schemas.

I'm on LinkedIn 🚀 Thought leadership. Agree? 👇

Philosophy

  • Zero-expertise operation. Say what you want. The system classifies, dispatches, enforces, delivers.
  • LLMs orchestrate, programs execute. Deterministic work belongs to scripts. LLM judgment handles design decisions, diagnosis, review.
  • Density. Every word carries instruction, rule, or decision. Cut everything else.
  • Breadth over depth. Right context ensures correctness. Unfocused context adds cost.
  • Structural enforcement. Exit codes enforce what instructions can't. Quality gates are automated, not advisory.
  • Everything pipelines. Complex work decomposes into phases. Phases have gates. Gates prevent cascading failures.

Full design philosophy: PHILOSOPHY.md

Maintenance

One report-only script surfaces upkeep work; it prints a digest and never edits, deletes, or blocks.

  • python3 scripts/stale-skill-scan.py --top 20 ranks stale skills and agents as pruning candidates. Run it quarterly; see docs/deprecation-template.md.

Scheduled work follows the same boundary as everything else: judgment uses agents; repeatable plumbing uses scripts.

NeedUse
Run a deterministic command on a schedulescripts/agent-scheduler.py with runner: "command"
Run an agent judgment on a schedule, webhook, or file changescripts/agent-scheduler.py with the default runner: "claude"
Install or remove a user crontab entry safelyscripts/crontab-manager.py
Audit shell cron reliabilitycron-automation
Keep one interactive objective moving until criteria verifyobjective-loop

Contributing

See CONTRIBUTING.md.

License

MIT. See LICENSE.

其他

中风险

  • 来源需自行核对维护者身份。
  • 包含脚本或命令调用,安装前请复核。
  • 可能需要外部 token、网络权限或第三方服务。
  • 未检测到高风险命令。
  • 扫描发现:4 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/notque/vexjoy-agent.git
  3. 将 "skills/meta/html-artifact" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/notque/vexjoy-agent.git
  3. 将 "skills/meta/html-artifact" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/notque/vexjoy-agent.git
  3. 将 "skills/meta/html-artifact" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/notque/vexjoy-agent.git
  3. 将 "skills/meta/html-artifact" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/notque/vexjoy-agent.git
  3. 将 "skills/meta/html-artifact" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
name: html-artifact
description: |
  Generate rich self-contained HTML artifacts instead of markdown. Auto-detects
  artifact shape (spec, code-review, prototype, report, editor, data-viz,
  diagram, deck) and loads shape-specific patterns. Bundles Birchline design system with 4 theme
  presets. Use for "make HTML", "as HTML", "HTML artifact", or auto-injected
  by router when output benefits from rich visualization.
user_invocable: true  # justification: users type "/html" directly for explicit
                      # HTML output; also auto-injected by /do router enhancement
command: /html
argument-hint: "[description of what to generate]"
routing:
  triggers:
    - HTML artifact
    - make HTML
    - as HTML
    - rich visualization
    - interactive document
    - HTML file
    - self-contained HTML
    - visual companion
    - pptx
    - powerpoint
    - editable deck
    - pitch deck
    - slide deck
    - make a deck
  pairs_with:
    - pr-workflow
    - research-pipeline
    - planning
    - publish
  complexity: Medium
  category: meta

/html - Self-Contained HTML Artifacts

Generate single self-contained .html files that replace markdown when the output needs color, interactivity, layout, or visualization. Auto-detect artifact shape from the request, load shape-specific patterns, generate, validate, deliver.

Core constraint: Every artifact is ONE .html file. All CSS in <style>, all JS in <script>. No CDN links, no frameworks, no build steps, no external dependencies. Works offline, opens in any browser.


Instructions

Overview

5-phase pipeline: DETECT SHAPE, LOAD CONTEXT, GENERATE, VALIDATE, DELIVER. Phase 1 classifies the request into one of 8 shapes via deterministic script. Phase 2 loads the Birchline design system plus shape-specific reference. Phase 3 dispatches a subagent to generate the HTML. Phase 4 validates structure. Phase 5 delivers the file path and offers browser preview. Phase 6 EXPORT (optional) renders to PDF when the user asks for one.


Phase 0: CHECK SAVED TEMPLATE (clone-first)

Before detecting a shape, check whether the request names or matches a saved template. A saved template is a frozen, human-authored layout; cloning it beats regenerating structure because the layout cannot drift.

Run: python3 skills/meta/html-artifact/scripts/fill-template.py --list

If the request names a listed template (e.g. "project kickoff", "business review", "system design") or clearly matches one:

  1. Read templates/saved/<name>.slots.json to learn the slots.
  2. Generate ONLY the slot content — never the layout, CSS, or chrome.
  3. Write the slot values to a JSON file and run fill-template.py --template <name> --slots <file> --out <artifact>.
  4. Skip Phases 1–3 (shape detection, assembly, generation). Go to Phase 4 VALIDATE.

The fill script fails loud on a missing required slot, an undeclared slot name, or a leftover marker. Fix the slot JSON; do not edit the template.

If no saved template matches, continue to Phase 1.

See "Fidelity & Authority" below for the content-vs-layout rule that governs clone mode.


Phase 1: DETECT SHAPE

Classify the user's request into one of 8 artifact shapes.

Run: python3 skills/meta/html-artifact/scripts/detect-shape.py --request "{user_request}"

The script outputs a shape name and confidence score.

ShapeTrigger SignalsWhat It Produces
specplan, explore options, compare N approaches, brainstormSide-by-side grids, Pro/Con badges, SVG data-flow diagrams, risk tables
code-reviewreview PR, explain diff, annotate code, understand moduleDiff rendering, severity colors, margin annotations, jump links
prototypeprototype, animation, tune, try options, component variantsSliders, CSS var live update, animation sandbox, contact sheets
reportreport, summarize, status update, explain how X works, incidentTL;DR box, collapsible sections, timeline, metric callouts, SVG diagrams
editorreorder, triage, edit config, tune prompt, pick valuesDrag-drop, kanban, toggle switches, split-pane, export buttons
data-vizvisualize, chart, dashboard, show data, trendsSVG charts, canvas, interactive tooltips, filter controls
diagramdiagram, flowchart, architecture, sequence, SVG, illustrate, figureInline SVG diagrams, annotated flowcharts, figure sheets, interactive node details
deckslides, presentation, deck, talk, pitchArrow-key navigable slide deck, 16:9 aspect ratio, slide types, progress bar

Gate: Shape detected with medium+ confidence. -- because low-confidence classification produces artifacts that mix concerns and satisfy no shape well. Fallback to "report" (safest general-purpose shape) if confidence is low or ambiguous.


Hybrid Shapes

Real content often combines two shapes — a report with embedded diagrams, a spec with data-viz charts. When detect-shape.py returns a primary shape with medium/high confidence but the request also contains signals for a secondary shape, use the hybrid pattern:

Primary Shape+ SecondaryResult
report+ diagramReport layout (TL;DR, collapsibles, TOC) with inline SVG diagrams between sections
report+ data-vizReport layout with embedded SVG charts illustrating key metrics
spec+ diagramComparison grid with SVG flow diagrams showing each option's architecture
spec+ data-vizComparison grid with charts showing performance/cost per option
diagram+ reportFigure sheet with explanatory text sections between diagram groups

Detection: After running detect-shape.py, check if the secondary_shape field is non-null. If so, load BOTH shape references in Phase 2.

Generation rule: Primary shape controls page layout (outer structure). Secondary shape provides embedded components (inner elements). The html-builder agent receives both shape patterns and uses primary for structure, secondary for visual elements within sections.

Example: "create a visual companion for my pipelines article with diagrams and explanations" → primary: report (explain, article), secondary: diagram (visual, diagrams). Load shape-report-research.md AND shape-diagram-illustration.md.


Phase 2: ASSEMBLE TEMPLATE + LOAD CONTEXT

Two parallel steps: (A) run the template assembler to produce a pre-filled HTML skeleton, and (B) load principle-focused reference files for the builder agent.

Step A -- Assemble template (deterministic):

Run: python3 skills/meta/html-artifact/scripts/assemble-template.py --shape {shape} --title "{title}" --components {components}

The script reads CSS/JS from templates/ and injects:

  1. CSS reset (templates/base-reset.css)
  2. Full theme tokens (templates/themes/{theme}.css)
  3. Shape-specific layout CSS (templates/shapes/{shape}.css)
  4. Component CSS + JS (templates/components/{name}.{css,js})

The assembler also emits a self-describing stamp as the FIRST CSS comment, so a later run can re-audit the build statelessly (recover shape/theme from output):

/* vexjoy-artifact: shape=<shape> theme=<name> contrast=<pass|fail|n/a> */

shape and theme come from this build's decisions. contrast=n/a at assembly time because the assembler runs no WCAG check; the stamp is a claim, not proof — Phase 4's slop scan verifies the rendered CSS independently rather than trusting it.

Select components based on shape needs:

ShapeTypical Components
spectabs,copy-button,theme-toggle
code-reviewcollapsible,filter,keyboard-nav,theme-toggle
prototypeslider,copy-button,theme-toggle
reportcollapsible,theme-toggle,copy-button
editordrag-drop,filter,copy-button
data-vizfilter,theme-toggle
diagramcopy-button,theme-toggle
deckkeyboard-nav,theme-toggle

Step B -- Load reference files (principles + guidance):

Always load:

  1. references/design-system.md -- Theme selection, token architecture, accessibility checklist, SVG conventions, common mistakes
  2. references/interaction-patterns.md -- Component descriptions, when-to-use guidance, accessibility rules, composition guide

Load per detected shape:

ShapeReference FileKey Content
specreferences/shape-spec-exploration.mdLayout descriptions, composition guide, common mistakes
code-reviewreferences/shape-code-review.mdSeverity system, interaction patterns, section ordering
prototypereferences/shape-design-prototype.mdControl types, export requirements, layout patterns
reportreferences/shape-report-research.mdSection ordering, TL;DR placement, metric patterns
editorreferences/shape-custom-editor.mdEditor types, export bar rules, common mistakes
data-vizreferences/shape-data-visualization.mdChart types, coordinate system, color scales
diagramreferences/shape-diagram-illustration.mdSVG construction rules, diagram types, interaction patterns
deckreferences/shape-slide-deck.mdSlide types, navigation, print styles

Gate: Template assembled + required references loaded. -- because the template provides deterministic CSS/JS injection, and references provide the judgment guidance the builder needs.


Phase 3: GENERATE

Dispatch the html-builder subagent with the pre-assembled template.

  1. Read agents/html-builder.md for the subagent prompt
  2. Dispatch with: pre-assembled template (from Step A), design system principles, interaction pattern guidance, shape-specific reference, user request
  3. Agent fills in the content structure using CSS classes already defined in the template
  4. Agent writes a single .html file to the project directory (or /tmp/html-artifacts/ if no project context)

Self-contained file constraints (inline here because they govern generation):

ConstraintReason
All CSS in <style> tagNo external stylesheets -- file must work offline
All JS in <script> tagNo CDN imports -- no React, Vue, Tailwind CDN, Bootstrap CDN
Vanilla JS onlySingle file, no build step, no transpilation
Must include <title>Browser tab identification, validation requirement
Must include <meta charset="utf-8">Consistent rendering across platforms
Must include <meta name="viewport">Responsive on mobile/tablet
Semantic HTML sections<header>, <main>, <section>, <footer> for structure
SVG inline, not <img src>No external file references
Max 500KB file sizeKeeps generation time reasonable, prevents bloated inline assets

Constraint: No framework boilerplate. -- because React/Vue/Svelte require build steps and external imports that violate the single-file self-contained requirement. Vanilla JS handles all 8 shapes adequately.

Constraint: Generate HTML directly, never generate markdown then convert. -- because markdown-to-HTML conversion loses the shape-specific layout, interactivity, and visual structure that justifies using HTML in the first place.

Gate: .html file exists on disk. -- because Phase 4 validation reads the file; a missing file means generation failed silently.


Phase 4: VALIDATE

Run deterministic validation on the generated file.

Run: python3 skills/meta/html-artifact/scripts/validate-artifact.py {html_file_path}

The script checks:

CheckFails When
Valid HTML structureMissing <html>, <head>, or <body>
No external dependenciesAny src= or href= pointing to external URLs
Has <title>Missing or empty <title> tag
Has charset metaMissing <meta charset>
Has viewport metaMissing viewport meta tag
File size under 500KBExcessive inline assets or animation keyframes
No broken internal refshref="#id" pointing to nonexistent id attributes
Rendered-CSS slop scancss_slop_rules.scan_css over the file content (warnings only, non-blocking)

The slop scan (vendored css_slop_rules.py) flags 7 rendered-CSS patterns — transition-all, universal-hover-scale, gradient-text-headline, focus-ring-fade, emoji-feature-icon, two-line-cta, contrast-canary. It is shape-agnostic (checks CSS/markup, not page structure), so it applies to all 8 shapes including hero-less ones. Findings surface as warnings and do not fail the build yet; promote a rule to error in css_slop_rules.py to make it blocking.

Gate: All validation checks pass. -- because an HTML file with external dependencies fails offline, missing meta tags render inconsistently across browsers, and missing structure breaks accessibility.

If validation fails: Read the specific failures from script output, fix the identified issues in the HTML file, re-run validation. Maximum 3 fix attempts before showing the user the remaining issues and asking for guidance.


Phase 5: DELIVER

  1. Print the absolute file path
  2. Print a 1-line summary of what was generated (shape + key features)
  3. Ask user: "Open in browser?"
  4. If yes: run open {file} (macOS) or xdg-open {file} (Linux)

Constraint: Detect headless/SSH environments before offering browser open. -- because xdg-open fails without a display server, producing confusing errors. Check $DISPLAY on Linux or $SSH_TTY presence. If headless, print path only and skip the open offer.


Phase 6: EXPORT (optional)

Render the generated HTML to PDF. Opt-in only — HTML stays the default deliverable.

Fires when the user message contains any of: "PDF", "export PDF", "make a PDF", "as PDF", "send as PDF", "save as PDF", "PDF version", "PDF export". Without one of those signals, this phase stays dormant.

Runs:

python3 skills/meta/html-artifact/scripts/to-pdf.py \
    --input <generated.html> \
    --output <generated.pdf> \
    --json

The script auto-detects shape from <body data-shape="..."> (the assembler adds it in Phase 2). Page size, orientation, and margins come from a per-shape map: deck renders 13.333in × 7.5in landscape with no margin; spec, code-review, prototype, data-viz, and diagram render Letter landscape; report and editor render Letter portrait. Falls back to Letter portrait when shape is unknown.

Delivers both file paths to the user. The JSON output reports {"output", "page_count", "shape", "bytes"} — page_count reflects slide count for decks, 0 otherwise.

If Playwright is unavailable, exit code 2 surfaces install instructions: pip install -e ".[pdf]" && playwright install chromium. Pass that hint along to the user instead of failing silently.

See references/pdf-export.md for the full page-size table, troubleshooting (font fallback, image timing, install failures), and per-shape print stylesheet inventory.


Phase 7: EXPORT-PPTX (optional)

Render the generated HTML deck to an editable Microsoft PowerPoint .pptx. Opt-in only — HTML stays the default deliverable. Mirrors Phase 6 EXPORT-PDF in shape: signal-triggered, deterministic, runs after the HTML is built.

Fires when the user message contains any of: "pptx", ".pptx", "powerpoint", "editable deck", "editable", "as pptx", "export pptx", "hand-off", "corporate template". Without one of those signals, this phase stays dormant.

Only valid when the detected shape is deck. Other shapes (report, spec, diagram, etc.) cannot be exported to PPTX — fall back to Phase 6 PDF if the user asks.

Runs:

python3 skills/meta/html-artifact/scripts/pptx-bridge/run-unified.py \
    --input <generated.html> \
    --format pptx \
    --out <generated.pptx> \
    --no-render

The bridge re-authors slides natively via python-pptx because no general HTML→PPTX converter preserves CSS-rich layout. Output is 13.333 × 7.5 in (16:9), dark navy theme, Aptos body / Cascadia Code mono. Each <section class="slide"> becomes one editable slide; up to 12 layout types (title, content, metric_grid, layer_rows, pipeline, code_block, compare_table_2col/3col, outcome_grid, split_narrow, closing) map 1:1 to native python-pptx builders.

--out accepts either a .pptx file path (single-file mode) or a directory (writes the .pptx plus slides.json, report.md, optional render/ siblings). --no-render skips the optional LibreOffice QA step; required on hosts without soffice.

If python-pptx is unavailable, exit code 1 surfaces install instructions: pip install python-pptx. Pass that hint along to the user instead of failing silently.

See references/pptx-export.md for the full layout table, THEME dict, CLI reference, validation criteria, and failure modes.


Error Handling

ErrorCauseSolution
detect-shape.py returns low confidenceAmbiguous request mapping to multiple shapesFall back to "report" shape -- safest general-purpose format
Generated HTML has external dependenciesBuilder included CDN links or external src refsRegenerate with explicit constraint: "no external deps, all CSS/JS inline"
File exceeds 500KBExcessive inline SVGs or animation keyframesSimplify SVG paths, reduce keyframe count, compress data
Browser won't openNo display server (headless, SSH, WSL without WSLg)Print path only, suggest scp or a local preview: python3 -m http.server --bind 127.0.0.1. For public access use nginx, not http.server; see the public-web-deploy skill.
Validation fails repeatedly (3+ attempts)Structural issue the builder cannot self-correctShow validation output to user, ask for guidance
Shape misclassifiedAuto-detection picked wrong shape for requestUser overrides with /html --shape=<name> <request>

Preferred Patterns

Pattern 1: CDN and Framework Imports

What it looks like: <link href="https://cdn.jsdelivr.net/..."> or <script src="https://unpkg.com/react@18/..."> in the generated HTML.

Why wrong: Breaks the self-contained contract. File fails offline, introduces version drift, adds weight the user didn't ask for.

Do instead: Inline all CSS in <style>. Write vanilla JS in <script>. The Birchline design system in references/design-system.md provides the full token set.

Pattern 2: Markdown-to-HTML Conversion

What it looks like: Generating a markdown document first, then running it through a converter or wrapping it in <pre> tags.

Why wrong: Loses shape-specific layout, interactivity, SVG diagrams, and responsive grid structures. Produces "markdown in a browser" instead of a native HTML artifact.

Do instead: Generate HTML directly using shape-specific patterns from references. The HTML structure IS the output format, not a rendering layer on top of text.

Pattern 3: Monolithic Unstructured HTML

What it looks like: One giant <div> with inline styles on every element, no semantic structure, no comments.

Why wrong: Unreadable source, hard to debug, impossible for the user to modify. Accessibility tools cannot navigate it.

Do instead: Use semantic HTML (<header>, <main>, <section>, <footer>). Define CSS classes in <style>. Add section comments. Group related elements logically.

Pattern 4: Over-Engineering Simple Requests

What it looks like: Generating a full interactive dashboard when the user asked for a simple comparison table.

Why wrong: 2-4x generation time for features the user didn't request. Complexity without value.

Do instead: Match artifact complexity to request complexity. A comparison of 3 options needs a grid with cards, not a filterable dashboard with animations.


Anti-Rationalization

RationalizationWhy WrongRequired Action
"Markdown is fine for this"If shape detection triggered, the request has visual/interactive needs markdown can't serveGenerate HTML; user opts out with "as markdown"
"I'll add Tailwind CDN for faster styling"Breaks self-contained requirement, fails offlineUse Birchline tokens from design-system.md
"The HTML looks right, skip validation"Visual inspection misses missing meta tags, broken internal links, external depsRun validate-artifact.py every time
"Report shape works for everything"Each shape has distinct layout and interaction patterns; report is a fallback, not a defaultUse the detected shape; report only when confidence is genuinely low

Reference Loading Table

SignalLoad These FilesWhy
Any html-artifact invocationreferences/design-system.mdTheme selection, token architecture, accessibility, common mistakes
Any html-artifact invocationreferences/interaction-patterns.mdComponent descriptions, when-to-use, accessibility rules
Shape = specreferences/shape-spec-exploration.mdLayout descriptions, composition guide, common mistakes
Shape = code-reviewreferences/shape-code-review.mdSeverity system, interaction patterns, section ordering
Shape = prototypereferences/shape-design-prototype.mdControl types, export requirements, layout patterns
Shape = reportreferences/shape-report-research.mdSection ordering, TL;DR placement, metric patterns
Shape = editorreferences/shape-custom-editor.mdEditor types, export bar rules, common mistakes
Shape = data-vizreferences/shape-data-visualization.mdChart types, coordinate system, color scales
Shape = diagramreferences/shape-diagram-illustration.mdSVG construction rules, diagram types, interaction patterns
Shape = deckreferences/shape-slide-deck.mdSlide types, navigation, print styles
Request mentions scroll, reveal, animate on scroll, progressivereferences/scrollytelling-patterns.mdIntersectionObserver scroll animations, stagger, counters, progress bar
Request mentions PDF, export PDF, as PDF, PDF versionreferences/pdf-export.mdPhase 6 trigger conditions, page-size table, troubleshooting, install instructions
Request mentions pptx, .pptx, powerpoint, editable deck, hand-off, corporate templatereferences/pptx-export.mdPhase 7 trigger conditions, layout types, THEME dict, CLI reference, failure modes
Shape = diagram OR request contains "SVG", "architecture diagram", "flowchart", "sequence diagram"references/diagram-layering.mdSVG layer order, masking rect technique, semantic color system for dark-theme diagrams
Shape = data-viz OR request contains "infographic", "layout", "visualize data", "chart type"references/infographic-layouts.md21 layout types with content-type pairings and 22 visual styles
Request mentions animated text, rolling/slot text, kinetic headline, typewriter../../frontend/distinctive-frontend-design/references/roll-text.md, ../../frontend/distinctive-frontend-design/references/text-animation-patterns.mdZero-npm roll/slot text plus reveal, typewriter, crossfade patterns to inline

Shared Patterns

This skill uses:


Reference Files

  • references/design-system.md: Theme selection, token architecture, accessibility checklist, SVG conventions, common mistakes
  • references/interaction-patterns.md: Component descriptions, when-to-use guidance, accessibility rules, composition guide
  • references/shape-spec-exploration.md: Spec shape -- layout, composition guide, common mistakes
  • references/shape-code-review.md: Code review shape -- severity system, interaction patterns, section ordering
  • references/shape-design-prototype.md: Prototype shape -- control types, export requirements, layout patterns
  • references/shape-report-research.md: Report shape -- section ordering, TL;DR placement, metric patterns
  • references/shape-custom-editor.md: Editor shape -- editor types, export bar rules, common mistakes
  • references/shape-data-visualization.md: Data viz shape -- chart types, coordinate system, color scales
  • references/shape-diagram-illustration.md: Diagram shape -- SVG construction rules, diagram types, interaction patterns
  • references/shape-slide-deck.md: Deck shape -- slide types, navigation, print styles
  • agents/html-builder.md: Subagent prompt for HTML generation
  • references/scrollytelling-patterns.md: IntersectionObserver scroll animation patterns
  • references/pdf-export.md: Phase 6 EXPORT — trigger conditions, page-size table, print stylesheet inventory, troubleshooting
  • references/pptx-export.md: Phase 7 EXPORT-PPTX — trigger conditions, layout types, THEME dict, CLI reference, failure modes
  • references/diagram-layering.md: SVG layer order, masking rect technique, dark design system constants, semantic color palette
  • references/infographic-layouts.md: 21 layout types with structure and use guidance, 22 visual styles, content-type pairings
  • scripts/detect-shape.py: Deterministic shape classification from user request
  • scripts/assemble-template.py: Template assembly with theme, shape, and component CSS/JS injection
  • scripts/validate-artifact.py: HTML structure, self-containment, and rendered-CSS slop validation
  • scripts/css_slop_rules.py: vendored slop scanner (scan_css) — 7 rendered-CSS rules, dependency-free. Keep in sync with distinctive-frontend-design.
  • scripts/to-pdf.py: Playwright-based PDF rendering with per-shape page sizing
  • scripts/pptx-bridge/: HTML deck → editable PPTX (extract_slides.py, _pptx_engine.py, render_pptx.py, run-unified.py)
  • templates/: CSS/JS template files organized by themes/, shapes/, components/, print/

Saved Templates

Pre-built, reusable artifact templates for recurring requests. Two renderer patterns:

  • Specialized renderer — a script that fetches live data and fills a bespoke template (github-issues).
  • Generic slot filler — scripts/fill-template.py clones any frozen template in templates/saved/ and substitutes caller-supplied slot values. One skill, many template files: add a layout, not a skill.
TemplateRendererUse For
templates/saved/github-issues.htmlscripts/render-github-issues.py"show me my GitHub issues" / "show me my tickets" — assigned + mentioned + review-requested across all repos, with per-issue discussion expanders and 5 client-side sort modes
templates/saved/business-review.htmlscripts/fill-template.py"business review" — KPIs, segment results, priorities, decisions, outlook
templates/saved/project-kickoff.htmlscripts/fill-template.py"project kickoff" — agenda, foundation, scope, workstreams + owners, milestone gates, decisions, risks
templates/saved/system-design.htmlscripts/fill-template.py"system design" — requirements, architecture, components, data flow, tradeoffs, operations

See templates/saved/README.md to add a template.


Fidelity & Authority

Governs clone mode (Phase 0). Adapted from the OpenAI curated-template skills, which keep on-brand output by cloning a fixed reference instead of regenerating it.

Clone, don't regenerate. When a saved template applies, clone its layout unchanged and fill only the content slots. Do not rebuild the structure, restyle the CSS, or "improve" the chrome. Regeneration is where visual drift and AI slop enter; a frozen template removes that risk.

Content-vs-layout authority. One rule resolves every "should I restyle this?" question:

User instructions control requested content and explicit deviations. The retained template controls layout and formatting where the user has not requested a change.

So: change layout only when the user asks for a layout change. Otherwise the template wins. fill-template.py enforces this mechanically — it substitutes slot values and touches nothing else.

Fail loud, don't degrade. If a required slot has no content, stop and get the content — do not silently ship a half-filled template. The fill script exits non-zero on a missing required slot, an undeclared slot, or a leftover marker.

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!