@code-migration/wow-migrator 0.1.1 → 0.1.2

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 (77) hide show
  1. package/package.json +1 -1
  2. package/skills/android-project-analyst/MIGRATION.md +39 -23
  3. package/skills/android-project-analyst/SKILL.md +54 -44
  4. package/skills/android-project-analyst/bind.md +22 -14
  5. package/skills/android-project-analyst/dependencies.yaml +8 -4
  6. package/skills/android-project-analyst/roles/analysis-workspace-state.md +118 -0
  7. package/skills/android-project-analyst/roles/behavior-logic.md +163 -0
  8. package/skills/android-project-analyst/roles/data-contract-flow.md +167 -0
  9. package/skills/android-project-analyst/roles/presentation-resource.md +296 -0
  10. package/skills/android-project-analyst/roles/project-architecture.md +171 -0
  11. package/skills/android-project-analyst/workflow.md +118 -70
  12. package/skills/android-to-kmp-migrator/MIGRATION.md +61 -1
  13. package/skills/android-to-kmp-migrator/SKILL.md +96 -134
  14. package/skills/android-to-kmp-migrator/bind.md +33 -11
  15. package/skills/android-to-kmp-migrator/roles/completion-report.md +72 -0
  16. package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +63 -0
  17. package/skills/android-to-kmp-migrator/roles/logic-implementation.md +66 -0
  18. package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +65 -0
  19. package/skills/android-to-kmp-migrator/roles/migration-verification.md +77 -0
  20. package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +13 -1
  21. package/skills/android-to-kmp-migrator/roles/module-node-review-fix.md +74 -0
  22. package/skills/android-to-kmp-migrator/roles/presentation-integration.md +65 -0
  23. package/skills/android-to-kmp-migrator/roles/state-data-prep.md +63 -0
  24. package/skills/android-to-kmp-migrator/roles/ui-implementation.md +64 -0
  25. package/skills/android-to-kmp-migrator/workflow.md +175 -149
  26. package/skills/kmp-test-validator/MIGRATION.md +18 -3
  27. package/skills/kmp-test-validator/SKILL.md +44 -79
  28. package/skills/kmp-test-validator/bind.md +8 -8
  29. package/skills/kmp-test-validator/dependencies.yaml +3 -3
  30. package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +67 -0
  31. package/skills/kmp-test-validator/roles/validation-plan-gate.md +66 -0
  32. package/skills/kmp-test-validator/roles/validation-remediation.md +7 -7
  33. package/skills/kmp-test-validator/roles/validation-report.md +8 -10
  34. package/skills/kmp-test-validator/roles/validation-test-runner.md +61 -0
  35. package/skills/kmp-test-validator/roles/validation-workspace-state.md +2 -2
  36. package/skills/kmp-test-validator/workflow.md +87 -119
  37. package/skills/migration-task-adapter/MIGRATION.md +34 -0
  38. package/skills/migration-task-adapter/SKILL.md +134 -0
  39. package/skills/migration-task-adapter/bind.md +113 -0
  40. package/skills/migration-task-adapter/dependencies.yaml +26 -0
  41. package/skills/migration-task-adapter/roles/task-reporter.md +129 -0
  42. package/skills/migration-task-adapter/roles/task-understanding-router.md +134 -0
  43. package/skills/migration-task-adapter/roles/workflow-orchestrator.md +140 -0
  44. package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +189 -0
  45. package/skills/migration-task-adapter/workflow.md +183 -0
  46. package/skills/android-project-analyst/roles/android-ecosystem.md +0 -141
  47. package/skills/android-project-analyst/roles/api-list.md +0 -136
  48. package/skills/android-project-analyst/roles/architecture-pattern.md +0 -131
  49. package/skills/android-project-analyst/roles/data-flow.md +0 -143
  50. package/skills/android-project-analyst/roles/logic-understand.md +0 -154
  51. package/skills/android-project-analyst/roles/resource-understand.md +0 -151
  52. package/skills/android-project-analyst/roles/ui-understand.md +0 -136
  53. package/skills/android-to-kmp-migrator/roles/api-contract-parity.md +0 -95
  54. package/skills/android-to-kmp-migrator/roles/dataflow-logic-implementation.md +0 -130
  55. package/skills/android-to-kmp-migrator/roles/dependency-resolution.md +0 -106
  56. package/skills/android-to-kmp-migrator/roles/incremental-build-check.md +0 -105
  57. package/skills/android-to-kmp-migrator/roles/legacy-spec-delta-review.md +0 -104
  58. package/skills/android-to-kmp-migrator/roles/migration-alignment.md +0 -119
  59. package/skills/android-to-kmp-migrator/roles/migration-report.md +0 -108
  60. package/skills/android-to-kmp-migrator/roles/module-node-migration-fix.md +0 -111
  61. package/skills/android-to-kmp-migrator/roles/module-node-migration-review.md +0 -108
  62. package/skills/android-to-kmp-migrator/roles/navigation-migration.md +0 -104
  63. package/skills/android-to-kmp-migrator/roles/platform-api-replacement.md +0 -104
  64. package/skills/android-to-kmp-migrator/roles/prd-completion-check.md +0 -124
  65. package/skills/android-to-kmp-migrator/roles/resource-migration.md +0 -109
  66. package/skills/android-to-kmp-migrator/roles/source-set-placement-guard.md +0 -95
  67. package/skills/android-to-kmp-migrator/roles/state-model-mapping.md +0 -109
  68. package/skills/android-to-kmp-migrator/roles/target-project-understand.md +0 -118
  69. package/skills/android-to-kmp-migrator/roles/theme-design-system-mapping.md +0 -101
  70. package/skills/android-to-kmp-migrator/roles/ui-mockup-implementation.md +0 -121
  71. package/skills/android-to-kmp-migrator/roles/ui-render-fidelity-check.md +0 -100
  72. package/skills/kmp-test-validator/roles/android-kmp-fidelity-audit.md +0 -102
  73. package/skills/kmp-test-validator/roles/build-preview-gate.md +0 -109
  74. package/skills/kmp-test-validator/roles/kmp-validation-plan.md +0 -108
  75. package/skills/kmp-test-validator/roles/test-case-decomposition.md +0 -103
  76. package/skills/kmp-test-validator/roles/test-execution.md +0 -104
  77. package/skills/kmp-test-validator/roles/validation-input-contract.md +0 -111
