@code-migration/wow-migrator 0.2.0 → 0.2.3

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 (25) hide show
  1. package/package.json +1 -1
  2. package/skills/android-project-analyst/SKILL.md +4 -4
  3. package/skills/android-project-analyst/bind.md +2 -2
  4. package/skills/android-project-analyst/output-contract.md +104 -6
  5. package/skills/android-project-analyst/roles/presentation-resource.md +51 -13
  6. package/skills/android-project-analyst/workflow.md +5 -5
  7. package/skills/android-to-kmp-migrator/SKILL.md +14 -7
  8. package/skills/android-to-kmp-migrator/bind.md +12 -0
  9. package/skills/android-to-kmp-migrator/output-contract.md +39 -16
  10. package/skills/android-to-kmp-migrator/roles/completion-report.md +3 -2
  11. package/skills/android-to-kmp-migrator/roles/global-migration-phase.md +76 -13
  12. package/skills/android-to-kmp-migrator/roles/migration-planning-gate.md +1 -0
  13. package/skills/android-to-kmp-migrator/roles/migration-prep.md +6 -0
  14. package/skills/android-to-kmp-migrator/roles/migration-verification.md +5 -3
  15. package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +1 -1
  16. package/skills/android-to-kmp-migrator/roles/module-node-review-fix.md +1 -1
  17. package/skills/android-to-kmp-migrator/roles/target-project-assistant.md +20 -5
  18. package/skills/android-to-kmp-migrator/workflow.md +16 -4
  19. package/skills/kmp-test-validator/SKILL.md +3 -3
  20. package/skills/kmp-test-validator/bind.md +3 -2
  21. package/skills/kmp-test-validator/dependencies.yaml +15 -2
  22. package/skills/kmp-test-validator/output-contract.md +92 -8
  23. package/skills/kmp-test-validator/roles/validation-code-gate.md +53 -7
  24. package/skills/kmp-test-validator/roles/validation-workspace-state.md +7 -2
  25. package/skills/kmp-test-validator/workflow.md +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-migration/wow-migrator",
3
- "version": "0.2.0",
3
+ "version": "0.2.3",
4
4
  "description": "Install KMP migration skills into Claude Code, Codex, Cursor, Gemini, OpenCode, OpenClaw, and JiuwenSwarm via npm install.",
