跳到正文
cccskills
免费在 GitHub 公开

wfa-avalonia-ui

Phase D of a WinForms-to-Avalonia migration: build the Avalonia UI shell with composition, MVVM state and commands, responsive XAML, accessibility, localization boundaries, and behavior-focused unit/Headless tests. Use only when an explicit migration is ready to port Forms or when the orchestrator routes here. Prefer this over control-by-control ports.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(4)

  • SKILL.md4.4 KB
  • references/control-mapping.md1.2 KB
  • references/modernization.md1.2 KB
  • references/mvvm-patterns.md1.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Phase D — Avalonia UI shell

Present Phase B/C capabilities through a bindable Avalonia shell. Code-behind is limited to control-only gestures and host interaction adapters. Business flow lives in ViewModels/workflows.

Read MVVM patterns for responsibility boundaries, control mapping only while translating legacy interaction semantics, and modernization for the completion checklist.

Preconditions

  • Core APIs and platform abstractions available (fakes OK)
  • Phase A command catalog for the main window

Workflow

1. Host and composition

  • Avalonia App + entry
  • Composition root builds services, ViewModels, main window
  • Constructor injection over new inside Views

2. Commands and state

  • Map the command catalog to ICommand / async commands
  • INotifyPropertyChanged (or small base / toolkit)
  • Eliminate field-by-field Refresh() as the primary sync

3. Layout and accessibility

Derive workflow zones from Phase A contracts. Use responsive panels, stable constraints, and appropriate scrolling; avoid absolute positioning for normal controls. Preserve accessible names, focus order, keyboard navigation, and visible focus.

4. Bindings

  • Use compiled bindings and x:DataType; document any deliberate exception
  • Stable automation ids and accessible names for interaction surfaces

5. Collections and editing, when present

  • Observable item projections when the product displays collections
  • Edits route through application commands and reproject derived state
  • Context actions bind to the same command semantics as other entry points

6. Shortcuts

  • Prefer declared key bindings
  • Do not intercept editing/navigation gestures from the focused control
  • Document intentional gesture changes

7. Secondary surfaces, when present

  • Dedicated View + ViewModel per cohesive surface
  • Window service shows/focuses; does not build large control trees

8. Localization

  • External resources for UI strings
  • Presentation-layer localization manager
  • Core free of UI culture for algorithms

9. State decomposition, when complexity grows

If the main VM bloats early, introduce a typed state aggregate and workflow collaborators only when evidence justifies them; full decomposition patterns are Phase G.

10. Tests

ProjectContent
Avalonia unitVM/commands/services — no Headless attributes
Avalonia Headlessseparate project; behavior-focused UI

Early modernization (do not defer forever)

  1. Composition root
  2. Observable VM; kill pervasive Refresh
  3. Real command surfaces (no hidden shims)
  4. Awaited async commands
  5. Injected boundary adapters discovered in Phase B/C
  6. Secondary surfaces as XAML+VM when present

Corrections seen in practice

  • A state change or option must have the same semantics across every affected view and command.
  • Layout is part of behavior: verify the supported default, wide, narrow, scaling, and localization states.
  • Group controls by product task rather than by implementation type.
  • Numeric inputs need explicit empty, range, increment, and validation semantics from the contract.
  • Window gestures must not steal input from the focused editor/control.
  • Do not use source-text XAML tests or accidentally start the desktop app from unit tests.
  • Reuse application services instead of reimplementing rules in individual windows.

Verification layers

  1. ViewModel tests
  2. Headless interactions, focus, accessibility, localization, and responsive-state behavior
  3. Executable smoke on every supported target environment

Deliverables

  • App runs with composition root
  • Phase A workflows are reachable through commands and bindings
  • Bindings-driven UI
  • Accessibility and responsive layout contracts verified
  • Unit + Headless coverage for critical paths

Handoff

  • Parity/cutover → wfa-parity-verify
  • Product evolution → wfa-post-port-evolve
  • God VM / security / isolation → wfa-harden-decompose

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.

中文简介正在准备中。当前显示原文说明。

tautcony/ChapterTool1132026年10月14日 更新

Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.

中文简介正在准备中。当前显示原文说明。

tautcony/ChapterTool1132026年10月14日 更新

Archive multiple completed changes at once. Use when archiving several parallel changes.

中文简介正在准备中。当前显示原文说明。

tautcony/ChapterTool1132026年10月14日 更新

Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.

中文简介正在准备中。当前显示原文说明。

tautcony/ChapterTool1132026年10月14日 更新

Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.

中文简介正在准备中。当前显示原文说明。

tautcony/ChapterTool1132026年10月14日 更新

Fast-forward through OpenSpec artifact creation. Use when the user wants to quickly create all artifacts needed for implementation without stepping through each one individually.

中文简介正在准备中。当前显示原文说明。

tautcony/ChapterTool1132026年10月14日 更新

查看 tautcony 的全部技能

报告此技能的问题