[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CV2A4V3R2YA5T57NXAC2GA":3,"skill-same:01M7CV2A4V3R2YA5T57NXAC2GA":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M7CV2A4V3R2YA5T57NXAC2GA","collect-user-input",null,"Build forms, validate data, and react to user input in Blazor. USE FOR adding forms, search boxes, filter panels, inline editing, data-entry UI, file uploads, validation (annotations or custom), handling form submissions, and binding input controls. Covers EditForm, built-in input components, DataAnnotationsValidator, custom validation, SSR form patterns (SupplyParameterFromForm, FormName, AntiforgeryToken, Enhance), and @bind for simple interactive controls. DO NOT USE for project scaffolding (see create-blazor-project) or prerendering issues (see support-prerendering).","deadmade\u002Fdead-agent-skills","deadmade","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F130925709?v=4","01M7CTQ65AGYR4J9K9TX0YR9V3","01M7CTQ66B4VMJFEDZP4EKKE6K",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fcollect-user-input\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nlicense: MIT\nname: collect-user-input\ndescription: Build forms, validate data, and react to user input in Blazor. USE FOR adding forms, search boxes, filter panels, inline editing, data-entry UI, file uploads, validation (annotations or custom), handling form submissions, and binding input controls. Covers EditForm, built-in input components, DataAnnotationsValidator, custom validation, SSR form patterns (SupplyParameterFromForm, FormName, AntiforgeryToken, Enhance), and @bind for simple interactive controls. DO NOT USE for project scaffolding (see create-blazor-project) or prerendering issues (see support-prerendering).\n---\n\n# Collect User Input\n\n## Step 1 — Read the Project's AGENTS.md\n\nCheck `AGENTS.md` for **Interactivity Mode** and **Interactivity Scope**. This determines which form patterns apply:\n\n| Mode | Form mechanism |\n|------|---------------|\n| None (Static SSR) | `EditForm` with `FormName` + `[SupplyParameterFromForm]`. No `@bind`, no `@onchange`. |\n| Server | `EditForm` with `@bind-Value`. Full interactivity — real-time validation, dynamic UI. |\n| WebAssembly | Same as Server, but validators needing server data must call APIs. |\n| Auto | Same as WebAssembly — code must work in both browser and server. |\n\n| Scope | Impact |\n|-------|--------|\n| Global | All forms are interactive. `FormName` only needed when explicitly opting a page to static SSR. |\n| Per-page | Forms in static pages use `FormName` + `[SupplyParameterFromForm]`. Forms in `@rendermode` pages use `@bind-Value`. |\n\n## EditForm Setup\n\n`EditForm` requires **either** `Model` or `EditContext` — never both.\n\n### Model-based (default)\n\n```razor\n\u003CEditForm Model=\"Employee\" OnValidSubmit=\"HandleSubmit\" FormName=\"employee\">\n    \u003CDataAnnotationsValidator \u002F>\n    \u003CValidationSummary \u002F>\n\n    \u003Clabel>\n        Name: \u003CInputText @bind-Value=\"Employee!.Name\" \u002F>\n        \u003CValidationMessage For=\"() => Employee!.Name\" \u002F>\n    \u003C\u002Flabel>\n\n    \u003Cbutton type=\"submit\">Save\u003C\u002Fbutton>\n\u003C\u002FEditForm>\n\n@code {\n    [SupplyParameterFromForm]\n    private EmployeeModel? Employee { get; set; }\n\n    protected override void OnInitialized() => Employee ??= new();\n\n    private async Task HandleSubmit()\n    {\n        \u002F\u002F Save Employee\n    }\n}\n```\n\nThis single pattern works in **both** SSR and interactive modes:\n- In SSR: `FormName` identifies the form, `[SupplyParameterFromForm]` binds POST data, `??=` initializes on GET.\n- In interactive: `@bind-Value` provides two-way binding, `[SupplyParameterFromForm]` is ignored, `FormName` is harmless.\n\n### EditContext-based (advanced)\n\nUse when you need programmatic field tracking, dynamic validation rules, or manual `EditContext.Validate()` calls:\n\n```csharp\nprivate EditContext? editContext;\nprivate EmployeeModel model = new();\n\nprotected override void OnInitialized()\n{\n    editContext = new EditContext(model);\n}\n```\n\n```razor\n\u003CEditForm EditContext=\"editContext\" OnValidSubmit=\"HandleSubmit\" FormName=\"employee\">\n```\n\n## Submit Handlers\n\n| Handler | Fires when | Use when |\n|---------|-----------|----------|\n| `OnValidSubmit` | Validation passes | Standard forms with `DataAnnotationsValidator` |\n| `OnInvalidSubmit` | Validation fails | Need custom handling for invalid state |\n| `OnSubmit` | Always — validation is manual | Using `EditContext.Validate()` yourself |\n\n`OnSubmit` cannot combine with `OnValidSubmit`\u002F`OnInvalidSubmit`.\n\n## Built-in Input Components\n\n| Component | Binds to | Notes |\n|-----------|----------|-------|\n| `InputText` | `string` | Renders `\u003Cinput type=\"text\">` |\n| `InputTextArea` | `string` | Renders `\u003Ctextarea>` |\n| `InputNumber\u003CT>` | `int`, `double`, `decimal` | Renders `\u003Cinput type=\"number\">` |\n| `InputDate\u003CT>` | `DateTime`, `DateOnly`, `DateTimeOffset` | Renders `\u003Cinput type=\"date\">` |\n| `InputCheckbox` | `bool` | Renders `\u003Cinput type=\"checkbox\">` |\n| `InputSelect\u003CT>` | `string`, enums, numeric types | Renders `\u003Cselect>` |\n| `InputRadioGroup\u003CT>` | `string`, enums, numeric types | Wraps `InputRadio\u003CT>` children |\n| `InputFile` | `IBrowserFile` | File upload — interactive modes only |\n\nAll input components use `@bind-Value` for binding. Always wrap text in a `\u003Clabel>` or use `id`\u002F`for` attributes for accessibility.\n\n### InputSelect with enum values\n\n```razor\n\u003CInputSelect @bind-Value=\"Model!.Status\">\n    \u003Coption value=\"\">-- Select --\u003C\u002Foption>\n    @foreach (var value in Enum.GetValues\u003COrderStatus>())\n    {\n        \u003Coption value=\"@value\">@value\u003C\u002Foption>\n    }\n\u003C\u002FInputSelect>\n```\n\n### InputRadioGroup\n\n```razor\n\u003CInputRadioGroup @bind-Value=\"Model!.Priority\">\n    @foreach (var p in Enum.GetValues\u003CPriority>())\n    {\n        \u003Clabel>\n            \u003CInputRadio Value=\"p\" \u002F> @p\n        \u003C\u002Flabel>\n    }\n\u003C\u002FInputRadioGroup>\n```\n\n## Validation\n\n### Data annotations\n\nDefine validation rules on the model:\n\n```csharp\npublic class EmployeeModel\n{\n    [Required, StringLength(100)]\n    public string? Name { get; set; }\n\n    [Required, EmailAddress]\n    public string? Email { get; set; }\n\n    [Range(18, 99)]\n    public int Age { get; set; }\n\n    [Required]\n    public string? Department { get; set; }\n}\n```\n\nAdd `\u003CDataAnnotationsValidator \u002F>` inside `EditForm` — without it, annotation attributes are silently ignored.\n\nDisplay errors with:\n- `\u003CValidationSummary \u002F>` — all errors in a list\n- `\u003CValidationMessage For=\"() => Model!.FieldName\" \u002F>` — per-field inline errors\n\n### Custom validator component\n\nFor server-round-trip validation (uniqueness checks, business rules):\n\n```csharp\npublic class CustomValidator : ComponentBase\n{\n    [CascadingParameter]\n    private EditContext? EditContext { get; set; }\n\n    private ValidationMessageStore? messageStore;\n\n    protected override void OnInitialized()\n    {\n        messageStore = new ValidationMessageStore(EditContext!);\n        EditContext!.OnValidationRequested += (s, e) => messageStore.Clear();\n        EditContext!.OnFieldChanged += (s, e) => messageStore.Clear(e.FieldIdentifier);\n    }\n\n    public void DisplayErrors(Dictionary\u003Cstring, List\u003Cstring>> errors)\n    {\n        foreach (var (field, messages) in errors)\n        {\n            foreach (var message in messages)\n            {\n                messageStore!.Add(EditContext!.Field(field), message);\n            }\n        }\n        EditContext!.NotifyValidationStateChanged();\n    }\n\n    public void ClearErrors()\n    {\n        messageStore?.Clear();\n        EditContext?.NotifyValidationStateChanged();\n    }\n}\n```\n\nUsage in a form:\n\n```razor\n\u003CEditForm Model=\"Model\" OnValidSubmit=\"HandleSubmit\" FormName=\"register\">\n    \u003CDataAnnotationsValidator \u002F>\n    \u003CCustomValidator @ref=\"customValidator\" \u002F>\n    \u003CValidationSummary \u002F>\n    @* inputs *@\n\u003C\u002FEditForm>\n\n@code {\n    private CustomValidator? customValidator;\n\n    private async Task HandleSubmit()\n    {\n        var errors = await RegistrationService.ValidateAsync(Model!);\n        if (errors.Count > 0)\n        {\n            customValidator!.DisplayErrors(errors);\n            return;\n        }\n        \u002F\u002F proceed\n    }\n}\n```\n\n## React to Input Changes (Interactive Only)\n\n### @bind:after\n\nRun logic after a bound value changes:\n\n```razor\n\u003CInputText @bind-Value=\"Model!.ZipCode\" @bind:after=\"OnZipCodeChanged\" \u002F>\n\n@code {\n    private async Task OnZipCodeChanged()\n    {\n        \u002F\u002F Fetch city\u002Fstate based on new zip code\n        var location = await LocationService.LookupAsync(Model!.ZipCode);\n        Model.City = location?.City;\n        Model.State = location?.State;\n    }\n}\n```\n\n### @oninput for real-time filtering\n\n```razor\n\u003Cinput type=\"text\" @oninput=\"OnSearchInput\" placeholder=\"Search...\" \u002F>\n\n@code {\n    private string searchTerm = \"\";\n    private List\u003CItem> filteredItems = new();\n\n    private void OnSearchInput(ChangeEventArgs e)\n    {\n        searchTerm = e.Value?.ToString() ?? \"\";\n        filteredItems = allItems.Where(i =>\n            i.Name.Contains(searchTerm, StringComparison.OrdinalIgnoreCase)).ToList();\n    }\n}\n```\n\n## SSR-Specific Patterns\n\nThese apply when the form renders in Static SSR (mode = None, or per-page without `@rendermode`).\n\n### SupplyParameterFromForm\n\nBinds POST data to a property on form submission:\n\n```csharp\n[SupplyParameterFromForm]\nprivate ContactModel? Contact { get; set; }\n\nprotected override void OnInitialized() => Contact ??= new();\n```\n\n**Critical:** The `??=` in `OnInitialized` is required. On GET the property is null — `??=` creates the model. On POST the framework populates it — `??=` preserves the posted values.\n\n### FormName — multiple forms on one page\n\nEach form needs a unique `FormName`:\n\n```razor\n\u003CEditForm Model=\"Search\" OnSubmit=\"DoSearch\" FormName=\"search\">...\u003C\u002FEditForm>\n\u003CEditForm Model=\"Contact\" OnValidSubmit=\"SaveContact\" FormName=\"contact\">...\u003C\u002FEditForm>\n```\n\nMatch `[SupplyParameterFromForm]` to its form:\n\n```csharp\n[SupplyParameterFromForm(FormName = \"search\")]\nprivate SearchModel? Search { get; set; }\n\n[SupplyParameterFromForm(FormName = \"contact\")]\nprivate ContactModel? Contact { get; set; }\n```\n\n### Enhanced navigation for forms\n\nAdd `Enhance` for SPA-like form submissions without full page reload:\n\n```razor\n\u003CEditForm Model=\"Model\" OnValidSubmit=\"Save\" FormName=\"quick\" Enhance>\n```\n\nEnhanced forms submit via `fetch`, patch the DOM, and preserve scroll position. The page stays interactive-feeling even in SSR.\n\n### Plain HTML forms\n\nWhen using raw `\u003Cform>` instead of `EditForm` in SSR, add the antiforgery token manually:\n\n```razor\n\u003Cform method=\"post\" @onsubmit=\"Submit\" @formname=\"raw-form\">\n    \u003CAntiforgeryToken \u002F>\n    \u003Cinput name=\"Model.Name\" value=\"@Model?.Name\" \u002F>\n    \u003Cbutton type=\"submit\">Send\u003C\u002Fbutton>\n\u003C\u002Fform>\n```\n\n`EditForm` includes the antiforgery token automatically.\n\n## File Upload\n\n`InputFile` works in **interactive modes only** — not in Static SSR.\n\n```razor\n\u003CInputFile OnChange=\"OnFileSelected\" accept=\".pdf,.jpg,.png\" \u002F>\n\n@code {\n    private IBrowserFile? selectedFile;\n\n    private async Task OnFileSelected(InputFileChangeEventArgs e)\n    {\n        selectedFile = e.File;\n\n        \u002F\u002F Read stream with size limit\n        await using var stream = selectedFile.OpenReadStream(maxAllowedSize: 10 * 1024 * 1024);\n        \u002F\u002F Process stream — save to disk, upload to storage, etc.\n    }\n}\n```\n\nStream size limits:\n- **Server:** Default ~30 KB SignalR message size. Call `OpenReadStream(maxAllowedSize)` to increase. Large files stream over the circuit.\n- **WebAssembly:** File is read in the browser. No SignalR limit, but memory constrained.\n\nFor multiple files:\n\n```razor\n\u003CInputFile OnChange=\"OnFilesSelected\" multiple \u002F>\n\n@code {\n    private async Task OnFilesSelected(InputFileChangeEventArgs e)\n    {\n        foreach (var file in e.GetMultipleFiles(maxAllowedFiles: 10))\n        {\n            await using var stream = file.OpenReadStream(maxAllowedSize: 10 * 1024 * 1024);\n            \u002F\u002F Process each file\n        }\n    }\n}\n```\n\n## Prevent Double Submission\n\nDisable the submit button while processing:\n\n```razor\n\u003Cbutton type=\"submit\" disabled=\"@isSubmitting\">\n    @(isSubmitting ? \"Saving...\" : \"Save\")\n\u003C\u002Fbutton>\n\n@code {\n    private bool isSubmitting;\n\n    private async Task HandleSubmit()\n    {\n        isSubmitting = true;\n        try\n        {\n            await SaveService.SaveAsync(Model!);\n        }\n        finally\n        {\n            isSubmitting = false;\n        }\n    }\n}\n```\n\n## Custom Validation CSS\n\nReplace the default `valid`\u002F`invalid` CSS classes:\n\n```csharp\npublic class BootstrapFieldCssClassProvider : FieldCssClassProvider\n{\n    public override string GetFieldCssClass(EditContext editContext, in FieldIdentifier fieldIdentifier)\n    {\n        var isValid = !editContext.GetValidationMessages(fieldIdentifier).Any();\n        return editContext.IsModified(fieldIdentifier)\n            ? (isValid ? \"is-valid\" : \"is-invalid\")\n            : \"\";\n    }\n}\n```\n\nApply to the form:\n\n```csharp\nprotected override void OnInitialized()\n{\n    editContext = new EditContext(model);\n    editContext.SetFieldCssClassProvider(new BootstrapFieldCssClassProvider());\n}\n```\n\n## Don'ts\n\n- Don't use `@bind` or `@oninput` in Static SSR forms — they require interactivity. Use `[SupplyParameterFromForm]` and `FormName`.\n- Don't forget `Model ??= new()` in `OnInitialized` — the model is null on GET, populated on POST.\n- Don't use `OnSubmit` together with `OnValidSubmit`\u002F`OnInvalidSubmit` — they're mutually exclusive.\n- Don't omit `\u003CDataAnnotationsValidator \u002F>` — validation attributes are silently ignored without it.\n- Don't omit `FormName` in SSR when a page has multiple forms — both forms will fire on any submission.\n- Don't use `InputFile` in Static SSR — it requires an interactive render mode.\n- Don't use both `Model` and `EditContext` on an `EditForm` — pick one.\n- Don't forget `\u003CAntiforgeryToken \u002F>` in plain `\u003Cform>` elements — the server rejects the POST without it.\n","# Collect User Input\n\n## Step 1 — Read the Project's AGENTS.md\n\nCheck `AGENTS.md` for **Interactivity Mode** and **Interactivity Scope**. This determines which form patterns apply:\n\n| Mode | Form mechanism |\n|------|---------------|\n| None (Static SSR) | `EditForm` with `FormName` + `[SupplyParameterFromForm]`. No `@bind`, no `@onchange`. |\n| Server | `EditForm` with `@bind-Value`. Full interactivity — real-time validation, dynamic UI. |\n| WebAssembly | Same as Server, but validators needing server data must call APIs. |\n| Auto | Same as WebAssembly — code must work in both browser and server. |\n\n| Scope | Impact |\n|-------|--------|\n| Global | All forms are interactive. `FormName` only needed when explicitly opting a page to static SSR. |\n| Per-page | Forms in static pages use `FormName` + `[SupplyParameterFromForm]`. Forms in `@rendermode` pages use `@bind-Value`. |\n\n## EditForm Setup\n\n`EditForm` requires **either** `Model` or `EditContext` — never both.\n\n### Model-based (default)\n\n```razor\n\u003CEditForm Model=\"Employee\" OnValidSubmit=\"HandleSubmit\" FormName=\"employee\">\n    \u003CDataAnnotationsValidator \u002F>\n    \u003CValidationSummary \u002F>\n\n    \u003Clabel>\n        Name: \u003CInputText @bind-Value=\"Employee!.Name\" \u002F>\n        \u003CValidationMessage For=\"() => Employee!.Name\" \u002F>\n    \u003C\u002Flabel>\n\n    \u003Cbutton type=\"submit\">Save\u003C\u002Fbutton>\n\u003C\u002FEditForm>\n\n@code {\n    [SupplyParameterFromForm]\n    private EmployeeModel? Employee { get; set; }\n\n    protected override void OnInitialized() => Employee ??= new();\n\n    private async Task HandleSubmit()\n    {\n        \u002F\u002F Save Employee\n    }\n}\n```\n\nThis single pattern works in **both** SSR and interactive modes:\n- In SSR: `FormName` identifies the form, `[SupplyParameterFromForm]` binds POST data, `??=` initializes on GET.\n- In interactive: `@bind-Value` provides two-way binding, `[SupplyParameterFromForm]` is ignored, `FormName` is harmless.\n\n### EditContext-based (advanced)\n\nUse when you need programmatic field tracking, dynamic validation rules, or manual `EditContext.Validate()` calls:\n\n```csharp\nprivate EditContext? editContext;\nprivate EmployeeModel model = new();\n\nprotected override void OnInitialized()\n{\n    editContext = new EditContext(model);\n}\n```\n\n```razor\n\u003CEditForm EditContext=\"editContext\" OnValidSubmit=\"HandleSubmit\" FormName=\"employee\">\n```\n\n## Submit Handlers\n\n| Handler | Fires when | Use when |\n|---------|-----------|----------|\n| `OnValidSubmit` | Validation passes | Standard forms with `DataAnnotationsValidator` |\n| `OnInvalidSubmit` | Validation fails | Need custom handling for invalid state |\n| `OnSubmit` | Always — validation is manual | Using `EditContext.Validate()` yourself |\n\n`OnSubmit` cannot combine with `OnValidSubmit`\u002F`OnInvalidSubmit`.\n\n## Built-in Input Components\n\n| Component | Binds to | Notes |\n|-----------|----------|-------|\n| `InputText` | `string` | Renders `\u003Cinput type=\"text\">` |\n| `InputTextArea` | `string` | Renders `\u003Ctextarea>` |\n| `InputNumber\u003CT>` | `int`, `double`, `decimal` | Renders `\u003Cinput type=\"number\">` |\n| `InputDate\u003CT>` | `DateTime`, `DateOnly`, `DateTimeOffset` | Renders `\u003Cinput type=\"date\">` |\n| `InputCheckbox` | `bool` | Renders `\u003Cinput type=\"checkbox\">` |\n| `InputSelect\u003CT>` | `string`, enums, numeric types | Renders `\u003Cselect>` |\n| `InputRadioGroup\u003CT>` | `string`, enums, numeric types | Wraps `InputRadio\u003CT>` children |\n| `InputFile` | `IBrowserFile` | File upload — interactive modes only |\n\nAll input components use `@bind-Value` for binding. Always wrap text in a `\u003Clabel>` or use `id`\u002F`for` attributes for accessibility.\n\n### InputSelect with enum values\n\n```razor\n\u003CInputSelect @bind-Value=\"Model!.Status\">\n    \u003Coption value=\"\">-- Select --\u003C\u002Foption>\n    @foreach (var value in Enum.GetValues\u003COrderStatus>())\n    {\n        \u003Coption value=\"@value\">@value\u003C\u002Foption>\n    }\n\u003C\u002FInputSelect>\n```\n\n### InputRadioGroup\n\n```razor\n\u003CInputRadioGroup @bind-Value=\"Model!.Priority\">\n    @foreach (var p in Enum.GetValues\u003CPriority>())\n    {\n        \u003Clabel>\n            \u003CInputRadio Value=\"p\" \u002F> @p\n        \u003C\u002Flabel>\n    }\n\u003C\u002FInputRadioGroup>\n```\n\n## Validation\n\n### Data annotations\n\nDefine validation rules on the model:\n\n```csharp\npublic class EmployeeModel\n{\n    [Required, StringLength(100)]\n    public string? Name { get; set; }\n\n    [Required, EmailAddress]\n    public string? Email { get; set; }\n\n    [Range(18, 99)]\n    public int Age { get; set; }\n\n    [Required]\n    public string? Department { get; set; }\n}\n```\n\nAdd `\u003CDataAnnotationsValidator \u002F>` inside `EditForm` — without it, annotation attributes are silently ignored.\n\nDisplay errors with:\n- `\u003CValidationSummary \u002F>` — all errors in a list\n- `\u003CValidationMessage For=\"() => Model!.FieldName\" \u002F>` — per-field inline errors\n\n### Custom validator component\n\nFor server-round-trip validation (uniqueness checks, business rules):\n\n```csharp\npublic class CustomValidator : ComponentBase\n{\n    [CascadingParameter]\n    private EditContext? EditContext { get; set; }\n\n    private ValidationMessageStore? messageStore;\n\n    protected override void OnInitialized()\n    {\n        messageStore = new ValidationMessageStore(EditContext!);\n        EditContext!.OnValidationRequested += (s, e) => messageStore.Clear();\n        EditContext!.OnFieldChanged += (s, e) => messageStore.Clear(e.FieldIdentifier);\n    }\n\n    public void DisplayErrors(Dictionary\u003Cstring, List\u003Cstring>> errors)\n    {\n        foreach (var (field, messages) in errors)\n        {\n            foreach (var message in messages)\n            {\n                messageStore!.Add(EditContext!.Field(field), message);\n            }\n        }\n        EditContext!.NotifyValidationStateChanged();\n    }\n\n    public void ClearErrors()\n    {\n        messageStore?.Clear();\n        EditContext?.NotifyValidationStateChanged();\n    }\n}\n```\n\nUsage in a form:\n\n```razor\n\u003CEditForm Model=\"Model\" OnValidSubmit=\"HandleSubmit\" FormName=\"register\">\n    \u003CDataAnnotationsValidator \u002F>\n    \u003CCustomValidator @ref=\"customValidator\" \u002F>\n    \u003CValidationSummary \u002F>\n    @* inputs *@\n\u003C\u002FEditForm>\n\n@code {\n    private CustomValidator? customValidator;\n\n    private async Task HandleSubmit()\n    {\n        var errors = await RegistrationService.ValidateAsync(Model!);\n        if (errors.Count > 0)\n        {\n            customValidator!.DisplayErrors(errors);\n            return;\n        }\n        \u002F\u002F proceed\n    }\n}\n```\n\n## React to Input Changes (Interactive Only)\n\n### @bind:after\n\nRun logic after a bound value changes:\n\n```razor\n\u003CInputText @bind-Value=\"Model!.ZipCode\" @bind:after=\"OnZipCodeChanged\" \u002F>\n\n@code {\n    private async Task OnZipCodeChanged()\n    {\n        \u002F\u002F Fetch city\u002Fstate based on new zip code\n        var location = await LocationService.LookupAsync(Model!.ZipCode);\n        Model.City = location?.City;\n        Model.State = location?.State;\n    }\n}\n```\n\n### @oninput for real-time filtering\n\n```razor\n\u003Cinput type=\"text\" @oninput=\"OnSearchInput\" placeholder=\"Search...\" \u002F>\n\n@code {\n    private string searchTerm = \"\";\n    private List\u003CItem> filteredItems = new();\n\n    private void OnSearchInput(ChangeEventArgs e)\n    {\n        searchTerm = e.Value?.ToString() ?? \"\";\n        filteredItems = allItems.Where(i =>\n            i.Name.Contains(searchTerm, StringComparison.OrdinalIgnoreCase)).ToList();\n    }\n}\n```\n\n## SSR-Specific Patterns\n\nThese apply when the form renders in Static SSR (mode = None, or per-page without `@rendermode`).\n\n### SupplyParameterFromForm\n\nBinds POST data to a property on form submission:\n\n```csharp\n[SupplyParameterFromForm]\nprivate ContactModel? Contact { get; set; }\n\nprotected override void OnInitialized() => Contact ??= new();\n```\n\n**Critical:** The `??=` in `OnInitialized` is required. On GET the property is null — `??=` creates the model. On POST the framework populates it — `??=` preserves the posted values.\n\n### FormName — multiple forms on one page\n\nEach form needs a unique `FormName`:\n\n```razor\n\u003CEditForm Model=\"Search\" OnSubmit=\"DoSearch\" FormName=\"search\">...\u003C\u002FEditForm>\n\u003CEditForm Model=\"Contact\" OnValidSubmit=\"SaveContact\" FormName=\"contact\">...\u003C\u002FEditForm>\n```\n\nMatch `[SupplyParameterFromForm]` to its form:\n\n```csharp\n[SupplyParameterFromForm(FormName = \"search\")]\nprivate SearchModel? Search { get; set; }\n\n[SupplyParameterFromForm(FormName = \"contact\")]\nprivate ContactModel? Contact { get; set; }\n```\n\n### Enhanced navigation for forms\n\nAdd `Enhance` for SPA-like form submissions without full page reload:\n\n```razor\n\u003CEditForm Model=\"Model\" OnValidSubmit=\"Save\" FormName=\"quick\" Enhance>\n```\n\nEnhanced forms submit via `fetch`, patch the DOM, and preserve scroll position. The page stays interactive-feeling even in SSR.\n\n### Plain HTML forms\n\nWhen using raw `\u003Cform>` instead of `EditForm` in SSR, add the antiforgery token manually:\n\n```razor\n\u003Cform method=\"post\" @onsubmit=\"Submit\" @formname=\"raw-form\">\n    \u003CAntiforgeryToken \u002F>\n    \u003Cinput name=\"Model.Name\" value=\"@Model?.Name\" \u002F>\n    \u003Cbutton type=\"submit\">Send\u003C\u002Fbutton>\n\u003C\u002Fform>\n```\n\n`EditForm` includes the antiforgery token automatically.\n\n## File Upload\n\n`InputFile` works in **interactive modes only** — not in Static SSR.\n\n```razor\n\u003CInputFile OnChange=\"OnFileSelected\" accept=\".pdf,.jpg,.png\" \u002F>\n\n@code {\n    private IBrowserFile? selectedFile;\n\n    private async Task OnFileSelected(InputFileChangeEventArgs e)\n    {\n        selectedFile = e.File;\n\n        \u002F\u002F Read stream with size limit\n        await using var stream = selectedFile.OpenReadStream(maxAllowedSize: 10 * 1024 * 1024);\n        \u002F\u002F Process stream — save to disk, upload to storage, etc.\n    }\n}\n```\n\nStream size limits:\n- **Server:** Default ~30 KB SignalR message size. Call `OpenReadStream(maxAllowedSize)` to increase. Large files stream over the circuit.\n- **WebAssembly:** File is read in the browser. No SignalR limit, but memory constrained.\n\nFor multiple files:\n\n```razor\n\u003CInputFile OnChange=\"OnFilesSelected\" multiple \u002F>\n\n@code {\n    private async Task OnFilesSelected(InputFileChangeEventArgs e)\n    {\n        foreach (var file in e.GetMultipleFiles(maxAllowedFiles: 10))\n        {\n            await using var stream = file.OpenReadStream(maxAllowedSize: 10 * 1024 * 1024);\n            \u002F\u002F Process each file\n        }\n    }\n}\n```\n\n## Prevent Double Submission\n\nDisable the submit button while processing:\n\n```razor\n\u003Cbutton type=\"submit\" disabled=\"@isSubmitting\">\n    @(isSubmitting ? \"Saving...\" : \"Save\")\n\u003C\u002Fbutton>\n\n@code {\n    private bool isSubmitting;\n\n    private async Task HandleSubmit()\n    {\n        isSubmitting = true;\n        try\n        {\n            await SaveService.SaveAsync(Model!);\n        }\n        finally\n        {\n            isSubmitting = false;\n        }\n    }\n}\n```\n\n## Custom Validation CSS\n\nReplace the default `valid`\u002F`invalid` CSS classes:\n\n```csharp\npublic class BootstrapFieldCssClassProvider : FieldCssClassProvider\n{\n    public override string GetFieldCssClass(EditContext editContext, in FieldIdentifier fieldIdentifier)\n    {\n        var isValid = !editContext.GetValidationMessages(fieldIdentifier).Any();\n        return editContext.IsModified(fieldIdentifier)\n            ? (isValid ? \"is-valid\" : \"is-invalid\")\n            : \"\";\n    }\n}\n```\n\nApply to the form:\n\n```csharp\nprotected override void OnInitialized()\n{\n    editContext = new EditContext(model);\n    editContext.SetFieldCssClassProvider(new BootstrapFieldCssClassProvider());\n}\n```\n\n## Don'ts\n\n- Don't use `@bind` or `@oninput` in Static SSR forms — they require interactivity. Use `[SupplyParameterFromForm]` and `FormName`.\n- Don't forget `Model ??= new()` in `OnInitialized` — the model is null on GET, populated on POST.\n- Don't use `OnSubmit` together with `OnValidSubmit`\u002F`OnInvalidSubmit` — they're mutually exclusive.\n- Don't omit `\u003CDataAnnotationsValidator \u002F>` — validation attributes are silently ignored without it.\n- Don't omit `FormName` in SSR when a page has multiple forms — both forms will fire on any submission.\n- Don't use `InputFile` in Static SSR — it requires an interactive render mode.\n- Don't use both `Model` and `EditContext` on an `EditForm` — pick one.\n- Don't forget `\u003CAntiforgeryToken \u002F>` in plain `\u003Cform>` elements — the server rejects the POST without it.\n",{"name":5,"license":14,"description":7},"main","ccab8dffc0ecc173838f51e4c5f0d3b51a704f41","plugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fcollect-user-input","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills","https:\u002F\u002Fgithub.com\u002Fdeadmade","https:\u002F\u002Fdeadmade.github.io\u002F","Blood, an Ocean of blood","2026-11-14 02:03:31",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add deadmade\u002Fdead-agent-skills --skill collect-user-input",{"tool":37,"command":38},"bunx","bunx skills add deadmade\u002Fdead-agent-skills --skill collect-user-input",{"tool":40,"command":41},"pnpm","pnpm dlx skills add deadmade\u002Fdead-agent-skills --skill collect-user-input","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fcollect-user-input\u002FSKILL.md",true,[],[46,53,62,70,77,84],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7CVRBFTXSTTQ7F5P6PJEFYA","rust-best-practices","Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Frust-skills\u002Fskills\u002Frust-best-practices\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":58,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7CVR0W7B8EGTNPSPA7FPC4Z","postgres-database-migration","Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production data or shared databases.\n\n**Trigger when user asks to:**\n- Test a schema migration before applying it to production\n- Add, remove, or rename columns safely on a live table\n- Change a column's data type without downtime\n- Add or drop indexes, constraints, or foreign keys on large tables\n- Understand which ALTER TABLE operations lock the table\n- Roll back a failed migration\n- Plan a zero-downtime migration strategy\n- Fork a database to test a migration safely\n\nCovers: lock-level reference for every common DDL operation, safe migration patterns, fork-based testing, zero-downtime column changes, index creation, constraint addition, backfill strategies, pre\u002Fpost-migration validation, and rollback planning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-database-migration\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-database-migration\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":66,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7CVQWK20ASAZN5VETZC8J99","postgres-best-practices","Best practices and guidelines for working with Postgres. Covers schema design, indexing strategies, query optimization, migrations, and common pitfalls. Use when writing SQL, designing database schemas, optimizing queries, or setting up a Postgres database.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fpostgres\u002Fskills\u002Fpostgres-best-practices\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7CVQ5CY7AQHY7A2Y99RE6A7","writing-mstest-tests","ALWAYS USE when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7CVPWJZ63GB0810F0SCGZ1K","winforms-expert","Create, modify, debug, or review Windows Forms applications only when the request contains a concrete Windows Forms marker. USE FOR: WinForms, Windows Forms, System.Windows.Forms, WinForms Form or UserControl designer files (*.Designer.cs or *.Designer.vb), Visual Studio WinForms Designer, TableLayoutPanel, BindingSource, DataGridView, Control.InvokeAsync, component-tray ownership, or custom control serialization. DO NOT USE FOR: WPF or WPF XAML, including Window.InputBindings, KeyBinding, commands, or DataContext; .NET MAUI; Avalonia; or any request where none of the listed Windows Forms markers is present.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fwinforms-expert\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M7CVPR0QFZ1HMJ6GZRBQAQ7W","vectorization","Design, implement, optimize, and review SIMD code in .NET. USE FOR: vectorizing scalar loops with TensorPrimitives, Vector64\u002F128\u002F256\u002F512, or platform hardware intrinsics; reviewing existing SIMD code, including the generic Vector type, for contract equivalence, tail handling, memory safety, portability, fallbacks, and measured performance. DO NOT USE FOR: performance work unrelated to SIMD or vectorization.","https:\u002F\u002Fgithub.com\u002Fdeadmade\u002Fdead-agent-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fopt-in\u002Fimplementation\u002Fcsharp-skills\u002Flibrary\u002Fvectorization\u002FSKILL.md",[],[]]