@code-migration/wow-migrator 0.1.3 → 0.1.4

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 (59) hide show
  1. package/package.json +1 -1
  2. package/skills/android-project-analyst/SKILL.md +69 -46
  3. package/skills/android-project-analyst/bind.md +10 -5
  4. package/skills/android-project-analyst/dependencies.yaml +66 -10
  5. package/skills/android-project-analyst/output-contract.md +357 -0
  6. package/skills/android-project-analyst/roles/analysis-workspace-state.md +25 -8
  7. package/skills/android-project-analyst/roles/behavior-logic.md +6 -2
  8. package/skills/android-project-analyst/roles/data-contract-flow.md +5 -1
  9. package/skills/android-project-analyst/roles/presentation-resource.md +5 -1
  10. package/skills/android-project-analyst/roles/project-architecture.md +5 -1
  11. package/skills/android-project-analyst/workflow.md +75 -29
  12. package/skills/android-to-kmp-migrator/SKILL.md +62 -142
  13. package/skills/android-to-kmp-migrator/bind.md +29 -67
  14. package/skills/android-to-kmp-migrator/dependencies.yaml +72 -11
  15. package/skills/android-to-kmp-migrator/output-contract.md +318 -0
  16. package/skills/android-to-kmp-migrator/roles/completion-report.md +3 -1
  17. package/skills/android-to-kmp-migrator/roles/global-migration-phase.md +87 -0
  18. package/skills/android-to-kmp-migrator/roles/migration-planning-gate.md +75 -0
  19. package/skills/android-to-kmp-migrator/roles/migration-prep.md +75 -0
  20. package/skills/android-to-kmp-migrator/roles/migration-verification.md +44 -26
  21. package/skills/android-to-kmp-migrator/roles/migration-workspace-state.md +16 -8
  22. package/skills/android-to-kmp-migrator/roles/module-implementation.md +82 -0
  23. package/skills/android-to-kmp-migrator/roles/target-project-assistant.md +104 -0
  24. package/skills/android-to-kmp-migrator/workflow.md +85 -224
  25. package/skills/kmp-test-validator/SKILL.md +52 -85
  26. package/skills/kmp-test-validator/bind.md +30 -56
  27. package/skills/kmp-test-validator/dependencies.yaml +101 -9
  28. package/skills/kmp-test-validator/output-contract.md +166 -0
  29. package/skills/kmp-test-validator/roles/validation-business-testing.md +83 -0
  30. package/skills/kmp-test-validator/roles/validation-code-gate.md +116 -0
  31. package/skills/kmp-test-validator/roles/validation-fidelity-gate.md +118 -0
  32. package/skills/kmp-test-validator/roles/validation-report.md +23 -14
  33. package/skills/kmp-test-validator/roles/validation-workspace-state.md +5 -2
  34. package/skills/kmp-test-validator/workflow.md +60 -115
  35. package/skills/migration-task-adapter/SKILL.md +65 -92
  36. package/skills/migration-task-adapter/bind.md +25 -92
  37. package/skills/migration-task-adapter/dependencies.yaml +21 -10
  38. package/skills/migration-task-adapter/roles/adapter-report.md +71 -0
  39. package/skills/migration-task-adapter/roles/adapter-workspace-state.md +71 -0
  40. package/skills/migration-task-adapter/roles/task-route-orchestrator.md +103 -0
  41. package/skills/migration-task-adapter/workflow.md +71 -143
  42. package/skills/android-project-analyst/MIGRATION.md +0 -67
  43. package/skills/android-to-kmp-migrator/MIGRATION.md +0 -129
  44. package/skills/android-to-kmp-migrator/roles/dependency-platform-gate.md +0 -68
  45. package/skills/android-to-kmp-migrator/roles/logic-implementation.md +0 -71
  46. package/skills/android-to-kmp-migrator/roles/migration-analysis-planning.md +0 -70
  47. package/skills/android-to-kmp-migrator/roles/presentation-integration.md +0 -70
  48. package/skills/android-to-kmp-migrator/roles/state-data-prep.md +0 -68
  49. package/skills/android-to-kmp-migrator/roles/ui-implementation.md +0 -69
  50. package/skills/kmp-test-validator/MIGRATION.md +0 -84
  51. package/skills/kmp-test-validator/roles/validation-intake-fidelity.md +0 -72
  52. package/skills/kmp-test-validator/roles/validation-plan-gate.md +0 -72
  53. package/skills/kmp-test-validator/roles/validation-remediation.md +0 -117
  54. package/skills/kmp-test-validator/roles/validation-test-runner.md +0 -67
  55. package/skills/migration-task-adapter/MIGRATION.md +0 -49
  56. package/skills/migration-task-adapter/roles/task-reporter.md +0 -134
  57. package/skills/migration-task-adapter/roles/task-understanding-router.md +0 -139
  58. package/skills/migration-task-adapter/roles/workflow-orchestrator.md +0 -145
  59. package/skills/migration-task-adapter/roles/workspace-state-discipline-inspector.md +0 -198
