@code-migration/wow-migrator 0.1.1 → 0.1.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 (78) hide show
  1. package/package.json +1 -1
  2. package/skills/android-project-analyst/MIGRATION.md +51 -21
  3. package/skills/android-project-analyst/SKILL.md +74 -44
  4. package/skills/android-project-analyst/bind.md +24 -15
  5. package/skills/android-project-analyst/dependencies.yaml +8 -4
  6. package/skills/android-project-analyst/roles/analysis-workspace-state.md +123 -0
  7. package/skills/android-project-analyst/roles/behavior-logic.md +166 -0
  8. package/skills/android-project-analyst/roles/data-contract-flow.md +170 -0
  9. package/skills/android-project-analyst/roles/presentation-resource.md +301 -0
  10. package/skills/android-project-analyst/roles/project-architecture.md +174 -0
  11. package/skills/android-project-analyst/workflow.md +123 -72
  12. package/skills/android-to-kmp-migrator/MIGRATION.md +87 -2
  13. package/skills/android-to-kmp-migrator/SKILL.md +126 -133
  14. package/skills/android-to-kmp-migrator/bind.md +43 -15
  15. package/skills/android-to-kmp-migrator/dependencies.yaml +3 -3
  16. package/skills/android-to-kmp-migrator/roles/completion-report.md +79 -0
  17. package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +68 -0
  18. package/skills/android-to-kmp-migrator/roles/logic-implementation.md +71 -0
  19. package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +70 -0
  20. package/skills/android-to-kmp-migrator/roles/migration-verification.md +83 -0
  21. package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +210 -19
  22. package/skills/android-to-kmp-migrator/roles/module-node-review-fix.md +81 -0
  23. package/skills/android-to-kmp-migrator/roles/presentation-integration.md +70 -0
  24. package/skills/android-to-kmp-migrator/roles/state-data-prep.md +68 -0
  25. package/skills/android-to-kmp-migrator/roles/ui-implementation.md +69 -0
  26. package/skills/android-to-kmp-migrator/workflow.md +215 -149
  27. package/skills/kmp-test-validator/MIGRATION.md +44 -3
  28. package/skills/kmp-test-validator/SKILL.md +93 -77
  29. package/skills/kmp-test-validator/bind.md +29 -9
  30. package/skills/kmp-test-validator/dependencies.yaml +3 -3
  31. package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +72 -0
  32. package/skills/kmp-test-validator/roles/validation-plan-gate.md +72 -0
  33. package/skills/kmp-test-validator/roles/validation-remediation.md +14 -9
  34. package/skills/kmp-test-validator/roles/validation-report.md +15 -12
  35. package/skills/kmp-test-validator/roles/validation-test-runner.md +67 -0
  36. package/skills/kmp-test-validator/roles/validation-workspace-state.md +9 -4
  37. package/skills/kmp-test-validator/workflow.md +106 -118
  38. package/skills/migration-task-adapter/MIGRATION.md +49 -0
  39. package/skills/migration-task-adapter/SKILL.md +152 -0
  40. package/skills/migration-task-adapter/bind.md +116 -0
  41. package/skills/migration-task-adapter/dependencies.yaml +26 -0
  42. package/skills/migration-task-adapter/roles/task-reporter.md +134 -0
  43. package/skills/migration-task-adapter/roles/task-understanding-router.md +139 -0
  44. package/skills/migration-task-adapter/roles/workflow-orchestrator.md +145 -0
  45. package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +198 -0
  46. package/skills/migration-task-adapter/workflow.md +183 -0
  47. package/skills/android-project-analyst/roles/android-ecosystem.md +0 -141
  48. package/skills/android-project-analyst/roles/api-list.md +0 -136
  49. package/skills/android-project-analyst/roles/architecture-pattern.md +0 -131
  50. package/skills/android-project-analyst/roles/data-flow.md +0 -143
  51. package/skills/android-project-analyst/roles/logic-understand.md +0 -154
  52. package/skills/android-project-analyst/roles/resource-understand.md +0 -151
  53. package/skills/android-project-analyst/roles/ui-understand.md +0 -136
  54. package/skills/android-to-kmp-migrator/roles/api-contract-parity.md +0 -95
  55. package/skills/android-to-kmp-migrator/roles/dataflow-logic-implementation.md +0 -130
  56. package/skills/android-to-kmp-migrator/roles/dependency-resolution.md +0 -106
  57. package/skills/android-to-kmp-migrator/roles/incremental-build-check.md +0 -105
  58. package/skills/android-to-kmp-migrator/roles/legacy-spec-delta-review.md +0 -104
  59. package/skills/android-to-kmp-migrator/roles/migration-alignment.md +0 -119
  60. package/skills/android-to-kmp-migrator/roles/migration-report.md +0 -108
  61. package/skills/android-to-kmp-migrator/roles/module-node-migration-fix.md +0 -111
  62. package/skills/android-to-kmp-migrator/roles/module-node-migration-review.md +0 -108
  63. package/skills/android-to-kmp-migrator/roles/navigation-migration.md +0 -104
  64. package/skills/android-to-kmp-migrator/roles/platform-api-replacement.md +0 -104
  65. package/skills/android-to-kmp-migrator/roles/prd-completion-check.md +0 -124
  66. package/skills/android-to-kmp-migrator/roles/resource-migration.md +0 -109
  67. package/skills/android-to-kmp-migrator/roles/source-set-placement-guard.md +0 -95
  68. package/skills/android-to-kmp-migrator/roles/state-model-mapping.md +0 -109
  69. package/skills/android-to-kmp-migrator/roles/target-project-understand.md +0 -118
  70. package/skills/android-to-kmp-migrator/roles/theme-design-system-mapping.md +0 -101
  71. package/skills/android-to-kmp-migrator/roles/ui-mockup-implementation.md +0 -121
  72. package/skills/android-to-kmp-migrator/roles/ui-render-fidelity-check.md +0 -100
  73. package/skills/kmp-test-validator/roles/android-kmp-fidelity-audit.md +0 -102
  74. package/skills/kmp-test-validator/roles/build-preview-gate.md +0 -109
  75. package/skills/kmp-test-validator/roles/kmp-validation-plan.md +0 -108
  76. package/skills/kmp-test-validator/roles/test-case-decomposition.md +0 -103
  77. package/skills/kmp-test-validator/roles/test-execution.md +0 -104
  78. package/skills/kmp-test-validator/roles/validation-input-contract.md +0 -111
