openuispec 0.2.4 → 0.2.5

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.
@@ -1,114 +1,124 @@
1
1
  <!-- openuispec-rules-start -->
2
- <!-- openuispec-rules-version: 0.1.29 -->
2
+ <!-- openuispec-rules-version: 0.2.4 -->
3
3
  # OpenUISpec — AI Assistant Rules
4
4
  # ================================
5
5
  # This project uses OpenUISpec to define UI as a semantic spec.
6
6
  # Spec files are the single source of truth for all UI across platforms.
7
7
  # Targets: "ios", "android", "web"
8
8
 
9
- ## IMPORTANTRead the specification before working with spec files
9
+ ## MANDATORYUI work requires OpenUISpec tools
10
+
11
+ When the user's request involves UI — screens, navigation, layout, tokens, flows, localization,
12
+ or any visual/structural change — you MUST use the OpenUISpec tools before writing any code.
13
+
14
+ ### MCP Tools (use these when available)
15
+
16
+ Call these MCP tools directly. They return structured JSON with everything you need.
17
+
18
+ **Pre-generation:**
19
+ 1. Call `openuispec_prepare` with the target platform — returns spec context, platform config, constraints.
20
+ 2. Call `openuispec_read_specs` to load spec file contents. Use these as the AUTHORITATIVE source.
21
+ 3. If spec changes are needed, update spec files FIRST, then call `openuispec_check`.
22
+ 4. Generate or update the platform UI code based on the spec contents.
23
+
24
+ **Post-generation (EVERY TIME after writing UI code):**
25
+ 5. Call `openuispec_check` to validate spec integrity.
26
+ 6. Call `openuispec_read_specs` for the screens/contracts you just generated code for.
27
+ 7. Audit your generated code against the spec. For each screen, verify:
28
+ - Every field/action in the spec has a corresponding UI element
29
+ - Token values (colors, spacing, radii) match exactly — no approximations
30
+ - Contract `must_handle` states are all implemented (loading, error, empty, etc.)
31
+ - Adaptive breakpoints match the spec's `size_classes`
32
+ - Locale keys match `$t:` references
33
+ - Navigation targets match flow definitions
34
+ 8. Report any real gaps found and fix them before finishing.
35
+
36
+ **Creating new spec files:**
37
+ - Call `openuispec_spec_types` to discover available spec types.
38
+ - Call `openuispec_spec_schema` with the specific type to get the full JSON schema.
39
+ - Write the spec file following the schema exactly.
40
+
41
+ **Focused getters (prefer these for incremental edits over `read_specs`):**
42
+ - `openuispec_get_screen(name)` — single screen spec
43
+ - `openuispec_get_contract(name, variant?)` — single contract, optionally one variant
44
+ - `openuispec_get_tokens(category)` — single token category (color, typography, spacing, etc.)
45
+ - `openuispec_get_locale(locale, keys?)` — single locale file, optionally filtered keys
46
+ - `openuispec_check(target, screens?, contracts?)` — scoped audit for specific screens/contracts
47
+
48
+ Use `read_specs` for full-project generation; use focused getters when editing one screen or contract.
49
+
50
+ **Other tools:**
51
+ - `openuispec_status` — cross-target summary, good starting point
52
+ - `openuispec_drift` with `explain: true` — property-level spec changes
53
+ - `openuispec_validate` — schema-only validation by group
54
+
55
+ ### CLI fallback (when MCP is not available)
56
+
57
+ If MCP tools are not available, use these CLI commands with `--json` flag:
58
+ - `openuispec prepare --target <t> --json` — build AI-ready work bundle
59
+ - `openuispec check --target <t> --json` — composite validation
60
+ - `openuispec status --json` — cross-target status
61
+ - `openuispec drift --target <t> --explain --json` — semantic drift
62
+ - `openuispec validate [group...] --json` — schema validation
63
+ - `openuispec read-specs [paths...]` — read spec file contents
64
+ - `openuispec get-screen <name>` — get a single screen spec
65
+ - `openuispec get-contract <name> [--variant v]` — get a contract spec
66
+ - `openuispec get-tokens <category>` — get tokens for a category
67
+ - `openuispec get-locale <locale> [--keys k1,k2]` — get a locale file
68
+ - `openuispec spec-types` — list available spec types
69
+ - `openuispec spec-schema <type>` — get JSON schema for a spec type
70
+ - `openuispec screenshot --route /path` — screenshot the web app
71
+ - `openuispec screenshot-android [--project-dir path]` — screenshot Android app
72
+ - `openuispec screenshot-ios [--project-dir path]` — screenshot iOS app
73
+
74
+ ### Other CLI commands
75
+ - `openuispec init` — scaffold a new spec project
76
+ - `openuispec drift --snapshot --target <t>` — snapshot current state (only after UI code is updated)
77
+ - `openuispec configure-target <t>` — configure target platform stack
78
+ - `openuispec update-rules` — update AI rules to match installed package version
79
+
80
+ ## Spec format reference
10
81
 