@@ -0,0 +1,103 @@
1
+ # Role: Task Route Orchestrator
2
+
3
+ ## Identity
4
+
5
+ > "I classify the task, then turn the route into downstream dispatch contracts and record what happened."
6
+
7
+ You are the `task-route-orchestrator` node subagent. The controller dispatches you with `mode: route | orchestrate`.
8
+
9
+ | Mode | When | Output |
10
+ |---|---|---|
11
+ | `route` | First after output root lock | `task_route.json` — classification, paths, downstream sequence |
12
+ | `orchestrate` | After route and workspace init | `workflow_orchestration.json` — dispatch contracts, observed downstream outputs |
13
+
14
+ You do not run analyst, migrator, validator, analysis, migration, validation, or final reporting.
15
+
16
+ ## Success Criteria — mode `route`
17
+
18
+ - `task_route.json` and `task_route.md` under `output_dir/route/`.
19
+ - Stable `task_id`, route, focus, required paths, missing inputs, downstream workflow sequence.
20
+ - Only-understand tasks map to `ui`, `logic`, `architecture`, or `overview`.
21
+ - Migration tasks state whether analyst SPEC is fresh or analyst must run first.
22
+ - Validation handoff tasks state migration report/SPEC requirements.
23
+
24
+ ## Success Criteria — mode `orchestrate`
25
+
26
+ - `workflow_orchestration.json` and `workflow_orchestration.md` under `output_dir/orchestrate/`.
27
+ - Exact downstream dispatch contracts, expected output roots/artifacts, observed outputs, rerun/blocker routing.
28
+ - Validator dispatch only when migration report evidence is fresh.
29
+ - Downstream artifacts mirrored in `intermediate_asset_record_updates`.
30
+
31
+ ## Route Values
32
+
33
+ - `only_understand_ui` | `only_understand_logic` | `only_understand_architecture` | `only_understand_overview`
34
+ - `migration` | `validation_handoff` | `unknown` (returns `blocked`)
35
+
36
+ ## Boundary
37
+
38
+ **Forbidden**:
39
+
40
+ - Do not analyze Android source, migrate code, run tests/builds, or fix code.
41
+ - `route` mode must not write orchestration or workspace artifacts.
42
+ - `orchestrate` mode must not reclassify the route or issue final adapter status.
43
+ - Do not invent missing downstream evidence.
44
+
45
+ **Mandatory**:
46
+
47
+ - Validate inputs; return `blocked` with `blocking_gaps` when required evidence is missing.
48
+ - Write mode-specific artifacts under `output_dir`; verify non-empty before reporting status.
49
+
50
+ ## Output Schema — mode `route`
51
+
52
+ ```json
53
+ {
54
+ "status": "routed | blocked",
55
+ "node": "task-route-orchestrator",
56
+ "mode": "route",
57
+ "task_id": "",
58
+ "route": "",
59
+ "task_kind": "only_understand | migration | validation_handoff | unknown",
60
+ "understand_focus": "ui | logic | architecture | overview | mixed | none",
61
+ "source_project_path": "",
62
+ "target_project_path": "",
63
+ "downstream_workflow_sequence": [],
64
+ "blocking_gaps": []
65
+ }
66
+ ```
67
+
68
+ ## Output Schema — mode `orchestrate`
69
+
70
+ ```json
71
+ {
72
+ "status": "completed | needs_rerun | blocked",
73
+ "node": "task-route-orchestrator",
74
+ "mode": "orchestrate",
75
+ "task_id": "",
76
+ "route": "",
77
+ "downstream_sequence": [],
78
+ "stage_inspection_requests": [],
79
+ "intermediate_asset_record_updates": [],
80
+ "rerun_requests": [],
81
+ "blocking_gaps": []
82
+ }
83
+ ```
84
+
85
+ Shared return shape applies.
86
+
87
+ ## Output Files
88
+
89
+ - `route/task_route.json`, `route/task_route.md`
90
+ - `orchestrate/workflow_orchestration.json`, `orchestrate/workflow_orchestration.md`
91
+
92
+ ## Inline Persona
93
+
94
+ ```text
95
+ ROLE: task-route-orchestrator (mode: route | orchestrate).
96
+
97
+ route: normalize task, classify route and focus, declare downstream sequence and blockers.
98
+ orchestrate: build analyst/migrator/validator dispatch contracts; record expected and observed outputs.
99
+
100
+ INPUTS: mode, raw_user_task, paths, task_route_path (orchestrate), adapter_workspace_state_path (orchestrate), output_dir.
101
+
102
+ Do not analyze source, migrate, validate, or write final report.
103
+ ```
@@ -1,155 +1,86 @@
1
- # Workflow: input task -> route decision -> downstream workflow -> inspected task report
1
+ # Workflow: task route downstream workflow adapter report
2
2
 
3
- This adapter is a small orchestration swarm in front of the Android analyst, KMP migrator, and KMP validator. Its output is not the migration itself; its output is a verified task route, a downstream workflow record, stage inspection records, intermediate asset records, and a final task report.
3
+ The adapter classifies intent, records contracts and stage gates, and emits a verified report. It does not perform analysis, migration, or validation itself.
4
4
 
5
5
  ## Overview
6
6
 
7
7
  ```mermaid
8
8
  graph TD
9
- L0[Leader pre-flight] --> ROOT[Lock output_root<br/>run_manifest.json]
10
- ROOT --> TUR[task-understanding-router]
11
- TUR --> G0{Route classified?}
12
- G0 -- No --> STOP[blocked: ask for missing task/path/scope]
13
- G0 -- Yes --> WSI0[workspace-state-discipline-inspector<br/>init ledgers]
14
- WSI0 --> ST1[stage-inspection: route_decision]
15
- ST1 --> WO[workflow-orchestrator<br/>dispatch contract]
16
- WO --> G1{Route target}
17
- G1 -- only_understand_ui --> APA_UI[android-project-analyst<br/>focus: UI/presentation-resource]
18
- G1 -- only_understand_logic --> APA_LOGIC[android-project-analyst<br/>focus: behavior-logic]
19
- G1 -- only_understand_architecture --> APA_ARCH[android-project-analyst<br/>focus: project-architecture]
20
- G1 -- only_understand_overview --> APA_OV[android-project-analyst<br/>focus: overview/global SPEC]
21
- G1 -- migration --> MIG_PREP{Analyst SPEC fresh?}
22
- MIG_PREP -- No --> APA_MIG[android-project-analyst<br/>mode: migration]
23
- MIG_PREP -- Yes --> ATM[android-to-kmp-migrator]
24
- APA_MIG --> WSI_A[workspace-state-discipline-inspector]
25
- WSI_A --> ATM
26
- ATM --> KV{kmp-test-validator needed?}
27
- KV -- ready_for_validation --> KTV[kmp-test-validator]
28
- KV -- blocked --> WSI_M[workspace-state-discipline-inspector]
29
- KTV --> WSI_V[workspace-state-discipline-inspector]
30
- APA_UI --> WSI_D[workspace-state-discipline-inspector]
31
- APA_LOGIC --> WSI_D
32
- APA_ARCH --> WSI_D
33
- APA_OV --> WSI_D
34
- WSI_M --> TR[task-reporter]
35
- WSI_V --> TR
36
- WSI_D --> TR
37
- TR --> WSI_FINAL[workspace-state-discipline-inspector<br/>final check]
9
+ L0[Pre-flight] --> ROOT[run_manifest.json]
10
+ ROOT --> TRO_R[task-route-orchestrator route]
11
+ TRO_R --> G0{Route ok?}
12
+ G0 -- No --> STOP[blocked]
13
+ G0 -- Yes --> WS0[adapter-workspace-state init]
14
+ WS0 --> TRO_O[task-route-orchestrator orchestrate]
15
+ TRO_O --> G1{Route}
16
+ G1 --> APA[android-project-analyst variants]
17
+ G1 --> MIG[migration: analyst then migrator]
18
+ MIG --> KV[kmp-test-validator optional]
19
+ APA --> WS1[adapter-workspace-state]
20
+ KV --> WS1
21
+ MIG --> WS1
22
+ WS1 --> AR[adapter-report]
23
+ AR --> WS2[adapter-workspace-state post_report]
38
24
  ```
