@ankhorage/devtools 1.9.4 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,137 @@
1
+ # Design, Composition, and Template Workflow
2
+
3
+ Use this workflow for `interactive`, `screen`, `screens`, and `template`. Audit uses the same
4
+ compiled target baseline when a redesign is requested; it never fills unknown observed values with
5
+ presets and pretends they were measured.
6
+
7
+ ## 1. Establish mode, intent, and evidence
8
+
9
+ Record the audience, primary task, requested screen or ordered series, platform, input modes,
10
+ viewport constraints, target theme modes, available source artifacts, and requested deliverable.
11
+ Inspect the current manifest, theme, installed packages, ZORA metadata, fonts, and existing
12
+ `zora-designer.md` before prompting.
13
+
14
+ For an input image or series, decompose each screen into semantic regions. Give each region a stable
15
+ evidence ID, purpose, content/data responsibility, state and interaction needs, accessibility needs,
16
+ and its relationship to other regions. Preserve image order and original dimensions. Do not map by
17
+ appearance alone.
18
+
19
+ ## 2. Build the design in dependency order
20
+
21
+ Interactive questions and compiler calls follow this exact order. Skip a question only when the
22
+ answer is already supplied or reliably discovered.
23
+
24
+ 1. **Category and intent.** Read `APP_CATEGORIES` and `CATEGORY_PRESETS` from Templates. Show the
25
+ preset's ordered primary-color and font-family recommendations and explain that they are starting
26
+ points, not user stereotypes. Defer font activation until its availability and owning loader are
27
+ verified.
28
+ 2. **Primary color.** Offer the preset's first recommended primary color and any verified project
29
+ brand color. Let the user accept or supply a color. The owner normalizes and validates it.
30
+ 3. **Harmony.** Only after primary is resolved, show `recommendedHarmonies` and the installed owner
31
+ harmony catalog. Preserve the selected canonical identifier.
32
+ 4. **Per-mode tone combination.** Show the preset recommendation first, then read all valid choices
33
+ from `TONE_PAIR_CATALOG`. Resolve light and dark independently with `resolveTonePair`; do not copy
34
+ a list into prose or code.
35
+ 5. **Generated colors.** Call `resolveCategoryDesignPreset` or `compileCategoryDesign`. Inspect
36
+ generated owner roles and diagnostics; never hand-calculate secondary, accent, severity,
37
+ background, neutral, or on-colors.
38
+ 6. **Computed Surface output.** Inspect `computedTheme.light.surfaceTheme` and
39
+ `computedTheme.dark.surfaceTheme`, including `ThemeTokens.colors`, `ThemeSemantics`, provenance,
40
+ selections, and diagnostics. Record `GeneratedColorRole` and `SemanticColorToken` names exactly.
41
+ 7. **Composition.** Resolve density, shape, layout, navigation, content hierarchy, states, and exact
42
+ ZORA elements from metadata. Typography recommendations remain advisory until the chosen font is
43
+ verified and the owning app/module can load it; never install or bundle a font implicitly.
44
+ 8. **Confirmation and output.** Show high-impact choices, their origins, diagnostics, gaps, and the
45
+ requested artifact. Persist runtime state only through the canonical manifest/contracts.
46
+
47
+ Use separate light/dark tone pairs and owner compilation even when the two modes share a primary
48
+ seed. Never generate dark mode by inversion.
49
+
50
+ ## 3. Inspect installed owner APIs
51
+
52
+ Run from the target repository:
53
+
54
+ ```text
55
+ bun .agents/skills/zora-designer/scripts/owner-api.mjs inspect
56
+ ```
57
+
58
+ The output reports installed versions, category presets, tone pairs, component metadata, recipe
59
+ metadata, and required exports. An error names the missing package/export, minimum owner release,
60
+ and update action. There is no fallback calculation.
61
+
62
+ For deterministic composition, provide JSON to:
63
+
64
+ ```text
65
+ bun .agents/skills/zora-designer/scripts/owner-api.mjs compose design-input.json
66
+ ```
67
+
68
+ The input contains `category`, optional `theme` overrides, `navigator`, `screens`, and optional
69
+ `regions`. Each region has `id`, `requestedCapability`, `screenId`, `parentNodeId`, an optional exact
70
+ `component`, explicit `props`, and `evidenceId`. The helper:
71
+
72
+ - compiles the category through Templates and the released ZORA compiler;
73
+ - validates exact component names and props against `ZORA_COMPONENT_META`;
74
+ - emits metadata-derived `MissingElement` nodes for unresolved regions;
75
+ - composes the canonical manifest in draft mode while a gap exists;
76
+ - reports `applicationGate: blocked` and owner actions for every gap;
77
+ - preserves Templates and ZORA diagnostics.
78
+
79
+ The agent remains responsible for semantic matching. A requested component name is an explicit
80
+ decision to validate, not a fuzzy-search request.
81
+
82
+ ## 4. Design one screen or a series
83
+
84
+ For each screen define purpose, information hierarchy, primary action, navigation relationship,
85
+ data needs, and relevant default/loading/empty/partial/error/offline/success/disabled/hover/pressed/
86
+ selected/focus states. Define narrow and wide behavior where applicable.
87
+
88
+ For a series also define the shared shell, canonical route topology, state continuity, back/cancel
89
+ behavior, shared recipes and terminology, and one common theme. A concept image series must remain
90
+ ordered and visually coherent. Label every generated image as a concept; replace it with an actual
91
+ runtime capture only after running the manifest.
92
+
93
+ ## 5. Audit a URL, image, or series
94
+
95
+ For a URL, capture the relevant modes, viewports, and states using a browser/runtime tool. For one
96
+ image or a series, retain original dimensions and input order. Every evidence item records location,
97
+ observation, evidence level, confidence factor, reproduction, and limitations.
98
+
99
+ Read [audit.md](audit.md), create a criterion input JSON, and run:
100
+
101
+ ```text
102
+ bun .agents/skills/zora-designer/scripts/audit.mjs audit-input.json zora-designer.md
103
+ ```
104
+
105
+ Invisible behavior remains `not-assessable` unless source, accessibility-tree, browser, or runtime
106
+ evidence supports it. A recommended redesign baseline may use the category workflow but must be
107
+ clearly separated from observed implementation.
108
+
109
+ ## 6. Author a canonical template
110
+
111
+ Use `composeCategoryAppManifest`, `validateTemplateManifest`, and
112
+ `assertTemplateManifestReady`. Draft output may contain `MissingElement`; release output may not.
113
+
114
+ When the target repository is `@ankhorage/templates`, scaffold reviewed composition output with:
115
+
116
+ ```text
117
+ bun .agents/skills/zora-designer/scripts/scaffold-template.mjs scaffold-input.json
118
+ ```
119
+
120
+ The scaffold input provides the ready manifest, category, template ID, label, description, and
121
+ target root. The helper verifies the Templates repository and owner validation, creates a normal
122
+ variant `manifest.ts`, `template.ts`, and `index.ts`, and updates the category registry import and
123
+ definition deterministically. It refuses existing targets, unsafe identifiers, blocked manifests,
124
+ and non-Templates repositories. Review and validate the generated production diff; do not hand-hide
125
+ a systemic skill or owner defect.
126
+
127
+ ## 7. Delivery gates
128
+
129
+ Before application or release:
130
+
131
+ - every visible/interactive region has an exact metadata-supported element;
132
+ - every gap has evidence and a linked ZORA owner issue;
133
+ - both modes compile without owner errors;
134
+ - the manifest is owner-validated and release-ready;
135
+ - required concept-image, runtime-capture, or supplied-image capabilities were actually available;
136
+ - target and observed state are clearly separated;
137
+ - `zora-designer.md` is deterministic and contains no runtime authority or copied owner catalogs.