11
- The spec format, file schemas, and generation rules are defined in the installed `openuispec` package.
12
- You MUST read the reference files listed below before creating, editing, or generating from any spec file.
13
- Do NOT guess the file format — skipping this step will produce invalid YAML that fails validation.
82
+ The spec format, schemas, and generation rules are in the installed `openuispec` package.
83
+ You MUST read the reference files before creating or editing spec files do NOT guess the format.
14
84
 
15
- **Find the package in this order:**
16
- 1. `node_modules/openuispec/` (project dependency)
17
- 2. Run `npm root -g` → `<prefix>/openuispec/` (global install)
18
- 3. Online: `https://openuispec.rsteam.uz/llms-full.txt` (if not installed)
85
+ **Find the package:** `node_modules/openuispec/` or run `npm root -g` → `<prefix>/openuispec/`.
86
+ **Online fallback:** `https://openuispec.rsteam.uz/llms-full.txt`
19
87
 
20
- **Reference files inside the package (read in this order):**
21
- 1. `README.md` — schema tables, file format reference, root wrapper keys
22
- 2. `spec/openuispec-v0.1.md` — full specification (contracts, layout, expressions, adaptive, etc.)
23
- 3. `examples/taskflow/openuispec/` — complete working example with all file types
88
+ **Reference files (read in order):**
89
+ 1. `README.md` — schema tables, file format, root wrapper keys
90
+ 2. `spec/openuispec-v0.1.md` — full specification
91
+ 3. `examples/taskflow/openuispec/` — complete working example
24
92
  4. `schema/` — JSON Schemas for every file type
25
93
 
26
- These files are updated with each package version. Always read from the installed package,
27
- not from cached or memorized content, to ensure you use the latest spec.
94
+ ## Spec location
95
+ - Spec root: `openuispec/` read `openuispec/openuispec.yaml` first for actual paths.
96
+ - Default dirs: tokens/, screens/, flows/, contracts/, platform/, locales/
28
97
 
29
- ## What is OpenUISpec
30
- OpenUISpec is a YAML-based spec format that describes an app's UI semantically — tokens, screens, flows, and platform overrides. AI reads the spec and generates native code (SwiftUI, Compose, React). AI reads native code and updates the spec. The spec is the sync layer between platforms.
98
+ ## When to start from spec vs platform code
31
99
 
32
- ## Spec location
33
- - Spec root: `openuispec/`
34
- - Manifest: `openuispec/openuispec.yaml` always read this first.
35
- - Tokens: `openuispec/tokens/`
36
- - Screens: `openuispec/screens/`
37
- - Flows: `openuispec/flows/`
38
- - Contracts: `openuispec/contracts/`
39
- - Platform: `openuispec/platform/`
40
- - Locales: `openuispec/locales/`
100
+ **Spec-first** (use `openuispec_prepare` or `openuispec prepare`):
101
+ - Screen structure, navigation, fields, actions, validation, data binding changes
102
+ - Token, variant, contract, flow, or localization changes
103
+ - Changes affecting multiple platforms
104
+ - Requests in product/UI terms
41
105
 
