| name | analyzer-codefix-cli-workflow |
| description | Use when a coding agent needs to run MigrateToWinUI analyzer/code-fix CLI workflows, iterate safe rewrite preview/apply rounds, verify after each round, collect JSON/Markdown/SARIF reports, or coordinate Avalonia/WPF migration fixes without hand-assembling commands. |
Analyzer Code-Fix CLI Workflow
Use this skill when the task asks for analyzer results, code fixes, safe rewrite application, repeated migration rounds, or report collection. Prefer the wrapper script so artifacts and guardrails stay deterministic.
Primary Script
python3 plugins/migrate-to-winui-agent/scripts/analyzer_codefix_workflow.py <input> --source <avalonia|wpf> --target <winui3|uno|both> --mode preview --bundle
Artifacts are written under artifacts/migrate-to-winui-agent/analyzer-codefix/<input>/ unless --out or --output-dir is supplied. Each round contains:
migration-report.json
dashboard.md
plan.md
rewrite-preview.txt
preview-report.json
verify.log
- root
workflow-manifest.json
Modes
--mode report: run analyze, detail, plan, and verify.
--mode preview: also run convert --dry-run and write the safe rewrite preview.
--mode apply: run preview, apply safe rewrites, verify, and repeat up to --rounds.
Apply mode is intentionally gated:
python3 plugins/migrate-to-winui-agent/scripts/analyzer_codefix_workflow.py samples/AvaloniaInput --source avalonia --target both --mode apply --rules AW2U0101 AW2U0102 --rounds 2 --bundle
python3 plugins/migrate-to-winui-agent/scripts/analyzer_codefix_workflow.py samples/WpfInput --source wpf --target uno --mode apply --rules WP2U0101 --rounds 2 --bundle
Only use --all-safe after reviewing the current preview. Do not use --source auto for apply unless the user explicitly accepts --allow-auto-apply.
Workflow
-
Build the toolchain when needed:
python3 plugins/migrate-to-winui-agent/scripts/bootstrap_build.py --skip-restore
-
Run a preview round with an explicit source framework.
-
Inspect rewrite-preview.txt, dashboard.md, and manual-review blockers before selecting rules.
-
Apply only selected safe rules, then let the wrapper verify and rerun reports.
-
Bundle reports for delivery:
python3 plugins/migrate-to-winui-agent/scripts/report_bundle.py --source-dir artifacts/migrate-to-winui-agent/analyzer-codefix/<input> --name <input>-migration
Guardrails
- Treat Roslyn analyzer/code-fix coverage and CLI rewrite coverage as overlapping but not identical. Manual-review diagnostics are not fixable.
- Do not apply from stale previews. Rerun preview after any file change.
- Do not hide
Review or Manual findings after safe fixes; include residual blockers in the final summary.
- For Avalonia use
AW2U rules; for WPF use WP2U rules. Do not mix prefixes in a single source-pinned apply.
- For broad migrations, prefer
compose or staged target projects after preview/apply rounds.
Focused Validation
dotnet test tests/MigrateToWinUI.Tests/MigrateToWinUI.Tests.csproj --filter "FullyQualifiedName~AnalyzerTests|FullyQualifiedName~AnalyzerCodeFixTests"
python3 plugins/migrate-to-winui-agent/scripts/analyzer_codefix_workflow.py samples/AvaloniaInput --source avalonia --target both --mode preview
python3 plugins/migrate-to-winui-agent/scripts/analyzer_codefix_workflow.py samples/WpfInput --source wpf --target both --mode preview