@@ -1,167 +1,231 @@
1
- # Workflow: Legacy Android SPEC + target KMP project migrated, validation-ready KMP code
1
+ # Workflow: Legacy Android SPEC + target KMP project -> migrated, validation-ready KMP code
2
2
 
3
- This Swarm Skill is a **specialization pipeline (C) with embedded parallel fan-outs (B) and review→fix loops**. The `android-to-kmp-migrator` controller (Leader) verifies the trigger, dispatches nodes in a hard dependency order, gates every handoff, runs a mandatory review→fix→re-review loop after any node changes files, routes guard/parity/fidelity/build failures back to the responsible node, and invokes `kmp-test-validator` only after the migration report returns `ready_for_validation`. Implementation outputs must be fully implemented — TODO placeholders are not acceptable.
3
+ This workflow uses the reduced 10-role module-first migrator. Adjacent responsibilities are consolidated, but gates remain explicit through role modes, check IDs, exact output paths, and a workspace-state progress ledger that tracks per-module finish rates, plan-vs-code gaps, and rerun hooks.
4
4
 
5
5
  ## Overview
6
6
 
7
7
  ```mermaid
8
8
  graph TD
9
- L0[Leader: Step 0 pre-flight deps] --> WS[migration-workspace-state]
10
- WS --> SD[legacy-spec-delta-review]
11
- SD --> TP[target-project-understand]
12
- TP -->|KMP evidence?| GT{target is KMP?}
13
- GT -- No --> BLK[Stop: blocked, missing target evidence]
14
- GT -- Yes --> AL[migration-alignment]
15
- AL --> DEP{dependency-resolution<br/>minimal-change gate}
16
- DEP -- blocked --> BLK
17
- DEP -- ready_for_implementation --> PREP
18
-
19
- subgraph PREP[Stage Prep — parallel B]
20
- TH[theme-design-system-mapping]
21
- RS[resource-migration]
22
- NV[navigation-migration]
23
- PA[platform-api-replacement]
24
- SM[state-model-mapping]
9
+ L0[Leader pre-flight] --> ROOT[LockOutputRoot<br/>run_manifest.json]
10
+ ROOT --> INV[MigrationModuleInventory]
11
+ INV --> WS[migration-workspace-state<br/>progress ledger]
12
+ WS --> LOOP[ForEachMigrationModule]
13
+ LOOP --> PLAN[migration-analysis-planning]
14
+ PLAN --> DP[dependency-platform-gate]
15
+ DP --> PREP
16
+
17
+ subgraph PREP[Prep fan-out]
18
+ PI[presentation-integration]
19
+ SD[state-data-prep]
25
20
  end
26
21
 
27
- PREP --> RFa{reviewfix loop<br/>per changed slice}
28
- RFa -->|approved| UI[ui-mockup-implementation]
29
- UI --> RFb{reviewfix loop}
30
- RFb -->|approved| DL[dataflow-logic-implementation]
31
- DL --> RFc{reviewfix loop}
32
-
33
- RFc -->|approved| VER
34
-
35
- subgraph VER[Stage Verify parallel B]
36
- SG[source-set-placement-guard]
37
- AP[api-contract-parity]
38
- RF[ui-render-fidelity-check]
39
- IB[incremental-build-check]
40
- end
22
+ PREP --> RF1{module-node-review-fix<br/>review/fix/re-review}
23
+ RF1 --> UI[ui-implementation]
24
+ UI --> RF2{module-node-review-fix}
25
+ RF2 --> LOGIC[logic-implementation]
26
+ LOGIC --> RF3{module-node-review-fix}
27
+ RF3 --> VER[migration-verification<br/>source_set api_contract ui_render incremental_build]
28
+ VER -->|failed| RESP[Re-dispatch responsible reduced role<br/>from rerun_hook]
29
+ RESP --> RF1
30
+ VER -->|passed| READY[completion-report<br/>mode readiness]
31
+ READY -->|needs_rerun| RESP
32
+ READY -->|ready_for_validation| MODREP[module_migration_representation.*]
33
+ MODREP --> ALL{all modules represented?}
34
+ ALL -- No --> LOOP
35
+ ALL -- Yes --> GLOB[global_migration_representation.*]
36
+ GLOB --> REPORT[completion-report<br/>mode report]
37
+ REPORT --> KV[kmp-test-validator]
38
+ ```
41
39
 