42
- **Note:** These are the default paths. Actual paths are in `includes:` in `openuispec.yaml` and may use relative paths. Always read `openuispec.yaml` to find the real directories.
106
+ **Platform-first** (skip spec tools):
107
+ - Platform-specific polish (iOS-only, Android-only, web-only)
108
+ - Local bug fixes that don't alter shared semantic behavior
43
109
 
44
110
  ## If spec directories are empty (first-time setup)
45
- This means the project has existing UI code but hasn't been specced yet. Your job:
46
-
47
- 1. **Read the spec first** — find and read `spec/openuispec-v0.1.md` from the installed package.
48
- 2. **Find existing screens** — scan the codebase for UI screen files.
49
- 3. **Create stubs** — for each screen, create `openuispec/screens/<name>.yaml` with:
50
- ```yaml
51
- screen_name:
52
- semantic: "Brief description of what this screen does"
53
- status: stub
54
- layout:
55
- type: scroll_vertical
56
- ```
57
- 4. **Extract tokens** — scan for colors, fonts, spacing and create files in `openuispec/tokens/`.
58
- 5. **Update the manifest** — fill in `data_model`, `api.endpoints`, and `generation.code_roots.backend` in `openuispec/openuispec.yaml`.
59
-
60
- ## OpenUISpec Source Of Truth
61
-
62
- OpenUISpec spec files are the primary source of truth for UI behavior across platforms.
63
-
64
- ### Start from spec when:
65
- - the request changes screen structure
66
- - the request changes navigation
67
- - the request changes fields, actions, validation, or data binding
68
- - the request changes tokens, variants, contracts, flows, or localization
69
- - the request affects more than one platform
70
- - the request is phrased in product/UI terms rather than platform-code terms
71
-
72
- Spec-first workflow:
73
- 1. Read `openuispec/openuispec.yaml` and the relevant spec files first.
74
- 2. Update the spec first.
75
- 3. Update the affected generated/native UI code to match the spec.
76
- 4. Run `openuispec validate`.
77
- 5. Run `openuispec validate semantic`.
78
- 6. Run `openuispec drift --target <target> --explain` to inspect semantic changes since that target's baseline.
79
- 7. Run `openuispec prepare --target <target>` to build the target work bundle for that target. In `bootstrap` mode it provides first-generation constraints; in `update` mode it provides drift-based update scope.
80
- If the target stack was filled from defaults, stop and ask the user to confirm or change it before implementation.
81
- 8. Verify the affected UI targets build/run if possible.
82
- 9. Only then run `openuispec drift --snapshot --target <target>` for affected targets, after that target output directory exists.
83
- 10. Run `openuispec drift --target <target> --explain` again to confirm no spec changes remain for that target.
84
- 11. Use `openuispec status` to see which other targets are still behind the updated spec.
85
-
86
- ### Start from platform code when:
87
- - the change is platform-specific polish
88
- - the change is a local bug fix that does not alter shared semantic behavior
89
- - the request explicitly asks for an iOS-only, Android-only, or web-only adjustment
90
-
91
- Platform-first workflow:
92
- 1. Update native/platform code.
93
- 2. If the change affects shared semantics, sync the spec afterward.
94
- 3. If the change is intentionally platform-specific, document it in `platform/*.yaml` when appropriate.
95
-
96
- ### Never do this:
97
- - Do not snapshot drift immediately after changing spec unless the UI code has also been updated.
98
- - Do not treat `openuispec drift` as proof that generated UI matches the spec.
99
- - Do not skip `--explain` / `prepare` when another platform needs to catch up with shared spec changes.
100
- - Do not modify generated UI without checking whether the spec must change first.
101
- - Do not use `configure-target --defaults` as silent approval for implementation. Ask the user to confirm the stack first.
102
111
 
