Reviews and safely refactors existing WinForms (.NET Framework) code without rewriting. Applies a safety checklist for cross-thread crashes, UI freezes, event-handler leaks, and DataGridView/BindingSource issues.
Ships in .NET Pack (legacy .NET Framework + Migration Pack to .NET 10). Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Keep an existing WinForms app alive and healthy with small, safe, behavior-preserving changes. This is maintenance, not migration: no WPF/MAUI rewrite, no restructuring the whole form. Fix the things that actually cause crashes, hangs, and leaks in long-lived WinForms apps, and leave the rest alone.
You don't need pasted snippets. Work from whatever target the user gives:
MainForm.cs (grab its .Designer.cs too if control setup matters)Forms/ or UI/ directory.csproj / .sln or the repo rootgit clone --depth 1 <url> /tmp/repo && cd /tmp/repoFind the WinForms code yourself with Glob/Grep/Bash instead of asking for a paste:
grep -rl "System.Windows.Forms\|: Form\|InitializeComponent" --include=*.cs <target> | grep -vi "/obj/\|/bin/"
grep -rn "new Thread\|InvokeRequired\|async void\|ShowDialog\|+= " --include=*.cs <target>
Prioritize handlers with cross-thread access, blocking calls, or leaks, and tell the user which forms you scanned.
The user maintains a WinForms app on .NET Framework and wants a specific handler/form reviewed or fixed - a cross-thread crash, a UI that freezes, a leak, a flaky grid. They paste a Form/UserControl or describe the symptom. If you don't have the code, ask for the handler and the .Designer.cs if control setup is relevant.
Do not propose rewriting to another UI stack or restructuring the form. Every change must be droppable into the existing form with minimal diff. If a real fix requires bigger surgery, describe it and let the user decide - default to the smallest safe change.
Apply every item. For each finding: problem -> impact -> minimal fix.
Touching a control from a non-UI thread throws InvalidOperationException ("Cross-thread operation not valid").
Thread, Task.Run, BackgroundWorker.DoWork, timer callback, or async continuation that sets .Text, .DataSource, .Items, .Enabled, etc. on a control.async/await - do the work with await Task.Run(...) and update the UI after the await, which resumes on the UI thread via the sync context. No Invoke needed.if (control.InvokeRequired) control.BeginInvoke(() => control.Text = value); else control.Text = value;. Prefer BeginInvoke (async, won't deadlock) over Invoke (sync, can deadlock if the UI thread is waiting on your worker).Long work on the UI thread makes the window "Not Responding".
Thread.Sleep, big loops directly inside a Click/Load handler; .Result / .Wait() on a Task in a UI handler (also a deadlock risk with the sync context).async and await the work off-thread (await Task.Run(...) for CPU-bound; real async APIs for I/O). Disable the triggering control and show busy state while it runs; re-enable in a finally. Never .Result/.Wait() on the UI thread.new Form() / new SomeDialog() shown without using; Font, Brush, Pen, Bitmap, Graphics created in OnPaint/handlers without disposal; controls added/removed dynamically but never disposed.using var dlg = new EditForm(); dlg.ShowDialog(this);. Dispose GDI objects (Font/Brush/Pen/Bitmap) with using, or cache long-lived ones as fields and dispose in the form's Dispose. Note: controls added to Controls are disposed by the parent - ones you remove and drop are not.Long-lived publishers keep short-lived subscribers alive via += that's never -='d.
FormClosed/Dispose for every += to an external/long-lived source. (In-form Designer wiring to the form's own controls is fine - it dies with the form.)DataSource on every refresh causing flicker/reset; editing the grid's backing list directly instead of through a BindingSource; heavy formatting per cell.BindingSource; mutate the list via the BindingSource so the grid updates; for bulk changes SuspendLayout()/ResumeLayout() or set DataSource = null then rebind once. Keep DataTable/DataSet binding if that's what's already load-bearing - don't swap the data model.async void handlers that can throw - an unobserved exception crashes the process.async void is acceptable only for event handlers, and only if the whole body is wrapped in try/catch that surfaces errors to the user/log. Everywhere else, async Task.*.Designer.cs.private async void btnLoad_Click(object sender, EventArgs e)
{
btnLoad.Enabled = false; // guard against double-click / re-entry
UseWaitCursor = true;
try
{
// off the UI thread
List<OrderDto> orders = await _service.GetOrdersAsync(_customerId, CancellationToken.None);
// back on the UI thread automatically after await - safe to touch controls
ordersBindingSource.DataSource = orders;
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, "Load failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
// and log it - async void must not let exceptions escape
}
finally
{
UseWaitCursor = false;
btnLoad.Enabled = true;
}
}
## Summary
<one paragraph: crash/hang/leak headline findings>
## Findings
1. [Cross-thread] <handler/line> - <problem> -> <minimal fix>
2. [UI-thread block] ... -> ...
3. [Leak] ... -> ...
## Patched code
<the minimally changed handler(s), ready to paste>
## Verify on your side
<Designer.cs touch points, threading assumptions, anything needing a run>
InvokeRequired boilerplate; use BeginInvoke when you must marshal..Result on the UI thread. That's freezes and deadlocks.+= to a long-lived source needs a -=. That's your slow leak.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
winforms, legacy-maintenance, ui-debugging, cross-thread-fix
/dotnet-pack:winforms-maintainerfrom .NET Pack (legacy .NET Framework + Migration Pack to .NET 10)
npx claudepluginhub stefanthecode/ai-for-developers --plugin dotnet-pack12 skills in this plugin
/adonet-data-access-auditor(.NET) Audit and fix classic ADO.NET data-access code (SqlConnection / SqlCommand / SqlDataReader / DataSet) on .NET Framework. Use this skill whenever the user shares raw ADO.NET code, a DAL / repository built on SqlCommand, stored-proc calls, string-concatenated SQL, or mentions SQL injection, parameterized queries, connection leaks, "using / Dispose", reading the same column multiple times, transactions, or "why does my old data layer leak connections / is it safe". Always use this skill for classic ADO.NET review instead of answering from memory; it applies a fixed security + correctness + performance checklist and rewrites the code./aspnet-mvc-webapi-migrator(.NET) Migrate ASP.NET MVC 5 and Web API 2 code to ASP.NET Core on .NET 10, one controller at a time - actions, routes, filters, model binding, IHttpActionResult, child actions, OutputCache, bundling - plus the app plumbing around them - Global.asax, IHttpModule, IHttpHandler/.ashx, HttpContext.Current, Newtonsoft.Json formatters and XML content negotiation. Use this skill whenever the user wants to "migrate this controller", "Web API 2 to ASP.NET Core", "MVC 5 to .NET 10", "replace Global.asax", "convert this HTTP module to middleware", "port this .ashx handler", or is moving endpoints one by one in a strangler-fig migration. Always use this skill for MVC/Web API migrations instead of answering from memory; it keeps routes, status codes and payloads identical and proves it with parity tests./ef6-to-efcore-migrator(.NET) Move an Entity Framework 6 data layer to .NET 10 in two safe steps - first EF 6.5 on .NET 10 as a bridge (same model, same queries, no rewrite), then EF Core one DbContext at a time behind query parity tests. Covers DbModelBuilder fluent config, EDMX models, lazy loading, database initializers and Seed, DbFunctions/SqlFunctions, string Include, cascade-delete and orphan differences, and a baseline migration for an existing database. Use this skill whenever the user mentions EF6, EntityFramework 6, "EF6 to EF Core", EDMX, DbModelBuilder, "EF6 on .NET 8/10", lazy loading differences, or is moving a data layer in a .NET Framework migration. Always use this skill for EF6 migrations instead of answering from memory./legacy-config-auth-migrator(.NET) Migrate the cross-cutting parts of an ASP.NET Framework app to .NET 10 - web.config and transforms to appsettings + Options, machineKey to Data Protection, Forms authentication / Membership / OWIN cookies to ASP.NET Core cookie auth or Identity (with remote authentication while both apps run), <location> authorization to policies, session and Application state, BinaryFormatter, customErrors and Application_Error. Use this skill whenever the user asks about "web.config in .NET 10", "ConfigurationManager replacement", "machineKey", "Forms authentication to ASP.NET Core", "Membership to Identity", "share login between old and new app", "session in ASP.NET Core", "replace BinaryFormatter", or plans how auth and session work during a migration. Always use this skill for these cross-cutting pieces instead of answering from memory; they are where migrations break for users./legacy-package-migrator(.NET) Migrate a .NET Framework solution from packages.config to PackageReference and Central Package Management (Directory.Packages.props). Use this skill whenever the user mentions packages.config, PackageReference, "migrate packages", Directory.Packages.props, Central Package Management / CPM, transitive package versions, NuGet version drift across projects, "different projects use different versions of the same package", or wants to unify NuGet versions across a multi-project solution (including third-party/vendor extension projects). Always use this skill for these requests; it produces a staged, per-project migration plan plus the actual Directory.Packages.props and .csproj edits, not a generic explanation./migration-assessment-report(.NET) Assess a .NET Framework solution (WebForms, MVC 5, Web API 2, WCF, EF6, class libraries) for a move to .NET 10 and produce a self-contained HTML report - architecture diagrams, a blocker scan, a target per WebForms page (Razor Pages, Blazor or MVC), effort in person-days with and without AI, and a clear split of what an AI agent can do versus what needs a human. Use this skill whenever the user asks "how hard is it to move this to .NET 10", "assess this legacy solution", "give me a migration estimate", "what would it take to modernize this", "should we migrate this WebForms app", or wants a migration report for a manager or a client. Always use this skill for migration assessments instead of answering from memory; it runs a deterministic scanner, reviews the result and renders the report.Other plugins' skills for the same job