@@ -1,167 +1,193 @@
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, and exact output paths.
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]
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]
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 6 — UI 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 7 Dataflow/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
+ - **Gate**: missing optional tools do not skip nodes; the controller records degraded evidence.
60
+
61
+ ### Step 1 — Trigger + Output Root
62
+
63
+ - **Executor**: Leader
64
+ - **Input**: `legacy_android_project_path` or completed SPEC, `kmp_target_project_path`, `migration_scope`, optional `output_dir`
65
+ - **Action**: verify migration trigger, verify analyst completion, lock `output_root`, write `<output_root>/run_manifest.json`.
66
+ - **Gate**: stop if target is not KMP-compatible or analyst completion is missing/stale.
67
+
68
+ ### Step 2 Migration Module Inventory
69
+
70
+ - **Executor**: Leader
71
+ - **Action**: divide the requested migration into deterministic `migration_module_id` slices.
72
+ - **Output**:
73
+ - `<module_index_dir>/migration_module_inventory.json`
74
+ - `<module_index_dir>/migration_module_inventory.md`
75
+ - `<module_root>/module_brief.json` for every scheduled module
76
+ - **Gate**: every module has `module_scope`, UI/logic/data/resource scope, target placement hints, `allowed_target_files`, and `allowed_source_sets`.
77
+
78
+ ### Step 3 Workspace State
79
+
80
+ - **Executor**: `migration-workspace-state`
81
+ - **Output**: `<global_dir>/node-results/migration-workspace-state/migration_workspace_state.*`
82
+ - **Gate**: stale upstream outputs must be rerun before downstream consumption.
83
+
84
+ ### Step 4 Module Analysis And Planning
85
+
86
+ - **Executor**: `migration-analysis-planning`
87
+ - **Input**: module brief, SPEC paths, analyst artifacts, target path, workspace state
88
+ - **Action**: verify SPEC/raw-source deltas, capture target KMP context/reuse inventory, produce source-to-target map and ordered implementation plan.
89
+ - **Output**: `<module_root>/node-results/migration-analysis-planning/migration_analysis_planning.*`
90
+ - **Gate**: target KMP evidence and source-to-target map must exist before dependency/platform work.
91
+
92
+ ### Step 5 Dependency And Platform Gate
93
+
94
+ - **Executor**: `dependency-platform-gate`
95
+ - **Input**: planning output, target baseline, allowed files/source sets
96
+ - **Action**: apply minimal-change dependency gate and define/implement safe platform boundaries when required.
97
+ - **Output**: `<module_root>/node-results/dependency-platform-gate/dependency_platform_gate.*`
98
+ - **Gate**: returns `ready_for_implementation` or `blocked`; no prep/implementation proceeds on blocked platform/dependency capability.
99
+
100
+ ### Step 6 Prep Fan-Out
101
+
102
+ - **Executors**: `presentation-integration`, `state-data-prep`
103
+ - **Action**:
104
+ - `presentation-integration`: theme tokens, resource migration/modeling, navigation routes.
105
+ - `state-data-prep`: state holders, models, mappers, API/data expectations, logic handoff.
106
+ - **Output**:
107
+ - `<module_root>/node-results/presentation-integration/presentation_integration.*`
108
+ - `<module_root>/node-results/state-data-prep/state_data_prep.*`
109
+ - **Gate**: every file-changing prep slice enters review/fix before UI or logic consumes it.
110
+
111
+ ### Step 7 Review/Fix Loop
112
+
113
+ - **Executor**: `module-node-review-fix`
114
+ - **Modes**:
115
+ - `review`: read-only review of one module/node slice.
116
+ - `fix`: scoped edit of explicit `must_fix` findings inside `allowed_files`.
117
+ - **Gate**: every fix must be followed by a fresh review. Downstream nodes may consume only slices whose latest review is `approved`.
118
+
119
+ ### Step 8 UI Implementation
120
+
121
+ - **Executor**: `ui-implementation`
122
+ - **Action**: implement visible UI surface first, including states/resources and binding surfaces.
123
+ - **Gate**: UI output is reviewed/approved before logic implementation.
124
+
125
+ ### Step 9Logic Implementation
126
+
127
+ - **Executor**: `logic-implementation`
128
+ - **Action**: implement repositories/use cases/API integration/business logic bound to approved UI surfaces.
129
+ - **Gate**: logic output is reviewed/approved before verification.
130
+
131
+ ### Step 10 Verification
132
+
133
+ - **Executor**: `migration-verification`
134
+ - **Required `check_ids`**:
135
+ - `source_set`
136
+ - `api_contract`
137
+ - `ui_render`
138
+ - `incremental_build`
139
+ - **Output**: `<module_root>/node-results/migration-verification/migration_verification.*`
140
+ - **Gate**: failures route to the responsible reduced role and re-enter review/fix.
141
+
142
+ ### Step 11 — Readiness And Module Representation
143
+
144
+ - **Executor**: `completion-report` in `mode: readiness`, then Leader
145
+ - **Action**: decide module readiness; write module representation.
146
+ - **Output**:
147
+ - `<module_root>/node-results/completion-report/readiness/completion_readiness.*`
148
+ - `<module_representation_dir>/module_migration_representation.json`
149
+ - `<module_representation_dir>/module_migration_representation.md`
150
+ - **Gate**: blocked modules still write a representation with blockers.
151
+
152
+ ### Step 12 — Global Representation
153
+
154
+ - **Executor**: Leader
155
+ - **Input**: all module representations
156
+ - **Output**:
157
+ - `<global_dir>/global_migration_representation.json`
158
+ - `<global_dir>/global_migration_representation.md`
159
+ - **Gate**: final report cannot run until global representation exists and is non-empty.
160
+
161
+ ### Step 13 — Final Report And Validation Handoff
162
+
163
+ - **Executor**: `completion-report` in `mode: report`, then Leader
164
+ - **Output**:
165
+ - `<report_dir>/migration_report.json`
166
+ - `<report_dir>/migration_report.md`
167
+ - **Gate**: report mode may return `ready_for_validation` only after module/global representations exist and readiness has passed. Leader invokes `kmp-test-validator` afterward.
168
+
169
+ ## Final Report Shape
154
170
 