103
- ## CLI commands
104
- - `openuispec init` scaffold a new spec project
105
- - `openuispec validate [group...]` validate spec files against schemas
106
- - `openuispec validate semantic` run semantic cross-reference linting
107
- - `openuispec drift --target <t>` — check for spec drift
108
- - `openuispec drift --target <t> --explain` explain semantic spec drift since the target baseline
109
- - `openuispec drift --snapshot --target <t>` — snapshot current state after the target output exists
110
- - `openuispec prepare --target <t>` — build the target work bundle and check whether stack confirmation is still pending
111
- - `openuispec status` show cross-target baseline/drift status
112
- - `openuispec update-rules` update AI rules to match installed package version
113
- - `openuispec drift --all` — include stubs in drift check
112
+ Read `spec/openuispec-v0.1.md` from the package first, then:
113
+ 1. Scan codebase for UI screens create `openuispec/screens/<name>.yaml` as `status: stub`
114
+ 2. Extract tokens (colors, fonts, spacing) `openuispec/tokens/`
115
+ 3. Create contract extensions `openuispec/contracts/`
116
+ 4. Create locale files `openuispec/locales/<locale>.json`
117
+ 5. Fill in `data_model`, `api.endpoints` in `openuispec/openuispec.yaml`
118
+
119
+ ## Rules
120
+ - Do not snapshot drift unless the UI code has also been updated.
121
+ - Do not modify generated UI without checking whether the spec must change first.
122
+ - Do not use `configure-target --defaults` as silent approval ask the user to confirm.
123
+ - Always read spec format from the installed package, not from cached/memorized content.
114
124
  <!-- openuispec-rules-end -->
@@ -1,114 +1,124 @@
1
1
  <!-- openuispec-rules-start -->
2
- <!-- openuispec-rules-version: 0.1.29 -->
2
+ <!-- openuispec-rules-version: 0.2.4 -->
3
3
  # OpenUISpec — AI Assistant Rules
4
4
  # ================================
5
5
  # This project uses OpenUISpec to define UI as a semantic spec.
6
6
  # Spec files are the single source of truth for all UI across platforms.
7
7
  # Targets: "ios", "android", "web"
8
8
 
