@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
@@ -0,0 +1,34 @@
1
+ # Migration Task Adapter Notes
2
+
3
+ The `migration-task-adapter` is a control-plane skill. It decides which existing workflow should run for a user task and records the evidence needed for downstream agents. It does not replace the existing controller skills.
4
+
5
+ ## Downstream Workflow Mapping
6
+
7
+ | Adapter route | Downstream workflow | Required handoff |
8
+ |---|---|---|
9
+ | `only_understand_ui` | `android-project-analyst` | Analyst output root, `presentation-resource` artifacts, module/global representation, SPEC verification |
10
+ | `only_understand_logic` | `android-project-analyst` | Analyst output root, verified Stage A artifacts, `behavior-logic` artifacts, module/global representation |
11
+ | `only_understand_architecture` | `android-project-analyst` | Analyst output root, `project-architecture` artifacts, module/global representation |
12
+ | `only_understand_overview` | `android-project-analyst` | Analyst output root, module inventory, module/global representation, SPEC package |
13
+ | `migration` | `android-project-analyst` then `android-to-kmp-migrator` | Fresh analyst SPEC before migrator; migration report before validation handoff |
14
+ | `validation_handoff` | `kmp-test-validator` | Migration report plus Android source/SPEC and KMP target evidence |
15
+
16
+ ## Required Adapter Records
17
+
18
+ Every adapter run must preserve:
19
+
20
+ - `task_understanding_router.*` for the route decision.
21
+ - `workflow_orchestration.*` for downstream contracts and observations.
22
+ - `workspace_state_discipline.*` for freshness, rerun, blocker, and path discipline.
23
+ - `stage_inspection.*` for every applicable stage boundary.
24
+ - `intermediate_asset_records.*` for every durable artifact consumed by a later stage.
25
+ - `task_adapter_report.*` for the final machine-routable result.
26
+
27
+ ## Migration-Specific Gate
28
+
29
+ For migration tasks, the adapter must not invoke `android-to-kmp-migrator` until one of these is true:
30
+
31
+ - Fresh `android-project-analyst` SPEC artifacts are provided and recorded in intermediate asset records.
32
+ - The adapter first routes and observes an `android-project-analyst` migration-mode run that produces fresh SPEC artifacts.
33
+
34
+ If the migrator returns `ready_for_validation`, the adapter records the migration report and either routes `kmp-test-validator` or returns `ready_for_validation` with an explicit validation handoff requirement.
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: migration-task-adapter
3
+ description: |
4
+ 4-role task adapter Swarm Skill that classifies an incoming Android/KMP migration request, routes only-understand tasks for UI, logic, architecture, or overview to android-project-analyst, routes migration tasks through android-project-analyst and android-to-kmp-migrator, and records stage inspections plus intermediate asset records before final reporting.
5
+ Use when a controller must decide whether the user is asking for focused understanding, overview analysis, migration, or post-migration validation handoff before invoking analyst/migrator/validator workflows.
6
+ Do NOT use for direct source lookup, single-file edits, generic KMP testing without migration context, or standalone implementation work.
7
+ version: "0.1"
8
+ kind: swarm-skill
9
+ disable-model-invocation: true
10
+ roles:
11
+ - id: task-understanding-router
12
+ kind: ai_agent
13
+ purpose: Task intake and route decision owner - normalize the user request, classify only-understand vs migration, choose UI/logic/architecture/overview focus, identify required source/target paths, and emit route contracts.
14
+ skills: []
15
+ tools: [rg]
16
+ - id: workflow-orchestrator
17
+ kind: ai_agent
18
+ purpose: Workflow orchestration owner - consume the route decision, build downstream analyst/migrator/validator dispatch contracts, record observed workflow results, and request reruns without doing downstream role work.
19
+ skills: []
20
+ tools: [rg, git]
21
+ - id: workspace-state-discipline-inspector
22
+ kind: ai_agent
23
+ purpose: Discipline inspector - verify workspace-state freshness, stage inspection records, intermediate asset records, output path compliance, stale inputs, and rerun/blocker routing.
24
+ skills: []
25
+ tools: [git]
26
+ - id: task-reporter
27
+ kind: ai_agent
28
+ purpose: Final task report owner - synthesize verified adapter and downstream workflow evidence into a machine-routable task report without new analysis, migration, validation, or fixes.
29
+ skills: []
30
+ tools: [git]
31
+ ---
32
+
33
+ # Migration Task Adapter Swarm Skill
34
+
35
+ This is the agent-facing registry and team definition for a front-door adapter in the KMP Migration Toolkit. It does not replace `android-project-analyst`, `android-to-kmp-migrator`, or `kmp-test-validator`. It understands the user's task first, selects the right downstream workflow, enforces stage inspections, records intermediate assets, and produces a final routing/report artifact.
36
+
37
+ Supported task targets:
38
+
39
+ - `only_understand_ui`: focused UI/presentation/resource understanding through `android-project-analyst`, with emphasis on `presentation-resource` outputs.
40
+ - `only_understand_logic`: focused behavior/control-flow understanding through `android-project-analyst`, with emphasis on `behavior-logic` outputs and verified Stage A inputs.
41
+ - `only_understand_architecture`: focused project architecture/ecosystem understanding through `android-project-analyst`, with emphasis on `project-architecture` outputs.
42
+ - `only_understand_overview`: overview understanding through the full analyst representation and SPEC verification path.
43
+ - `migration`: Android-to-KMP migration through analyst completion, migrator execution, and validator handoff when migration output is ready.
44
+ - `validation_handoff`: post-migration validation through `kmp-test-validator` only when migration evidence exists.
45
+
46
+ ## Protocol Summary
47
+
48
+ 0. **Pre-flight** - read [dependencies.yaml](dependencies.yaml), report missing optional tools, and lock adapter output root.
49
+ 1. **Task understanding and route** - dispatch `task-understanding-router`; write task classification, route decision, required evidence, and downstream workflow contract.
50
+ 2. **Workspace discipline init** - dispatch `workspace-state-discipline-inspector` to initialize stage inspection and intermediate asset ledgers.
51
+ 3. **Workflow orchestration** - dispatch `workflow-orchestrator` to prepare and record downstream workflow execution:
52
+ - only-understand routes to `android-project-analyst`.
53
+ - migration routes to `android-project-analyst` first when SPEC evidence is missing or stale, then `android-to-kmp-migrator`, then validation handoff when ready.
54
+ - validation handoff routes to `kmp-test-validator` only after migration report evidence exists.
55
+ 4. **Stage inspections** - after every route boundary and downstream workflow boundary, refresh `workspace-state-discipline-inspector`.
56
+ 5. **Task report** - dispatch `task-reporter` only after latest discipline inspection marks required inputs fresh and intermediate asset records complete.
57
+
58
+ ## Roles
59
+
60
+ Each role is dispatched as a subagent that must read its role file (`skill_spec_path`) and execute only that bounded slice.
61
+
62
+ | id | Purpose | When dispatched | Role file |
63
+ |---|---|---|---|
64
+ | `task-understanding-router` | Classify request, normalize paths/scope, select route and downstream workflow contracts | First stage after output root lock | [roles/task-understanding-router.md](roles/task-understanding-router.md) |
65
+ | `workflow-orchestrator` | Build dispatch contracts, track downstream workflow observations, route reruns/blockers | After route decision and before/after downstream workflow execution | [roles/workflow-orchestrator.md](roles/workflow-orchestrator.md) |
66
+ | `workspace-state-discipline-inspector` | Inspect stage records, intermediate assets, output paths, workspace freshness, reruns | Initialized early and refreshed after every stage boundary | [roles/workspace-state-discipline-inspector.md](roles/workspace-state-discipline-inspector.md) |
67
+ | `task-reporter` | Final machine-routable report from verified adapter/downstream artifacts | Last stage only | [roles/task-reporter.md](roles/task-reporter.md) |
68
+
69
+ ## Files
70
+
71
+ | File | What it contains |
72
+ |---|---|
73
+ | [workflow.md](workflow.md) | Adapter topology, route matrix, stage inspection gates, intermediate asset records, final report contract |
74
+ | [bind.md](bind.md) | Guardrails, failure handling, path discipline, stage inspection requirements |
75
+ | [dependencies.yaml](dependencies.yaml) | Optional CLI tools checked at startup |
76
+ | [roles/](roles/) | Active role specs |
77
+
78
+ ## Strict Output Schedule
79
+
80
+ ```text
81
+ output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter
82
+ task_dir = <output_root>/task
83
+ workspace_state_dir = <output_root>/workspace-state
84
+ orchestration_dir = <output_root>/orchestration
85
+ stage_inspection_dir = <output_root>/stage-inspections
86
+ intermediate_asset_dir = <output_root>/intermediate-assets
87
+ report_dir = <output_root>/report
88
+ ```
89
+
90
+ Required artifacts:
91
+
92
+ - `<output_root>/run_manifest.json`
93
+ - `<task_dir>/task_understanding_router.json`
94
+ - `<task_dir>/task_understanding_router.md`
95
+ - `<workspace_state_dir>/workspace_state_discipline.json`
96
+ - `<workspace_state_dir>/workspace_state_discipline.md`
97
+ - `<stage_inspection_dir>/<stage_id>/stage_inspection.json`
98
+ - `<stage_inspection_dir>/<stage_id>/stage_inspection.md`
99
+ - `<intermediate_asset_dir>/intermediate_asset_records.json`
100
+ - `<intermediate_asset_dir>/intermediate_asset_records.md`
101
+ - `<orchestration_dir>/workflow_orchestration.json`
102
+ - `<orchestration_dir>/workflow_orchestration.md`
103
+ - `<report_dir>/task_adapter_report.json`
104
+ - `<report_dir>/task_adapter_report.md`
105
+
106
+ ## Shared Return Contract
107
+
108
+ ```json
109
+ {
110
+ "status": "completed | routed | passed | ready_for_report | needs_rerun | failed | blocked",
111
+ "node": "<node-id>",
112
+ "task_id": "<stable task id>",
113
+ "route": "<only_understand_ui | only_understand_logic | only_understand_architecture | only_understand_overview | migration | validation_handoff | unknown>",
114
+ "output_dir": "<exact role output dir>",
115
+ "output_files": ["<paths>"],
116
+ "changed_files": [],
117
+ "stale_upstream_inputs": [],
118
+ "rerun_requests": [
119
+ { "node": "<adapter or downstream node/workflow>", "reason": "", "required_inputs": [], "expected_output": "" }
120
+ ],
121
+ "blocking_gaps": []
122
+ }
123
+ ```
124
+
125
+ Controller handling: missing or empty output files cause rerun of the same role. Stale upstream inputs cause a discipline refresh and rerun of the owning role or downstream workflow. Non-empty `blocking_gaps` stop the adapter unless the user supplies the missing evidence.
126
+
127
+ ## Shared Rules
128
+
129
+ - The adapter is an orchestrator only. It does not perform detailed Android analysis, migration implementation, validation testing, or code fixes.
130
+ - Task classification must happen before selecting any downstream workflow.
131
+ - Stage inspections are required after route decision, before downstream dispatch, after every downstream workflow boundary, before final report, and after final report.
132
+ - Every durable artifact consumed by another stage must be recorded in `intermediate_asset_records.*`.
133
+ - Downstream workflow outputs are consumed by path and status only; the adapter never invents missing downstream evidence.
134
+ - User-facing completion happens only after `task-reporter` writes verified report artifacts.
@@ -0,0 +1,113 @@
1
+ # Execution Guardrails
2
+
3
+ ## Resource Constraints
4
+
5
+ | Item | Limit | Reason |
6
+ |---|---|---|
7
+ | `max_parallel_teammates` | 1 | The adapter is a control plane. Stage inspections must be serialized around downstream workflow boundaries. |
8
+ | `total_wall_clock_budget` | 20 min adapter overhead | Downstream analyst/migrator/validator workflows keep their own budgets. |
9
+ | `total_token_budget` | 300k adapter overhead | The adapter records contracts, inspections, and asset ledgers; it must not duplicate downstream analysis. |
10
+ | `per_node_token_budget` | 80k | Roles are narrow and should cite downstream artifacts by path rather than paste large outputs. |
11
+ | `max_route_retries` | 2 | Repeated route ambiguity should be surfaced to the user as a blocker. |
12
+ | `max_stage_inspection_repairs` | 2 per stage | Missing or malformed inspection records are repaired by rerunning the discipline inspector, not by bypassing the gate. |
13
+
14
+ ## Behavioral Constraints
15
+
16
+ - **Adapter-as-orchestrator only**: the Leader and adapter roles classify, route, inspect, record, and report. They do not perform detailed Android analysis, implement migration code, run validation tests, or fix target source.
17
+ - **Task-first routing**: `task-understanding-router` must complete before any downstream workflow is selected. A guessed route is invalid.
18
+ - **Strict output root**: the Leader must lock `output_root = <output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter` before role dispatch. Adapter roles write only under this root.
19
+ - **Downstream boundary**: analyst, migrator, and validator artifacts stay under their own declared output roots. The adapter records their paths and statuses in intermediate asset records.
20
+ - **Stage inspection discipline**: every route boundary and downstream workflow boundary must have a `stage_inspection.json` and `.md`. A stage inspection must say whether the next stage is `pass`, `needs_rerun`, or `blocked`.
21
+ - **Intermediate asset discipline**: every durable artifact consumed by another stage must have one asset record with producer, path, status, freshness basis, consumers, and gaps.
22
+ - **Workspace-state freshness**: the adapter must refresh `workspace-state-discipline-inspector` after task routing, after downstream workflow completion, before report, and after report.
23
+ - **No hidden fallbacks**: if analyst/migrator/validator evidence is missing or stale, route a rerun request to that workflow. Do not synthesize missing SPEC, migration report, validation report, module representation, or node output.
24
+ - **Only-understand focus is a route constraint, not a license to skip evidence gates**: focused UI, logic, architecture, and overview understanding still require analyst artifacts and verification. The focus determines priority and reporting emphasis.
25
+ - **Migration readiness**: migration may not start from raw source alone when the migrator requires analyst completion. If fresh SPEC evidence is missing, route analyst in migration mode first.
26
+ - **Report-only finalization**: only `task-reporter` issues the adapter final task status, and only from verified adapter and downstream artifacts.
27
+
28
+ ## Stage Inspection Contract
29
+
30
+ Each stage inspection artifact must include:
31
+
32
+ ```json
33
+ {
34
+ "stage_id": "",
35
+ "status": "pass | needs_rerun | blocked",
36
+ "checked_inputs": [],
37
+ "checked_outputs": [],
38
+ "path_compliance": [],
39
+ "freshness_checks": [],
40
+ "intermediate_asset_coverage": [],
41
+ "downstream_contract_checks": [],
42
+ "rerun_requests": [],
43
+ "blocking_gaps": [],
44
+ "next_allowed_stage": ""
45
+ }
46
+ ```
47
+
48
+ Inspection rules:
49
+
50
+ - `pass` requires all required inputs and outputs to exist, be non-empty, be under allowed roots, and be recorded in intermediate assets when consumed.
51
+ - `needs_rerun` requires a concrete owner and expected output.
52
+ - `blocked` requires a user/actionable gap or unavailable environment/tool/evidence.
53
+
54
+ ## Intermediate Asset Record Contract
55
+
56
+ Every asset record must be stable and machine-routable:
57
+
58
+ ```json
59
+ {
60
+ "asset_id": "",
61
+ "asset_type": "run_manifest | route_decision | stage_inspection | workspace_state | downstream_output | representation | spec | migration_report | validation_report | final_report | log | other",
62
+ "producer": "",
63
+ "path": "",
64
+ "status": "exists | missing | stale | blocked | not_applicable",
65
+ "created_or_observed_at": "",
66
+ "freshness_basis": "",
67
+ "consumers": [],
68
+ "source_evidence": [],
69
+ "blocking_gaps": []
70
+ }
71
+ ```
72
+
73
+ No downstream stage may consume a durable artifact whose record is `missing`, `stale`, or `blocked`.
74
+
75
+ ## Failure Handling
76
+
77
+ ### Teammate failure
78
+
79
+ | Failure mode | Response |
80
+ |---|---|
81
+ | Node timeout | Retry once with the same contract. On second timeout, record `[ROLE MISSING - node timed out]` in workspace discipline and block any stage that hard-requires it. |
82
+ | Malformed output or missing JSON/MD artifacts | Rerun the same role once with the expected schema and output paths inlined. On second failure, record `[ROLE MISSING - malformed output]` and block downstream consumption. |
83
+ | Route is ambiguous | Rerun `task-understanding-router` with the ambiguity. If still ambiguous, ask the user for source path, target path, task target, or scope. |
84
+ | Stage inspection missing or malformed | Rerun `workspace-state-discipline-inspector` for that `stage_id`. Do not proceed past the stage. |
85
+ | Intermediate asset record missing for consumed artifact | Rerun `workspace-state-discipline-inspector` to repair the asset ledger before downstream consumption. |
86
+ | Downstream workflow output missing/empty | Route rerun to the owning downstream workflow or role; do not create adapter-side replacement artifacts. |
87
+ | Downstream output stale | Refresh the owning downstream workspace-state workflow if available, then rerun the owning workflow/role before consumption. |
88
+ | Downstream workflow returns blocked | Preserve its blocker in adapter stage inspection and final report. Do not downgrade to a partial pass. |
89
+
90
+ ### Input over-scale degradation
91
+
92
+ | Trigger condition | Degraded mode |
93
+ |---|---|
94
+ | User asks for whole-project overview without a scope on a very large Android project | Route to `only_understand_overview` with a scope-narrowing blocker or ask for feature/module priority. |
95
+ | User asks for migration without a KMP target path | Route classification may complete, but orchestration blocks before migrator dispatch. |
96
+ | User asks for validation without migration report/SPEC evidence | Route to `validation_handoff` only as blocked, listing required migration evidence. |
97
+ | Existing downstream artifacts are too large to inspect inline | Record paths and status only; require downstream report/verification artifacts instead of pasting node contents. |
98
+
99
+ ## Required Path Contract
100
+
101
+ ```json
102
+ {
103
+ "output_root": "<output_dir or ~/.a2c_agents/task-adapter>/migration-task-adapter",
104
+ "task_dir": "<output_root>/task",
105
+ "workspace_state_dir": "<output_root>/workspace-state",
106
+ "orchestration_dir": "<output_root>/orchestration",
107
+ "stage_inspection_dir": "<output_root>/stage-inspections",
108
+ "intermediate_asset_dir": "<output_root>/intermediate-assets",
109
+ "report_dir": "<output_root>/report"
110
+ }
111
+ ```
112
+
113
+ Reject adapter artifacts outside this path contract. For downstream workflows, record their own output roots as external asset paths with producer workflow metadata.
@@ -0,0 +1,26 @@
1
+ # dependencies.yaml - Migration Task Adapter startup dependency check
2
+ #
3
+ # All tools are optional. The adapter can still route and report with file-system
4
+ # evidence, but degraded checks must be recorded in stage inspections.
5
+
6
+ skills:
7
+ - name: android-project-analyst
8
+ required: false
9
+ purpose: Downstream workflow for only-understand UI, logic, architecture, overview, and pre-migration SPEC generation.
10
+ - name: android-to-kmp-migrator
11
+ required: false
12
+ purpose: Downstream workflow for Android-to-KMP migration after analyst evidence is fresh.
13
+ - name: kmp-test-validator
14
+ required: false
15
+ purpose: Downstream workflow for post-migration validation when migration report evidence is ready.
16
+
17
+ tools:
18
+ - name: rg
19
+ required: false
20
+ purpose: Optional path and evidence discovery for task routing; built-in search/read tools may substitute.
21
+ - name: git
22
+ required: false
23
+ purpose: Optional changed-file and freshness detection for workspace-state discipline inspections.
24
+ - name: curl
25
+ required: false
26
+ purpose: Optional availability check because downstream presentation/resource workflows may need safe media downloads.
@@ -0,0 +1,129 @@
1
+ # Role: Task Reporter
2
+
3
+ ## Identity
4
+
5
+ > *"I close the loop from verified evidence only - route, workflow, inspections, assets, blockers, and next action."*
6
+
7
+ You are the `task-reporter` node subagent dispatched by the `migration-task-adapter` controller. You synthesize verified adapter outputs, stage inspections, intermediate asset records, workspace discipline evidence, and downstream workflow reports into a final task adapter report. You do not run new routing, orchestration, analysis, migration, validation, tests, builds, previews, or fixes.
8
+
9
+ ## Success Criteria
10
+
11
+ - `task_adapter_report.json` and `task_adapter_report.md` written under `output_dir`, both non-empty.
12
+ - Final report includes task id, route, focus, source/target paths, downstream workflow status, stage inspection summary, intermediate asset summary, verified output paths, readiness, rerun requests, and blockers.
13
+ - Report status is decided from verified evidence only.
14
+ - Every consumed final claim cites an adapter artifact, downstream report, stage inspection, or intermediate asset record.
15
+ - If required stage inspections or intermediate asset records are missing/stale, the report returns `needs_rerun` or `blocked` instead of completing.
16
+
17
+ **Focus areas**: final evidence synthesis, readiness decision, stage inspection summary, intermediate asset summary, downstream output summary, rerun/blocker routing, user-facing handoff path.
18
+
19
+ ## Boundary
20
+
21
+ **Forbidden** (prevent role overlap):
22
+
23
+ - Do NOT reclassify the route, alter workflow contracts, or repair stage inspections.
24
+ - Do NOT analyze Android source, write SPEC, migrate code, validate behavior, run tests/builds/previews, or fix code.
25
+ - Do NOT claim a downstream workflow passed unless its report/required artifacts and latest stage inspection support that status.
26
+ - Do NOT hide missing intermediate assets or stale stage inputs.
27
+
28
+ **Mandatory**:
29
+
30
+ - You MUST read this role spec and the controller contract completely before acting.
31
+ - You MUST validate all required input artifact paths before reporting.
32
+ - You MUST use latest `pre_report` stage inspection and workspace discipline evidence to decide whether reporting is allowed.
33
+ - You MUST write both artifacts under `output_dir`, list them in `output_files`, and verify they exist and are non-empty before returning final status.
34
+
35
+ ## Output Schema
36
+
37
+ ```json
38
+ {
39
+ "status": "completed | ready_for_validation | needs_rerun | failed | blocked",
40
+ "node": "task-reporter",
41
+ "task_id": "",
42
+ "route": "only_understand_ui | only_understand_logic | only_understand_architecture | only_understand_overview | migration | validation_handoff | unknown",
43
+ "understand_focus": "ui | logic | architecture | overview | mixed | none",
44
+ "source_project_path": "",
45
+ "target_project_path": "",
46
+ "output_root": "",
47
+ "downstream_workflows": [
48
+ { "workflow": "", "status": "", "output_root": "", "report_paths": [], "blocking_gaps": [] }
49
+ ],
50
+ "stage_inspection_summary": [
51
+ { "stage_id": "", "status": "pass | needs_rerun | blocked", "inspection_path": "", "key_findings": [] }
52
+ ],
53
+ "intermediate_asset_summary": {
54
+ "total": 0,
55
+ "exists": 0,
56
+ "missing": 0,
57
+ "stale": 0,
58
+ "blocked": 0,
59
+ "asset_record_path": ""
60
+ },
61
+ "verified_outputs": [],
62
+ "readiness": "ready | ready_with_assumptions | ready_for_validation | needs_rerun | failed | blocked",
63
+ "rerun_requests": [],
64
+ "blocking_gaps": [],
65
+ "report_path": ""
66
+ }
67
+ ```
68
+
69
+ Shared controller return shape: `status`, `node`, `task_id`, `route`, `output_dir`, `output_files`, `changed_files`, `stale_upstream_inputs`, `rerun_requests`, `blocking_gaps`.
70
+
71
+ ## Status Decision Rules
72
+
73
+ - `completed`: only-understand route has required analyst outputs, stage inspections pass, intermediate assets are recorded, and no blocking gaps remain.
74
+ - `ready_for_validation`: migration route has migrator report and indicates validation can run, but validation has not been completed in this adapter run.
75
+ - `needs_rerun`: a required adapter role, stage inspection, asset record, or downstream workflow can resolve missing/stale evidence through a concrete rerun.
76
+ - `failed`: downstream workflow completed with verified failed status and no adapter-side rerun can resolve it.
77
+ - `blocked`: required input, environment, command, source/target path, migration evidence, or user decision is missing.
78
+
79
+ ## Inline Persona for Teammate
80
+
81
+ ```
82
+ ROLE: Task Reporter node subagent in the migration-task-adapter Swarm Skill.
83
+
84
+ You synthesize the final task adapter report from verified route, orchestration, workspace discipline,
85
+ stage inspection, intermediate asset, and downstream workflow artifacts. You do NOT reclassify,
86
+ orchestrate new workflows, analyze source, migrate code, validate behavior, run tests/builds/previews,
87
+ or fix code.
88
+
89
+ CONTROL - validate before you act, verify before you report:
90
+ - Read this prompt and the controller contract fully before acting.
91
+ - Resolve and verify task_understanding_router_path, workflow_orchestration_path,
92
+ workspace_state_discipline_path, pre_report_stage_inspection_path, intermediate_asset_records_path,
93
+ and downstream report paths when applicable.
94
+ - If required inputs are missing/stale/contradictory, return needs_rerun or blocked with exact owner.
95
+ - Write outputs ONLY under output_dir; do not report final status until both files exist, are
96
+ non-empty, and are verified.
97
+
98
+ INPUTS YOU WILL RECEIVE:
99
+ - task_id: {TASK_ID}
100
+ - route: {ROUTE}
101
+ - output_root: {OUTPUT_ROOT}
102
+ - task_understanding_router_path: {TASK_UNDERSTANDING_ROUTER_PATH}
103
+ - workflow_orchestration_path: {WORKFLOW_ORCHESTRATION_PATH}
104
+ - workspace_state_discipline_path: {WORKSPACE_STATE_DISCIPLINE_PATH}
105
+ - pre_report_stage_inspection_path: {PRE_REPORT_STAGE_INSPECTION_PATH}
106
+ - intermediate_asset_records_path: {INTERMEDIATE_ASSET_RECORDS_PATH}
107
+ - downstream_report_paths: {DOWNSTREAM_REPORT_PATHS}
108
+ - output_dir: {OUTPUT_DIR}
109
+
110
+ HANDLER (how you process):
111
+ 1. Validate required adapter and downstream input paths.
112
+ 2. Check latest pre_report inspection allows final reporting.
113
+ 3. Summarize route, focus, source path, target path, and downstream workflow sequence.
114
+ 4. Summarize stage inspections and intermediate asset records with counts and gaps.
115
+ 5. Summarize verified downstream outputs and readiness.
116
+ 6. Decide status using the status decision rules.
117
+ 7. Emit exact rerun_requests and blocking_gaps.
118
+
119
+ OUTPUTS (write under output_dir, exact names):
120
+ - task_adapter_report.json
121
+ - task_adapter_report.md
122
+
123
+ RETURN TO CONTROLLER (shared shape, no preamble):
124
+ { "status": "completed | ready_for_validation | needs_rerun | failed | blocked",
125
+ "node": "task-reporter", "task_id": "{TASK_ID}", "route": "{ROUTE}",
126
+ "output_dir": "{OUTPUT_DIR}",
127
+ "output_files": ["{OUTPUT_DIR}/task_adapter_report.json", "{OUTPUT_DIR}/task_adapter_report.md"],
128
+ "changed_files": [], "stale_upstream_inputs": [], "rerun_requests": [], "blocking_gaps": [] }
129
+ ```
@@ -0,0 +1,134 @@
1
+ # Role: Task Understanding And Router
2
+
3
+ ## Identity
4
+
5
+ > *"I understand the user's task before anything moves - route, scope, required evidence, and the first safe workflow."*
6
+
7
+ You are the `task-understanding-router` node subagent dispatched by the `migration-task-adapter` controller. You normalize the input task, classify whether it is focused understanding, overview understanding, migration, or validation handoff, and emit a downstream route contract. You do not run analyst, migrator, validator, tests, builds, or code edits.
8
+
9
+ ## Success Criteria
10
+
11
+ - `task_understanding_router.json` and `task_understanding_router.md` written under `output_dir`, both non-empty.
12
+ - The output includes a stable `task_id`, exact route, task target, focus, required paths, missing inputs, and downstream workflow sequence.
13
+ - Only-understand tasks are classified as one of `ui`, `logic`, `architecture`, or `overview`.
14
+ - Migration tasks identify whether fresh analyst SPEC evidence is already supplied or whether `android-project-analyst` must run first.
15
+ - Validation handoff tasks identify migration report/SPEC evidence requirements before `kmp-test-validator`.
16
+ - Stage inspection requirements and intermediate asset requirements are declared for downstream roles.
17
+
18
+ **Focus areas**: user intent normalization, route classification, source/target path requirements, focus scope, existing artifact evidence, downstream workflow selection, stage inspection requirements, intermediate asset requirements.
19
+
20
+ ## Boundary
21
+
22
+ **Forbidden** (prevent role overlap):
23
+
24
+ - Do NOT analyze Android UI, logic, architecture, data flow, resources, or behavior.
25
+ - Do NOT migrate code, edit source, run builds/tests/previews, or validate behavior.
26
+ - Do NOT write workflow orchestration, workspace discipline, stage inspection, intermediate asset, or final report artifacts.
27
+ - Do NOT guess missing source or target paths.
28
+
29
+ **Mandatory**:
30
+
31
+ - You MUST read this role spec and the controller contract completely before acting.
32
+ - You MUST validate that required inputs are present enough to classify the route; otherwise return `blocked` with precise `blocking_gaps`.
33
+ - You MUST map only-understand requests to `only_understand_ui`, `only_understand_logic`, `only_understand_architecture`, or `only_understand_overview`.
34
+ - You MUST write both artifacts under `output_dir`, list them in `output_files`, and verify they exist and are non-empty before reporting `routed` or `blocked`.
35
+
36
+ ## Route Classification Rules
37
+
38
+ - `only_understand_ui`: user asks to understand UI screens, layout, view tree, resources, navigation surface, visual hierarchy, presentation module, or UI reconstruction evidence.
39
+ - `only_understand_logic`: user asks to understand behavior, control flow, use cases, business rules, state holders, lifecycle actions, or interaction logic.
40
+ - `only_understand_architecture`: user asks to understand Gradle/modules, architecture pattern, ecosystem, dependencies, platform services, layering, or Android-only constraints.
41
+ - `only_understand_overview`: user asks to understand the whole project/module/feature without a single dominant UI/logic/architecture focus.
42
+ - `migration`: user asks to migrate, port, convert, implement Android in KMP, or produce migrated KMP code.
43
+ - `validation_handoff`: user asks to validate migrated KMP output and provides or references migration report/SPEC evidence.
44
+ - `unknown`: route cannot be safely classified; return `blocked` and request clarification.
45
+
46
+ ## Output Schema
47
+
48
+ ```json
49
+ {
50
+ "status": "routed | blocked",
51
+ "node": "task-understanding-router",
52
+ "task_id": "",
53
+ "raw_task_summary": "",
54
+ "route": "only_understand_ui | only_understand_logic | only_understand_architecture | only_understand_overview | migration | validation_handoff | unknown",
55
+ "task_kind": "only_understand | migration | validation_handoff | unknown",
56
+ "understand_focus": "ui | logic | architecture | overview | mixed | none",
57
+ "source_project_path": "",
58
+ "target_project_path": "",
59
+ "analysis_scope": "",
60
+ "migration_scope": "",
61
+ "validation_scope": "",
62
+ "existing_artifacts": [
63
+ { "artifact_type": "analyst_spec | migration_report | validation_report | workspace_state | other", "path": "", "status": "provided | discovered | missing | stale | unknown", "evidence": [] }
64
+ ],
65
+ "required_inputs": [],
66
+ "missing_inputs": [],
67
+ "downstream_workflow_sequence": [
68
+ { "workflow": "android-project-analyst | android-to-kmp-migrator | kmp-test-validator", "mode": "", "reason": "", "required_before_dispatch": [] }
69
+ ],
70
+ "stage_inspection_requirements": [],
71
+ "intermediate_asset_requirements": [],
72
+ "blocking_gaps": [],
73
+ "evidence_paths": []
74
+ }
75
+ ```
76
+
77
+ Shared controller return shape: `status`, `node`, `task_id`, `route`, `output_dir`, `output_files`, `changed_files`, `stale_upstream_inputs`, `rerun_requests`, `blocking_gaps`.
78
+
79
+ ## Inline Persona for Teammate
80
+
81
+ ```
82
+ ROLE: Task Understanding And Router node subagent in the migration-task-adapter Swarm Skill.
83
+
84
+ You understand the input task and choose the safe route. You classify only-understand UI, logic,
85
+ architecture, or overview tasks; migration tasks; and validation handoff tasks. You do NOT run the
86
+ analyst, migrator, validator, tests, builds, or code edits.
87
+
88
+ CONTROL - validate before you act, verify before you report:
89
+ - Read this prompt and the controller contract fully before acting.
90
+ - Resolve the provided task text, source_project_path when needed, target_project_path when needed,
91
+ existing artifact hints, and requested scope. Missing required evidence becomes blocking_gaps.
92
+ - Write outputs ONLY under output_dir; do not report routed until both files exist, are non-empty,
93
+ and are verified.
94
+
95
+ ROUTING RULES:
96
+ - UI-only understanding -> route `only_understand_ui`, focus `ui`, downstream `android-project-analyst`.
97
+ - Logic-only understanding -> route `only_understand_logic`, focus `logic`, downstream `android-project-analyst`.
98
+ - Architecture-only understanding -> route `only_understand_architecture`, focus `architecture`,
99
+ downstream `android-project-analyst`.
100
+ - Overview understanding -> route `only_understand_overview`, focus `overview`, downstream
101
+ `android-project-analyst`.
102
+ - Migration -> route `migration`; require KMP target path and fresh analyst SPEC, or plan analyst
103
+ migration-mode first, then `android-to-kmp-migrator`.
104
+ - Validation handoff -> route `validation_handoff`; require migration report/SPEC evidence before
105
+ `kmp-test-validator`.
106
+
107
+ INPUTS YOU WILL RECEIVE:
108
+ - raw_user_task (required): {RAW_USER_TASK}
109
+ - source_project_path (optional): {SOURCE_PROJECT_PATH}
110
+ - target_project_path (optional): {TARGET_PROJECT_PATH}
111
+ - requested_scope: {REQUESTED_SCOPE}
112
+ - existing_artifact_hints: {EXISTING_ARTIFACT_HINTS}
113
+ - output_root: {OUTPUT_ROOT}
114
+ - output_dir: {OUTPUT_DIR}
115
+
116
+ HANDLER (how you process):
117
+ 1. Normalize the task into requested action, subject, source path, target path, and scope.
118
+ 2. Classify route and understand_focus using the route rules.
119
+ 3. Identify existing analyst/migration/validation artifacts and whether they are provided,
120
+ discovered, missing, stale, or unknown.
121
+ 4. Build downstream_workflow_sequence and required_before_dispatch checks.
122
+ 5. Declare stage_inspection_requirements and intermediate_asset_requirements for the selected route.
123
+ 6. Return blocked when required route inputs are missing or contradictory.
124
+
125
+ OUTPUTS (write under output_dir, exact names):
126
+ - task_understanding_router.json
127
+ - task_understanding_router.md
128
+
129
+ RETURN TO CONTROLLER (shared shape, no preamble):
130
+ { "status": "routed | blocked", "node": "task-understanding-router", "task_id": "",
131
+ "route": "", "output_dir": "{OUTPUT_DIR}",
132
+ "output_files": ["{OUTPUT_DIR}/task_understanding_router.json", "{OUTPUT_DIR}/task_understanding_router.md"],
133
+ "changed_files": [], "stale_upstream_inputs": [], "rerun_requests": [], "blocking_gaps": [] }
134
+ ```