WORK-456
ID:WORK-456Status:done

Preset-pack format and presets.json manifest (capability not kind)

SPEC-111 §1,§3 — define the standalone preset-pack format and the presets.json manifest. A pack is a capability a package adds, not a kind it becomes, so it coexists with a theme contract / template.json.

Priority:highComplexity:moderateMilestone:v0.25.0Source:SPEC-111

Criteria completion

Criteria completion: 5 of 5 (100%) checked; history from Jun 23 to Jun 240%25%50%75%100%Jun 23Jun 24
Branches 3
History 4
  1. f6e6a38
    • ☑ A preset-pack is a package shipping one or more `ThemeTokensConfig` presets + a standalone `presets.json`, resolvable independently of any theme
    • ☑ `presets.json` records per-preset `id`, `title`, `scope`, `module`, optional `tunedFor`, and a `refrakt` range
    • ☑ Packs are a capability, not a `kind`: a package may declare `presets.json` alongside a theme contract / `template.json`; Lumina (theme + 9 presets) is expressible as a theme that also declares a pack — no `ThemeManifest` change
    • ☑ Distributable discovery scans for each capability (theme contract, `template.json`, `presets.json`) independently
    • ☑ Lumina's existing presets remain exported/functional and are expressible in the pack format without altering their data
    by bjornolofandersson
  2. dede57e
    Created (ready)by bjornolofandersson
  3. c36d24c
    Content editedby Claude
    plan(v0.25.0): renumber WORK-444 → WORK-465 to avoid collision with main
  4. a6bdcba
    Content editedby Claude
    plan(v0.25.0): accept specs/ADRs and decompose into 21 work items

Acceptance Criteria

  • A preset-pack is a package shipping one or more ThemeTokensConfig presets + a standalone presets.json, resolvable independently of any theme
  • presets.json records per-preset id, title, scope, module, optional tunedFor, and a refrakt range
  • Packs are a capability, not a kind: a package may declare presets.json alongside a theme contract / template.json; Lumina (theme + 9 presets) is expressible as a theme that also declares a pack — no ThemeManifest change
  • Distributable discovery scans for each capability (theme contract, template.json, presets.json) independently
  • Lumina's existing presets remain exported/functional and are expressible in the pack format without altering their data

Approach

Add the presets.json type in packages/types. Reframe distributable discovery to scan per-capability. No engine/loader change here — the carrier + validation land in their own work items (JSON carrier, scope/validation).

Dependencies

  • WORK-465 — the refrakt range field

References

  • SPEC-111 §1, §3; packages/lumina/src/presets/*

Resolution

Completed: 2026-06-23

Branch: claude/v0.25.0-impl

What was done

  • PresetPackManifest/PresetEntry types (WORK-465 distribution.ts).
  • packages/cli/src/commands/presets.ts discoverPacks() scans node_modules (following symlinks/workspaces) for any package carrying a presets.json — independent of kind, so a theme that also ships presets is found.
  • Gave Lumina a presets.json declaring its 9 presets (niwaki=syntax, the other 8=palette, tunedFor @refrakt-md/lumina), module-pointing at the built ./dist/presets/*.js; added presets.json to its files + a ./presets.json export. No ThemeManifest change, no preset-data change. Verified end-to-end: theme presets list/validate discover Lumina as theme+pack, all 9 resolve and scopes agree.