9
- ## IMPORTANTRead the specification before working with spec files
9
+ ## MANDATORYUI work requires OpenUISpec tools
10
+
11
+ When the user's request involves UI — screens, navigation, layout, tokens, flows, localization,
12
+ or any visual/structural change — you MUST use the OpenUISpec tools before writing any code.
13
+
14
+ ### MCP Tools (use these when available)
15
+
16
+ Call these MCP tools directly. They return structured JSON with everything you need.
17
+
18
+ **Pre-generation:**
19
+ 1. Call `openuispec_prepare` with the target platform — returns spec context, platform config, constraints.
20
+ 2. Call `openuispec_read_specs` to load spec file contents. Use these as the AUTHORITATIVE source.
21
+ 3. If spec changes are needed, update spec files FIRST, then call `openuispec_check`.
22
+ 4. Generate or update the platform UI code based on the spec contents.
23
+
24
+ **Post-generation (EVERY TIME after writing UI code):**
25
+ 5. Call `openuispec_check` to validate spec integrity.
26
+ 6. Call `openuispec_read_specs` for the screens/contracts you just generated code for.
27
+ 7. Audit your generated code against the spec. For each screen, verify:
28
+ - Every field/action in the spec has a corresponding UI element
29
+ - Token values (colors, spacing, radii) match exactly — no approximations
30
+ - Contract `must_handle` states are all implemented (loading, error, empty, etc.)
31
+ - Adaptive breakpoints match the spec's `size_classes`
32
+ - Locale keys match `$t:` references
33
+ - Navigation targets match flow definitions
34
+ 8. Report any real gaps found and fix them before finishing.
35
+
36
+ **Creating new spec files:**
37
+ - Call `openuispec_spec_types` to discover available spec types.
38
+ - Call `openuispec_spec_schema` with the specific type to get the full JSON schema.
39
+ - Write the spec file following the schema exactly.
40
+
41
+ **Focused getters (prefer these for incremental edits over `read_specs`):**
42
+ - `openuispec_get_screen(name)` — single screen spec
43
+ - `openuispec_get_contract(name, variant?)` — single contract, optionally one variant
44
+ - `openuispec_get_tokens(category)` — single token category (color, typography, spacing, etc.)
45
+ - `openuispec_get_locale(locale, keys?)` — single locale file, optionally filtered keys
46
+ - `openuispec_check(target, screens?, contracts?)` — scoped audit for specific screens/contracts
47
+
48
+ Use `read_specs` for full-project generation; use focused getters when editing one screen or contract.
49
+
50
+ **Other tools:**
51
+ - `openuispec_status` — cross-target summary, good starting point
52
+ - `openuispec_drift` with `explain: true` — property-level spec changes
53
+ - `openuispec_validate` — schema-only validation by group
54
+
55
+ ### CLI fallback (when MCP is not available)
56
+
57
+ If MCP tools are not available, use these CLI commands with `--json` flag:
58
+ - `openuispec prepare --target <t> --json` — build AI-ready work bundle
59
+ - `openuispec check --target <t> --json` — composite validation
60
+ - `openuispec status --json` — cross-target status
61
+ - `openuispec drift --target <t> --explain --json` — semantic drift
62
+ - `openuispec validate [group...] --json` — schema validation
63
+ - `openuispec read-specs [paths...]` — read spec file contents
64
+ - `openuispec get-screen <name>` — get a single screen spec
65
+ - `openuispec get-contract <name> [--variant v]` — get a contract spec
66
+ - `openuispec get-tokens <category>` — get tokens for a category
67
+ - `openuispec get-locale <locale> [--keys k1,k2]` — get a locale file
68
+ - `openuispec spec-types` — list available spec types
69
+ - `openuispec spec-schema <type>` — get JSON schema for a spec type
70
+ - `openuispec screenshot --route /path` — screenshot the web app
71
+ - `openuispec screenshot-android [--project-dir path]` — screenshot Android app
72
+ - `openuispec screenshot-ios [--project-dir path]` — screenshot iOS app
73
+
74
+ ### Other CLI commands
75
+ - `openuispec init` — scaffold a new spec project
76
+ - `openuispec drift --snapshot --target <t>` — snapshot current state (only after UI code is updated)
77
+ - `openuispec configure-target <t>` — configure target platform stack
78
+ - `openuispec update-rules` — update AI rules to match installed package version
79
+
80
+ ## Spec format reference
10
81
 
11
- The spec format, file schemas, and generation rules are defined in the installed `openuispec` package.
12
- You MUST read the reference files listed below before creating, editing, or generating from any spec file.
13
- Do NOT guess the file format — skipping this step will produce invalid YAML that fails validation.
82
+ The spec format, schemas, and generation rules are in the installed `openuispec` package.
83
+ You MUST read the reference files before creating or editing spec files do NOT guess the format.
14
84
 
15
- **Find the package in this order:**
16
- 1. `node_modules/openuispec/` (project dependency)
17
- 2. Run `npm root -g` → `<prefix>/openuispec/` (global install)
18
- 3. Online: `https://openuispec.rsteam.uz/llms-full.txt` (if not installed)
85
+ **Find the package:** `node_modules/openuispec/` or run `npm root -g` → `<prefix>/openuispec/`.
86
+ **Online fallback:** `https://openuispec.rsteam.uz/llms-full.txt`
19
87
 