42
- VER -->|failure routed| RESP[Re-dispatch responsible node] --> RFa
43
- VER -->|all passed| PC[prd-completion-check]
44
- PC -- needs_rerun --> RESP
45
- PC -- blocked --> BLK
46
- PC -- ready_for_validation --> MR[migration-report]
47
- MR -- ready_for_validation --> KV[Leader invokes kmp-test-validator]
48
- MR -- blocked --> BLK
40
+ ## Strict Output Roots
49
41
 
50
- WS -. refreshed after major completions .-> PC
42
+ ```text
43
+ output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
44
+ module_index_dir = <output_root>/module-index
45
+ module_root = <output_root>/modules/<migration_module_id>
46
+ node_result_dir = <module_root>/node-results/<node_id>
47
+ module_representation_dir = <module_root>/representation
48
+ global_dir = <output_root>/global
49
+ report_dir = <output_root>/report
51
50
  ```
52
51
 
53
- The review→fix loop (`RFa/RFb/RFc`) is: `module-node-migration-review` → if `needs_fix`, `module-node-migration-fix` → mandatory re-review → repeat until `approved` or `blocked`. The `migration-workspace-state` ledger is refreshed after major node completions to flag stale upstream artifacts.
54
-
55
52
  ## Detailed Steps
56
53
 
57
- ### Step 0 — Pre-flight: dependency check
54
+ ### Step 0 — Pre-flight
58
55
 
59
56
  - **Executor**: Leader
60
57
  - **Input**: [dependencies.yaml](dependencies.yaml)