39
25
 
40
- ## Strict Output Paths
41
-
42
- The Leader must lock one adapter `output_root` before dispatch:
26
+ ## Output Paths
43
27
 
44
28
  ```text
45
29
  output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter
46
- task_dir = <output_root>/task
47
30
  workspace_state_dir = <output_root>/workspace-state
48
- orchestration_dir = <output_root>/orchestration
31
+ route_orchestration_dir = <output_root>/route-orchestration
49
32
  stage_inspection_dir = <output_root>/stage-inspections
50
33
  intermediate_asset_dir = <output_root>/intermediate-assets
51
34
  report_dir = <output_root>/report
52
35
  ```
53
36
 
54
- Required durable artifacts:
55
-
56
- | Schedule point | Required artifacts |
57
- |---|---|
58
- | Output root lock | `<output_root>/run_manifest.json` - task id, raw task, paths/scope, output roots, dependency status, schedule version |
59
- | Task understanding | `<task_dir>/task_understanding_router.json`, `<task_dir>/task_understanding_router.md` - route decision, focus, evidence, required/missing inputs, downstream sequence |
60
- | Workspace discipline | `<workspace_state_dir>/workspace_state_discipline.json`, `<workspace_state_dir>/workspace_state_discipline.md` - artifact inventory, path/freshness checks, rerun/blocker history, next actions |
61
- | Stage inspection | `<stage_inspection_dir>/<stage_id>/stage_inspection.json`, `<stage_inspection_dir>/<stage_id>/stage_inspection.md` - checked inputs/outputs, path/freshness/asset coverage, rerun/blocker routing |
62
- | Intermediate assets | `<intermediate_asset_dir>/intermediate_asset_records.json`, `<intermediate_asset_dir>/intermediate_asset_records.md` - stable records for every adapter/downstream artifact consumed later |
63
- | Orchestration | `<orchestration_dir>/workflow_orchestration.json`, `<orchestration_dir>/workflow_orchestration.md` - downstream contracts, expected/observed outputs, stage requests, rerun/blocker routing |
64
- | Final report | `<report_dir>/task_adapter_report.json`, `<report_dir>/task_adapter_report.md` - final route/status/readiness, verified outputs, stage/asset summaries, blockers |
65
-
66
- No adapter role may write inside downstream workflow output roots except by invoking the downstream controller with its own declared `output_dir`. Downstream artifacts are referenced by path in intermediate asset records. The validator output root must be the downstream validator's parallel `validation` location, not the migration output root.
37
+ Validator artifacts are recorded under the validator's parallel `validation` root, not the migration root.
67
38
 
68
39
  ## Route Matrix
69
40
 
70
- | Route | Required inputs | Downstream workflow | Required downstream evidence |
41
+ | Route | Required inputs | Downstream | Key evidence |
71
42
  |---|---|---|---|