20
- **Reference files inside the package (read in this order):**
21
- 1. `README.md` — schema tables, file format reference, root wrapper keys
22
- 2. `spec/openuispec-v0.1.md` — full specification (contracts, layout, expressions, adaptive, etc.)
23
- 3. `examples/taskflow/openuispec/` — complete working example with all file types
88
+ **Reference files (read in order):**
89
+ 1. `README.md` — schema tables, file format, root wrapper keys
90
+ 2. `spec/openuispec-v0.1.md` — full specification
91
+ 3. `examples/taskflow/openuispec/` — complete working example
24
92
  4. `schema/` — JSON Schemas for every file type
25
93
 
26
- These files are updated with each package version. Always read from the installed package,
27
- not from cached or memorized content, to ensure you use the latest spec.
94
+ ## Spec location
95
+ - Spec root: `openuispec/` read `openuispec/openuispec.yaml` first for actual paths.
96
+ - Default dirs: tokens/, screens/, flows/, contracts/, platform/, locales/
28
97
 
29
- ## What is OpenUISpec
30
- OpenUISpec is a YAML-based spec format that describes an app's UI semantically — tokens, screens, flows, and platform overrides. AI reads the spec and generates native code (SwiftUI, Compose, React). AI reads native code and updates the spec. The spec is the sync layer between platforms.
98
+ ## When to start from spec vs platform code
31
99
 
32
- ## Spec location
33
- - Spec root: `openuispec/`
34
- - Manifest: `openuispec/openuispec.yaml` always read this first.
35
- - Tokens: `openuispec/tokens/`
36
- - Screens: `openuispec/screens/`
37
- - Flows: `openuispec/flows/`
38
- - Contracts: `openuispec/contracts/`
39
- - Platform: `openuispec/platform/`
40
- - Locales: `openuispec/locales/`
100
+ **Spec-first** (use `openuispec_prepare` or `openuispec prepare`):
101
+ - Screen structure, navigation, fields, actions, validation, data binding changes
102
+ - Token, variant, contract, flow, or localization changes
103
+ - Changes affecting multiple platforms
104
+ - Requests in product/UI terms
41
105
 
42
- **Note:** These are the default paths. Actual paths are in `includes:` in `openuispec.yaml` and may use relative paths. Always read `openuispec.yaml` to find the real directories.
106
+ **Platform-first** (skip spec tools):
107
+ - Platform-specific polish (iOS-only, Android-only, web-only)
108
+ - Local bug fixes that don't alter shared semantic behavior
43
109
 
44
110
  ## If spec directories are empty (first-time setup)
