microsoft/managing-winforms-designer-code
> Governs WinForms Designer-generated code structure and InitializeComponent patterns. Use when writing or reviewing .Designer.cs files, fixing "Designer file cannot be loaded" errors, resolving Designer round-trip issues, validating control instantiation in InitializeComponent, implementing proper Dispose(bool disposing) pattern with components.Dispose(), working with IContainer and components field, troubleshooting Designer serialization failures, organizing Designer code vs application logic separation, or understanding what code belongs in InitializeComponent vs elsewhere. Also triggers for "InitializeComponent", ".Designer.cs file", "Designer cannot load", "components.Dispose", "IContainer field", "Designer compatibility", "Designer round-trip", and "Form Designer errors".
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill managing-winforms-designer-code
The WinForms Designer generates serialization code, not regular C# code. Understanding and following these rules is CRITICAL for Designer compatibility. All WinForms Forms and UserControls should be Designer-compatible — these rules are not optional guidance but mandatory constraints for any code that the Designer must be able to round-trip (read, modify, and re-serialize).
Use this skill when:
.Designer.cs or .Designer.vb filesmanaging-winforms-high-dpi-layout so both Designer serialization and human/layout/DPI quality are checked.IMPORTANT: Other skills (layout, rendering, data binding, MVVM) describe *what* to build. This skill defines *how* the Designer code-behind file must be structured. When those skills show control configuration, the actual property assignments belong in InitializeComponent following the rules below.
Read Detailed guide for comprehensive patterns, examples, and troubleshooting.
Take microsoft/managing-winforms-designer-code from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.