Official agent skill

Collect User Input

by dotnet in dotnet/skills

Build forms, validate data, and react to user input in Blazor.

OfficialMITAuto-check passedDevelopment

Install Collect User Input

skills CLI
$ npx skills add dotnet/skills --skill collect-user-input -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dotnet/skills collect-user-input --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dotnet/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dotnet-blazor/skills/collect-user-input .claude/skills/collect-user-input && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
collect-user-input
GitHub stars
5.6k
Used in
1 other repo
Token cost
~3.2k tokens
SKILL.md length
651 words
Files
1
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Build forms, validate data, and react to user input in Blazor.

  • Validation (annotations
  • SKILL.md covers Step 1 — Read the Project's…, EditForm Setup, Submit Handlers and Built-in Input Components, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Handling form submissions

What it does

Collect User Input is an agent skill from dotnet/skills, published by the product's own GitHub organization. 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…

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Project scaffolding and File uploads and storage. It works with Blazor and React. The repository describes itself as: Repository for skills to assist AI coding agents with .NET and C. The licence is MIT.

When your agent uses it

  • Validation (annotations
  • Handling form submissions
  • Binding input controls
  • Project scaffolding (see create-blazor-project)

Example prompts

  • “/collect-user-input”

What it can do on your machine

Read from SKILL.md and the folder at commit 8d670fa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are razor and csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Collect User Input loads about 3.2k tokens when it runs. Until then it costs about 149 tokens; SKILL.md has 651 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~149
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dotnet/skills at commit 8d670fa, republished under its MIT licence (© dotnet). 651 words, ~3,181 tokens.

Download SKILL.mdSave it as .claude/skills/collect-user-input/SKILL.md (or your agent's skills folder).
name
collect-user-input
description
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).
license
MIT

Collect User Input

Step 1 — Read the Project's AGENTS.md

Check AGENTS.md for Interactivity Mode and Interactivity Scope. This determines which form patterns apply:

ModeForm mechanism
None (Static SSR)EditForm with FormName + [SupplyParameterFromForm]. No @bind, no @onchange.
ServerEditForm with @bind-Value. Full interactivity — real-time validation, dynamic UI.
WebAssemblySame as Server, but validators needing server data must call APIs.
AutoSame as WebAssembly — code must work in both browser and server.
ScopeImpact
GlobalAll forms are interactive. FormName only needed when explicitly opting a page to static SSR.
Per-pageForms in static pages use FormName + [SupplyParameterFromForm]. Forms in @rendermode pages use @bind-Value.

EditForm Setup

EditForm requires either Model or EditContext — never both.

Model-based (default)
razor
<EditForm Model="Employee" OnValidSubmit="HandleSubmit" FormName="employee">
    <DataAnnotationsValidator />
    <ValidationSummary />

    <label>
        Name: <InputText @bind-Value="Employee!.Name" />
        <ValidationMessage For="() => Employee!.Name" />
    </label>

    <button type="submit">Save</button>
</EditForm>

@code {
    [SupplyParameterFromForm]
    private EmployeeModel? Employee { get; set; }

    protected override void OnInitialized() => Employee ??= new();

    private async Task HandleSubmit()
    {
        // Save Employee
    }
}

This single pattern works in both SSR and interactive modes:

  • In SSR: FormName identifies the form, [SupplyParameterFromForm] binds POST data, ??= initializes on GET.
  • In interactive: @bind-Value provides two-way binding, [SupplyParameterFromForm] is ignored, FormName is harmless.
EditContext-based (advanced)

Use when you need programmatic field tracking, dynamic validation rules, or manual EditContext.Validate() calls:

csharp
private EditContext? editContext;
private EmployeeModel model = new();

protected override void OnInitialized()
{
    editContext = new EditContext(model);
}
razor
<EditForm EditContext="editContext" OnValidSubmit="HandleSubmit" FormName="employee">

Submit Handlers

HandlerFires whenUse when
OnValidSubmitValidation passesStandard forms with DataAnnotationsValidator
OnInvalidSubmitValidation failsNeed custom handling for invalid state
OnSubmitAlways — validation is manualUsing EditContext.Validate() yourself

OnSubmit cannot combine with OnValidSubmit/OnInvalidSubmit.

Built-in Input Components

ComponentBinds toNotes
InputTextstringRenders <input type="text">
InputTextAreastringRenders <textarea>
InputNumber<T>int, double, decimalRenders <input type="number">
InputDate<T>DateTime, DateOnly, DateTimeOffsetRenders <input type="date">
InputCheckboxboolRenders <input type="checkbox">
InputSelect<T>string, enums, numeric typesRenders <select>
InputRadioGroup<T>string, enums, numeric typesWraps InputRadio<T> children
InputFileIBrowserFileFile upload — interactive modes only

All input components use @bind-Value for binding. Always wrap text in a <label> or use id/for attributes for accessibility.

InputSelect with enum values
razor
<InputSelect @bind-Value="Model!.Status">
    <option value="">-- Select --</option>
    @foreach (var value in Enum.GetValues<OrderStatus>())
    {
        <option value="@value">@value</option>
    }
</InputSelect>
InputRadioGroup
razor
<InputRadioGroup @bind-Value="Model!.Priority">
    @foreach (var p in Enum.GetValues<Priority>())
    {
        <label>
            <InputRadio Value="p" /> @p
        </label>
    }
</InputRadioGroup>

Validation

Data annotations

Define validation rules on the model:

csharp
public class EmployeeModel
{
    [Required, StringLength(100)]
    public string? Name { get; set; }

    [Required, EmailAddress]
    public string? Email { get; set; }

    [Range(18, 99)]
    public int Age { get; set; }

    [Required]
    public string? Department { get; set; }
}

Add <DataAnnotationsValidator /> inside EditForm — without it, annotation attributes are silently ignored.

Display errors with:

  • <ValidationSummary /> — all errors in a list
  • <ValidationMessage For="() => Model!.FieldName" /> — per-field inline errors
Custom validator component

For server-round-trip validation (uniqueness checks, business rules):

csharp
public class CustomValidator : ComponentBase
{
    [CascadingParameter]
    private EditContext? EditContext { get; set; }

    private ValidationMessageStore? messageStore;

    protected override void OnInitialized()
    {
        messageStore = new ValidationMessageStore(EditContext!);
        EditContext!.OnValidationRequested += (s, e) => messageStore.Clear();
        EditContext!.OnFieldChanged += (s, e) => messageStore.Clear(e.FieldIdentifier);
    }

    public void DisplayErrors(Dictionary<string, List<string>> errors)
    {
        foreach (var (field, messages) in errors)
        {
            foreach (var message in messages)
            {
                messageStore!.Add(EditContext!.Field(field), message);
            }
        }
        EditContext!.NotifyValidationStateChanged();
    }

    public void ClearErrors()
    {
        messageStore?.Clear();
        EditContext?.NotifyValidationStateChanged();
    }
}

Usage in a form:

razor
<EditForm Model="Model" OnValidSubmit="HandleSubmit" FormName="register">
    <DataAnnotationsValidator />
    <CustomValidator @ref="customValidator" />
    <ValidationSummary />
    @* inputs *@
</EditForm>

@code {
    private CustomValidator? customValidator;

    private async Task HandleSubmit()
    {
        var errors = await RegistrationService.ValidateAsync(Model!);
        if (errors.Count > 0)
        {
            customValidator!.DisplayErrors(errors);
            return;
        }
        // proceed
    }
}

React to Input Changes (Interactive Only)

@bind:after

Run logic after a bound value changes:

razor
<InputText @bind-Value="Model!.ZipCode" @bind:after="OnZipCodeChanged" />

@code {
    private async Task OnZipCodeChanged()
    {
        // Fetch city/state based on new zip code
        var location = await LocationService.LookupAsync(Model!.ZipCode);
        Model.City = location?.City;
        Model.State = location?.State;
    }
}
@oninput for real-time filtering
razor
<input type="text" @oninput="OnSearchInput" placeholder="Search..." />

@code {
    private string searchTerm = "";
    private List<Item> filteredItems = new();

    private void OnSearchInput(ChangeEventArgs e)
    {
        searchTerm = e.Value?.ToString() ?? "";
        filteredItems = allItems.Where(i =>
            i.Name.Contains(searchTerm, StringComparison.OrdinalIgnoreCase)).ToList();
    }
}

SSR-Specific Patterns

These apply when the form renders in Static SSR (mode = None, or per-page without @rendermode).

SupplyParameterFromForm

Binds POST data to a property on form submission:

csharp
[SupplyParameterFromForm]
private ContactModel? Contact { get; set; }

protected override void OnInitialized() => Contact ??= new();

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.

Show full SKILL.md (249 more words)Show less
FormName — multiple forms on one page

Each form needs a unique FormName:

razor
<EditForm Model="Search" OnSubmit="DoSearch" FormName="search">...</EditForm>
<EditForm Model="Contact" OnValidSubmit="SaveContact" FormName="contact">...</EditForm>

Match [SupplyParameterFromForm] to its form:

csharp
[SupplyParameterFromForm(FormName = "search")]
private SearchModel? Search { get; set; }

[SupplyParameterFromForm(FormName = "contact")]
private ContactModel? Contact { get; set; }
Enhanced navigation for forms

Add Enhance for SPA-like form submissions without full page reload:

razor
<EditForm Model="Model" OnValidSubmit="Save" FormName="quick" Enhance>

Enhanced forms submit via fetch, patch the DOM, and preserve scroll position. The page stays interactive-feeling even in SSR.

Plain HTML forms

When using raw <form> instead of EditForm in SSR, add the antiforgery token manually:

razor
<form method="post" @onsubmit="Submit" @formname="raw-form">
    <AntiforgeryToken />
    <input name="Model.Name" value="@Model?.Name" />
    <button type="submit">Send</button>
</form>

EditForm includes the antiforgery token automatically.

File Upload

InputFile works in interactive modes only — not in Static SSR.

razor
<InputFile OnChange="OnFileSelected" accept=".pdf,.jpg,.png" />

@code {
    private IBrowserFile? selectedFile;

    private async Task OnFileSelected(InputFileChangeEventArgs e)
    {
        selectedFile = e.File;

        // Read stream with size limit
        await using var stream = selectedFile.OpenReadStream(maxAllowedSize: 10 * 1024 * 1024);
        // Process stream — save to disk, upload to storage, etc.
    }
}

Stream size limits:

  • Server: Default ~30 KB SignalR message size. Call OpenReadStream(maxAllowedSize) to increase. Large files stream over the circuit.
  • WebAssembly: File is read in the browser. No SignalR limit, but memory constrained.

For multiple files:

razor
<InputFile OnChange="OnFilesSelected" multiple />

@code {
    private async Task OnFilesSelected(InputFileChangeEventArgs e)
    {
        foreach (var file in e.GetMultipleFiles(maxAllowedFiles: 10))
        {
            await using var stream = file.OpenReadStream(maxAllowedSize: 10 * 1024 * 1024);
            // Process each file
        }
    }
}

Prevent Double Submission

Disable the submit button while processing:

razor
<button type="submit" disabled="@isSubmitting">
    @(isSubmitting ? "Saving..." : "Save")
</button>

@code {
    private bool isSubmitting;

    private async Task HandleSubmit()
    {
        isSubmitting = true;
        try
        {
            await SaveService.SaveAsync(Model!);
        }
        finally
        {
            isSubmitting = false;
        }
    }
}

Custom Validation CSS

Replace the default valid/invalid CSS classes:

csharp
public class BootstrapFieldCssClassProvider : FieldCssClassProvider
{
    public override string GetFieldCssClass(EditContext editContext, in FieldIdentifier fieldIdentifier)
    {
        var isValid = !editContext.GetValidationMessages(fieldIdentifier).Any();
        return editContext.IsModified(fieldIdentifier)
            ? (isValid ? "is-valid" : "is-invalid")
            : "";
    }
}

Apply to the form:

csharp
protected override void OnInitialized()
{
    editContext = new EditContext(model);
    editContext.SetFieldCssClassProvider(new BootstrapFieldCssClassProvider());
}

Don'ts

  • Don't use @bind or @oninput in Static SSR forms — they require interactivity. Use [SupplyParameterFromForm] and FormName.
  • Don't forget Model ??= new() in OnInitialized — the model is null on GET, populated on POST.
  • Don't use OnSubmit together with OnValidSubmit/OnInvalidSubmit — they're mutually exclusive.
  • Don't omit <DataAnnotationsValidator /> — validation attributes are silently ignored without it.
  • Don't omit FormName in SSR when a page has multiple forms — both forms will fire on any submission.
  • Don't use InputFile in Static SSR — it requires an interactive render mode.
  • Don't use both Model and EditContext on an EditForm — pick one.
  • Don't forget <AntiforgeryToken /> in plain <form> elements — the server rejects the POST without it.

© dotnet, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/dotnet-blazor/skills/collect-user-input of dotnet/skills.

Open the folder on GitHubat commit 8d670fa

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in dotnet/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Collect User Input next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Collect User Input compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Collect User Input this skilldotnet/skills5.6k1 repos~3.2kAutomated safety check: PassMIT
Fullstack DevHHU3637kr/skills1453 repos~8.6kAutomated safety check: NotesMIT
Experience UI Bundle Deployforcedotcom/sf-skills1.1k—~4.4kAutomated safety check: NotesApache-2.0
Fullstack Devinfometa/workbuddyskills342—~1kAutomated safety check: PassMIT
Nx Generatenomcopter/react-mosaic4.8k6 repos~1.9kAutomated safety check: PassCustom licence
Nextjs App Architecturejakubwarkusz/themes1231 repos~2.5kAutomated safety check: PassMIT

Similar skills

  • Fullstack Dev

    HHU3637kr/skills

    Full-stack backend architecture and frontend-backend integration guide.

    145 GitHub starsUsed in 3 repos~8.6k tokens
    Backend & APIsAuto-check: notes
  • Experience UI Bundle Deploy

    forcedotcom/sf-skills

    MUST activate when the project has a uiBundles//src/ directory and the task involves deploying to an org or post-deploy org setup.

    1.1k GitHub stars~4.4k tokensUpdated 4 days ago
    Backend & APIsAuto-check: notes
  • Fullstack Dev

    infometa/workbuddyskills

    Full-stack backend architecture and frontend-backend integration guide.

    342 GitHub stars~1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Nx Generate

    nomcopter/react-mosaic

    Generate code using nx generators. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 6 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Nextjs App Architecture

    jakubwarkusz/themes

    Build or audit Next.js 16 App Router apps using a next-beats-style React Server Components architecture.

    123 GitHub starsUsed in 1 repo~2.5k tokens
    DevelopmentAuto-check passed
  • Add Integration Event

    fullstackhero/dotnet-starter-kit

    Publish a cross-module integration event via the Outbox and handle it idempotently in another module.

    6.8k GitHub stars~1.1k tokensUpdated 7 days ago
    DevelopmentAuto-check passed

More from dotnet/skills

All 91 skills in this repo
  • Official

    Resolves .NET runtime frames in Apple .ips crash logs to function names, source files and line numbers using dSYM symbols, atos and the Microsoft symbol server.

    5.6k GitHub starsUsed in 1 repo~2.4k tokens
    Auto-check passed
  • Official

    Resolves native crash frames from .NET Android tombstones to function names, source files and line numbers using BuildIds, Microsoft's symbol server and llvm-symbolizer.

    5.6k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Official

    Scans C# and .NET code for about 50 performance anti-patterns and reports prioritized findings with concrete fixes, at a scan depth you choose.

    5.6k GitHub starsUsed in 3 repos~3.1k tokens
    Auto-check passed
  • Official

    Statically pairs source files with test files to list code that no test references, using Roslyn for C# or tree-sitter for many languages, with no build.

    5.6k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Microbenchmarking

    dotnet/skills

    Official

    Activate this skill when BenchmarkDotNet (BDN) is involved in the task — creating, running, configuring, or reviewing BDN benchmarks.

    5.6k GitHub starsUsed in 3 repos~3.3k tokens
    Auto-check passed
  • Official

    Makes .NET projects compatible with Native AOT and trimming by resolving IL trim and AOT analyzer warnings through annotations rather than suppressions.

    5.6k GitHub starsUsed in 2 repos~4.2k tokens
    Auto-check passed

Works with

Categories

Questions about Collect User Input

What does Collect User Input do?

Build forms, validate data, and react to user input in Blazor. Collect User Input is an agent skill from dotnet/skills, published by the product's own GitHub organization. Build forms, validate data, and react to user input in Blazor.

When should I use Collect User Input?

Collect User Input fits situations like: validation (annotations; handling form submissions; binding input controls; project scaffolding (see create-blazor-project).

How do I install Collect User Input in Claude Code?

Run `npx skills add dotnet/skills --skill collect-user-input -a claude-code`. Or copy the skill folder (plugins/dotnet-blazor/skills/collect-user-input in dotnet/skills) into .claude/skills/collect-user-input in your project. Claude Code loads it when a task matches its description.

How do I install Collect User Input in Codex?

Run `npx skills add dotnet/skills --skill collect-user-input -a codex`. Or copy the skill folder (plugins/dotnet-blazor/skills/collect-user-input in dotnet/skills) into .agents/skills/collect-user-input in your project. Codex loads it when a task matches its description.

Can I use Collect User Input in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dotnet/skills --skill collect-user-input -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/collect-user-input, .gemini/skills/collect-user-input, .github/skills/collect-user-input and .opencode/skills/collect-user-input in your project.

What does Collect User Input need to run?

SKILL.md names no scripts, command-line tools or credentials: Collect User Input is instructions for the agent only.

Does Collect User Input access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Collect User Input safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Collect User Input use?

Collect User Input is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Collect User Input use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Collect User Input?

Skills that share tags, products or a category with Collect User Input: Fullstack Dev (HHU3637kr/skills, 145 stars), Experience UI Bundle Deploy (forcedotcom/sf-skills, 1.1k stars), Fullstack Dev (infometa/workbuddyskills, 342 stars) and Nx Generate (nomcopter/react-mosaic, 4.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Collect User Input?

dotnet (a GitHub organization, an official publisher) maintains it in dotnet/skills, which has 5,568 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 7, 2026.

Source: dotnet/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.