45
- This means the project has existing UI code but hasn't been specced yet. Your job:
46
-
47
- 1. **Read the spec first** — find and read `spec/openuispec-v0.1.md` from the installed package.
48
- 2. **Find existing screens** — scan the codebase for UI screen files.
49
- 3. **Create stubs** — for each screen, create `openuispec/screens/<name>.yaml` with:
50
- ```yaml
51
- screen_name:
52
- semantic: "Brief description of what this screen does"
53
- status: stub
54
- layout:
55
- type: scroll_vertical
56
- ```
57
- 4. **Extract tokens** — scan for colors, fonts, spacing and create files in `openuispec/tokens/`.
58
- 5. **Update the manifest** — fill in `data_model`, `api.endpoints`, and `generation.code_roots.backend` in `openuispec/openuispec.yaml`.
59
-
60
- ## OpenUISpec Source Of Truth
61
-
62
- OpenUISpec spec files are the primary source of truth for UI behavior across platforms.
63
-
64
- ### Start from spec when:
65
- - the request changes screen structure
66
- - the request changes navigation
67
- - the request changes fields, actions, validation, or data binding
68
- - the request changes tokens, variants, contracts, flows, or localization
69
- - the request affects more than one platform
70
- - the request is phrased in product/UI terms rather than platform-code terms
71
-
72
- Spec-first workflow:
73
- 1. Read `openuispec/openuispec.yaml` and the relevant spec files first.
74
- 2. Update the spec first.
75
- 3. Update the affected generated/native UI code to match the spec.
76
- 4. Run `openuispec validate`.
77
- 5. Run `openuispec validate semantic`.
78
- 6. Run `openuispec drift --target <target> --explain` to inspect semantic changes since that target's baseline.
79
- 7. Run `openuispec prepare --target <target>` to build the target work bundle for that target. In `bootstrap` mode it provides first-generation constraints; in `update` mode it provides drift-based update scope.
80
- If the target stack was filled from defaults, stop and ask the user to confirm or change it before implementation.
81
- 8. Verify the affected UI targets build/run if possible.
82
- 9. Only then run `openuispec drift --snapshot --target <target>` for affected targets, after that target output directory exists.
83
- 10. Run `openuispec drift --target <target> --explain` again to confirm no spec changes remain for that target.
84
- 11. Use `openuispec status` to see which other targets are still behind the updated spec.
85
-
86
- ### Start from platform code when:
87
- - the change is platform-specific polish
88
- - the change is a local bug fix that does not alter shared semantic behavior
89
- - the request explicitly asks for an iOS-only, Android-only, or web-only adjustment
90
-
91
- Platform-first workflow:
92
- 1. Update native/platform code.
93
- 2. If the change affects shared semantics, sync the spec afterward.
94
- 3. If the change is intentionally platform-specific, document it in `platform/*.yaml` when appropriate.
95
-
96
- ### Never do this:
97
- - Do not snapshot drift immediately after changing spec unless the UI code has also been updated.
98
- - Do not treat `openuispec drift` as proof that generated UI matches the spec.
99
- - Do not skip `--explain` / `prepare` when another platform needs to catch up with shared spec changes.
100
- - Do not modify generated UI without checking whether the spec must change first.
101
- - Do not use `configure-target --defaults` as silent approval for implementation. Ask the user to confirm the stack first.
102
111
 
103
- ## CLI commands
104
- - `openuispec init` scaffold a new spec project
105
- - `openuispec validate [group...]` validate spec files against schemas
106
- - `openuispec validate semantic` run semantic cross-reference linting
107
- - `openuispec drift --target <t>` — check for spec drift
108
- - `openuispec drift --target <t> --explain` explain semantic spec drift since the target baseline
109
- - `openuispec drift --snapshot --target <t>` — snapshot current state after the target output exists
110
- - `openuispec prepare --target <t>` — build the target work bundle and check whether stack confirmation is still pending
111
- - `openuispec status` show cross-target baseline/drift status
112
- - `openuispec update-rules` update AI rules to match installed package version
113
- - `openuispec drift --all` — include stubs in drift check
112
+ Read `spec/openuispec-v0.1.md` from the package first, then:
113
+ 1. Scan codebase for UI screens create `openuispec/screens/<name>.yaml` as `status: stub`
114
+ 2. Extract tokens (colors, fonts, spacing) `openuispec/tokens/`
115
+ 3. Create contract extensions `openuispec/contracts/`
116
+ 4. Create locale files `openuispec/locales/<locale>.json`
117
+ 5. Fill in `data_model`, `api.endpoints` in `openuispec/openuispec.yaml`
118
+
119
+ ## Rules
120
+ - Do not snapshot drift unless the UI code has also been updated.
121
+ - Do not modify generated UI without checking whether the spec must change first.
122
+ - Do not use `configure-target --defaults` as silent approval ask the user to confirm.
123
+ - Always read spec format from the installed package, not from cached/memorized content.
114
124
  <!-- openuispec-rules-end -->
@@ -0,0 +1,4 @@
1
+
2
+ [mcp_servers.openuispec]
3
+ command = "openuispec"
4
+ args = ["mcp"]
@@ -0,0 +1,10 @@
1
+ {
2
+ "mcpServers": {
3
+ "openuispec": {
4
+ "command": "openuispec",
5
+ "args": [
6
+ "mcp"
7
+ ]
8
+ }
9
+ }
10
+ }