155
171
  ```json
156
172
  {
157
173
  "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": [],
174
+ "migration_scope": "",
175
+ "kmp_target_project_path": "",
176
+ "legacy_android_project_path": "",
177
+ "output_root": "",
178
+ "migration_module_inventory": "",
179
+ "module_representations": [],
180
+ "global_migration_representation": "",
181
+ "changed_files_by_role": [],
162
182
  "source_to_target_summary": [],
163
- "coverage_summary": { "ui": "", "resources": "", "navigation": "", "platform": "", "state_models": "", "data_api": "", "logic": "" },
164
- "module_node_review_summary": [],
183
+ "coverage_summary": {
184
+ "presentation": "",
185
+ "state_data": "",
186
+ "ui": "",
187
+ "logic": "",
188
+ "platform": "",
189
+ "verification": ""
190
+ },
165
191
  "validation_inputs": [],
166
192
  "limitations": [],
167
193
  "manual_steps": [],
@@ -171,10 +197,10 @@ The review→fix loop (`RFa/RFb/RFc`) is: `module-node-migration-review` → if
171
197
 
172
198
  ## Acceptance Criteria
173
199
 
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.
200
+ - Active dispatch uses only the 10 reduced role IDs from `SKILL.md`.
201
+ - Every module has a `module_brief.json`, verified node outputs under `<module_root>/node-results/`, and a module migration representation.
202
+ - Review/fix invocations are separate: `review` -> optional `fix` -> fresh `review`.
203
+ - Verification uses stable `check_ids` and routes failures to reduced role IDs.
204
+ - No Android-only API leaks into `commonMain`; dependency changes pass the minimal-change gate.
205
+ - `global_migration_representation.*` exists before report mode.
206
+ - `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,21 @@ 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.
@@ -1,114 +1,84 @@
1
1
  ---
