跳到正文
FunCoding

zui-build

使用内置 ZUI 资源从零创建可运行的独立网页或小型静态站点。向已有应用集成 ZUI 时使用 zui 技能。

Star
2,765
许可证
MIT
最近提交
2026年12月1日

skills/zui-build/SKILL.md

在 GitHub 上查看

Build standalone pages with ZUI

Create a portable static Web project that opens without package installation. Treat the user's intent as the design brief, ZUI as the interface foundation, and the bundled published release as the default runtime.

Establish the output

  1. Read applicable workspace instructions and inspect the requested destination before writing.
  2. Default to one responsive static page with index.html, app.css, and local ZUI assets when the user does not specify a stack.
  3. Choose a new empty directory. Never run the scaffold over an existing or non-empty project; it intentionally refuses to overwrite files.
  4. If the request is actually to add ZUI to an existing application, stop this workflow and use the separate $zui integration skill.

Do not add npm, a framework, a bundler, or a development server dependency unless the user asks. A simple static page is the fastest default and still supports ZUI's full browser bundle.

Scaffold with bundled resources

Run:

node <skill-root>/scripts/create-zui-page.mjs \
  --output <empty-page-directory> \
  --title "<page title>" \
  --lang <language-tag>

Omit --lang to use zh-CN. The command copies the bundled ZUI release, including the icon fonts and licenses, into assets/zui/.

Use CDN delivery only when the user requests it or the result must not carry local vendor assets:

node <skill-root>/scripts/create-zui-page.mjs \
  --output <empty-page-directory> \
  --title "<page title>" \
  --cdn

Read references/resources-and-delivery.md before selecting CDN, ESM, another ZUI version, multiple pages, or updating the bundled release. Prefer the bundled exact version over network retrieval for speed and reproducibility.

Use the bundled AI index for library discovery and detailed source API references. Read setup, the relevant entry, and constraints, directly or with the standalone reader:

node <skill-root>/references/ai/read.mjs --lib menu --section setup
node <skill-root>/references/ai/read.mjs --lib menu --section vanilla --entry vanilla-menu
node <skill-root>/references/ai/read.mjs --lib menu --section constraints

Without --runtime-version, the reader uses the bundled vendor manifest and reports its relationship to the source documentation version. For CDN or another selected runtime, pass --runtime-version <selected-exact-version> instead. The reference manifest records both versions independently. A version mismatch means the source entry is only a discovery aid: verify the actual bundled JS/CSS or matching release documentation before using its options, methods, classes, or examples. Equal version numbers still do not establish build/API equivalence. When evidence is unavailable, stay with verified bundled patterns; never introduce source-only Web Components or replace/upgrade the runtime to make an example work. The reader needs only Node; Markdown can also be read directly offline.

If Node is unavailable, copy assets/starter/ and assets/vendor/zui-3.0.0/ manually, preserve the CSS-to-icons/ layout, replace every {{TOKEN}}, and apply the same empty-destination safety rule.

Turn the starter into the requested interface

Do not deliver the starter unchanged. Replace its information architecture, content, visual direction, sample data, accessible names, and interactions so they serve the user's actual goal. Delete irrelevant sections instead of filling every starter slot.

Read references/page-quality.md before making substantive layout or visual decisions. In particular:

  • use semantic HTML and verified ZUI component classes for matching controls and structures;
  • place page-specific CSS after zui.css and build on ZUI color, radius, shadow, and spacing variables;
  • derive the page structure, tasks, and responsive hierarchy from the user's brief rather than from the starter;
  • make content credible and specific without inventing business claims;
  • preserve accessibility, keyboard behavior, focus, contrast, reduced motion, and meaningful states.

Use images only when they materially support the brief. Store output-owned assets locally unless the user requests remote URLs, and give every meaningful image suitable alternative text.

Prefer declarative ZUI behavior

Choose the smallest working surface in this order:

  1. semantic HTML plus ZUI CSS;
  2. zui-create for a component initialized with the page;
  3. zui-toggle for click or hover behavior;
  4. zui-on-* or a small zui-init action;
  5. imperative zui.* code only when state, lifecycle, CSP, dynamic data, or a public method requires it.

If the user requests Web Components, first check the selected runtime using Web Component availability; custom tags are a separate consumption surface and do not use zui-create to instantiate themselves.

Read references/declarative-zui.md before adding interactive components or dynamically inserted markup. Verify every component name, option, event, method, CSS class, and variable against the bundled release or version-matched official documentation. Do not infer APIs.

Keep evaluated declarative values developer-authored. Never interpolate untrusted user, URL, CMS, or API data into zui-create-*, zui-toggle-*, zui-on-*, or zui-init attributes. Use controlled JavaScript when data is dynamic or a strict CSP forbids evaluated declarations.

Validate the result

Run the deterministic ZUI resource check:

node <skill-root>/scripts/validate-zui-page.mjs --root <page-directory>

The validator only verifies that the entry page references ZUI and that recognized local ZUI resources resolve safely. It deliberately imposes no requirements on page content, document metadata, landmarks, headings, IDs, controls, or declarative interaction style. A CSS-only ZUI page is valid; include zui.js only when the requested page needs it.

Then preview the actual page, for example:

python3 -m http.server 4173 --directory <page-directory>

Inspect it in a browser at narrow and wide widths. Exercise the primary flow with pointer and keyboard; verify declared components, focus and dismissal, dynamic initialization, responsive layout, theme behavior, console output, and every local or CDN resource request. Fix discovered problems rather than merely reporting validator success.

Deliver the runnable entry path, resource mode and ZUI version, changed files, validation performed, and any browser behavior that could not be checked. Do not publish or deploy unless the user asks.

相似的 Skill

prototype

MAmattpocock/skills336k近 7 天新增 4,217 个 star

angular-developer

AFaffaan-m/ECC314k近 7 天新增 3,503 个 star

官方

firecrawl-build-scrape

FIfirecrawl/firecrawl214k近 7 天新增 4,815 个 star

官方

brand-guidelines

ANanthropics/skills203k近 7 天新增 2,822 个 star

精选

frontend-design

为界面确定视觉方向和字体,避免模板化的默认样式。

ANanthropics/skills203k近 7 天新增 2,822 个 star

精选

web-artifacts-builder

用 React、Tailwind 和 shadcn/ui 构建多组件页面。

ANanthropics/skills203k近 7 天新增 2,822 个 star