html
GitHub用于创建和修订包含语义化HTML、响应式布局及本地交互的完整离线HTML报告、落地页和信息图。流程涵盖受众分析、源码构建、多端视口自动化QA测试、视觉审查及最终发布,确保文件自包含且质量达标。
Trigger Scenarios
Install
npx skills add SourceWeft/SourceWeft --skill html -g -y
SKILL.md
Frontmatter
{
"name": "html",
"description": "Create and revise polished self-contained HTML reports, landing pages, infographics and local interactive visualizations with responsive layout and final-file QA. Use the separate html-slides skill for paginated browser presentations."
}
HTML pages
Create a complete offline index.html with semantic HTML, intentional typography, responsive layout and browser-local interactions. Use the existing artifact workflow and skill selection; no new product entry or mode selector.
- Establish the audience, information hierarchy and expected interactions. Read
references/page-design.mdandreferences/quality.md. - Author a full UTF-8 document with an early charset declaration and viewport meta. Use normal document flow. Keep source, images and local scripts together in a sandbox project directory. Do not add Reveal, slide IDs, fixed presentation canvases or presentation font-size rules.
- Confirm the provisioned
SOURCEWEFT_HTML_RUNTIMEandSOURCEWEFT_HTML_FONTSexist. Missing tooling, fonts or required model configuration must be reported; do not substitute runtime dependencies, system fonts or CDN assets. - Bundle the final document with
node /skills/html/scripts/build.cjs /workspace/draft.html /workspace/index.html. Assets and selected fonts become part of the file. Use embedded font families from the provisioned catalog, or explicitly provision authorized custom fonts with their hashes and license information. Keep Canvas/SVG typography consistent with embedded fonts. - Run
node /skills/html/scripts/qa.cjs /workspace/index.html /workspace/qa. Default viewports are 1440×900, 768×1024 and 390×844; inspect the whole page, including its tail. Interactive pages must supply a localinteraction-checks.cjsmodule as the third argument. It exports an async function(page), asserts the requested behavior using the existing Playwright API, and returns true only after all checks pass. These are ordinary project tests, not a new platform protocol. - Before publishing, run
review_html_visualswith task-specific criteria against every image path listed in the QAqa.jsonimagesarray (in batches of at most 24). QA slices each viewport's full page into parts no taller than 2,000 px, so a long page has several images per viewport; review all of them. Never pass a hand-made full-page screenshot: a result naming an image with unsupported dimensions means rerunning QA to obtain slices, not skipping the review. Major visual defects, missing content, failed interactions, unavailable models and incomplete QA block delivery. Rebuild and recheck after any change. - Publish with
artifactType=html, the actual final source file and the QAexpectedContentDigest. An optional preview image can come from successful QA. Report only completed checks and the committed artifact/version.
Revisions
Load the artifact through prepare_sandbox_workspace, specifying its artifact ID and a sandbox destination. Retain the returned sourceArtifact.versionNo; pass an explicit artifactVersionId when the user selected a historical version. Modify the relevant sections or functionality, rebuild, rerun QA and publish with republishArtifactId plus the captured expectedVersionNo. Do not silently overwrite a concurrent revision.
Local execution
Use browser-local computation and state. The iframe has an opaque origin and cannot use the host's cookies, browser storage or the network. When the user wants the page to remember data or to link to websites, read references/storage.md: data is saved through the host's window.sourceweft.storage after declaring the storage capability, and plain http(s) links open after the viewer confirms. External services, login flows and multi-file website hosting need a separately agreed scope. The file must retain its content and interactions after this generating skill is disabled.
Version History
- 66a6a34 Current 2026-11-07 08:57


