openuispec 0.1.41 → 0.1.42

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.
package/cli/init.ts CHANGED
@@ -319,21 +319,28 @@ or any visual/structural change — you MUST use the OpenUISpec tools before wri
319
319
 
320
320
  Call these MCP tools directly. They return structured JSON with everything you need.
321
321
 
322
- 1. **Before ANY UI code generation or modification:**
323
- Call \`openuispec_prepare\` with the target platform. This returns the spec context,
324
- platform config, generation constraints, and semantic changes. Do not skip this step.
325
-
326
- 2. **After editing spec files:**
327
- Call \`openuispec_check\` to validate schema + semantic lint + prepare readiness.
328
-
329
- 3. **To understand project state:**
330
- Call \`openuispec_status\` for cross-target summary.
331
-
332
- 4. **To detect what changed:**
333
- Call \`openuispec_drift\` with \`explain: true\` to see property-level spec changes.
334
-
335
- 5. **For schema validation only:**
336
- Call \`openuispec_validate\` optionally with specific groups.
322
+ **Pre-generation:**
323
+ 1. Call \`openuispec_prepare\` with the target platform returns spec context, platform config, constraints.
324
+ 2. Call \`openuispec_read_specs\` to load spec file contents. Use these as the AUTHORITATIVE source.
325
+ 3. If spec changes are needed, update spec files FIRST, then call \`openuispec_check\`.
326
+ 4. Generate or update the platform UI code based on the spec contents.
327
+
328
+ **Post-generation (EVERY TIME after writing UI code):**
329
+ 5. Call \`openuispec_check\` to validate spec integrity.
330
+ 6. Call \`openuispec_read_specs\` for the screens/contracts you just generated code for.
331
+ 7. Audit your generated code against the spec. For each screen, verify:
332
+ - Every field/action in the spec has a corresponding UI element
333
+ - Token values (colors, spacing, radii) match exactly no approximations
334
+ - Contract \`must_handle\` states are all implemented (loading, error, empty, etc.)
335
+ - Adaptive breakpoints match the spec's \`size_classes\`
336
+ - Locale keys match \`$t:\` references
337
+ - Navigation targets match flow definitions
338
+ 8. Report any real gaps found and fix them before finishing.
339
+
340
+ **Other tools:**
341
+ - \`openuispec_status\` — cross-target summary, good starting point
342
+ - \`openuispec_drift\` with \`explain: true\` — property-level spec changes
343
+ - \`openuispec_validate\` — schema-only validation by group
337
344
 
338
345
  ### CLI fallback (when MCP is not available)
339
346
 
@@ -69,14 +69,26 @@ const server = new McpServer(
69
69
  Spec files (YAML) are the single source of truth for all UI across platforms.
70
70
 
71
71
  MANDATORY WORKFLOW for any UI-related request (screens, navigation, layout, tokens, flows, localization):
72
- 1. BEFORE writing or modifying any UI code, call openuispec_prepare with the target platform.
73
- This returns the spec context, platform config, generation constraints, and the list of spec files.
74
- 2. Then call openuispec_read_specs to load the spec file contents you need for the task.
75
- Pass specific paths for targeted work, or omit paths to load everything.
72
+
73
+ PRE-GENERATION:
74
+ 1. Call openuispec_prepare with the target platform.
75
+ 2. Call openuispec_read_specs to load the spec file contents you need.
76
76
  Use the returned contents as the AUTHORITATIVE source — do NOT paraphrase from memory.
77
77
  Cross-reference exact token values, contract must_handle lists, and locale keys from the content.
78
- 3. If the request requires spec changes, update the spec files FIRST, then call openuispec_check to validate.
79
- 4. Only then generate or update the platform UI code based on the spec contents.
78
+ 3. If the request requires spec changes, update the spec files FIRST, then call openuispec_check.
79
+ 4. Generate or update the platform UI code based on the spec contents.
80
+
81
+ POST-GENERATION (do this EVERY TIME after writing UI code):
82
+ 5. Call openuispec_check to validate spec integrity.
83
+ 6. Call openuispec_read_specs for the screens/contracts you just generated code for.
84
+ 7. Audit your generated code against the spec contents. For each screen, verify:
85
+ - Every field/action in the spec has a corresponding UI element
86
+ - Token values (colors, spacing, radii) match the spec exactly, not approximations
87
+ - Contract must_handle states are all implemented (loading, error, empty, etc.)
88
+ - Adaptive breakpoints match the layout size_classes in the spec
89
+ - Locale keys match $t: references in the spec
90
+ - Navigation targets match flow definitions
91
+ Report any real gaps found and fix them before finishing.
80
92
 
81
93
  Skip these tools ONLY when the request is purely non-UI (API logic, database, infrastructure, etc.)
82
94
  or explicitly platform-specific polish that doesn't affect shared UI semantics.`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openuispec",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A semantic UI specification format for AI-native, platform-native app development",