61
- - **Action**: verify each `tools[]` entry is available; the target Gradle wrapper drives builds.
62
- - **Output**: pre-flight note to the user
63
- - **Quality gate**: all deps `required: false`; the run proceeds with degraded behavior recorded. User decides go/no-go on anything missing; Leader does not auto-skip nodes.
64
-
65
- ### Step 1 — Trigger verification + shared brief + workspace state
66
-
67
- - **Executor**: Leader, then `migration-workspace-state`
68
- - **Input**: `kmp_target_project_path`, `legacy_android_project_path` (or null), `migration_scope`, `spec_dir`, optional `output_dir` (default `~/.a2c_agents/migration/`), optional `jetbrains` MCP context
69
- - **Action**: confirm the migration trigger and Legacy SPEC context; build the shared brief; initialize/refresh the workspace-state ledger.
70
- - **Output**: shared brief + `migration_workspace_state.*`
71
- - **Serial / Parallel**: serial
72
- - **Quality gate**: Legacy SPEC context present (or `android-project-analyst` is invoked first); else stop with a user-visible blocker.
73
-
74
- ### Step 2 — Analysis chain: delta review → target understand → alignment
75
-
76
- - **Executor**: `legacy-spec-delta-review` `target-project-understand` `migration-alignment`
77
- - **Input**: SPEC paths, target path, shared brief; alignment additionally consumes delta-review + target-understanding outputs
78
- - **Action**: verify SPEC coverage vs raw source; understand the target & reuse inventory; build the source-to-target map, integration scaffold, and ordered tasks.
79
- - **Output**: `spec_delta_review.*`, `target_project_understanding.*` + `target_migration_context.md`, `migration_alignment.*` + `migration_implementation_map.md`
80
- - **Serial / Parallel**: serial (each consumes the prior)
81
- - **Quality gate**: `target-project-understand` must confirm a KMP project, else `blocked`. Each return is `completed`/`blocked` with verified non-empty `output_files`, else re-dispatch.
82
-
83
- ### Step 3 — Dependency gate
84
-
85
- - **Executor**: `dependency-resolution`
86
- - **Input**: target-understanding + alignment + SPEC paths
87
- - **Action**: map required capabilities to baseline/reuse, apply the minimal-change gate, justify any build-config change.
88
- - **Output**: `dependency_resolution.*`
89
- - **Serial / Parallel**: serial blocks all implementation
90
- - **Quality gate**: status must be `ready_for_implementation`; `blocked` halts implementation with the unmet capability. Implementation nodes do NOT run until this passes.
91
-
92
- ### Step 4 — Stage Prep (parallel, B-pattern)
93
-
94
- - **Executor**: `theme-design-system-mapping`, `resource-migration`, `navigation-migration`, `platform-api-replacement`, `state-model-mapping`
95
- - **Input**: alignment + dependency outputs + relevant Legacy understanding paths
96
- - **Action**: prepare visual tokens, resources, routes, platform abstractions, and state/models before UI.
97
- - **Output**: each node's `*.json`/`*.md` + changed target files
98
- - **Serial / Parallel**: parallel — slices are dispatch-time fixed
99
- - **Quality gate**: each return verified (output + changed files); any node that changed files enters the Step 5 review→fix loop before its slice is consumed downstream.
100
-
101
- ### Step 5 Review→fix loop (after any file-changing node)
102
-
103
- - **Executor**: `module-node-migration-review` `module-node-migration-fix` (conditional) re-review
104
- - **Input**: owning-node output, changed files, upstream evidence, workspace state
105
- - **Action**: review one slice; if `needs_fix`, apply only assigned `must_fix` findings inside `allowed_files`, then mandatorily re-review.
106
- - **Output**: `module_node_migration_review.*`, `module_node_migration_fix.*` (when fixes ran)
107
- - **Serial / Parallel**: serial per slice; runs after Prep (5a), after UI (5b), and after dataflow/logic (5c)
108
- - **Quality gate**: loop until review returns `approved` or `blocked`. A fix output with `requires_re_review: true` MUST be followed by a re-review before any downstream gate consumes the slice; max fix↔review cycles per [bind.md](bind.md).
109
-
110
- ### Step 6UI implementation review→fix loop
111
-
112
- - **Executor**: `ui-mockup-implementation`, then Step 5 loop (5b)
113
- - **Input**: alignment, dependency, theme, resource, navigation, target outputs
114
- - **Action**: implement the visible UI surface first, exposing binding surfaces; no TODO placeholders.
115
- - **Output**: `ui_impl_result.*` + changed UI/resource files
116
- - **Serial / Parallel**: serial runs after Prep approved
117
- - **Quality gate**: every in-scope visible requirement implemented or explicitly `blocked`; slice approved via 5b before logic runs.
118
-
119
- ### Step 7Dataflow/logic implementation review→fix loop
120
-
121
- - **Executor**: `dataflow-logic-implementation`, then Step 5 loop (5c)
122
- - **Input**: alignment, dependency, navigation, platform, state, resource, and UI outputs
123
- - **Action**: implement models/repositories/APIs/logic bound to UI surfaces; no Android-only leak into `commonMain`; no TODO placeholders.
124
- - **Output**: `dataflow_logic_impl_result.*` + changed logic/data/API files
125
- - **Serial / Parallel**: serial runs after UI approved
126
- - **Quality gate**: slice approved via 5c before verification.
127
-
128
- ### Step 8Stage Verify (parallel, B-pattern) with failure routing
129
-
130
- - **Executor**: `source-set-placement-guard`, `api-contract-parity`, `ui-render-fidelity-check`, `incremental-build-check`
131
- - **Input**: changed files + the relevant implementation/prep/target outputs
132
- - **Action**: check source-set placement, API parity, UI render, and an incremental build.
133
- - **Output**: each node's `*.json`/`*.md` (+ build logs)
134
- - **Serial / Parallel**: parallel
135
- - **Quality gate**: each `passed`/`failed`/`blocked`. Any `failed`/violation is routed to the responsible implementation node, which re-runs and re-enters the review→fix loop. `blocked` (e.g., no trustworthy build command) is surfaced, not invented.
136
-
137
- ### Step 9 PRD completion check
138
-
139
- - **Executor**: `prd-completion-check`
140
- - **Input**: raw user task + PRD/SPEC + all node outputs + review/fix outputs + verification outputs + changed files
141
- - **Action**: judge requirement coverage, completion areas, migration invariants, incomplete markers, review-fix readiness, and guard/parity/fidelity/build results.
142
- - **Output**: `prd_completion_check.*`
143
- - **Serial / Parallel**: serial
144
- - **Quality gate**: `ready_for_validation` → Step 10; `needs_rerun` → route requests to responsible nodes (re-enter the relevant stage + loop); `blocked` → stop with missing evidence.
145
-
146
- ### Step 10 Final: migration report validation handoff
147
-
148
- - **Executor**: `migration-report`, then Leader
149
- - **Input**: workspace state, all node outputs, review/fix outputs, completion check
150
- - **Action**: synthesize the final report and validation inputs; Leader invokes `kmp-test-validator` only when the report returns `ready_for_validation`.
151
- - **Output**: `migration_report.*` + the controller completion summary below
152
-
153
- #### Final Report Format
58
+ - **Action**: check optional tools (`rg`, `git`, `curl`) and report degraded behavior.
59
+ - **Output**: pre-flight status recorded in `run_manifest.json` and later workspace-state artifacts.
60
+ - **Gate**: missing optional tools do not skip nodes; the controller records degraded evidence.
61
+
62
+ ### Step 1 — Trigger + Output Root
63
+
64
+ - **Executor**: Leader
65
+ - **Input**: `legacy_android_project_path` or completed SPEC, `kmp_target_project_path`, `migration_scope`, optional `output_dir`
66
+ - **Action**: verify migration trigger, verify analyst completion, lock `output_root`, write `<output_root>/run_manifest.json`.
67
+ - **Output**: `<output_root>/run_manifest.json` containing Android/SPEC inputs, KMP target path, migration scope, output root, allowed roots, dependency-preflight status, schedule version, and timestamp.
68
+ - **Gate**: stop if target is not KMP-compatible or analyst completion is missing/stale.
69
+
70
+ ### Step 2 — Migration Module Inventory
71
+
72
+ - **Executor**: Leader
73
+ - **Action**: divide the requested migration into deterministic `migration_module_id` slices.
74
+ - **Output**:
75
+ - `<module_index_dir>/migration_module_inventory.json`: module ids/order, scope slices, target placement hints, allowed files/source sets, module output roots, blockers.
76
+ - `<module_index_dir>/migration_module_inventory.md`: agent-readable module schedule and boundary evidence.
77
+ - `<module_root>/module_brief.json` for every scheduled module: module dispatch contract, evidence paths, role hints, allowed files/source sets, assumptions.
78
+ - **Gate**: every module has `module_scope`, UI/logic/data/resource scope, target placement hints, `allowed_target_files`, and `allowed_source_sets`.
79
+
80
+ ### Step 3 — Workspace State
81
+
82
+ - **Executor**: `migration-workspace-state`
83
+ - **Input**: migration module inventory, module briefs, node outputs, changed files, planning outputs, implementation outputs, review outputs, verification outputs, representation outputs, source change/timestamp evidence, rerun reports, blockers.
84
+ - **Action**: initialize and refresh a progress ledger. Track per-module current stage, stage status, planned/completed work units, `finish_rate`, changed-file ownership, plan-vs-code gaps, stale outputs, rerun hooks, blockers, and next safe actions.
85
+ - **Output**:
86
+ - `<global_dir>/node-results/migration-workspace-state/migration_workspace_state.json`, `.md`: global/module progress ledger, aggregate finish rate, stale/blocked modules, rerun hooks.
87
+ - `<module_root>/node-results/migration-workspace-state/migration_workspace_state.json`, `.md`: module stage status, finish rate, changed-file ownership, plan-vs-code gaps, stale outputs, rerun hooks.
88
+ - **Gate**: stale upstream outputs, failed stages, missing review/verification, or non-empty `rerun_hooks` must be routed before downstream consumption. A downstream stage may consume a module only when the latest module progress record marks its required upstream stages fresh and usable.
89
+
90
+ ### Workspace State Refresh Points
91
+
92
+ The Leader refreshes `migration-workspace-state` after each major stage, and before any downstream role consumes newly produced artifacts:
93
+
94
+ | Refresh point | Required progress evidence |
95
+ |---|---|
96
+ | After module inventory | module list, module briefs, planned stage schedule |
97
+ | After planning | planned work units, source-to-target map, expected artifacts |
98
+ | After dependency/platform gate | dependency/platform readiness and blockers |
99
+ | After prep fan-out | presentation/state-data prep outputs and changed-file ownership |
100
+ | After every review/fix/re-review | latest review status, fix ownership, unresolved findings |
101
+ | After UI implementation | UI coding artifacts, plan coverage, review hook if needed |
102
+ | After logic implementation | logic coding artifacts, plan coverage, review hook if needed |
103
+ | After verification | check status, failed check routing, verification-required gaps |
104
+ | After readiness/module representation | module status and representation artifacts |
105
+ | After global representation/report | aggregate finish rate, stale module list, validation handoff readiness |
106
+
107
+ ### Step 4Module Analysis And Planning
108
+
109
+ - **Executor**: `migration-analysis-planning`
110
+ - **Input**: module brief, SPEC paths, analyst artifacts, target path, workspace state
111
+ - **Action**: verify SPEC/raw-source deltas, capture target KMP context/reuse inventory, produce source-to-target map and ordered implementation plan.
112
+ - **Output**: `<module_root>/node-results/migration-analysis-planning/migration_analysis_planning.json`, `.md`. The artifacts must contain SPEC/raw-source deltas, target KMP evidence, reuse inventory, source-to-target map, resource project map, integration scaffold, ordered implementation tasks, blockers.
113
+ - **Gate**: target KMP evidence and source-to-target map must exist before dependency/platform work.
114
+ - **Workspace-state update**: record planned work units and initial `finish_rate` basis. If the plan is incomplete, `migration-workspace-state` emits a rerun hook to `migration-analysis-planning`.
115
+
116
+ ### Step 5Dependency And Platform Gate
117
+
118
+ - **Executor**: `dependency-platform-gate`
119
+ - **Input**: planning output, target baseline, allowed files/source sets
120
+ - **Action**: apply minimal-change dependency gate and define/implement safe platform boundaries when required.
121
+ - **Output**: `<module_root>/node-results/dependency-platform-gate/dependency_platform_gate.json`, `.md`. The artifacts must contain capability map, dependency/build decisions, platform capability boundaries, expect/actual/source-set plan, changed files, implementation constraints, blockers.
122
+ - **Gate**: returns `ready_for_implementation` or `blocked`; no prep/implementation proceeds on blocked platform/dependency capability.
123
+ - **Workspace-state update**: record dependency/platform stage status and pause downstream consumers when blocked.
124
+
125
+ ### Step 6Prep Fan-Out
126
+
127
+ - **Executors**: `presentation-integration`, `state-data-prep`
128
+ - **Action**:
129
+ - `presentation-integration`: theme tokens, resource migration/modeling, navigation routes.
130
+ - `state-data-prep`: state holders, models, mappers, API/data expectations, logic handoff.
131
+ - **Output**:
132
+ - `<module_root>/node-results/presentation-integration/presentation_integration.json`, `.md`: token/component/resource/media/route mappings, UI handoff, changed files, presentation gaps.
133
+ - `<module_root>/node-results/state-data-prep/state_data_prep.json`, `.md`: state holders, UI state/events/effects, model/mappers, API/data contract expectations, logic handoff, changed files.
134
+ - **Gate**: every file-changing prep slice enters review/fix before UI or logic consumes it.
135
+ - **Workspace-state update**: record changed-file ownership and plan-vs-code gaps for prep outputs; emit review rerun hooks when file-changing slices lack review approval.
136
+
137
+ ### Step 7 Review/Fix Loop
138
+
139
+ - **Executor**: `module-node-review-fix`
140
+ - **Modes**:
141
+ - `review`: read-only review of one module/node slice.
142
+ - `fix`: scoped edit of explicit `must_fix` findings inside `allowed_files`.
143
+ - **Gate**: every fix must be followed by a fresh review. Downstream nodes may consume only slices whose latest review is `approved`.
144
+ - **Output**:
145
+ - Review mode: `<module_root>/node-results/module-node-review-fix/<owning_node>/review/module_node_review.json`, `.md` with read-only findings, reviewed files, approval/needs-fix status, blockers.
146
+ - Fix mode: `<module_root>/node-results/module-node-review-fix/<owning_node>/fix/module_node_fix.json`, `.md` with fixed/unfixed findings, changed files, `requires_re_review: true`, blockers.
147
+ - **Workspace-state update**: record review status by owner node and planned work unit. `needs_fix` and missing re-review produce rerun hooks.
148
+
149
+ ### Step 8 — UI Implementation
150
+
151
+ - **Executor**: `ui-implementation`
152
+ - **Action**: implement visible UI surface first, including states/resources and binding surfaces.
153
+ - **Output**: `<module_root>/node-results/ui-implementation/ui_implementation.json`, `.md` with changed UI/resource files, UI coverage, fidelity notes, binding surfaces, diagnostics, blockers.
154
+ - **Gate**: UI output is reviewed/approved before logic implementation.
155
+ - **Workspace-state update**: record UI implementation progress, changed files, missing planned UI work, unplanned UI changes, and required review hooks.
156
+
157
+ ### Step 9 — Logic Implementation
158
+
159
+ - **Executor**: `logic-implementation`
160
+ - **Action**: implement repositories/use cases/API integration/business logic bound to approved UI surfaces.
161
+ - **Output**: `<module_root>/node-results/logic-implementation/logic_implementation.json`, `.md` with changed logic/data/API files, architecture alignment, platform boundaries, data flows, API integrations, logic coverage, diagnostics, blockers.
162
+ - **Gate**: logic output is reviewed/approved before verification.
163
+ - **Workspace-state update**: record logic implementation progress, changed files, missing planned logic work, unplanned logic changes, and required review hooks.
164
+
165
+ ### Step 10 — Verification
166
+
167
+ - **Executor**: `migration-verification`
168
+ - **Required `check_ids`**:
169
+ - `source_set`
170
+ - `api_contract`
171
+ - `ui_render`
172
+ - `incremental_build`
173
+ - **Output**: `<module_root>/node-results/migration-verification/migration_verification.json`, `.md`, plus log files when commands run. The artifacts must contain stable `check_results`, evidence, failures, routed owner nodes, command/log paths, blockers.
174
+ - **Gate**: failures route to the responsible reduced role and re-enter review/fix.
175
+ - **Workspace-state update**: record verification status, failed check ids, `route_to_node`, and rerun hooks that pause readiness until resolved.
176
+
177
+ ### Step 11 — Readiness And Module Representation
178
+
179
+ - **Executor**: `completion-report` in `mode: readiness`, then Leader
180
+ - **Action**: decide module readiness; write module representation.
181
+ - **Output**:
182
+ - `<module_root>/node-results/completion-report/readiness/completion_readiness.json`, `.md`: requirement coverage, invariants, review/verification status, rerun requests, blockers.
183
+ - `<module_representation_dir>/module_migration_representation.json`: machine synthesis of verified module migration outputs, changed files by role, coverage, gaps, evidence.
184
+ - `<module_representation_dir>/module_migration_representation.md`: agent-readable module migration handoff and traceability.
185
+ - **Gate**: blocked modules still write a representation with blockers.
186
+ - **Workspace-state update**: record module representation artifacts, final module finish rate, and remaining blockers without issuing the final report verdict.
187
+
188
+ ### Step 12 — Global Representation
189
+
190
+ - **Executor**: Leader
191
+ - **Input**: all module representations
192
+ - **Output**:
193
+ - `<global_dir>/global_migration_representation.json`: machine synthesis of module representations, cross-module target changes, shared ownership, coverage, blockers.
194
+ - `<global_dir>/global_migration_representation.md`: agent-readable global migration handoff and validation prerequisites.
195
+ - **Gate**: final report cannot run until global representation exists and is non-empty.
196
+ - **Workspace-state update**: record aggregate finish rate, represented modules, blocked/stale modules, and report blockers.
197
+
198
+ ### Step 13 — Final Report And Validation Handoff
199
+
200
+ - **Executor**: `completion-report` in `mode: report`, then Leader
201
+ - **Output**:
202
+ - `<report_dir>/migration_report.json`: validation-ready machine handoff with scope, paths, module/global representations, changed files by role, coverage, validation inputs, limitations, blockers.
203
+ - `<report_dir>/migration_report.md`: agent-readable migration report for validator and follow-up agents.
204
+ - **Gate**: report mode may return `ready_for_validation` only after module/global representations exist and readiness has passed. Leader invokes `kmp-test-validator` afterward.
205
+ - **Workspace-state update**: final refresh records report artifacts and validation handoff readiness.
206
+
207
+ ## Final Report Shape
154
208
 
