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
claude/v0.25.0-impl View source

Criteria completion

Criteria completion: 5 of 5 (100%) checked; tracking started on Jun 23, no incremental history yet0%25%50%75%100%Jun 23Jul 11

Tracking started Jun 23 — check back for trends.

Branches 3
History 3
  1. da9667d
    Created (done)by bjornolofandersson
  2. c36d24c
    Content editedby Claude
    plan(v0.25.0): renumber WORK-444 → WORK-465 to avoid collision with main
  3. 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.