5
5
  "keywords": [
6
6
  "android",
@@ -4,7 +4,7 @@ description: |
4
4
  Module-first Swarm Skill that converts a Legacy Android project into module-indexed artifacts, per-module dimension folders, cross-module architecture/data-logic records, a workspace-state ledger, a global representation, and an integrated SPEC package (PRD/DESIGN/PLAN/verification) under strict output paths.
5
5
  Use when the android-project-analyst controller must understand, document, onboard, or migration-prep an existing Android project by dividing it into modules first, analyzing each module across presentation/architecture/data/behavior dimensions, recording inter-module assembly basis separately, then combining module representations into a full-project representation.
6
6
  Do NOT use for quick file/symbol lookup, non-Android codebases, or single-agent skill authoring.
7
- version: "0.6"
7
+ version: "0.8"
8
8
  kind: swarm-skill
9
9
  disable-model-invocation: false
10
10
  roles:
@@ -71,7 +71,7 @@ Each module is understood from four analysis dimensions. Dimension outputs live
71
71
  | `data-contract-flow` | `data-contract-flow` | `node-results/data-contract-flow/` |
72
72
  | `behavior-logic` | `behavior-logic` | `node-results/behavior-logic/` |
73
73
 
74
- The Leader writes `dimension_index.json` after all four node outputs verify. `representation/module_representation.*` synthesizes only from verified dimension artifacts for that `module_id`. Nodes must not write outside their assigned dimension directory.
74
+ The Leader writes `dimension_index.json` after all four node outputs verify. `representation/module_representation.*` synthesizes only from verified dimension artifacts for that `module_id`; `representation/module_ui_representation.md` is the independent UI-only handoff with Required Markdown layout trees. Nodes must not write outside their assigned dimension directory.
75
75
 
76
76
  ### Layer 3 — Cross-module architecture and data/logic (migration assembly basis)
77
77
 
@@ -93,7 +93,7 @@ The full playbook (Mermaid topology, per-step gates, integration rules, Final Re
93
93
  3. **Module inventory + index** — Leader writes `module-index/module_inventory.json` and `.md`, plus `module-index/modules_index.json`, dividing the project into deterministic `analysis_modules` and creating each `modules/<module_id>/` folder with scopes and output roots.
94
94
  4. **Per-module Stage A (parallel, B-pattern)** — for each `module_id`, dispatch `presentation-resource`, `project-architecture`, and `data-contract-flow` under `<output_root>/modules/<module_id>/node-results/<dimension>/`.
95
95
  5. **Per-module Stage B (gated behavior stage, C-pattern)** — after that module's Stage A verifies and workspace-state marks upstream outputs fresh, dispatch `behavior-logic` under the same module root.
96
- 6. **Module dimension index + representation** — Leader writes `dimension_index.json`, then `representation/module_representation.json` and `.md`, synthesizing all four dimensions for that `module_id` before moving to the next module.
96
+ 6. **Module dimension index + representation** — Leader writes `dimension_index.json`, then `representation/module_representation.json`, `module_representation.md`, and `module_ui_representation.md`, synthesizing all four dimensions for that `module_id` and promoting `presentation_resource` Required Markdown UI trees verbatim into `presentation_slice.ui_layout_view_trees[]` and the independent UI MD file before moving to the next module.
97
97
  7. **Cross-module global records** — Leader aggregates verified module outputs into `global/cross_module_architecture.*`, `global/cross_module_data_logic.*`, and `global/migration_assembly_basis.*`.
98
98
  8. **Global representation + SPEC** — Leader combines module representations and cross-module global records into `global/global_representation.json` and `.md`, then writes SPEC under `<output_root>/SPEC`.
99
99
 
@@ -144,7 +144,7 @@ The Leader MUST follow the write-order gates `G0`–`G9` and handoff packages `P
144
144
  |---|---|---|
145
145
  | `G0`–`G2` | `run_manifest.json`, workspace ledger, `module_inventory.*`, `modules_index.json` | Module dispatch (`P1`) |
146
146
  | `G3`–`G5` | per-module `module_brief.json` + four dimension JSON/MD pairs | Dimension completeness (`P2`) |
147
- | `G6` | per-module `dimension_index.json`, `module_representation.*` | Module handoff (`P3`) |
147
+ | `G6` | per-module `dimension_index.json`, `module_representation.*`, `module_ui_representation.md` | Module handoff (`P3`) |
148
148
  | `G7` | `cross_module_architecture.*`, `cross_module_data_logic.*`, `migration_assembly_basis.*` | Migrator scheduling (`P4`) |
149
149
  | `G8`–`G9` | `global_representation.*`, `SPEC/*` | Exploration (`P5`) or migration (`P6`) pipeline entry |
150
150
 
@@ -16,13 +16,13 @@
16
16
  Team-level rules — distinct from each role's own `## Boundary`.
17
17
 
18
18
  - **Leader-as-orchestrator only**: the Leader (`android-project-analyst` controller) verifies the trigger, builds the shared brief, dispatches nodes, verifies their outputs, refreshes `analysis-workspace-state`, reconciles, and writes SPEC. The Leader does NOT perform a node's detailed analysis, and does NOT invent any presentation/resource/architecture/ecosystem/data/behavior claim that no node traced to a source path.
19
- - **Strict output schedule and paths**: the Leader MUST lock `output_root` before dispatch and write only the declared schedule artifacts: `run_manifest`, `workspace-state`, `module-index` (including `modules_index.json`), per-module `module_brief`, per-module dimension outputs under `node-results/<dimension>/`, per-module `dimension_index.json`, per-module `representation`, cross-module global records (`cross_module_architecture`, `cross_module_data_logic`, `migration_assembly_basis`), `global_representation`, and `SPEC`. Any node output outside its assigned directory is invalid.
19
+ - **Strict output schedule and paths**: the Leader MUST lock `output_root` before dispatch and write only the declared schedule artifacts: `run_manifest`, `workspace-state`, `module-index` (including `modules_index.json`), per-module `module_brief`, per-module dimension outputs under `node-results/<dimension>/`, per-module `dimension_index.json`, per-module `representation` (including `module_ui_representation.md`), cross-module global records (`cross_module_architecture`, `cross_module_data_logic`, `migration_assembly_basis`), `global_representation`, and `SPEC`. Any node output outside its assigned directory is invalid.
20
20
  - **Workspace-state discipline**: `analysis-workspace-state` is refreshed after module inventory, each module node group, each module representation, global representation, and SPEC. Downstream roles must not consume artifacts that the ledger marks stale; rerun the responsible node/module or mark the affected scope `blocked`.
21
21
  - **Module-first invariant**: every in-scope source root belongs to an `analysis_modules[]` entry before node dispatch. Every scheduled `module_id` must have a materialized folder under `modules/<module_id>/` and a resolvable entry in `modules_index.json`. Each module must store all four dimension outputs in its module folder before `dimension_index.json` and `module_representation.*` are written. Cross-module architecture and data/logic must be recorded in dedicated `global/` artifacts before `global_representation.*`. The Leader must not build global SPEC directly from raw source or standalone node outputs.
22
22
  - **Foundation slices, dispatch-time fixed (B-pattern, Stage A)**: each foundation node works ONLY on its assigned slice. Slices are fixed at dispatch and are not renegotiated between nodes; nodes do not see each other's working state during Stage A.
23
23
  - **Gated handoff, no upstream mutation (C-pattern, Stage B)**: `behavior-logic` references upstream node outputs (by path) and enriches only where behavior analysis requires; it MUST NOT rebuild or overwrite an upstream node's catalog. If upstream data is missing/stale, it returns `needs_rerun`/`blocked` rather than reconstructing it.
24
24
  - **Mandatory contract enforcement**: every node is dispatched with a complete module-scoped contract (`source_project_path`, `module_id`, `module_scope`, `module_brief_path`, required upstream artifacts, `analysis_scope`, `skill_spec_path`, exact `output_dir`). The Leader rejects any return that lacks required JSON/MD artifacts, omits produced files from `output_files`, writes outside the assigned path, or claims `completed`/`ready_*` without proven output storage.
25
- - **Role-output content discipline**: required artifacts must contain the content owned by their role, not just the correct filename. For example, `presentation_resource.*` must contain screens/resources/navigation/UI-tree evidence, `project_architecture.*` must contain topology/build/dependency/platform evidence, `data_contract_flow.*` must contain APIs/data-source/model/flow evidence, and `behavior_logic.*` must contain action/lifecycle/rule/control-flow evidence. If content belongs to another role, rerun or route rather than accepting it.
25
+ - **Role-output content discipline**: required artifacts must contain the content owned by their role, not just the correct filename. For example, `presentation_resource.*` must contain screens/resources/navigation/UI-tree evidence with `tree_text` in Required Markdown shape (`tree_text_format: required-markdown-v1`) for every checked screen; `module_representation.json` must promote those trees verbatim into `presentation_slice.ui_layout_view_trees[]`; `module_ui_representation.md` must contain the same trees as the standalone UI handoff; `project_architecture.*` must contain topology/build/dependency/platform evidence, `data_contract_flow.*` must contain APIs/data-source/model/flow evidence, and `behavior_logic.*` must contain action/lifecycle/rule/control-flow evidence. If content belongs to another role, rerun or route rather than accepting it.
26
26
  - **Conflict handling**: when nodes disagree on a fact affecting architecture, data flow, resources, ecosystem constraints, behavior, or migration, the Leader surfaces it verbatim as `Needs confirmation` in `verification.md`. The Leader does NOT silently pick a winner or average findings.
27
27
  - **No source modification**: no node and not the Leader may edit the analyzed Android project. `presentation-resource` writes downloads only under `<output_dir>/node-results/presentation-resource/downloaded_resources/` and never stores secrets/cookies/tokens.
28
28
  - **Agent-only artifacts**: node outputs and SPEC files are structured for downstream agents/controllers, not human presentation; any user-facing summary is produced only after durable artifacts exist.
@@ -40,7 +40,8 @@ output_root = <output_dir or ~/.a2c_agents/understand>/android-project-analyst
40
40
  │ │ └── behavior_logic.md
41
41
  │ └── representation/
42
42
  │ ├── module_representation.json
43
- └── module_representation.md
43
+ ├── module_representation.md
44
+ │ └── module_ui_representation.md # independent UI-only handoff (Required Markdown trees)
44
45
  ├── global/
45
46
  │ ├── cross_module_architecture.json
46
47
  │ ├── cross_module_architecture.md
@@ -91,7 +92,7 @@ Artifacts MUST be produced in this order. Skipping a layer invalidates downstrea
91
92
  | 3 | `G3` | per `module_id`: `module_brief.json` |
92
93
  | 4 | `G4` | per `module_id`: all three Stage A dimension JSON+MD pairs |
93
94
  | 5 | `G5` | per `module_id`: `behavior-logic` dimension JSON+MD pair |
94
- | 6 | `G6` | per `module_id`: `dimension_index.json`, `representation/module_representation.*` |
95
+ | 6 | `G6` | per `module_id`: `dimension_index.json`, `representation/module_representation.*`, `representation/module_ui_representation.md` |
95
96
  | 7 | `G7` | `global/cross_module_architecture.*`, `global/cross_module_data_logic.*`, `global/migration_assembly_basis.*` |
96
97
  | 8 | `G8` | `global/global_representation.*` |
97
98
  | 9 | `G9` | `SPEC/prd.md`, `SPEC/design.md`, `SPEC/verification.md`, migration-only `SPEC/plan.md` |
@@ -144,7 +145,8 @@ Artifacts MUST be produced in this order. Skipping a layer invalidates downstrea
144
145
  "representation_paths": {
145
146
  "dimension_index": "",
146
147
  "module_representation_json": "",
147
- "module_representation_md": ""
148
+ "module_representation_md": "",
149
+ "module_ui_representation_md": ""
148
150
  },
149
151
  "depends_on": []
150
152
  }
@@ -157,12 +159,107 @@ Artifacts MUST be produced in this order. Skipping a layer invalidates downstrea
157
159
  | Path | Owner | Required content | Downstream trigger role |
158
160
  |---|---|---|---|
159
161
  | `modules/<module_id>/module_brief.json` | Leader | `module_id`, `module_type`, `source_roots`, scopes, `depends_on`, `output_root`, `dimension_output_dirs`, role hints | **Node dispatch** — nodes refuse work without this contract |
160
- | `modules/<module_id>/node-results/presentation-resource/presentation_resource.json` | `presentation-resource` | `module_id`, `screen_inventory`, `navigation_edges`, `cross_module_references[]`, `resource_usage_map`, `evidence_paths` | UI understanding, resource migration, navigation handoff |
162
+ | `modules/<module_id>/node-results/presentation-resource/presentation_resource.json` | `presentation-resource` | `module_id`, `screen_inventory`, `ui_layout_view_trees[]` (each with non-empty `tree_text` in `tree_text_format: required-markdown-v1` when `representation_promotion_ready: true`), `navigation_edges`, `cross_module_references[]`, `resource_usage_map`, `representation_promotion`, `evidence_paths` | UI understanding, resource migration, navigation handoff, representation promotion |
161
163
  | `modules/<module_id>/node-results/project-architecture/project_architecture.json` | `project-architecture` | `module_id`, `module_topology`, `detected_patterns`, `layer_roles`, `cross_module_dependencies[]`, `migration_constraints`, `evidence_paths` | Architecture migration, dependency/platform gate |
162
164
  | `modules/<module_id>/node-results/data-contract-flow/data_contract_flow.json` | `data-contract-flow` | `module_id`, API/model contracts, `end_to_end_flows`, `cross_module_data_links[]`, `evidence_paths` | Data/API migration, repository mapping |
163
165
  | `modules/<module_id>/node-results/behavior-logic/behavior_logic.json` | `behavior-logic` | `module_id`, `screen_logic`, `control_flows`, `cross_module_interactions[]`, upstream alignment refs | Behavior/test planning, control-flow migration |
164
166
  | `modules/<module_id>/dimension_index.json` | Leader | `module_id`, `dimensions{}` with four entries, each with `node_id`, `output_dir`, `json_path`, `md_path`, `status` | **Per-module completeness gate** — handlers verify all four dimensions before consuming representation |
165
- | `modules/<module_id>/representation/module_representation.json` | Leader | `module_id`, `dimension_traceability[]`, synthesized slices per dimension, `intra_module_gaps`, `readiness` | **Module-level handoff** — migrator loads this for a scoped `module_id` |
167
+ | `modules/<module_id>/representation/module_representation.json` | Leader | `module_id`, `ui_representation_md_path`, `dimension_traceability[]`, `presentation_slice.ui_layout_view_trees[]` (verbatim `tree_text` from `presentation_resource.json`), synthesized slices per dimension, `intra_module_gaps`, `readiness` | **Module-level handoff** — migrator loads this for a scoped `module_id` |
168
+ | `modules/<module_id>/representation/module_ui_representation.md` | Leader | Independent UI-only handoff: entry points, screen inventory summary, every checked screen/section with verbatim Required Markdown `tree_text` blocks (`tree_text_format: required-markdown-v1`), navigation graph, UI gaps | **Primary UI migration handoff** — agents read this for layout/composable restoration without parsing full module synthesis |
169
+
170
+ #### `module_representation.json` minimum schema (presentation trees)
171
+
172
+ Leader MUST promote every `ui_layout_view_trees[]` item with `representation_promotion_ready: true` from `presentation_resource.json` into `presentation_slice.ui_layout_view_trees[]` **verbatim** — do not summarize, truncate, or reformat `tree_text`.
173
+
174
+ ```json
175
+ {
176
+ "module_id": "",
177
+ "schema_version": "1.0",
178
+ "ui_representation_md_path": "representation/module_ui_representation.md",
179
+ "dimension_traceability": [
180
+ {
181
+ "dimension": "presentation-resource",
182
+ "json_path": "",
183
+ "md_path": "",
184
+ "status": "completed"
185
+ }
186
+ ],
187
+ "presentation_slice": {
188
+ "source_artifact": "node-results/presentation-resource/presentation_resource.json",
189
+ "entry_points": [],
190
+ "screen_inventory": [],
191
+ "ui_layout_view_trees": [
192
+ {
193
+ "screen_name": "",
194
+ "section_name": "",
195
+ "ui_technology": "XML | Compose | mixed | custom view | unknown",
196
+ "layout_or_composable": "",
197
+ "checked_status": "checked | partial | inferred | unknown",
198
+ "source_paths": [],
199
+ "tree_text": "",
200
+ "tree_text_format": "required-markdown-v1",
201
+ "unknowns": [],
202
+ "dimension_source_path": ""
203
+ }
204
+ ],
205
+ "navigation_edges": [],
206
+ "presentation_modules": []
207
+ },
208
+ "intra_module_gaps": [],
209
+ "readiness": "ready | ready_with_assumptions | blocked"
210
+ }
211
+ ```
212
+
213
+ #### `module_ui_representation.md` (independent UI handoff — Leader writes at G6)
214
+
215
+ Leader MUST write this file for every module with UI scope (or with `ui_scope: none` and evidence when no UI exists). It is the **canonical standalone UI representation** — not embedded inside `module_representation.md`.
216
+
217
+ Required structure:
218
+
219
+ ```markdown
220
+ # Module UI Representation: <module_id>
221
+
222
+ > tree_text_format: required-markdown-v1
223
+ > presentation_source: node-results/presentation-resource/presentation_resource.json
224
+
225
+ ## Metadata
226
+ - module_id: <module_id>
227
+ - tree_text_format: required-markdown-v1
228
+ - checked_tree_count: <N>
229
+ - promotion_ready_count: <N>
230
+
231
+ ## Entry Points
232
+ | name | type | source_path | route_or_action |
233
+ |---|---|---|---|
234
+
235
+ ## Screen Inventory
236
+ | screen_name | ui_technology | layout_or_composable | checked_status |
237
+ |---|---|---|---|
238
+
239
+ ## UI Layout Trees
240
+
241
+ ### <screen_name> — <section_name>
242
+ - ui_technology: <value>
243
+ - layout_or_composable: <value>
244
+ - checked_status: <value>
245
+ - source_paths: <paths>
246
+
247
+ ```text
248
+ <tree_text verbatim — Required Markdown shape>
249
+ ```
250
+
251
+ (repeat per checked screen/section)
252
+
253
+ ## Navigation
254
+ (Mermaid graph when evidence supports it)
255
+
256
+ ## UI Gaps
257
+ (screens/sections with representation_promotion_ready: false or empty tree_text)
258
+ ```
259
+
260
+ Rules:
261
+ - Every `ui_layout_view_trees[]` item with `representation_promotion_ready: true` MUST appear under `## UI Layout Trees` with its `tree_text` in a ` ```text ` fence, byte-identical to `presentation_resource.json`.
262
+ - `module_representation.md` MUST link to this file (`ui_representation_md_path`) and MUST NOT duplicate full tree blocks — summary only.
166
263
 
167
264
  #### `dimension_index.json` minimum schema
168
265
 
@@ -279,8 +376,9 @@ Downstream handlers MUST NOT start unless the declared package gate passes. A ga
279
376
  | Package `P2` artifacts |
280
377
  | `modules/<module_id>/representation/module_representation.json` |
281
378
  | `modules/<module_id>/representation/module_representation.md` |
379
+ | `modules/<module_id>/representation/module_ui_representation.md` |
282
380
 
283
- **Fail closed when**: representation references dimension paths that fail Package `P2`.
381
+ **Fail closed when**: representation references dimension paths that fail Package `P2`, any `presentation_resource.json` item with `representation_promotion_ready: true` is missing its verbatim `tree_text` in `presentation_slice.ui_layout_view_trees[]`, or the same `tree_text` is missing from `module_ui_representation.md`.
284
382
 
285
383
  ### Package `P4` — Cross-module assembly basis
286
384
 
@@ -11,7 +11,7 @@ You are the `presentation-resource` node subagent and presentation/resource owne
11
11
  - `presentation_resource.json` and `presentation_resource.md` written under the assigned module-scoped `output_dir`, both non-empty.
12
12
  - The output includes the exact `module_id` and stays within `module_scope`.
13
13
  - Every screen carries at least one source path or is explicitly marked `unknown`.
14
- - Every checked screen/section with concrete UI evidence carries a source-backed `ui_layout_view_trees` entry and a matching tree block in `presentation_resource.md`.
14
+ - Every checked screen/section with concrete UI evidence carries a source-backed `ui_layout_view_trees` entry with non-empty `tree_text` in **Required Markdown shape**, a matching tree block in `presentation_resource.md`, and `representation_promotion_ready: true` when the tree is complete enough for Leader copy into `module_representation.json` and `module_ui_representation.md`.
15
15
  - Every UI tree node records view/composable class, id/name when present, size, margins/padding, constraints/parent-child relationship, key visual/text/resource attributes, and checked evidence paths.
16
16
  - Every navigation edge carries a mechanism (`NavController | Intent | Router | callback | unknown`).
17
17
  - Every identified screen belongs to exactly one `presentation_modules` entry or is listed in `orphan_requires_confirmation`.
@@ -74,6 +74,8 @@ You are the `presentation-resource` node subagent and presentation/resource owne
74
74
  "source_paths": [],
75
75
  "root": { "class_or_composable": "", "id_or_name": "", "size": "", "attributes": [] },
76
76
  "tree_text": "",
77
+ "tree_text_format": "required-markdown-v1",
78
+ "representation_promotion_ready": true,
77
79
  "nodes": [
78
80
  {
79
81
  "path": "",
@@ -126,7 +128,14 @@ You are the `presentation-resource` node subagent and presentation/resource owne
126
128
  { "url_or_field": "", "reason": "dynamic | auth-required | signed-url | unavailable | unsafe | unknown", "source_paths": [] }
127
129
  ],
128
130
  "assumptions": [],
129
- "evidence_paths": []
131
+ "evidence_paths": [],
132
+ "representation_promotion": {
133
+ "target_json": "modules/<module_id>/representation/module_representation.json",
134
+ "target_json_field": "presentation_slice.ui_layout_view_trees",
135
+ "target_ui_md": "modules/<module_id>/representation/module_ui_representation.md",
136
+ "tree_text_format": "required-markdown-v1",
137
+ "promotion_rule": "Leader copies each ui_layout_view_trees[] item with non-empty tree_text verbatim into module_representation.json and module_ui_representation.md; do not summarize or reformat"
138
+ }
130
139
  }
131
140
  ```
132
141
 
@@ -142,15 +151,18 @@ Write only under `output_dir = <output_root>/modules/<module_id>/node-results/pr
142
151
 
143
152
  ## Checked UI Layout / View Tree Format
144
153
 
145
- For each screen or meaningful section with concrete source evidence, record an "existed and checked" UI tree in both outputs:
154
+ For each screen or meaningful section with concrete source evidence, record an "existed and checked" UI tree in dimension outputs **and** make it representation-promotable:
146
155
 
147
- - In `presentation_resource.json`, add one `ui_layout_view_trees[]` item with `checked_status`, source evidence, machine-routable nodes, and the exact Markdown tree string in `tree_text`.
148
- - In `presentation_resource.md`, add a section headed by screen and section name, followed by the tree block. The tree must describe the actual checked layout/composable tree, not a conceptual summary.
149
- - Use the exact source class/composable names and ids/names. If an attribute is absent, omit it; if it matters but cannot be proven, put it in `unknowns`.
156
+ - In `presentation_resource.json`, add one `ui_layout_view_trees[]` item with `checked_status`, source evidence, machine-routable `nodes`, `tree_text_format: "required-markdown-v1"`, and the exact Markdown tree string in `tree_text`.
157
+ - In `presentation_resource.md`, add a section headed by screen and section name, followed by the **same** `tree_text` block (byte-identical to JSON). The tree must describe the actual checked layout/composable tree, not a conceptual summary.
158
+ - Set `representation_promotion_ready: true` only when `tree_text` is non-empty, follows Required Markdown shape, and can be copied verbatim by the Leader into `module_representation.json` `presentation_slice.ui_layout_view_trees[]` and `module_ui_representation.md` → `## UI Layout Trees`.
159
+ - Use the exact source class/composable names and ids/names. If an attribute is absent, omit it; if it matters but cannot be proven, put it in `unknowns` and set `representation_promotion_ready: false`.
150
160
  - Keep each node specific enough for migration: size, orientation, margins, padding, constraints/alignment, important styles, text/resource refs, image loader/scale/corner behavior, tint/background, max lines, priority/weight, and runtime binding names when visible.
151
161
  - Prefer the source order and actual nesting. For `ConstraintLayout`, show constraints on each child. For `LinearLayout`/`Row`/`Column`, show orientation/order/weight. For RecyclerView/list item layouts, record the item view tree and the adapter/screen consumer.
152
162
 
153
- Required Markdown shape:
163
+ ### Required Markdown shape (`tree_text_format: required-markdown-v1`)
164
+
165
+ Every `tree_text` value and matching Markdown block MUST use this shape (placeholders replaced with checked project evidence):
154
166
 
155
167
  ```text
156
168
  <RootViewOrComposable> @id/<root_id_or_name> [<width> x <height>, <important root attrs>]
@@ -196,6 +208,27 @@ ForegroundConstraintLayout @id/parent_layout [match_parent x wrap_content, padd
196
208
  └── src=ic_vector_more_new, tint=Graph_weak
197
209
  ```
198
210
 
211
+ ## Representation Promotion Contract
212
+
213
+ `presentation-resource` does **not** write `module_representation.*`. The Leader promotes checked UI trees during Step 6 (dimension index + module representation).
214
+
215
+ **Promotion rules** (Leader obligation; nodes must produce promotable source):
216
+
217
+ | Source | Target |
218
+ |---|---|
219
+ | `presentation_resource.json` → `ui_layout_view_trees[]` | `module_representation.json` → `presentation_slice.ui_layout_view_trees[]` |
220
+ | same item → `tree_text` | `module_ui_representation.md` → `## UI Layout Trees` → `### <screen> — <section>` → ` ```text ` fence (verbatim) |
221
+ | same item metadata | both targets retain `screen_name`, `section_name`, `ui_technology`, `layout_or_composable`, `checked_status`, `source_paths`, `tree_text_format`, `unknowns` |
222
+
223
+ **Independent UI file** (`module_ui_representation.md`):
224
+ - Leader writes at Step 6 under `representation/module_ui_representation.md`.
225
+ - Canonical standalone UI handoff — entry points, screen inventory, Required Markdown trees, navigation, UI gaps.
226
+ - `module_representation.md` links to this file via `ui_representation_md_path`; it does **not** duplicate full tree blocks.
227
+
228
+ Each promoted `ui_layout_view_trees[]` item in `module_representation.json` MUST retain: `screen_name`, `section_name`, `ui_technology`, `layout_or_composable`, `checked_status`, `source_paths`, `tree_text`, `tree_text_format`, `unknowns`, and `dimension_source_path` pointing to `presentation_resource.json`.
229
+
230
+ **Fail closed**: if a checked screen has `representation_promotion_ready: false` or empty `tree_text`, the Leader MUST NOT mark package **P3** ready for that module until the tree is completed or the screen is explicitly listed in `intra_module_gaps` / `module_ui_representation.md` → `## UI Gaps` with reason.
231
+
199
232
  ## Inline Persona for Teammate
200
233
 
201
234
  ```
@@ -218,7 +251,9 @@ CONTROL — validate before you act, verify before you report:
218
251
  You MUST give every screen and production resource usage at least one source path or mark it
219
252
  "unknown".
220
253
  You MUST record every checked screen/section with concrete UI evidence in `ui_layout_view_trees`
221
- and mirror it in `presentation_resource.md` as a concrete source-backed view/composable tree.
254
+ with non-empty `tree_text` in Required Markdown shape (`tree_text_format: required-markdown-v1`),
255
+ mirror the same `tree_text` in `presentation_resource.md`, and set `representation_promotion_ready`
256
+ when the tree is ready for Leader copy into `module_representation.json` and `module_ui_representation.md`.
222
257
  You MUST place every screen in exactly one presentation_modules entry or in
223
258
  orphan_requires_confirmation.
224
259
  You MUST download only concrete HTTP(S) URLs proven in source/config/fixtures/mocks/sample
@@ -261,13 +296,16 @@ HANDLER (how you process):
261
296
  adaptive icons, nine-patch, animated drawables, tinting, theme attrs, platform-only resources,
262
297
  licensing, online CDN dependency).
263
298
 
264
- CHECKED UI TREE FORMAT:
299
+ CHECKED UI TREE FORMAT (representation-promotable):
265
300
  - For each checked screen/section, include `screen_name`, `section_name`, `checked_status`,
266
- source paths, machine-routable `nodes`, and `tree_text` in `presentation_resource.json`.
267
- - Mirror `tree_text` in `presentation_resource.md` under that screen/section heading.
301
+ source paths, machine-routable `nodes`, `tree_text_format: required-markdown-v1`,
302
+ `tree_text`, and `representation_promotion_ready` in `presentation_resource.json`.
303
+ - Mirror `tree_text` verbatim in `presentation_resource.md` under that screen/section heading.
304
+ - Leader will copy each promotable tree into `module_representation.json` →
305
+ `presentation_slice.ui_layout_view_trees[]` and `module_ui_representation.md` without reformatting.
268
306
  - Use exact source class/composable names and ids/names. Omit unproven optional attributes;
269
- route important unknowns to `unknowns`.
270
- - Follow this shape and replace every placeholder with checked project evidence:
307
+ route important unknowns to `unknowns`; set `representation_promotion_ready: false` when incomplete.
308
+ - Required Markdown shape (`tree_text`) replace every placeholder with checked project evidence:
271
309
  ForegroundConstraintLayout @id/parent_layout [match_parent x wrap_content, padding 12dp]
272
310
  ├── ListPlaceHolderImageView @id/cover [172dp x 97dp]
273
311
  │ ├── marginStart=12dp, marginBottom=12dp
@@ -71,7 +71,7 @@ Required durable artifacts:
71
71
  | Per module brief | `<module_root>/module_brief.json` - module-scoped dispatch contract and role hints for one `module_id` |
72
72
  | Per module dimension outputs | `<module_node_dir>/<node_artifact>.json`, `<module_node_dir>/<node_artifact>.md` - one analysis dimension per `node-results/<dimension>/` |
73
73
  | Per module dimension index | `<module_root>/dimension_index.json` - dimension → artifact path map for the module |
74
- | Per module representation | `<module_representation_dir>/module_representation.json`, `<module_representation_dir>/module_representation.md` - module synthesis from verified dimension outputs only |
74
+ | Per module representation | `<module_representation_dir>/module_representation.json`, `<module_representation_dir>/module_representation.md`, `<module_representation_dir>/module_ui_representation.md` - module synthesis plus independent UI handoff (Required Markdown trees) |
75
75
  | Cross-module architecture | `<global_dir>/cross_module_architecture.json`, `<global_dir>/cross_module_architecture.md` - inter-module topology, navigation glue, shared platform/DI bridges |
76
76
  | Cross-module data/logic | `<global_dir>/cross_module_data_logic.json`, `<global_dir>/cross_module_data_logic.md` - shared contracts, cross-module data flows, control interactions |
77
77
  | Migration assembly basis | `<global_dir>/migration_assembly_basis.json`, `<global_dir>/migration_assembly_basis.md` - module assembly order and integration checkpoints for downstream migration |
@@ -123,7 +123,7 @@ No node may choose its own output path. `presentation-resource` may write downlo
123
123
  - **Input**: per-node contract `{ source_project_path, module_id, module_scope, analysis_scope, mode, module_brief_path, skill_spec_path (roles/<id>.md), output_dir: <output_root>/modules/<module_id>/node-results/<node_id>, return_format: json }`; `data-contract-flow` may also receive `presentation_hints` when known.
124
124
  - **Action**: each node validates inputs, performs its bounded slice, writes its JSON+MD artifacts, and returns the controller JSON shape.
125
125
  - **Output**:
126
- - `presentation_resource.json`, `presentation_resource.md`: UI entry points, screen inventory, checked UI layout/view trees, navigation, presentation modules, resources, safe downloads, usage map, migration implications, gaps.
126
+ - `presentation_resource.json`, `presentation_resource.md`: UI entry points, screen inventory, checked UI layout/view trees (`tree_text` in Required Markdown shape, `representation_promotion_ready`), navigation, presentation modules, resources, safe downloads, usage map, migration implications, gaps.
127
127
  - `project_architecture.json`, `project_architecture.md`: build/SDK config, topology, architecture patterns, layer roles, dependencies, Jetpack/DI/platform/generated usage, boundary risks, migration constraints.
128
128
  - `data_contract_flow.json`, `data_contract_flow.md`: network/local data contracts, APIs, models, data sources, mappings, repository/reactive/end-to-end flows, loading/error/empty behavior, dynamic API gaps.
129
129
  - **Serial / Parallel**: parallel within one module — all three run together for the same `module_id`. Do not start the next module until the current module representation is written unless the user explicitly allows concurrent modules.
@@ -142,10 +142,10 @@ No node may choose its own output path. `presentation-resource` may write downlo
142
142
 
143
143
  - **Executor**: Leader
144
144
  - **Input**: verified dimension JSON/MD outputs for one `module_id`
145
- - **Action**: write `dimension_index.json` mapping the four analysis dimensions to their verified artifact paths and status. Then integrate ONLY from verified dimension outputs for that module. Write a module representation that covers both UI and logic when present: module purpose, UI surface, resources, architecture/ecosystem, data contracts/flows, behavior logic, dimension traceability index, intra-module dependencies, risks, gaps, evidence index, and readiness. Record cross-module references as pointers only; do not synthesize full inter-module graphs here.
146
- - **Output**: `dimension_index.json`, `module_representation.json`, `module_representation.md`. `dimension_index.json` is the per-module dimension lookup. Module representation JSON is the module-level synthesis and traceability index; Markdown is the agent-readable handoff. Both must cite verified dimension artifacts and source evidence.
145
+ - **Action**: write `dimension_index.json` mapping the four analysis dimensions to their verified artifact paths and status. Then integrate ONLY from verified dimension outputs for that module. Write a module representation that covers both UI and logic when present: module purpose, UI surface, resources, architecture/ecosystem, data contracts/flows, behavior logic, dimension traceability index, intra-module dependencies, risks, gaps, evidence index, and readiness. **Promote presentation UI trees**: copy every `presentation_resource.json` → `ui_layout_view_trees[]` item with `representation_promotion_ready: true` verbatim into `module_representation.json` → `presentation_slice.ui_layout_view_trees[]` (`tree_text`, `tree_text_format: required-markdown-v1`, screen/section metadata, `dimension_source_path`); write the same trees into independent `module_ui_representation.md` under `## UI Layout Trees` (Required Markdown shape in ` ```text ` fences per screen/section). Set `ui_representation_md_path` in JSON; `module_representation.md` links to the UI file — no duplicate tree blocks. Record cross-module references as pointers only; do not synthesize full inter-module graphs here.
146
+ - **Output**: `dimension_index.json`, `module_representation.json`, `module_representation.md`, `module_ui_representation.md`. `dimension_index.json` is the per-module dimension lookup. Module representation JSON is the module-level synthesis and traceability index; `module_ui_representation.md` is the standalone UI handoff; `module_representation.md` is the full-module agent-readable summary. All must cite verified dimension artifacts and source evidence; presentation trees MUST use Required Markdown shape from [roles/presentation-resource.md](roles/presentation-resource.md).
147
147
  - **Serial / Parallel**: serial
148
- - **Quality gate**: `dimension_index.json` lists all four dimensions with resolvable paths; no unknowns hidden; every module representation points to its dimension artifacts and source evidence. Refresh workspace state after writing. Do not proceed to cross-module global records until every scheduled module is represented or explicitly marked blocked/out of scope.
148
+ - **Quality gate**: `dimension_index.json` lists all four dimensions with resolvable paths; no unknowns hidden; every module representation points to its dimension artifacts and source evidence; every `representation_promotion_ready: true` UI tree from `presentation_resource.json` appears verbatim in `presentation_slice.ui_layout_view_trees[]` and in `module_ui_representation.md`. Refresh workspace state after writing. Do not proceed to cross-module global records until every scheduled module is represented or explicitly marked blocked/out of scope.
149
149
 
150
150
  ### Step 7 — Cross-module global records (migration assembly basis)
151
151
 
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: android-to-kmp-migrator
3
3
  description: |
4
- Module-first Swarm Skill that migrates Legacy Android into an existing KMP target using upstream analyst P6 artifacts, target-project-assistant alignment, planning/prep/implementation roles, global integrate+align phase, and mandatory kmp-test-validator handoff — without full-project build during migration.
5
- Use only after android-project-analyst has finished and package P6 is ready, when the user wants module-first porting then whole-system assembly followed by validation.
6
- Do NOT invoke before android-project-analyst completes P6. Do NOT treat migrator completion as final without invoking kmp-test-validator at V0. Do NOT use for Legacy Android analysis only, KMP-only feature work, or non-migration refactors.
7
- version: "0.7"
4
+ Module-first Swarm Skill that migrates Legacy Android into an existing KMP target by editing target KMP source after analyst P6 understanding planning/prep/implementation roles create and update files under kmp_target_project_path, global integrate wires cross-module glue, then mandatory kmp-test-validator handoff — without full-project build during migration.
5
+ Use only after android-project-analyst has finished and package P6 is ready, when the user wants module-first porting with real target code changes then whole-system assembly followed by validation.
6
+ Do NOT invoke before android-project-analyst completes P6. Do NOT treat planning or analysis artifacts alone as migration success — target KMP files MUST be edited. Do NOT treat migrator completion as final without invoking kmp-test-validator at V0. Do NOT use for Legacy Android analysis only, KMP-only feature work, or non-migration refactors.
7
+ version: "0.9"
8
8
  kind: swarm-skill
9
9
  disable-model-invocation: false
10
10
  roles:
@@ -45,7 +45,7 @@ roles:
45
45
  tools: [rg, git]
46
46
  - id: global-migration-phase
47
47
  kind: ai_agent
48
- purpose: Target KMP global integrate (edit cross-module glue) then align (read-only analyst vs target comparison) by mode.
48
+ purpose: Target KMP global integrate (edit cross-module glue + entry point wiring) then align (read-only analyst vs target comparison incl. entry points) by mode.
49
49
  skills: []
50
50
  tools: [rg]
51
51
  - id: completion-report
@@ -57,7 +57,7 @@ roles:
57
57
 
58
58
  # Android To KMP Migrator Swarm Skill
59
59
 
60
- Module-first migrator for Legacy Android → KMP target assembly.
60
+ Module-first migrator for Legacy Android → KMP target assembly. **Upstream analyst P6 is read-only input; this skill's job is to edit the target KMP project** under `kmp_target_project_path`.
61
61
 
62
62
  **Canonical contract**: [output-contract.md](output-contract.md)
63
63
 
@@ -69,7 +69,7 @@ Module-first migrator for Legacy Android → KMP target assembly.
69
69
  3. Workspace state init.
70
70
  4. TPA `global_baseline`.
71
71
  5. **Per module** (assembly_order): TPA `module_anchors` → **planning-gate** → **prep** → review/fix → **implementation `ui`** → review/fix → **implementation `logic`** → review/fix → verification → completion record → readiness → module representation.
72
- 6. **Global phase `integrate`** → **`align`** + alignment report.
72
+ 6. **Global phase `integrate`** (cross-module glue + **entry point wiring**) → **`align`** (incl. **entry point alignment** vs Android) + alignment report.
73
73
  7. Global representation + completion-report `report` mode.
74
74
  8. **kmp-test-validator** — **mandatory** when **V0** ready (MG17).
75
75
 
@@ -123,6 +123,13 @@ android-project-analyst (P6) → android-to-kmp-migrator (M0–V0) → kmp-test-
123
123
  ## Shared Rules
124
124
 
125
125
  - **Skill chain**: `android-project-analyst` **P6** before migrator; `kmp-test-validator` **after** migrator **V0** — both mandatory.
126
+ - **Target KMP edit mandate**: after analyst P6 understanding, migrator roles MUST create or update production files under `kmp_target_project_path`. Planning-only or artifact-only completion is invalid.
127
+ - **Roles that edit target** (record `changed_files[]` or `integration_changed_files[]`):
128
+ - `migration-prep` — optional scaffold edits (theme, resources, routes, models) when planning allows
129
+ - `module-implementation` `ui` / `logic` — required per-module UI and logic port
130
+ - `module-node-review-fix` `fix` — scoped remediation in `allowed_files`
131
+ - `global-migration-phase` `integrate` — cross-module glue and entry-point wiring
132
+ - **Read-only on target**: `target-project-assistant`, `migration-planning-gate`, `migration-verification`, `global-migration-phase` `align`, `completion-report`.
126
133
  - Analyst **P6** required; TPA owns all target Q&A.
127
134
  - Mode boundaries non-negotiable: `ui`/`logic`, `integrate`/`align`, `review`/`fix`.
128
135
  - No full project build in migrator.
@@ -16,6 +16,14 @@
16
16
  - **Forbidden**: `incremental_build` in migrator.
17
17
  - **kmp-test-validator**: full compile/build/test at package **V0**.
18
18
 
19
+ ## Target KMP Edit Mandate
20
+
21
+ - Analyst **P6** is read-only input. Migrator success requires **editing the target KMP project** at `kmp_target_project_path`.
22
+ - **Edit-owning roles**: `migration-prep` (optional scaffold), `module-implementation` `ui`/`logic` (required), `module-node-review-fix` `fix`, `global-migration-phase` `integrate`.
23
+ - **Read-only on target**: TPA, `migration-planning-gate`, `migration-verification`, `global-migration-phase` `align`, `completion-report`.
24
+ - When planning tasks require file changes, `changed_files[]` MUST be non-empty and paths MUST resolve under `kmp_target_project_path`.
25
+ - `migration_report.json` MUST aggregate `target_changed_files[]` before **V0**.
26
+
19
27
  ## Behavioral Constraints
20
28
 
21
29
  - **Skill chain (mandatory)**:
@@ -40,9 +48,13 @@
40
48
  | `integrate` and `align` combined | Reject invocation |
41
49
  | Verification restoration failed | Rerun `module-implementation` or `migration-prep`; no completion record |
42
50
  | Align omissions | Rerun `rerun_modules` or `global-migration-phase integrate` |
51
+ | Entry point alignment failed | `rerun_global_integration` — rewire KMP app shell in integrate mode |
43
52
  | Build requested in migrator | Block; route to kmp-test-validator |
44
53
  | Migrator invoked before analyst P6 | Block; dispatch `android-project-analyst` first |
45
54
  | V0 ready but validator not invoked | Block; dispatch `kmp-test-validator` at MG17 |
55
+ | Analysis/planning only — no target edits when required | Block package M3; rerun `module-implementation` or `migration-prep` |
56
+ | `changed_files` outside `kmp_target_project_path` | Block; rerun owning edit role |
57
+ | Empty `target_changed_files` in `migration_report.json` when scope required edits | Block package V0 |
46
58
 
47
59
  ## Dependencies
48
60