aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging,…
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;
Claude Code
$ npx -y skills add managedcode/dotnet-skills --skill winforms --agent claude-code
Codex
$ npx skills add managedcode/dotnet-skills --skill winforms -a codex -y
Cursor
$ npx skills add managedcode/dotnet-skills --skill winforms -a cursor -y
Gemini CLI
$ npx skills add managedcode/dotnet-skills --skill winforms -a gemini-cli -y
GitHub Copilot
$ npx skills add managedcode/dotnet-skills --skill winforms -a github-copilot -y
OpenCode
$ npx skills add managedcode/dotnet-skills --skill winforms -a opencode -y
Windsurf
$ npx skills add managedcode/dotnet-skills --skill winforms -a windsurf -y
name: winforms description: "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." compatibility: "Requires a Windows Forms project on .NET or .NET Framework."
1. **Respect designer boundaries** — never edit `.Designer.cs` directly; changes are lost on regeneration. 2. **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); }
};
}
}3. **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>());
4. **Use data binding** via `BindingSource` and `INotifyPropertyChanged` instead of manual control population. See [references/patterns.md](references/patterns.md) for complete binding patterns. 5. **Use async/await** for I/O operations — disable controls during loading, use `Progress<T>` for progress reporting. Never block the UI thread. 6. **Validate with `ErrorProvider`** and the `Validating` event. Call `ValidateChildren()` before save operations. 7. **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"]
| 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 |
Stop explaining .NET to your AI. Start building. We've all been there: asking Claude to use Entity Framework, only to get EF6 patterns in a .NET 8 project. Explaining to Copilot that Blazor Server and Blazor WebAssembly aren't the same thing.
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging,…
Build, upgrade, and operate Aspire 13.5.x C# or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults,…
Build and debug Avalonia 11/12 .NET applications with XAML, compiled bindings, MVVM, custom controls, desktop lifetimes, and…
Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable…
Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design,…
Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.