2
2
  name: kmp-test-validator
3
3
  description: |
4
- 9-role pipeline Swarm Skill (C) with a remediation loop that validates Android-to-KMP migration output: input gate, fidelity audit, validation plan, build/preview gate, test decomposition and execution, remediation, and report.
5
- Use with the kmp-test-validator controller after a migration report is ready, or when given Android source/SPEC plus a KMP target.
4
+ 6-role reduced pipeline Swarm Skill that validates Android-to-KMP migration output: workspace ledger, intake/fidelity trust gate, command/build-preview gate, Android-anchored test runner, scoped remediation, and final validation report.
5
+ Use with the kmp-test-validator controller after android-to-kmp-migrator has produced a validation-ready migration report, or when given Android source/SPEC plus a KMP target for migrated behavior validation.
6
6
  Do NOT use for generic KMP testing, KMP-only feature work, isolated Gradle troubleshooting, Android analysis, or non-migration refactors.
7
- version: "0.2"
7
+ version: "0.3"
8
8
  kind: swarm-skill
9
9
  disable-model-invocation: true
10
10
  roles:
11
11
  - id: validation-workspace-state
12
12
  kind: ai_agent
13
- purpose: Validation ledger — node status, changed-file ownership, stale inputs, rerun/blocker history, next actions. No audit, build, or fix.
13
+ purpose: Validation ledger — node status, changed-file ownership, stale inputs, rerun/blocker history, next actions. No audit, build, test, fix, or verdict.
14
14
  skills: []
15
15
  tools: [git]
16
- - id: validation-input-contract
16
+ - id: validation-intake-fidelity
17
17
  kind: ai_agent
18
- purpose: Gate verify this is a post-migration validation scenario, confirm KMP evidence, normalize paths, and produce the validation brief.
19
- skills: []
20
- tools: [rg]
21
- - id: android-kmp-fidelity-audit
22
- kind: ai_agent
23
- purpose: Compare Android source/SPEC vs migrated KMP across UI, logic, data flow, control flow before tests are trusted; flag test-trust blockers.
18
+ purpose: Intake and fidelity trust gate verify migration scenario, normalize brief, compare Android source/SPEC vs KMP, and flag test-trust blockers.
24
19
  skills: []
25
20
  tools: [rg, git]
26
- - id: kmp-validation-plan
27
- kind: ai_agent
28
- purpose: Discover target structure and resolve trusted build/preview/test commands and scope-to-target mapping. Never invents commands.
29
- skills: []
30
- tools: [rg]
31
- - id: build-preview-gate
21
+ - id: validation-plan-gate
32
22
  kind: ai_agent
33
- purpose: Run the resolved build and Compose preview/renderability gate before behavioral tests; classify and route failures by owner.
23
+ purpose: Command and build gate — resolve trusted build/preview/test commands, run build and preview/renderability before behavioral tests, route failures.
34
24
  skills: []