155
209
  ```json
156
210
  {
157
211
  "status": "ready_for_validation | blocked",
158
- "migration_scope": "...",
159
- "kmp_target_project_path": "...",
160
- "legacy_android_project_path": "... or null",
161
- "changed_files_by_node": [],
212
+ "migration_scope": "",
213
+ "kmp_target_project_path": "",
214
+ "legacy_android_project_path": "",
215
+ "output_root": "",
216
+ "migration_module_inventory": "",
217
+ "module_representations": [],
218
+ "global_migration_representation": "",
219
+ "changed_files_by_role": [],
162
220
  "source_to_target_summary": [],
163
- "coverage_summary": { "ui": "", "resources": "", "navigation": "", "platform": "", "state_models": "", "data_api": "", "logic": "" },
164
- "module_node_review_summary": [],
221
+ "coverage_summary": {
222
+ "presentation": "",
223
+ "state_data": "",
224
+ "ui": "",
225
+ "logic": "",
226
+ "platform": "",
227
+ "verification": ""
228
+ },
165
229
  "validation_inputs": [],
166
230
  "limitations": [],
167
231
  "manual_steps": [],
@@ -171,10 +235,12 @@ The review→fix loop (`RFa/RFb/RFc`) is: `module-node-migration-review` → if
171
235
 
172
236
  ## Acceptance Criteria
173
237
 
174
- - Every dispatched node returned output matching its role `## Output Schema` and the shared return shape; any `[ROLE MISSING]` is recorded per [bind.md](bind.md).
175
- - **Gate check (C-pattern)**: the dependency gate passed before implementation; UI ran before logic; each stage ran only after the prior stage's slices were `approved`.
176
- - **Loop check**: every file-changing node has an `approved` latest review; every fix output was followed by a re-review for the same scope.
177
- - **Coverage check (B-pattern)**: all Prep slices and all four Verify checks accounted for; failures routed to the responsible node, not absorbed by the Leader.
178
- - Migration invariants hold: no Android-only API in `commonMain`, expect/actual complete, dependency gate respected, single KMP project, cross-module integration wired.
179
- - No changed file contains a TODO/placeholder presented as completion output.
180
- - `migration-report` returns `ready_for_validation` only when `prd-completion-check` is ready; `kmp-test-validator` is invoked only afterward. If `blocked`, the final response lists blockers and exact missing evidence.
238
+ - Active dispatch uses only the 10 reduced role IDs from `SKILL.md`.
239
+ - Every module has a `module_brief.json`, verified node outputs under `<module_root>/node-results/`, and a module migration representation.
240
+ - Latest `migration-workspace-state` includes `module_progress`, `finish_rate`, `plan_code_gaps`, and `rerun_hooks` for every scheduled module.
241
+ - No downstream stage consumes a module when its latest workspace-state record has stale required inputs, unresolved blocking plan-vs-code gaps, missing review approval, missing verification, or blocking rerun hooks.
242
+ - Review/fix invocations are separate: `review` -> optional `fix` -> fresh `review`.
243
+ - Verification uses stable `check_ids` and routes failures to reduced role IDs.
244
+ - No Android-only API leaks into `commonMain`; dependency changes pass the minimal-change gate.
245
+ - `global_migration_representation.*` exists before report mode.
246
+ - `kmp-test-validator` is invoked only after `completion-report` report mode returns `ready_for_validation`.
@@ -11,7 +11,7 @@ Converted from a single controller-support skill (a flat SKILL.md node registry
11
11
 
12
12
  The registry separated controller from nodes and encoded the dispatch order, but it did not encode the team as a first-class artifact: no per-role anti-convergence mottos, no `Forbidden`/`Mandatory` boundary blocks the validator could check, no pasteable `Inline Persona` (each of the 9 dispatches re-derived its contract by hand), no Mermaid topology making the pipeline + remediation loop explicit, and no resource/behavioral guardrails (token/wall-clock budgets, `max_remediation_cycles`, degraded modes). The fidelity-before-tests gate, build-before-tests gate, "Android/SPEC is ground truth", and "never invent a command" invariants lived only in prose.
13
13
 
14
- ## Decomposition
14
+ ## Original 0.2 Decomposition
15
15
 
16
16
  - **Pattern: C (specialization pipeline) + remediation loop.**
17
17
  - Gate: `validation-input-contract` (refuse non-migration scenarios).
@@ -38,6 +38,47 @@ The registry separated controller from nodes and encoded the dispatch order, but
38
38
  | Trigger boundary + controller validation rules | `bind.md` § Behavioral Constraints + SKILL.md § Shared Rules |
39
39
  | Optional Android Studio MCP context | SKILL.md § Optional Android Studio MCP Context + per-role Inline Persona MCP inputs |
40
40
 
41
- ## Team-vs-single delta
41
+ ## Original Team-vs-single Delta
42
42
 
43
- The conversion preserves every source contract while adding: explicit pipeline + remediation-loop topology with verifiable gates, per-role anti-overlap boundaries that name siblings, self-contained pasteable personas (no re-derivation per dispatch across 9 nodes), resource/token/wall-clock budgets plus a `max_remediation_cycles` bound, failure-routing rules, and concrete degraded modes for missing commands, unsupported previews, and missing MCP. The same-name controller subagent in `kmp-migration/agents/kmp-test-validator.md` is unchanged in behavior; its node table now points at `roles/<id>.md`.
43
+ The 0.2 conversion preserved every source contract while adding: explicit pipeline + remediation-loop topology with verifiable gates, per-role anti-overlap boundaries that name siblings, self-contained pasteable personas (no re-derivation per dispatch across 9 nodes), resource/token/wall-clock budgets plus a `max_remediation_cycles` bound, failure-routing rules, and concrete degraded modes for missing commands, unsupported previews, and missing MCP.
44
+
45
+ ## Role Reduction Refactor (0.3)
46
+
47
+ The current active validator reduces 9 roles to 6. See [ROLE_REDUCTION.md](ROLE_REDUCTION.md).
48
+
49
+ | Old role(s) | Active role |
50
+ |---|---|
51
+ | `validation-workspace-state` | `validation-workspace-state` |
52
+ | `validation-input-contract`, `android-kmp-fidelity-audit` | `validation-intake-fidelity` |
53
+ | `kmp-validation-plan`, `build-preview-gate` | `validation-plan-gate` |
54
+ | `test-case-decomposition`, `test-execution` | `validation-test-runner` |
55
+ | `validation-remediation` | `validation-remediation` |
56
+ | `validation-report` | `validation-report` |
57
+
58
+ The reduction keeps the important gates intact: migration trigger/fidelity trust gate, build-before-tests gate, scoped remediation with mandatory reruns, and report-only final verdict.
59
+
60
+ ## Validation Output Location Refinement
61
+
62
+ Validator outputs now use a strict validation root parallel to migration outputs:
63
+
64
+ ```text
65
+ validation_base = <output_dir or ~/.a2c_agents/validation>
66
+ output_root = <validation_base>/kmp-test-validator
67
+ ```
68
+
69
+ When a migration output root is supplied, it remains a read-only input. The validator writes to a sibling `validation` base location rather than writing inside the migration output root.
70
+
71
+ ## Output Contract Refinement
72
+
73
+ The active validator docs now distinguish output filenames from output content responsibilities. `SKILL.md` and `workflow.md` define the validation artifact schedule and content matrix, while each role file states the exact JSON/Markdown filenames and the evidence each artifact must contain.
74
+
75
+ Role ownership remains explicit:
76
+
77
+ - `validation_workspace_state.*` records validator ledger state only.
78
+ - `validation_intake_fidelity.*` records migration trigger evidence, validation brief, fidelity gaps, and test-trust blockers.
79
+ - `validation_plan_gate.*` records trusted commands, build/preview results, log paths, and failure routing.
80
+ - `validation_test_runner.*` records Android/SPEC-anchored cases, execution results, logs, and changed test files.
81
+ - `validation_remediation.*` records confirmed target fixes, changed files, diagnostics, and required reruns.
82
+ - `kmp_validation_report.*` records the final evidence-backed validation verdict.
83
+
84
+ The Leader must reject artifacts that have the correct filename but contain another role's work, generic KMP testing output, or prose-only summaries without machine-routable evidence.