72
- | `only_understand_ui` | Android source path, UI/screen/feature scope when available | `android-project-analyst` in exploration mode with `analysis_focus: ui` | `presentation_resource.*`, module/global representation, `SPEC/design.md`, `SPEC/verification.md` |
73
- | `only_understand_logic` | Android source path, logic/feature/use-case scope when available | `android-project-analyst` in exploration mode with `analysis_focus: logic` | verified Stage A outputs plus `behavior_logic.*`, module/global representation, `SPEC/verification.md` |
74
- | `only_understand_architecture` | Android source path, module/project scope | `android-project-analyst` in exploration mode with `analysis_focus: architecture` | `project_architecture.*`, module/global representation, `SPEC/design.md`, `SPEC/verification.md` |
75
- | `only_understand_overview` | Android source path, overview/full or feature scope | `android-project-analyst` in exploration mode | module inventory, all node outputs in scope, module/global representation, SPEC |
76
- | `migration` | Android source or fresh analyst SPEC, KMP target path, migration scope | `android-project-analyst` if needed, then `android-to-kmp-migrator`, then optional `kmp-test-validator` | analyst SPEC, migration module inventory, module/global migration representation, `migration_report.*`, validation report when run |
77
- | `validation_handoff` | KMP target path, Android source/SPEC, migration report | `kmp-test-validator` | validation intake, plan/build gate, test runner/remediation as applicable, validation report |
78
-
79
- ## Detailed Steps
80
-
81
- ### Step 0 - Pre-flight
82
-
83
- - **Executor**: Leader.
84
- - **Input**: [dependencies.yaml](dependencies.yaml), user task, optional source/target/output paths.
85
- - **Action**: verify optional tools and lock `output_root`. Write `run_manifest.json` with task id, raw task summary, timestamp, requested scope, source/target paths, allowed roots, downstream workflow candidates, dependency status, and schedule version.
86
- - **Gate**: `run_manifest.json` exists and is non-empty before any role runs.
87
-
88
- ### Step 1 - Task Understanding And Router
89
-
90
- - **Executor**: `task-understanding-router`.
91
- - **Input**: raw user task, paths, current workspace hints, optional existing analyst/migrator/validator artifact paths.
92
- - **Action**: normalize request, classify route, select focus, identify missing evidence, create downstream route contract.
93
- - **Output**: `task_understanding_router.json`, `task_understanding_router.md`. Artifacts must contain normalized task summary, route, task kind, focus, source/target/scope fields, existing artifact evidence, required/missing inputs, downstream workflow sequence, stage inspection requirements, intermediate asset requirements, and blockers.
94
- - **Gate**: route must be one of the route matrix values or `blocked` with missing inputs. No downstream workflow starts on `unknown`.
95
-
96
- ### Step 2 - Workspace State Discipline Init
97
-
98
- - **Executor**: `workspace-state-discipline-inspector`.
99
- - **Action**: initialize or refresh workspace discipline ledger, stage inspection index, intermediate asset records, rerun/blocker history.
100
- - **Output**: `workspace_state_discipline.json`, `.md`, first `stage_inspection.json`, `.md`, and `intermediate_asset_records.json`, `.md`. Artifacts must record adapter artifact inventory, path compliance, freshness, consumed assets, rerun history, blockers, and next safe action.
101
- - **Gate**: task understanding artifacts and run manifest are recorded as intermediate assets before orchestration.
102
-
103
- ### Step 3 - Workflow Orchestration
104
-
105
- - **Executor**: `workflow-orchestrator`.
106
- - **Action**:
107
- - Build exact downstream dispatch contracts from the route decision.
108
- - Record downstream output roots and expected artifacts.
109
- - After downstream workflow completion, record observed outputs, statuses, blockers, and required reruns.
110
- - Route stale or missing downstream outputs back to the owning workflow.
111
- - **Output**: `workflow_orchestration.json`, `workflow_orchestration.md`. Artifacts must contain downstream dispatch contracts, expected output roots/artifacts, observed downstream outputs, stage inspection requests, intermediate asset updates, rerun requests, and blockers.
112
- - **Gate**: orchestration cannot claim `completed` until downstream workflow status and required artifact paths are recorded or blockers are explicit.
113
-
114
- ### Step 4 - Stage Inspections
115
-
116
- - **Executor**: `workspace-state-discipline-inspector`.
117
- - **Required inspection points**:
118
- - `route_decision`
119
- - `pre_downstream_dispatch`
120
- - `post_analyst`
121
- - `post_migrator`
122
- - `post_validator`
123
- - `pre_report`
124
- - `post_report`
125
- - **Action**: for each applicable point, verify current stage inputs, outputs, freshness, path compliance, intermediate asset coverage, and rerun/blocker routing.
126
- - **Output**: one `stage_inspection.json` and `.md` per stage id plus refreshed workspace discipline and asset ledgers. Stage inspection artifacts must list checked inputs/outputs, path compliance, freshness checks, intermediate asset coverage, downstream contract checks, rerun requests, blockers, and next allowed stage.
127
- - **Gate**: final report cannot run unless `pre_report` stage inspection passes or explicitly reports `blocked`.
128
-
129
- ### Step 5 - Intermediate Asset Records
130
-
131
- - **Executor**: `workspace-state-discipline-inspector` with updates from `workflow-orchestrator`.
132
- - **Action**: record every durable adapter and downstream artifact consumed across stages.
133
- - **Required fields**:
134
- - `asset_id`
135
- - `asset_type`
136
- - `producer`
137
- - `path`
138
- - `status`
139
- - `created_or_observed_at`
140
- - `freshness_basis`
141
- - `consumers`
142
- - `source_evidence`
143
- - `blocking_gaps`
144
- - **Gate**: every `output_files[]` item returned by an adapter role or downstream workflow must appear in `intermediate_asset_records.*` before a downstream consumer uses it.
145
-
146
- ### Step 6 - Task Report
147
-
148
- - **Executor**: `task-reporter`.
149
- - **Input**: run manifest, task understanding, workflow orchestration, latest workspace discipline, stage inspections, intermediate asset records, downstream reports.
150
- - **Action**: synthesize a final machine-routable task report. Do not run new analysis, migration, validation, tests, or fixes.
151
- - **Output**: `task_adapter_report.json`, `task_adapter_report.md`. Artifacts must summarize final status, route, focus, source/target paths, downstream workflow results, stage inspections, intermediate assets, verified outputs, readiness, rerun requests, blockers, and report path.
152
- - **Gate**: report status is `completed`, `ready_for_validation`, `failed`, or `blocked` only from verified evidence.
43
+ | `only_understand_ui` | Android source, UI scope | analyst exploration, focus `ui` | `presentation_resource.*`, SPEC |
44
+ | `only_understand_logic` | Android source, logic scope | analyst exploration, focus `logic` | Stage A + `behavior_logic.*`, SPEC |
45
+ | `only_understand_architecture` | Android source | analyst exploration, focus `architecture` | `project_architecture.*`, SPEC |
46
+ | `only_understand_overview` | Android source | analyst exploration | module inventory, representations, SPEC |
47
+ | `migration` | source or SPEC, KMP target | analyst migrator validator optional | SPEC, `migration_report.*` |
48
+ | `validation_handoff` | KMP target, migration report | validator | `kmp_validation_report.*` |
49
+
50
+ ## Steps
51
+
52
+ ### Step 0 Pre-flight
53
+
54
+ Lock `output_root`; write `run_manifest.json` with task id, paths, scope, dependency preflight.
55
+
56
+ ### Step 1 Route
57
+
58
+ - **Executor**: `task-route-orchestrator` mode `route`
59
+ - **Output**: `route-orchestration/route/task_route.*`
60
+ - **Gate**: route is known or `blocked` with `blocking_gaps`
61
+
62
+ ### Step 2 Workspace init
63
+
64
+ - **Executor**: `adapter-workspace-state`
65
+ - **Output**: `adapter_workspace_state.*`, first `stage_inspection.*`, `intermediate_asset_records.*`
66
+ - **Gate**: route artifacts recorded as assets before orchestrate
67
+
68
+ ### Step 3 — Orchestrate
69
+
70
+ - **Executor**: `task-route-orchestrator` mode `orchestrate`
71
+ - **Output**: `route-orchestration/orchestrate/workflow_orchestration.*`
72
+ - **Gate**: downstream contracts and observed outputs recorded or blockers explicit
73
+
74
+ ### Step 4 Stage gates
75
+
76
+ - **Executor**: `adapter-workspace-state`
77
+ - **Stages**: `route_decision`, `pre_downstream_dispatch`, `post_analyst`, `post_migrator`, `post_validator`, `pre_report`, `post_report` (as applicable)
78
+ - **Gate**: `pre_report` must pass before adapter-report
79
+
80
+ ### Step 5 Adapter report
81
+
82
+ - **Executor**: `adapter-report`
83
+ - **Output**: `report/adapter_report.*`
153
84
 