35
- tools: [rg]
36
- - id: test-case-decomposition
37
- kind: ai_agent
38
- purpose: Decompose user tests, SPEC acceptance, and migration validation inputs into atomic Android-anchored cases. No fabricated expectations.
39
- skills: []
40
- tools: [rg]
41
- - id: test-execution
25
+ tools: [rg, git]
26
+ - id: validation-test-runner
42
27
  kind: ai_agent
43
- purpose: Execute atomic cases via project conventions and capture evidence; a KMP pass that contradicts Android evidence is a failure.
28
+ purpose: Test workflow decompose validation requirements into atomic Android-anchored cases, execute them through project conventions, capture evidence.
44
29
  skills: []
45
30
  tools: [rg, git]
46
31
  - id: validation-remediation
47
32
  kind: ai_agent
48
- purpose: Fix confirmed target failures inside allowed files, anchored to Android/SPEC; emit required reruns of build/preview and tests.
33
+ purpose: Scoped target fixes — fix confirmed target KMP failures inside allowed files and emit required reruns.
49
34
  skills: []
50
35
  tools: [rg, git]
51
36
  - id: validation-report
52
37
  kind: ai_agent
53
- purpose: Synthesize fidelity/build/preview/test/remediation into the final passed/failed/blocked verdict. No new tests or fixes.
38
+ purpose: Final verdict synthesis passed/failed/blocked from verified fidelity, build, preview, test, and remediation evidence. No new tests or fixes.
54
39
  skills: []
55
40
  tools: [git]
56
41
  ---
57
42
 
58
43
  # KMP Test Validator Swarm Skill
59
44
 
60
- This is the agent-facing registry and team definition for the `kmp-test-validator` controller (the same-name subagent in `kmp-migration/agents/`). It validates Android-to-KMP migration output against Android source and the migration SPEC, and is invoked only after an `android-to-kmp-migrator` migration report is `ready_for_validation` (or when the user supplies Android source/SPEC plus a KMP target).
61
-
62
- The team is a **specialization pipeline (C) with a remediation loop**: an input-contract gate, then a fidelity audit before tests are trusted, then a validation plan, a build/preview gate before behavioral tests, test decomposition and execution, a remediation loop back to the gate/tests, and a final report. A single agent attempting validation conflates these stages — it trusts green tests without auditing fidelity, runs behavioral tests before the build compiles, invents build commands, and lets a KMP pass that contradicts Android behavior count as success. Isolating each concern into an owned node with hard gates keeps Android source/SPEC as ground truth and every verdict evidence-backed. The controller (Leader) owns scenario gating, routing, rerun handling, and the final verdict; nodes own bounded validation work.
45
+ This is the agent-facing registry and team definition for the `kmp-test-validator` controller. It validates Android-to-KMP migration output against Android source and migration SPEC evidence.
63
46
 
64
- ## Workflow
47
+ The team is a **reduced serial pipeline with a remediation loop**. Role overlap has been collapsed from 9 role files to 6 role definitions. See [ROLE_REDUCTION.md](ROLE_REDUCTION.md) for the old-to-new map and merge rationale.
65
48
 
66
- The full playbook (Mermaid topology, per-step gates, remediation loop, Final Report format) is in [workflow.md](workflow.md). Protocol summary:
49
+ ## Protocol Summary
67
50
 
