Skip to content

Pack Authoring

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

Pack Authoring

Skill: ui-pack-maintain. References: contract, pack-authoring, schema-version, registry-format, evidence, semantic-review.

Pack anatomy

<pack>/
├─ PACK.md            id, name frontmatter + prose
├─ manifest.json      only machine-readable index / dependency source
├─ design-system.md
├─ foundation/        tokens + document CSS baseline, DOM-free
├─ components/<category>/<leaf>/{COMPONENT.md,component.html}
├─ patterns/<leaf>/{PATTERN.md,pattern.html}     optional
├─ presets/<leaf>/{PRESET.md,seed.html}          optional, business-fact-free
└─ vendor/ runtime/ assets/                      when declared; listed in manifest.delivery

manifest.json

Required: schemaVersion, id (hyphen-case), version, classPrefix and tokenPrefix (end in -, enforced on every class / custom property), foundation {id, contract, sources}, providers (each with compatibleFoundations including the pack's foundation), components. Optional: patterns, presets, delivery (schema v2). Entry fields: contract, source, requires, optional, uses, assets, vendor, runtime, adapter, atoms.

Supported schemaVersion: 1, 2 (_pack-schema.mjs in both skills; keep in sync). Bump version for content changes; bump schemaVersion only for resolver-visible contract changes.

Hard rules

  • Components are single leaves; patterns compose without copying; patterns/presets don't select internal components.
  • State adapters only project passed local state: no PrototypeViewers, persistence, URL parsing or global handlers.
  • Only required deps in requires; conditional ones in optional.

Workflow

node <ui-pack-maintain>/scripts/list-packs.mjs
node <ui-pack-maintain>/scripts/validate-pack.mjs --pack=<id|dir> --strict
node <ui-pack-maintain>/scripts/resolve-pack.mjs --pack=<id|dir> --entry=<id>[,<id>]
node <ui-pack-maintain>/scripts/generate-registry.mjs          # regenerate registry + fallback
node <ui-pack-maintain>/scripts/generate-registry.mjs --check

For a new pack or substantial semantic change, run the isolated semantic review. See Release Process.

Clone this wiki locally