| name | winforms-to-avalonia |
| description | Orchestrate a phased WinForms-to-Avalonia migration: behavior contracts, UI-independent application logic, platform adapters, MVVM shell, parity/cutover, evolution, and hardening. Use when the request explicitly involves moving a WinForms or .NET Framework desktop UI to Avalonia, or continuing that migration. Do not trigger for unrelated migrations, rewrites, ViewModel refactors, settings work, or command-line work without WinForms-to-Avalonia context. Load this orchestrator before one matching phase skill.
|
WinForms -> Avalonia (generic orchestrator)
Rewrite for behavior contracts and layered architecture, not control-for-control ports.
WinForms handlers and Designer state are evidence of what users can do; Avalonia Views only
present ViewModel state.
Suite (A–G)
| Phase | Skill | Generic outcome |
|---|
| A | wfa-capture-contracts | Inventory, modules, command contracts, coverage matrix, capability split |
| B | wfa-extract-domain | UI-independent application core, boundary ports, TDD |
| C | wfa-platform-services | Platform and infrastructure adapters |
| D | wfa-avalonia-ui | Composition root, MVVM, bindings, secondary tools |
| E | wfa-parity-verify | Diff matrix, acceptance, packaging, trunk/cutover |
| F | wfa-post-port-evolve | Product evolution without reintroducing legacy coupling |
| G | wfa-harden-decompose | State decomposition, resilience, security review, test isolation |
Shared references (all product-agnostic):
references/lifecycle-full.md — A–G journey and gates
references/phase-roadmap.md — critical path and parallelism
references/architecture-blueprint.md — layering and composition
references/anti-patterns.md — port and long-term smells
references/reusable-learnings.md — distilled rules of thumb
references/execution-corrections.md — how humans correct agents mid-migration (read this)
Route work
- Locate the legacy tree, target runtime, repository guidance, and existing migration artifacts.
- Inventory actual product capabilities before proposing abstractions or project boundaries.
- Choose a phase from the evidence below.
- Load one phase skill and only the references needed for that work.
- Use the repository's specification workflow per capability slice when applicable.
| Situation | Phase |
|---|
| No contracts / file coverage map | A |
| Business rules or use-case orchestration still inside Forms/helpers | B |
| Filesystem, process, dialogs, settings, or OS APIs leak into the application core | C |
| UI event-driven / manual control refresh | D |
| Comparing old vs new / delete legacy? | E |
| Avalonia is the trunk; evolving discovered product capabilities | F |
| Oversized ViewModels, stale async results, security debt, mixed Headless host | G |
Rules that always apply
- Contracts before controls - command catalog, state transitions, external effects, and acceptance evidence.
- Discover before abstracting - never assume a feature, integration, or storage mechanism exists.
- Layering - the application core has no Avalonia/WinForms types; adapters own environment-specific effects.
- Diagnostics over UI prompts below the presentation layer.
- State over controls - bindings and application state are authoritative; do not scrape controls before commands.
- Consistent behavior - one rule or option must produce the same semantics at every entry point and consumer.
- Security before release - bound untrusted input, external resource access, and dynamic execution in the phase that introduces them.
- Durable writes - version, validate, and atomically replace persisted state; preserve recoverable data on failure.
- No source-text tests that grep implementation files; no file-existence-only unit tests.
- Headless UI tests run in a separate project/process from non-UI unit tests.
- Sequential tests when multiple projects share build outputs.
- Legacy delete only after parity evidence and explicit decisions for every remaining gap.
- Half-extractions are bugs - extracted types must own behavior or be removed.
- Analyze then patch - establish the cause before changing architecture or adding fallbacks.
- Clean cuts over dual paths when the target design has been chosen.
- Firm specification decisions - do not leave incompatible designs simultaneously optional.
- Tasks need evidence - code, behavior tests, and command output before marking done.
Handoff after each phase
- Artifacts and paths
- Specification/change status if used
- Gaps and decisions
- Next phase skill
- Tests run
For “do the whole migration,” still checkpoint after A and after B+C before large UI work.