winforms
- Repo stars 423
- Author updated Live
- Author repo dotnet-skills
- Domain
- Design
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @managedcode · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Windows
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: winforms
description: Build, maintain, or modernize Windows Forms applications with practical guidance on designer-dri…
category: design
runtime: no special runtime
---
# winforms output preview
## PART A: Task fit
- Use case: Build, maintain, or modernize Windows Forms applications with practical guidance on designer-driven UI, event handling, data binding, MVP separation, and migration to modern .NET. USE FOR: working on Windows Forms UI, event-driven workflows, or classic LOB applications; migrating WinForms from .NET Framework to modern .NET; cleaning up oversized form code. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Trigger On / Workflow / Key Decisions” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Build, maintain, or modernize Windows Forms applications with practical guidance on designer-driven UI, event handling, data binding, MVP separation, and migration to modern .NET. USE FOR: working on Windows Forms UI, event-driven workflows, or classic LOB applications; migrating WinForms from .NET Framework to modern .NET; cleaning up oversized form code. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.”.
- **02** When the source has headings, the agent prioritizes “Trigger On / Workflow / Key Decisions” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “Trigger On / Workflow / Key Decisions”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: winforms
description: Build, maintain, or modernize Windows Forms applications with practical guidance on designer-dri…
category: design
source: managedcode/dotnet-skills
---
# winforms
## When to use
- Build, maintain, or modernize Windows Forms applications with practical guidance on designer-driven UI, event handling…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Trigger On / Workflow / Key Decisions” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "winforms" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Trigger On / Workflow / Key Decisions
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Windows Forms
Trigger On
- working on Windows Forms UI, event-driven workflows, or classic LOB applications
- migrating WinForms from .NET Framework to modern .NET
- cleaning up oversized form code or designer coupling
- implementing data binding, validation, or control customization
Workflow
- Respect designer boundaries — never edit
.Designer.csdirectly; changes are lost on regeneration. - Separate business logic from forms — use MVP (Model-View-Presenter) pattern. Forms orchestrate UI; presenters contain logic; services handle data access.
// View interface — forms implement this public interface ICustomerView { string CustomerName { get; set; } event EventHandler SaveRequested; void ShowError(string message); } // Presenter — testable without UI public class CustomerPresenter { private readonly ICustomerView _view; private readonly ICustomerService _service; public CustomerPresenter(ICustomerView view, ICustomerService service) { _view = view; _service = service; _view.SaveRequested += async (s, e) => { try { await _service.SaveAsync(_view.CustomerName); } catch (Exception ex) { _view.ShowError(ex.Message); } }; } } - Use DI from Program.cs (.NET 6+):
var services = new ServiceCollection(); services.AddSingleton<ICustomerService, CustomerService>(); services.AddTransient<MainForm>(); using var sp = services.BuildServiceProvider(); Application.Run(sp.GetRequiredService<MainForm>()); - Use data binding via
BindingSourceandINotifyPropertyChangedinstead of manual control population. See references/patterns.md for complete binding patterns. - Use async/await for I/O operations — disable controls during loading, use
Progress<T>for progress reporting. Never block the UI thread. - Validate with
ErrorProviderand theValidatingevent. CallValidateChildren()before save operations. - Modernize incrementally — prefer better structure over big-bang rewrites. Use .NET 8+ features (button commands, stock icons) when available.
flowchart LR A["Form event"] --> B["Presenter handles logic"] B --> C["Service layer / data access"] C --> D["Update view via interface"] D --> E["Validate and display results"]
Key Decisions
| Decision | Guidance |
|---|---|
| MVP vs MVVM | Prefer MVP for WinForms — simpler with event-driven model |
| BindingSource vs manual | Always prefer BindingSource for list/detail binding |
| Sync vs async I/O | Always async — use async void only for event handlers |
| Custom controls | Extract reusable UserControl when form grows beyond ~300 lines |
| .NET Framework → .NET | Use the official migration guide; validate designer compatibility first |
Deliver
- less brittle form code with clear UI/logic separation
- MVP pattern with testable presenters
- pragmatic modernization guidance for WinForms-heavy apps
- data binding and validation patterns that reduce manual wiring
Validate
- designer files stay stable and are not hand-edited
- forms are not acting as the application service layer
- async operations do not block the UI thread
- validation is implemented consistently with ErrorProvider
- Windows-only runtime behavior is tested on target
References
- references/patterns.md - WinForms architectural patterns (MVP, MVVM, Passive View), data binding, validation, form communication, threading, DI setup, and .NET 8+ features
- references/migration.md - step-by-step migration from .NET Framework to modern .NET, common issues, deployment options, and gradual migration strategies
Decide Fit First
Design Intent
How To Use It
Boundaries And Review