68
- 0. **Pre-flight: check dependencies** read [dependencies.yaml](dependencies.yaml) and verify `rg` / `git` (both `required: false`; the target Gradle wrapper drives build/test). Report status; **user decides** whether to proceed.
69
- 1. **Workspace state** — `validation-workspace-state` initializes the ledger (refreshed after each node group). Default `output_dir` = `~/.a2c_agents/validation/`.
70
- 2. **Input contract gate** — `validation-input-contract` verifies the migration scenario and KMP evidence; missing migration evidence → `blocked` (never downgrade to generic testing).
71
- 3. **Fidelity audit** — `android-kmp-fidelity-audit` compares Android source/SPEC vs KMP across UI/logic/data-flow/control-flow before tests are trusted.
72
- 4. **Validation plan** — `kmp-validation-plan` resolves trusted build/preview/test commands (user → project scripts/CI → verified Gradle tasks); else `blocked`.
73
- 5. **Build/preview gate** — `build-preview-gate` runs the resolved build and (UI in scope) preview/renderability; behavioral tests do NOT run on failure.
74
- 6. **Test decomposition** — `test-case-decomposition` produces atomic, Android-anchored cases.
75
- 7. **Test execution** — `test-execution` runs cases via project conventions; a KMP pass that contradicts Android evidence is a failure.
76
- 8. **Remediation loop** — `validation-remediation` fixes confirmed target failures within `allowed_files` and re-runs the affected gate/tests until pass or `blocked` (see [bind.md](bind.md)).
77
- 9. **Final: validation report** — `validation-report` synthesizes the `passed | failed | blocked` verdict. Leader routes non-target failures out; it never fabricates a pass.
51
+ 0. **Pre-flight** check optional dependencies from [dependencies.yaml](dependencies.yaml).
52
+ 1. **Workspace state** — initialize `validation-workspace-state`.
53
+ 2. **Intake/fidelity trust gate** — run `validation-intake-fidelity`; block non-migration validation and test-trust blockers.
54
+ 3. **Plan/build gate** — run `validation-plan-gate`; commands must be trusted, and build/preview must pass before behavioral tests.
55
+ 4. **Test workflow** — run `validation-test-runner` when validation cases exist.
56
+ 5. **Remediation loop** — run `validation-remediation` only for confirmed target KMP failures, then rerun affected gates/tests.
57
+ 6. **Final report** — run `validation-report` to issue `passed | failed | blocked`.
78
58
 
79
59
  ## Roles
80
60
 
81
- Each node is dispatched as a subagent that must read its role file (`skill_spec_path`), paste its `## Inline Persona for Teammate` into the dispatch prompt, and execute only that role's bounded slice. The dispatch order enforces fidelity-before-tests and build-before-tests gating.
82
-
83
- | id | Purpose | When dispatched | Key dependencies | Role file |
84
- |---|---|---|---|---|
85
- | validation-workspace-state | Ledger / stale-input tracking | Step 1 + refreshed after each group | git | [roles/validation-workspace-state.md](roles/validation-workspace-state.md) |
86
- | validation-input-contract | Migration-scenario gate + brief | Step 2 | rg | [roles/validation-input-contract.md](roles/validation-input-contract.md) |
87
- | android-kmp-fidelity-audit | Android-vs-KMP fidelity audit | Step 3 (before tests trusted) | rg, git | [roles/android-kmp-fidelity-audit.md](roles/android-kmp-fidelity-audit.md) |
88
- | kmp-validation-plan | Trusted command + scope resolution | Step 4 | rg | [roles/kmp-validation-plan.md](roles/kmp-validation-plan.md) |
89
- | build-preview-gate | Compile + render gate | Step 5 (before behavioral tests) | rg | [roles/build-preview-gate.md](roles/build-preview-gate.md) |
90
- | test-case-decomposition | Atomic Android-anchored cases | Step 6 | rg | [roles/test-case-decomposition.md](roles/test-case-decomposition.md) |
91
- | test-execution | Run cases + capture evidence | Step 7 (after build gate) | rg, git | [roles/test-execution.md](roles/test-execution.md) |
92
- | validation-remediation | Scoped target fixes + reruns | Step 8 loop (on failures) | rg, git | [roles/validation-remediation.md](roles/validation-remediation.md) |
93
- | validation-report | Final verdict synthesis | Step 9 | git | [roles/validation-report.md](roles/validation-report.md) |
94
-
95
- > Before dispatching each teammate, read its role file and paste its `## Inline Persona for Teammate`
96
- > section directly into the dispatch prompt — adopting agents do NOT auto-load role files. Fill the
97
- > `{PLACEHOLDER}` inputs from the contract.
61
+ | id | Purpose | Role file |
62
+ |---|---|---|
63
+ | `validation-workspace-state` | Ledger and stale-input tracking | [roles/validation-workspace-state.md](roles/validation-workspace-state.md) |
64
+ | `validation-intake-fidelity` | Migration scenario gate and fidelity audit | [roles/validation-intake-fidelity.md](roles/validation-intake-fidelity.md) |
65
+ | `validation-plan-gate` | Command resolution plus build/preview gate | [roles/validation-plan-gate.md](roles/validation-plan-gate.md) |
66
+ | `validation-test-runner` | Test decomposition and execution | [roles/validation-test-runner.md](roles/validation-test-runner.md) |
67
+ | `validation-remediation` | Scoped target fixes and rerun requests | [roles/validation-remediation.md](roles/validation-remediation.md) |
68
+ | `validation-report` | Final verdict synthesis | [roles/validation-report.md](roles/validation-report.md) |
98
69
 