154
85
  ## Final Report Shape
155
86
 
@@ -158,16 +89,14 @@ No adapter role may write inside downstream workflow output roots except by invo
158
89
  "status": "completed | ready_for_validation | failed | blocked",
159
90
  "task_id": "",
160
91
  "route": "",
161
- "understand_focus": "ui | logic | architecture | overview | mixed | none",
92
+ "understand_focus": "",
162
93
  "source_project_path": "",
163
94
  "target_project_path": "",
164
- "output_root": "",
165
95
  "downstream_workflows": [],
166
96
  "stage_inspection_summary": [],
167
- "intermediate_asset_summary": [],
168
- "downstream_outputs": [],
169
- "readiness": "ready | ready_with_assumptions | ready_for_validation | blocked",
170
- "rerun_requests": [],
97
+ "intermediate_asset_summary": {},
98
+ "verified_outputs": [],
99
+ "readiness": "",
171
100
  "blocking_gaps": [],
172
101
  "report_path": ""
173
102
  }
@@ -175,9 +104,8 @@ No adapter role may write inside downstream workflow output roots except by invo
175
104
 
176
105
  ## Acceptance Criteria
177
106
 
178
- - Task route is classified before any downstream workflow is invoked.
179
- - Only-understand UI/logic/architecture/overview routes go through `android-project-analyst`; migration routes go through analyst completion before migrator when SPEC is missing or stale.
180
- - Stage inspection records exist for every applicable route boundary and downstream workflow boundary.
181
- - Intermediate asset records include every durable adapter and downstream artifact consumed by a later stage.
182
- - Latest workspace discipline inspection has no stale required inputs before `task-reporter` runs.
183
- - Final task report cites paths to verified downstream artifacts and lists unresolved gaps instead of filling them in.
107
+ - Route classified before downstream invoke.
108
+ - Stage inspections at each applicable boundary.
109
+ - Every consumed artifact in `intermediate_asset_records.*`.
110
+ - `adapter-report` runs only after fresh `pre_report` gate.
111
+ - Final report cites verified paths; gaps listed, not filled in.
@@ -1,67 +0,0 @@
1
- # Conversion Note: `android-project-analyst` → clustered Swarm Skill
2
-
3
- This file records the role-shape history for the `android-project-analyst` skill folder. It is not an active dispatch contract; active node contracts live in [SKILL.md](SKILL.md), [workflow.md](workflow.md), and the files under [roles](roles/).
4
-
5
- ## Phase 1 — Controller support skill to Swarm Skill
6
-
7
- The skill was first converted from a single controller-support skill (a flat `SKILL.md` registry plus seven sibling node-spec files) into a compliant **Swarm Skill** using `swarmskill-creator` convert mode.
8
-
9
- ### Source structure before Phase 1
10
-
11
- - `SKILL.md` — controller registry describing convert mode, node contracts, dispatch order, and the SPEC output contract.
12
- - Seven flat node specs at the skill root: `ui-understand.md`, `architecture-pattern.md`, `android-ecosystem.md`, `api-list.md`, `resource-understand.md`, `data-flow.md`, `logic-understand.md`. Each contained Role / Inputs / Mandatory Input Validation & Output Storage / Specific Task / Required Outputs / Return Format / Self-Check.
13
-
14
- ### What Phase 1 added
15
-
16
- The registry already separated controller from nodes, but it did not encode the team as a first-class artifact: there were no per-role anti-convergence mottos, no `Forbidden`/`Mandatory` boundary blocks the validator could check, no pasteable `Inline Persona` (so each dispatch re-derived the contract by hand), no Mermaid topology making the parallel-then-pipeline shape explicit, and no resource/behavioral guardrails (`max_parallel_teammates`, token/wall-clock budgets, degraded modes). The handoff gates between stages lived only in prose.
17
-
18
- The seven-role Swarm Skill preserved the source contracts while adding explicit topology, per-role boundaries, self-contained pasteable personas, budgets, and degraded modes.
19
-
20
- ## Phase 2 — Seven roles to four clustered roles
21
-
22
- The second pass analyzed each role's function and duty, found repeated cataloging across adjacent personas, and reduced active dispatch from seven roles to four clustered personas. The full analysis is in [ROLE_CLUSTERING.md](ROLE_CLUSTERING.md).
23
-
24
- ## Phase 3 — Add workspace-state ledger role
25
-
26
- The third pass adds `analysis-workspace-state`, following the ledger pattern used by `android-to-kmp-migrator` and `kmp-test-validator`. This role does not change the four clustered analysis personas. It tracks module/node artifact status, stale upstream inputs, rerun/blocker history, and next safe controller actions so global representations and SPEC files are not built from stale evidence.
27
-
28
- ## Old-to-new role map
29
-
30
- | Old role(s) | New clustered role | Reason |
31
- |---|---|---|
32
- | `ui-understand` + `resource-understand` | `presentation-resource` | Resource usage and migration risk are meaningful only when tied to screens, components, navigation, and UI technology. |
33
- | `architecture-pattern` + `android-ecosystem` | `project-architecture` | Module topology, architecture style, dependency ecosystem, DI scopes, generated tooling, and Android-only constraints form one project-structure reality check. |
34
- | `api-list` + `data-flow` | `data-contract-flow` | APIs, local data sources, models, repositories, streams, cache/error behavior, transformations, and write-back paths are one data path. |
35
- | `logic-understand` | `behavior-logic` | Behavior remains last because user/lifecycle/control-flow analysis requires verified upstream presentation, project, and data evidence. |
36
- | none (new ledger role) | `analysis-workspace-state` | Workspace-state tracking is cross-cutting and read-only; it prevents stale module/node artifacts from being consumed downstream. |
37
-
38
- ## Current decomposition
39
-
40
- - **Pattern: Workspace-state + Mixed B + C.** `analysis-workspace-state` is initialized after output-root lock and refreshed after each major artifact group. Stage A (`presentation-resource`, `project-architecture`, `data-contract-flow`) is parallel decomposition (B) over clustered slices. Stage B (`behavior-logic`) is a gated specialization step (C) that consumes verified, non-stale upstream outputs and must not rebuild them.
41
- - **Boundary check: PASS.** Clustered roles remove the most common duplicate cataloging while preserving distinct ownership: workspace ledger vs. presentation/resource evidence vs. project architecture/ecosystem evidence vs. data contract/flow evidence vs. behavior/control evidence.
42
-
43
- ## Current content port map
44
-
45
- | Contract content | Current location |
46
- |---|---|
47
- | Active role registry | `SKILL.md` frontmatter |
48
- | Staged dispatch order + verification | `workflow.md` |
49
- | Mandatory contract enforcement + agent-only rules | `bind.md` § Behavioral Constraints |
50
- | Node failure / rerun handling | `bind.md` § Failure Handling |
51
- | Function/duty analysis and old-to-new map | `ROLE_CLUSTERING.md` |
52
- | Per-role identity, boundary, schema, and teammate persona | `roles/<clustered-role>.md` |
53
- | SPEC output contract + MCP context | `SKILL.md` body |
54
-
55
- ## Output Contract Refinement
56
-
57
- The active skill docs now distinguish output file names from output content responsibilities. `SKILL.md` and `workflow.md` define the full artifact schedule and content matrix, while each role file states the exact JSON/Markdown filenames and the evidence each artifact must contain.
58
-
59
- This refinement keeps role ownership explicit:
60
-
61
- - `analysis-workspace-state.*` records ledger state only.
62
- - `presentation_resource.*` records screens, checked UI trees, navigation, presentation modules, and resources.
63
- - `project_architecture.*` records build/module topology, architecture patterns, dependencies, platform services, and migration constraints.
64
- - `data_contract_flow.*` records APIs, models, data sources, mappings, streams, and end-to-end data flows.
65
- - `behavior_logic.*` records user actions, lifecycle behavior, state holders, rules, side effects, state machines, and upstream alignment.
66
-
67
- The Leader must reject artifacts that have the correct filename but contain another role's work or prose-only summaries without machine-routable evidence.
@@ -1,129 +0,0 @@
1
- # Conversion Note: `android-to-kmp-migrator` → Swarm Skill
2
-
3
- Converted from a single controller-support skill (a flat SKILL.md node registry plus 20 sibling node-spec files) into a compliant **Swarm Skill** using `swarmskill-creator` convert mode.
4
-
5
- ## Source structure (before)
6
-
7
- - `SKILL.md` — node registry: node table, required dispatch order (13 controller steps), shared input contract, shared return shape, and shared rules.
8
- - 20 flat node specs at the skill root, each with Role / Inputs / Mandatory Input Validation & Output Storage / Specific Task / Do-not list / Required Outputs (JSON schema) / Shared Return Shape / Return Shape.
9
-
10
- ## What was lost in the pre-swarm form
11
-
12
- The registry separated controller from nodes and even encoded the staged 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 20 dispatches re-derived its contract by hand), no Mermaid topology making the pipeline + parallel fan-outs + review→fix loops explicit, and no resource/behavioral guardrails (parallel cap, token/wall-clock budgets, `max_review_fix_cycles`, degraded modes). Stage gates and the single-project / dependency-gate invariants lived only in prose.
13
-
14
- ## Decomposition
15
-
16
- - **Pattern: C (specialization pipeline) + embedded B (parallel fan-outs) + review→fix loops.**
17
- - Serial analysis chain: `legacy-spec-delta-review` → `target-project-understand` → `migration-alignment`.
18
- - Hard gate: `dependency-resolution` (minimal-change) before any implementation.
19
- - Parallel prep (B): `theme-design-system-mapping`, `resource-migration`, `navigation-migration`, `platform-api-replacement`, `state-model-mapping`.
20
- - Sequential implementation: `ui-mockup-implementation` before `dataflow-logic-implementation`.
21
- - Review→fix loop after any file-changing node: `module-node-migration-review` ↔ `module-node-migration-fix`.
22
- - Parallel verify (B): `source-set-placement-guard`, `api-contract-parity`, `ui-render-fidelity-check`, `incremental-build-check`.
23
- - Completion + report: `prd-completion-check` → `migration-report` → `kmp-test-validator` handoff.
24
- - Cross-cutting: `migration-workspace-state` progress ledger refreshed after every major stage, tracking per-module finish rate, plan-vs-code gaps, stale outputs, and rerun hooks.
25
- - **Disjointness check: PASS.** Each node owns a distinct slice (state ledger vs SPEC delta vs target understanding vs alignment vs dependency gate vs theme vs resource vs navigation vs platform vs state/model vs UI vs logic vs review vs fix vs source-set guard vs API parity vs render vs build vs completion vs report). `module-node-migration-review` and `-fix` are intentionally complementary (read-only judge vs scoped editor) and gated as a loop, not overlapping.
26
-
27
- ## Content port map
28
-
29
- | Source node-spec content | Ported to |
30
- |---|---|
31
- | `## Role` first paragraph | role `## Identity` (rewritten as a 1-line motto + context) |
32
- | `## Specific Task` numbered steps | role `## Inline Persona for Teammate` HANDLER |
33
- | `## Mandatory Input Validation And Output Storage` | role `## Boundary > Mandatory` + Inline Persona CONTROL block |
34
- | `Do not:` lists + sibling routing | role `## Boundary > Forbidden` |
35
- | `## Required Outputs` JSON schema | role `## Output Schema` + Inline Persona OUTPUTS |
36
- | `## Return Shape` + shared return | role Inline Persona RETURN TO CONTROLLER + SKILL.md § Shared Return Shape |
37
- | Required dispatch order (13 steps) | `workflow.md` staged steps + Mermaid + gates |
38
- | Mandatory node contract enforcement + shared rules | `bind.md` § Behavioral Constraints + SKILL.md § Shared Rules |
39
- | Shared return status semantics + controller handling | SKILL.md § Shared Return Shape |
40
- | Optional Android Studio MCP context | SKILL.md § Optional Android Studio MCP Context + per-role Inline Persona MCP inputs |
41
-
42
- ## Team-vs-single delta
43
-
44
- The conversion preserves every source contract while adding: explicit pipeline + parallel + loop topology with verifiable gates, per-role anti-overlap boundaries that name siblings, self-contained pasteable personas (no re-derivation per dispatch across 20 nodes), resource/token/wall-clock budgets plus a `max_review_fix_cycles` bound, failure-routing rules, and concrete degraded modes for large monorepos and missing tooling. The same-name controller subagent in `kmp-migration/agents/android-to-kmp-migrator.md` was later updated to enforce the module-first schedule and strict output roots.
45
-
46
- ## Module-First Refactor (0.3)
47
-
48
- The second refactor added a module-first migration schedule and strict output paths. It initially kept the 20-role shape, then Phase 0.4 superseded that result with the reduced 10-role set recorded in `ROLE_REDUCTION.md`.
49
-
50
- ### New schedule
51
-
52
- 1. Lock `output_root = <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator`.
53
- 2. Write `<output_root>/run_manifest.json`.
54
- 3. Write `<output_root>/module-index/migration_module_inventory.json` and `.md`.
55
- 4. For each `migration_module_id`, write `<output_root>/modules/<migration_module_id>/module_brief.json`.
56
- 5. Run module-scoped node outputs under `<output_root>/modules/<migration_module_id>/node-results/<node_id>/`.
57
- 6. Run review/fix loops per module and owning node slice.
58
- 7. Write `<output_root>/modules/<migration_module_id>/representation/module_migration_representation.json` and `.md`.
59
- 8. Combine all module representations into `<output_root>/global/global_migration_representation.json` and `.md`.
60
- 9. Write final `<output_root>/report/migration_report.json` and `.md`.
61
- 10. Hand the final report to `kmp-test-validator`.
62
-
63
- ### Contract changes
64
-
65
- - Every module-scoped node now receives `migration_module_id`, `module_scope`, exact `output_dir`, and allowed target files/source sets when it may change files.
66
- - Review mode remains read-only. Fix mode consumes explicit findings, `allowed_files`, `owning_node`, and `migration_module_id`; re-review is a fresh read-only invocation.
67
- - Verification runs per module first. Global aggregation consumes module representations rather than loose node output lists.
68
- - `completion-report` report mode may return `ready_for_validation` only when every scheduled module representation and the global representation exists and is non-empty.
69
-
70
- ### Path compatibility
71
-
72
- The old default `~/.a2c_agents/migration/` is now only the base directory. The effective output root is always:
73
-
74
- ```text
75
- <output_dir or ~/.a2c_agents/migration>/android-to-kmp-migrator
76
- ```
77
-
78
- No controller or node should write durable migration artifacts directly under the base directory.
79
-
80
- ## Role Reduction Refactor (0.4)
81
-
82
- The third refactor reduces active migrator role definitions from 20 to 10. The full analysis lives in [ROLE_REDUCTION.md](ROLE_REDUCTION.md).
83
-
84
- ### Old-to-new map
85
-
86
- | Old role(s) | Active role |
87
- |---|---|
88
- | `migration-workspace-state` | `migration-workspace-state` |
89
- | `legacy-spec-delta-review`, `target-project-understand`, `migration-alignment` | `migration-analysis-planning` |
90
- | `dependency-resolution`, `platform-api-replacement` | `dependency-platform-gate` |
91
- | `theme-design-system-mapping`, `resource-migration`, `navigation-migration` | `presentation-integration` |
92
- | `state-model-mapping` plus API/data preparation expectations | `state-data-prep` |
93
- | `ui-mockup-implementation` | `ui-implementation` |
94
- | `dataflow-logic-implementation` | `logic-implementation` |
95
- | `module-node-migration-review`, `module-node-migration-fix` | `module-node-review-fix` with `mode: review | fix` |
96
- | `source-set-placement-guard`, `api-contract-parity`, `ui-render-fidelity-check`, `incremental-build-check` | `migration-verification` with stable `check_ids` |
97
- | `prd-completion-check`, `migration-report` | `completion-report` with `mode: readiness | report` |
98
-
99
- ### Safety preserved by modes
100
-
101
- - Review and fix are in one role file but must run as separate invocations.
102
- - Verification is consolidated but still read-only for source changes and uses explicit check IDs.
103
- - Completion and report are consolidated but report mode is blocked until readiness mode and module/global representation gates pass.
104
- - Build-config changes remain owned only by `dependency-platform-gate`.
105
-
106
- ## Workspace Progress Ledger Refinement
107
-
108
- The `migration-workspace-state` role was refined from basic node/stale-output tracking into the controller's progress ledger. It now records per-module migration status, current stage, planned/completed work units, `finish_rate`, changed-file ownership, plan-vs-code gaps, stale outputs, rerun hooks, blocker history, and next safe action.
109
-
110
- This preserves the role boundary: `migration-workspace-state` still does not analyze source behavior, implement code, fix code, or issue readiness verdicts. It only compares controller-visible plan artifacts, implementation outputs, review outputs, verification outputs, changed-file ownership, and freshness evidence so the Leader can rerun the correct owner before downstream consumption.
111
-
112
- ## Output Contract Refinement
113
-
114
- The active skill docs now distinguish output filenames from output content responsibilities. `SKILL.md` and `workflow.md` define the full artifact schedule and content matrix, while each role file states the exact JSON/Markdown filenames and the evidence each artifact must contain.
115
-
116
- This keeps the reduced-role boundaries explicit:
117
-
118
- - `migration_workspace_state.*` records progress ledger state only.
119
- - `migration_analysis_planning.*` records SPEC/raw-source deltas, target evidence, source-to-target mapping, and ordered tasks.
120
- - `dependency_platform_gate.*` records dependency, build, platform, and source-set decisions.
121
- - `presentation_integration.*` records theme/token/resource/media/navigation prep and UI handoff.
122
- - `state_data_prep.*` records state/model/API contract prep and logic handoff.
123
- - `ui_implementation.*` records visible UI implementation evidence and binding surfaces.
124
- - `logic_implementation.*` records behavior/data/API/state implementation evidence.
125
- - `module_node_review.*` and `module_node_fix.*` record review/fix evidence by mode.
126
- - `migration_verification.*` records stable check results and routed failures.
127
- - `completion_readiness.*` and `migration_report.*` record readiness and validation handoff evidence.
128
-
129
- The Leader must reject artifacts that have the correct filename but contain another role's work or prose-only summaries without machine-routable evidence.
@@ -1,68 +0,0 @@
1
- # Role: Dependency Platform Gate
2
-
3
- ## Identity
4
-
5
- > "I decide what the module can safely depend on and how Android-only behavior stays out of common code."
6
-
7
- You are the `dependency-platform-gate` node subagent. You merge minimal-change dependency resolution with Android-only platform replacement planning/implementation for one module.
8
-
9
- ## Success Criteria
10
-
11
- - `dependency_platform_gate.json` and `dependency_platform_gate.md` are written under `output_dir`.
12
- - Required capabilities are mapped to reuse, existing dependency, baseline API, expect/actual, platform source set, build change, or blocker.
13
- - Any build-config change is justified by the minimal-change gate.
14
- - Android-only APIs are routed to safe abstractions or expect/actual/platform-source-set implementations.
15
-
16
- ## Boundary
17
-
18
- Forbidden:
19
- - Do not implement feature UI, repositories, business logic, or broad refactors.
20
- - Do not add dependencies for convenience or upgrade unrelated versions.
21
- - Do not leak Android-only APIs into `commonMain`.
22
-
23
- Mandatory:
24
- - Validate planning output, target baseline, `allowed_files`, `allowed_source_sets`, and exact `output_dir`.
25
- - Use `output_dir = <output_root>/modules/<migration_module_id>/node-results/dependency-platform-gate`.
26
- - Record changed build/platform files and global-impact exceptions.
27
-
28
- ## Output Schema
29
-
30
- ```json
31
- {
32
- "status": "ready_for_implementation | blocked",
33
- "node": "dependency-platform-gate",
34
- "migration_module_id": "",
35
- "module_scope": {},
36
- "output_root": "",
37
- "output_dir": "",
38
- "capability_map": [],
39
- "build_config_changes": [],
40
- "platform_capabilities": [],
41
- "changed_files": [],
42
- "implementation_constraints": [],
43
- "blocking_gaps": []
44
- }
45
- ```
46
-
47
- Shared return shape applies.
48
-
49
- ## Output Files And Contents
50
-
51
- - `dependency_platform_gate.json`: machine-routable gate artifact containing capability map, minimal-change dependency decisions, build-config changes, platform capabilities, Android-only API replacement strategy, expect/actual/source-set placement, changed files, implementation constraints, and blockers.
52
- - `dependency_platform_gate.md`: agent-readable gate handoff containing dependency/platform decisions, build-change rationale, source-set/platform-boundary notes, changed-file summary, downstream constraints, and blockers.
53
-
54
- ## Inline Persona for Teammate
55
-
56
- ```text
57
- ROLE: dependency-platform-gate node.
58
-
59
- You protect the target build and common source sets. Map module capabilities to existing target support first, justify any build change, and define/implement platform-safe boundaries only when required.
60
-
61
- INPUTS: migration_module_id, module_scope, migration_analysis_planning_path, target paths, allowed_files, allowed_source_sets, output_root, output_dir.
62
-
63
- OUTPUTS:
64
- - dependency_platform_gate.json (machine gate: capabilities, dependency/build decisions, platform boundaries, changed files, constraints)
65
- - dependency_platform_gate.md (agent handoff: rationale, source-set/platform notes, downstream constraints, blockers)
66
-
67
- Return status ready_for_implementation or blocked. Include changed_files and blockers.
68
- ```