openuispec 0.1.28 → 0.1.30
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/README.md +33 -37
- package/cli/configure-target.ts +523 -0
- package/cli/index.ts +33 -5
- package/cli/init.ts +247 -60
- package/cli/target-presets.json +746 -0
- package/docs/implementation-notes.md +46 -9
- package/docs/release-notes-v0.1.26.md +1 -1
- package/drift/index.ts +18 -9
- package/examples/taskflow/AGENTS.md +6 -4
- package/examples/taskflow/CLAUDE.md +6 -4
- package/examples/taskflow/backend/.gitkeep +1 -0
- package/examples/taskflow/openuispec/README.md +7 -2
- package/examples/taskflow/openuispec/openuispec.yaml +2 -0
- package/examples/todo-orbit/AGENTS.md +6 -4
- package/examples/todo-orbit/CLAUDE.md +6 -4
- package/examples/todo-orbit/backend/.gitkeep +1 -0
- package/examples/todo-orbit/openuispec/README.md +7 -2
- package/examples/todo-orbit/openuispec/openuispec.yaml +2 -0
- package/package.json +1 -1
- package/prepare/index.ts +856 -25
- package/schema/openuispec.schema.json +10 -0
- package/schema/semantic-lint.ts +66 -16
- package/schema/validate.ts +192 -5
- package/status/index.ts +13 -7
|
@@ -36,24 +36,61 @@
|
|
|
36
36
|
|
|
37
37
|
## `prepare` command
|
|
38
38
|
|
|
39
|
-
- `openuispec prepare --target <target>` is the operational bridge between spec
|
|
39
|
+
- `openuispec prepare --target <target>` is the operational bridge between the spec and AI implementation work.
|
|
40
|
+
- `openuispec configure-target <target>` is the target stack selection step that feeds `prepare`.
|
|
41
|
+
- it should offer preset defaults for known stacks
|
|
42
|
+
- it must still allow custom values when the project uses frameworks or libraries outside the catalog
|
|
43
|
+
- `openuispec init --no-configure-targets` should remain available for users who want to defer target stack decisions until later
|
|
44
|
+
- `--defaults` is an unattended fallback only; it must not count as user confirmation for implementation
|
|
45
|
+
- It should support two modes:
|
|
46
|
+
1. bootstrap mode when no target snapshot exists yet
|
|
47
|
+
2. update mode when a target snapshot exists
|
|
40
48
|
- It should be documented as:
|
|
41
|
-
1.
|
|
42
|
-
2. compute semantic spec changes since that baseline
|
|
43
|
-
3. produce
|
|
49
|
+
1. if no snapshot exists, produce a first-time generation bundle from the manifest and current spec files
|
|
50
|
+
2. if a snapshot exists, compute semantic spec changes since that baseline
|
|
51
|
+
3. produce the target work bundle with likely target scope
|
|
44
52
|
- Current output includes:
|
|
45
53
|
- project and target
|
|
46
54
|
- output directory
|
|
47
55
|
- likely code roots
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
56
|
+
- mode (`bootstrap` or `update`)
|
|
57
|
+
- baseline commit info when available
|
|
58
|
+
- target stack summary from `platform/<target>.yaml`
|
|
59
|
+
- selected option refs for known preset values
|
|
60
|
+
- semantic change summary for update mode
|
|
61
|
+
- per-spec-file work items or first-time generation spec inventory
|
|
62
|
+
- best-effort candidate target files for update mode
|
|
52
63
|
- next-step guidance
|
|
64
|
+
- Selected option refs should be package-manager oriented, not artifact web pages:
|
|
65
|
+
- Android: Gradle plugin ids plus `group:artifact:{latest}` library coordinates
|
|
66
|
+
- Web: npm package specs like `react-router@{latest}`
|
|
67
|
+
- iOS: package identifiers plus docs links
|
|
68
|
+
- `prepare` must also carry dependency guidance explaining that these refs are anchors only.
|
|
69
|
+
- AI should add supporting build, plugin, repository, annotation-processing, runtime, dev, and test dependencies required by the chosen stack and current toolchain
|
|
70
|
+
- AI should resolve exact versions and wiring from current platform docs instead of assuming the preset list is exhaustive
|
|
71
|
+
- Bootstrap mode should surface soft warnings when configured framework/stack values are custom and therefore not covered by preset dependency refs.
|
|
72
|
+
- these warnings should explain that dependency guidance is incomplete, not silently omit the missing refs
|
|
73
|
+
- Bootstrap mode should also surface pending stack confirmation when values were auto-applied from defaults.
|
|
74
|
+
- `generation_ready` must remain false in that state
|
|
75
|
+
- AI consumers should ask the user to confirm or change the stack before starting implementation
|
|
76
|
+
- Bootstrap mode should also carry explicit generation constraints for the target:
|
|
77
|
+
- localization rules
|
|
78
|
+
- use target-native runtime localization resources
|
|
79
|
+
- forbid in-memory string maps embedded in app code
|
|
80
|
+
- file structure rules
|
|
81
|
+
- forbid single-file app output
|
|
82
|
+
- require separate screen/component/support/resource modules
|
|
83
|
+
- platform setup rules
|
|
84
|
+
- refresh current target/framework setup guidance before generation
|
|
85
|
+
- do not rely on stale memory for project layout, resource wiring, navigation APIs, or packaging conventions
|
|
86
|
+
- target-specific directory expectations for generated code
|
|
87
|
+
- backend generation context
|
|
88
|
+
- if the manifest declares `api.endpoints`, `generation.code_roots.backend` is required
|
|
89
|
+
- `prepare` should surface the resolved backend root so AI can inspect backend code when generating API clients
|
|
53
90
|
- Important positioning:
|
|
54
91
|
- `prepare` does not generate code
|
|
55
92
|
- `prepare` does not verify code correctness
|
|
56
|
-
- `prepare` packages the spec delta into scoped implementation work for AI or developers
|
|
93
|
+
- `prepare` packages either the current spec or the spec delta into scoped implementation work for AI or developers
|
|
57
94
|
|
|
58
95
|
## Semantic linting
|
|
59
96
|
|
|
@@ -11,7 +11,7 @@ This release expands OpenUISpec as a spec-management and AI-orchestration tool f
|
|
|
11
11
|
Drift snapshots now record the git baseline commit and branch for each target.
|
|
12
12
|
|
|
13
13
|
- `openuispec prepare --target <target>`
|
|
14
|
-
Produces
|
|
14
|
+
Produces the target work bundle with:
|
|
15
15
|
- semantic change summary
|
|
16
16
|
- likely code roots
|
|
17
17
|
- candidate target files
|
package/drift/index.ts
CHANGED
|
@@ -22,6 +22,8 @@ import { execFileSync } from "node:child_process";
|
|
|
22
22
|
import YAML from "yaml";
|
|
23
23
|
|
|
24
24
|
const STATE_FILE = ".openuispec-state.json";
|
|
25
|
+
export const SUPPORTED_TARGETS = ["ios", "android", "web"] as const;
|
|
26
|
+
export type SupportedTarget = typeof SUPPORTED_TARGETS[number];
|
|
25
27
|
|
|
26
28
|
// ── types ─────────────────────────────────────────────────────────────
|
|
27
29
|
|
|
@@ -73,7 +75,7 @@ export interface ExplainResult {
|
|
|
73
75
|
|
|
74
76
|
// ── helpers ───────────────────────────────────────────────────────────
|
|
75
77
|
|
|
76
|
-
function listFiles(dir: string, ext: string): string[] {
|
|
78
|
+
export function listFiles(dir: string, ext: string): string[] {
|
|
77
79
|
try {
|
|
78
80
|
return readdirSync(dir)
|
|
79
81
|
.filter((f) => f.endsWith(ext))
|
|
@@ -84,6 +86,10 @@ function listFiles(dir: string, ext: string): string[] {
|
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
|
|
89
|
+
export function isSupportedTarget(value: string): value is SupportedTarget {
|
|
90
|
+
return (SUPPORTED_TARGETS as readonly string[]).includes(value);
|
|
91
|
+
}
|
|
92
|
+
|
|
87
93
|
function hashFile(filePath: string): string {
|
|
88
94
|
const content = readFileSync(filePath);
|
|
89
95
|
const hash = createHash("sha256").update(content).digest("hex");
|
|
@@ -106,7 +112,7 @@ function parseSpecDocument(relPath: string, content: string): unknown {
|
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
/** Read the status field from a screen or flow YAML file. */
|
|
109
|
-
function readStatus(filePath: string): string {
|
|
115
|
+
export function readStatus(filePath: string): string {
|
|
110
116
|
try {
|
|
111
117
|
const doc = YAML.parse(readFileSync(filePath, "utf-8"));
|
|
112
118
|
if (doc && typeof doc === "object") {
|
|
@@ -123,12 +129,12 @@ function readStatus(filePath: string): string {
|
|
|
123
129
|
}
|
|
124
130
|
|
|
125
131
|
/** Returns true if a file is a screen or flow (has status semantics). */
|
|
126
|
-
function hasStatusSemantics(relPath: string): boolean {
|
|
132
|
+
export function hasStatusSemantics(relPath: string): boolean {
|
|
127
133
|
const dir = dirname(relPath);
|
|
128
134
|
return dir === "screens" || dir === "flows";
|
|
129
135
|
}
|
|
130
136
|
|
|
131
|
-
function discoverSpecFiles(projectDir: string): string[] {
|
|
137
|
+
export function discoverSpecFiles(projectDir: string): string[] {
|
|
132
138
|
const manifest = join(projectDir, "openuispec.yaml");
|
|
133
139
|
if (!existsSync(manifest)) {
|
|
134
140
|
console.error(`Error: No openuispec.yaml found in ${projectDir}`);
|
|
@@ -434,11 +440,14 @@ export function findProjectDir(cwd: string): string {
|
|
|
434
440
|
process.exit(1);
|
|
435
441
|
}
|
|
436
442
|
|
|
443
|
+
/** Read and parse the manifest YAML. */
|
|
444
|
+
export function readManifest(projectDir: string): Record<string, any> {
|
|
445
|
+
return YAML.parse(readFileSync(join(projectDir, "openuispec.yaml"), "utf-8"));
|
|
446
|
+
}
|
|
447
|
+
|
|
437
448
|
/** Read the project name from the manifest. */
|
|
438
449
|
export function readProjectName(projectDir: string): string {
|
|
439
|
-
const doc =
|
|
440
|
-
readFileSync(join(projectDir, "openuispec.yaml"), "utf-8")
|
|
441
|
-
);
|
|
450
|
+
const doc = readManifest(projectDir);
|
|
442
451
|
return doc.project?.name ?? basename(projectDir);
|
|
443
452
|
}
|
|
444
453
|
|
|
@@ -677,7 +686,7 @@ function check(
|
|
|
677
686
|
|
|
678
687
|
const d = result.drift;
|
|
679
688
|
const hasDrift = d.changed.length > 0 || d.added.length > 0 || d.removed.length > 0;
|
|
680
|
-
process.exit(hasDrift ?
|
|
689
|
+
process.exit(hasDrift ? 2 : 0);
|
|
681
690
|
}
|
|
682
691
|
|
|
683
692
|
function checkAll(
|
|
@@ -721,7 +730,7 @@ function checkAll(
|
|
|
721
730
|
}
|
|
722
731
|
}
|
|
723
732
|
|
|
724
|
-
process.exit(anyDrift ?
|
|
733
|
+
process.exit(anyDrift ? 2 : 0);
|
|
725
734
|
}
|
|
726
735
|
|
|
727
736
|
// ── output ────────────────────────────────────────────────────────────
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- openuispec-rules-start -->
|
|
2
|
-
<!-- openuispec-rules-version: 0.1.
|
|
2
|
+
<!-- openuispec-rules-version: 0.1.29 -->
|
|
3
3
|
# OpenUISpec — AI Assistant Rules
|
|
4
4
|
# ================================
|
|
5
5
|
# This project uses OpenUISpec to define UI as a semantic spec.
|
|
@@ -55,7 +55,7 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
|
|
|
55
55
|
type: scroll_vertical
|
|
56
56
|
```
|
|
57
57
|
4. **Extract tokens** — scan for colors, fonts, spacing and create files in `openuispec/tokens/`.
|
|
58
|
-
5. **Update the manifest** — fill in `data_model` and `
|
|
58
|
+
5. **Update the manifest** — fill in `data_model`, `api.endpoints`, and `generation.code_roots.backend` in `openuispec/openuispec.yaml`.
|
|
59
59
|
|
|
60
60
|
## OpenUISpec Source Of Truth
|
|
61
61
|
|
|
@@ -76,7 +76,8 @@ Spec-first workflow:
|
|
|
76
76
|
4. Run `openuispec validate`.
|
|
77
77
|
5. Run `openuispec validate semantic`.
|
|
78
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
|
|
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.
|
|
80
81
|
8. Verify the affected UI targets build/run if possible.
|
|
81
82
|
9. Only then run `openuispec drift --snapshot --target <target>` for affected targets, after that target output directory exists.
|
|
82
83
|
10. Run `openuispec drift --target <target> --explain` again to confirm no spec changes remain for that target.
|
|
@@ -97,6 +98,7 @@ Platform-first workflow:
|
|
|
97
98
|
- Do not treat `openuispec drift` as proof that generated UI matches the spec.
|
|
98
99
|
- Do not skip `--explain` / `prepare` when another platform needs to catch up with shared spec changes.
|
|
99
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.
|
|
100
102
|
|
|
101
103
|
## CLI commands
|
|
102
104
|
- `openuispec init` — scaffold a new spec project
|
|
@@ -105,7 +107,7 @@ Platform-first workflow:
|
|
|
105
107
|
- `openuispec drift --target <t>` — check for spec drift
|
|
106
108
|
- `openuispec drift --target <t> --explain` — explain semantic spec drift since the target baseline
|
|
107
109
|
- `openuispec drift --snapshot --target <t>` — snapshot current state after the target output exists
|
|
108
|
-
- `openuispec prepare --target <t>` — build
|
|
110
|
+
- `openuispec prepare --target <t>` — build the target work bundle and check whether stack confirmation is still pending
|
|
109
111
|
- `openuispec status` — show cross-target baseline/drift status
|
|
110
112
|
- `openuispec update-rules` — update AI rules to match installed package version
|
|
111
113
|
- `openuispec drift --all` — include stubs in drift check
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- openuispec-rules-start -->
|
|
2
|
-
<!-- openuispec-rules-version: 0.1.
|
|
2
|
+
<!-- openuispec-rules-version: 0.1.29 -->
|
|
3
3
|
# OpenUISpec — AI Assistant Rules
|
|
4
4
|
# ================================
|
|
5
5
|
# This project uses OpenUISpec to define UI as a semantic spec.
|
|
@@ -55,7 +55,7 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
|
|
|
55
55
|
type: scroll_vertical
|
|
56
56
|
```
|
|
57
57
|
4. **Extract tokens** — scan for colors, fonts, spacing and create files in `openuispec/tokens/`.
|
|
58
|
-
5. **Update the manifest** — fill in `data_model` and `
|
|
58
|
+
5. **Update the manifest** — fill in `data_model`, `api.endpoints`, and `generation.code_roots.backend` in `openuispec/openuispec.yaml`.
|
|
59
59
|
|
|
60
60
|
## OpenUISpec Source Of Truth
|
|
61
61
|
|
|
@@ -76,7 +76,8 @@ Spec-first workflow:
|
|
|
76
76
|
4. Run `openuispec validate`.
|
|
77
77
|
5. Run `openuispec validate semantic`.
|
|
78
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
|
|
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.
|
|
80
81
|
8. Verify the affected UI targets build/run if possible.
|
|
81
82
|
9. Only then run `openuispec drift --snapshot --target <target>` for affected targets, after that target output directory exists.
|
|
82
83
|
10. Run `openuispec drift --target <target> --explain` again to confirm no spec changes remain for that target.
|
|
@@ -97,6 +98,7 @@ Platform-first workflow:
|
|
|
97
98
|
- Do not treat `openuispec drift` as proof that generated UI matches the spec.
|
|
98
99
|
- Do not skip `--explain` / `prepare` when another platform needs to catch up with shared spec changes.
|
|
99
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.
|
|
100
102
|
|
|
101
103
|
## CLI commands
|
|
102
104
|
- `openuispec init` — scaffold a new spec project
|
|
@@ -105,7 +107,7 @@ Platform-first workflow:
|
|
|
105
107
|
- `openuispec drift --target <t>` — check for spec drift
|
|
106
108
|
- `openuispec drift --target <t> --explain` — explain semantic spec drift since the target baseline
|
|
107
109
|
- `openuispec drift --snapshot --target <t>` — snapshot current state after the target output exists
|
|
108
|
-
- `openuispec prepare --target <t>` — build
|
|
110
|
+
- `openuispec prepare --target <t>` — build the target work bundle and check whether stack confirmation is still pending
|
|
109
111
|
- `openuispec status` — show cross-target baseline/drift status
|
|
110
112
|
- `openuispec update-rules` — update AI rules to match installed package version
|
|
111
113
|
- `openuispec drift --all` — include stubs in drift check
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -27,7 +27,7 @@ Do NOT guess the file format — skipping this step will produce invalid YAML th
|
|
|
27
27
|
3. Online: `https://openuispec.rsteam.uz/llms-full.txt` (if not installed)
|
|
28
28
|
|
|
29
29
|
**Reference files inside the package (read in this order):**
|
|
30
|
-
1. `README.md` — schema tables, file format reference, root keys
|
|
30
|
+
1. `README.md` — schema tables, file format reference, root wrapper keys
|
|
31
31
|
2. `spec/openuispec-v0.1.md` — full specification (contracts, layout, expressions, etc.)
|
|
32
32
|
3. `examples/taskflow/openuispec/` — complete working example with all file types
|
|
33
33
|
4. `schema/` — JSON Schemas for validation
|
|
@@ -38,12 +38,17 @@ Do NOT guess the file format — skipping this step will produce invalid YAML th
|
|
|
38
38
|
openuispec validate # Validate spec files against schemas
|
|
39
39
|
openuispec validate semantic # Check semantic cross-references
|
|
40
40
|
openuispec validate screens # Validate only screens
|
|
41
|
+
openuispec configure-target ios [--defaults] # Configure target stack defaults
|
|
41
42
|
openuispec status # Show which targets are behind
|
|
42
43
|
openuispec drift --target ios --explain # Explain semantic spec drift since ios baseline
|
|
43
|
-
openuispec prepare --target ios # Build
|
|
44
|
+
openuispec prepare --target ios # Build the target work bundle
|
|
44
45
|
openuispec drift --snapshot --target ios # Snapshot current state + git baseline after ios output exists
|
|
45
46
|
```
|
|
46
47
|
|
|
48
|
+
The target work bundle has two modes:
|
|
49
|
+
- `bootstrap` when no snapshot exists yet, for first-time generation
|
|
50
|
+
- `update` after a snapshot exists, for drift-based target updates
|
|
51
|
+
|
|
47
52
|
## Learn more
|
|
48
53
|
|
|
49
54
|
Docs: https://openuispec.rsteam.uz
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- openuispec-rules-start -->
|
|
2
|
-
<!-- openuispec-rules-version: 0.1.
|
|
2
|
+
<!-- openuispec-rules-version: 0.1.29 -->
|
|
3
3
|
# OpenUISpec — AI Assistant Rules
|
|
4
4
|
# ================================
|
|
5
5
|
# This project uses OpenUISpec to define UI as a semantic spec.
|
|
@@ -55,7 +55,7 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
|
|
|
55
55
|
type: scroll_vertical
|
|
56
56
|
```
|
|
57
57
|
4. **Extract tokens** — scan for colors, fonts, spacing and create files in `openuispec/tokens/`.
|
|
58
|
-
5. **Update the manifest** — fill in `data_model` and `
|
|
58
|
+
5. **Update the manifest** — fill in `data_model`, `api.endpoints`, and `generation.code_roots.backend` in `openuispec/openuispec.yaml`.
|
|
59
59
|
|
|
60
60
|
## OpenUISpec Source Of Truth
|
|
61
61
|
|
|
@@ -76,7 +76,8 @@ Spec-first workflow:
|
|
|
76
76
|
4. Run `openuispec validate`.
|
|
77
77
|
5. Run `openuispec validate semantic`.
|
|
78
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
|
|
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.
|
|
80
81
|
8. Verify the affected UI targets build/run if possible.
|
|
81
82
|
9. Only then run `openuispec drift --snapshot --target <target>` for affected targets, after that target output directory exists.
|
|
82
83
|
10. Run `openuispec drift --target <target> --explain` again to confirm no spec changes remain for that target.
|
|
@@ -97,6 +98,7 @@ Platform-first workflow:
|
|
|
97
98
|
- Do not treat `openuispec drift` as proof that generated UI matches the spec.
|
|
98
99
|
- Do not skip `--explain` / `prepare` when another platform needs to catch up with shared spec changes.
|
|
99
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.
|
|
100
102
|
|
|
101
103
|
## CLI commands
|
|
102
104
|
- `openuispec init` — scaffold a new spec project
|
|
@@ -105,7 +107,7 @@ Platform-first workflow:
|
|
|
105
107
|
- `openuispec drift --target <t>` — check for spec drift
|
|
106
108
|
- `openuispec drift --target <t> --explain` — explain semantic spec drift since the target baseline
|
|
107
109
|
- `openuispec drift --snapshot --target <t>` — snapshot current state after the target output exists
|
|
108
|
-
- `openuispec prepare --target <t>` — build
|
|
110
|
+
- `openuispec prepare --target <t>` — build the target work bundle and check whether stack confirmation is still pending
|
|
109
111
|
- `openuispec status` — show cross-target baseline/drift status
|
|
110
112
|
- `openuispec update-rules` — update AI rules to match installed package version
|
|
111
113
|
- `openuispec drift --all` — include stubs in drift check
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- openuispec-rules-start -->
|
|
2
|
-
<!-- openuispec-rules-version: 0.1.
|
|
2
|
+
<!-- openuispec-rules-version: 0.1.29 -->
|
|
3
3
|
# OpenUISpec — AI Assistant Rules
|
|
4
4
|
# ================================
|
|
5
5
|
# This project uses OpenUISpec to define UI as a semantic spec.
|
|
@@ -55,7 +55,7 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
|
|
|
55
55
|
type: scroll_vertical
|
|
56
56
|
```
|
|
57
57
|
4. **Extract tokens** — scan for colors, fonts, spacing and create files in `openuispec/tokens/`.
|
|
58
|
-
5. **Update the manifest** — fill in `data_model` and `
|
|
58
|
+
5. **Update the manifest** — fill in `data_model`, `api.endpoints`, and `generation.code_roots.backend` in `openuispec/openuispec.yaml`.
|
|
59
59
|
|
|
60
60
|
## OpenUISpec Source Of Truth
|
|
61
61
|
|
|
@@ -76,7 +76,8 @@ Spec-first workflow:
|
|
|
76
76
|
4. Run `openuispec validate`.
|
|
77
77
|
5. Run `openuispec validate semantic`.
|
|
78
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
|
|
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.
|
|
80
81
|
8. Verify the affected UI targets build/run if possible.
|
|
81
82
|
9. Only then run `openuispec drift --snapshot --target <target>` for affected targets, after that target output directory exists.
|
|
82
83
|
10. Run `openuispec drift --target <target> --explain` again to confirm no spec changes remain for that target.
|
|
@@ -97,6 +98,7 @@ Platform-first workflow:
|
|
|
97
98
|
- Do not treat `openuispec drift` as proof that generated UI matches the spec.
|
|
98
99
|
- Do not skip `--explain` / `prepare` when another platform needs to catch up with shared spec changes.
|
|
99
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.
|
|
100
102
|
|
|
101
103
|
## CLI commands
|
|
102
104
|
- `openuispec init` — scaffold a new spec project
|
|
@@ -105,7 +107,7 @@ Platform-first workflow:
|
|
|
105
107
|
- `openuispec drift --target <t>` — check for spec drift
|
|
106
108
|
- `openuispec drift --target <t> --explain` — explain semantic spec drift since the target baseline
|
|
107
109
|
- `openuispec drift --snapshot --target <t>` — snapshot current state after the target output exists
|
|
108
|
-
- `openuispec prepare --target <t>` — build
|
|
110
|
+
- `openuispec prepare --target <t>` — build the target work bundle and check whether stack confirmation is still pending
|
|
109
111
|
- `openuispec status` — show cross-target baseline/drift status
|
|
110
112
|
- `openuispec update-rules` — update AI rules to match installed package version
|
|
111
113
|
- `openuispec drift --all` — include stubs in drift check
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -27,7 +27,7 @@ Do NOT guess the file format — skipping this step will produce invalid YAML th
|
|
|
27
27
|
3. Online: `https://openuispec.rsteam.uz/llms-full.txt` (if not installed)
|
|
28
28
|
|
|
29
29
|
**Reference files inside the package (read in this order):**
|
|
30
|
-
1. `README.md` — schema tables, file format reference, root keys
|
|
30
|
+
1. `README.md` — schema tables, file format reference, root wrapper keys
|
|
31
31
|
2. `spec/openuispec-v0.1.md` — full specification (contracts, layout, expressions, etc.)
|
|
32
32
|
3. `examples/taskflow/openuispec/` — complete working example with all file types
|
|
33
33
|
4. `schema/` — JSON Schemas for validation
|
|
@@ -38,12 +38,17 @@ Do NOT guess the file format — skipping this step will produce invalid YAML th
|
|
|
38
38
|
openuispec validate # Validate spec files against schemas
|
|
39
39
|
openuispec validate semantic # Check semantic cross-references
|
|
40
40
|
openuispec validate screens # Validate only screens
|
|
41
|
+
openuispec configure-target ios [--defaults] # Configure target stack defaults
|
|
41
42
|
openuispec status # Show which targets are behind
|
|
42
43
|
openuispec drift --target ios --explain # Explain semantic spec drift since ios baseline
|
|
43
|
-
openuispec prepare --target ios # Build
|
|
44
|
+
openuispec prepare --target ios # Build the target work bundle
|
|
44
45
|
openuispec drift --snapshot --target ios # Snapshot current state + git baseline after ios output exists
|
|
45
46
|
```
|
|
46
47
|
|
|
48
|
+
The target work bundle has two modes:
|
|
49
|
+
- `bootstrap` when no snapshot exists yet, for first-time generation
|
|
50
|
+
- `update` after a snapshot exists, for drift-based target updates
|
|
51
|
+
|
|
47
52
|
If a target snapshot was created before baseline metadata was added, `--explain` and `status` will ask you to re-run `openuispec drift --snapshot --target <target>` for that target.
|
|
48
53
|
|
|
49
54
|
## Learn more
|
|
@@ -29,6 +29,8 @@ generation:
|
|
|
29
29
|
# ios: "../ios-app/" # relative to this file
|
|
30
30
|
# android: "../android-app/"
|
|
31
31
|
# web: "../web-ui/"
|
|
32
|
+
code_roots:
|
|
33
|
+
backend: "../backend/"
|
|
32
34
|
output_format:
|
|
33
35
|
ios: { language: swift, framework: swiftui, min_version: "17.0" }
|
|
34
36
|
android: { language: kotlin, framework: compose, min_sdk: 26 }
|