99
70
  ## Files
100
71
 
101
- | File | What it contains | When to read |
102
- |---|---|---|
103
- | [workflow.md](workflow.md) | Mermaid C topology, staged protocol with gates, remediation loop, Final Report format | Before first dispatch — the complete playbook |
104
- | [bind.md](bind.md) | Resource limits, team behavioral constraints, trigger boundary, `max_remediation_cycles`, failure & degraded modes | When hitting limits, handling failures, or scoping a large validation |
105
- | [roles/\*.md](roles/) | Per-node identity, success criteria, boundary, output schema, Inline Persona for Teammate | Before dispatching each teammate — extract Inline Persona |
106
- | [dependencies.yaml](dependencies.yaml) | External CLI tools (`rg`, `git`) checked at startup | Step 0 — verify deps, report missing items, user decides go/no-go |
72
+ | File | What it contains |
73
+ |---|---|
74
+ | [ROLE_REDUCTION.md](ROLE_REDUCTION.md) | Reduced role analysis and old-to-new map |
75
+ | [workflow.md](workflow.md) | Reduced pipeline, gates, remediation loop, final report format |
76
+ | [bind.md](bind.md) | Guardrails, failure handling, resource constraints |
77
+ | [roles/](roles/) | Active reduced role specs |
78
+ | [dependencies.yaml](dependencies.yaml) | Optional CLI tools checked at startup |
107
79
 
108
80
  ## Shared Return Contract
109
81
 
110
- Every node returns a compact payload with, in addition to node-specific fields:
111
-
112
82
  ```json
113
83
  {
114
84
  "status": "completed | passed | failed | needs_rerun | blocked",
@@ -121,17 +91,12 @@ Every node returns a compact payload with, in addition to node-specific fields:
121
91
  }
122
92
  ```
123
93
 
124
- Use `needs_rerun` when a previous node can resolve the gap, `failed` when validation evidence is complete and a behavior/build/test failure remains, and `blocked` only when required Android/KMP/SPEC evidence, environment capability, or user input is missing and cannot be produced by rerunning another node.
125
-
126
- ## Optional Android Studio MCP Context
127
-
128
- When the `jetbrains` MCP server is available, the controller may pass indexed IDE context to nodes: project modules/dependencies/VCS roots/run configs (`get_project_modules`, `get_project_dependencies`, `get_repositories`, `get_run_configurations`), file/symbol ownership (`find_files_by_glob`, `search_in_files_by_regex`, `get_symbol_info`), diagnostics (`get_file_problems`), and IDE build diagnostics (`build_project`). Always pass `projectPath: <kmp_target_project_path>`. MCP is advisory — required build/preview/test commands and the final validation report remain the source of truth.
94
+ Use `needs_rerun` when a previous role can resolve the gap, `failed` when validation evidence is complete and a behavior/build/test failure remains, and `blocked` when required evidence, command, environment, or user input is missing.
129
95
 
130
96
  ## Shared Rules
131
97
 
132
- - Each node must read its own role file before work and stay inside its responsibility boundary.
133
- - Build and test commands must come from user input, project scripts, target understanding, or verified Gradle task discovery — never invented.
134
- - A passing test (or build) that contradicts Android source/SPEC behavior is a validation failure.
135
- - Nodes that edit code must list changed files and the evidence that justified each change; only `validation-remediation` edits target code.
136
- - The controller must not substitute itself for a node's audit, fix, or test execution.
137
- - Final success requires: migration trigger verified, fidelity audit complete, build/preview gate passed or explicitly blocked with evidence, tests executed when provided, fixes revalidated, and `validation-report` complete.
98
+ - Each role must read its role file before work and stay inside its responsibility boundary.
99
+ - Build/test/preview commands must come from user input, project scripts/docs/CI, or verified Gradle task discovery.
100
+ - A passing KMP test that contradicts Android source/SPEC behavior is a validation failure.
101
+ - Only `validation-remediation` edits target code.
102
+ - The controller must not substitute itself for a role's audit, command gate, test run, fix, or final verdict.