Skip to content

UI Packs

Brook Li edited this page Oct 16, 2026 · 1 revision

UI Packs

A pack is a reusable visual system (foundation tokens, components, patterns, presets) consumed by prototype generation. Official packs are prototype visual simulations, not production component libraries.

Official packs (registry.json)

id Description version schema components / patterns / presets
admin-desktop Desktop admin: forms, tables, navigation, dashboard charts 7 2 51 / 3 / 2
mobile-vant Phone-width Vant-style H5 3 2 21 / 3 / 2

Providers for both: action, navigation, form, data, feedback. Both include the same ECharts set (Chart Plugin). Registry defaultRef is pinned to v0.5.3.

Lookup chain

  1. --pack-root= and HTML_PROTOTYPE_PACK_ROOT (path-delimiter separated)
  2. .html-prototype/packs/ in the working directory and every parent
  3. ~/.html-prototype/packs/

Project packs win over the user cache. Use namespaced ids (e.g. mycompany-admin) for your own packs.

  • Registry: --registry= → HTML_PROTOTYPE_PACK_REGISTRY → GitHub raw registry.json; on failure falls back to bundled ui/pack-registry.fallback.json.
  • Download: GitHub codeload tarball for the entry's ref (override base with HTML_PROTOTYPE_PACK_SOURCE, or --ref=). Tar is parsed in pure Node.
  • --from-local=<dir> installs a local pack; a target containing a local-origin pack is protected unless --force (exit 3, install-blocked).
  • Agent protocol: --list-remote, present options, wait for the user to choose, never invent a kit when no pack is available. pack-install.md.

--list returns installed packs ({ "packs": [] }, exit 0 when empty). --pack=<id> --select=<ids> returns the minimal file closure plus deliver[]; optional dependencies only via --optional=. Missing pack → exit 2 with remediation; unsupported schemaVersion → exit 4.

Consumer rules: ui/catalog.md, ui/contract.md. Authoring: Pack Authoring.

Clone this wiki locally