openuispec 0.1.24 → 0.1.25

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.
Files changed (2) hide show
  1. package/cli/init.ts +35 -12
  2. package/package.json +1 -1
package/cli/init.ts CHANGED
@@ -252,18 +252,41 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
252
252
  4. **Extract tokens** — scan for colors, fonts, spacing and create files in \`${specDir}/tokens/\`.
253
253
  5. **Update the manifest** — fill in \`data_model\` and \`api.endpoints\` in \`${specDir}/openuispec.yaml\`.
254
254
 
255
- ## Making UI changes
256
- 1. Read the relevant spec files before modifying any UI code.
257
- 2. If the change requires a spec update, modify the spec FIRST, then update code.
258
- 3. Never modify generated code without updating the spec.
259
- 4. When adding a new screen, create the corresponding spec file.
260
- 5. When removing a screen, remove the spec file and update flow references.
261
-
262
- ## After modifying spec files
263
- 1. Run \`openuispec validate\` to check specs against the schema.
264
- 2. **Update the generated code** for each affected platform to match the new spec.
265
- 3. Run \`openuispec drift --snapshot --target <target>\` to baseline the updated state.
266
- 4. Run \`openuispec drift\` to verify no untracked drift remains.
255
+ ## OpenUISpec Source Of Truth
256
+
257
+ OpenUISpec spec files are the primary source of truth for UI behavior across platforms.
258
+
259
+ ### Start from spec when:
260
+ - the request changes screen structure
261
+ - the request changes navigation
262
+ - the request changes fields, actions, validation, or data binding
263
+ - the request changes tokens, variants, contracts, flows, or localization
264
+ - the request affects more than one platform
265
+ - the request is phrased in product/UI terms rather than platform-code terms
266
+
267
+ Spec-first workflow:
268
+ 1. Read \`${specDir}/openuispec.yaml\` and the relevant spec files first.
269
+ 2. Update the spec first.
270
+ 3. Update the affected generated/native UI code to match the spec.
271
+ 4. Run \`openuispec validate\`.
272
+ 5. Verify the affected UI targets build/run if possible.
273
+ 6. Only then run \`openuispec drift --snapshot --target <target>\` for affected targets.
274
+ 7. Run \`openuispec drift --target <target>\` as a bookkeeping check.
275
+
276
+ ### Start from platform code when:
277
+ - the change is platform-specific polish
278
+ - the change is a local bug fix that does not alter shared semantic behavior
279
+ - the request explicitly asks for an iOS-only, Android-only, or web-only adjustment
280
+
281
+ Platform-first workflow:
282
+ 1. Update native/platform code.
283
+ 2. If the change affects shared semantics, sync the spec afterward.
284
+ 3. If the change is intentionally platform-specific, document it in \`platform/*.yaml\` when appropriate.
285
+
286
+ ### Never do this:
287
+ - Do not snapshot drift immediately after changing spec unless the UI code has also been updated.
288
+ - Do not treat \`openuispec drift\` as proof that generated UI matches the spec.
289
+ - Do not modify generated UI without checking whether the spec must change first.
267
290
 
268
291
  ## CLI commands
269
292
  - \`openuispec init\` — scaffold a new spec project
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openuispec",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A semantic UI specification format for AI-native, platform-native app development",