Skip to main content
skill CX Codex

validation-patterns — Claude Code skill for ASP.NET Core validation

A skill that tells your agent how to validate data in ASP.NET Core, from attributes to FluentValidation and startup option checks.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add wshaddix/dotnet-skills --skill validation-patterns -a claude-code
Open on GitHub

What validation-patterns does

The skill lays out five validation layers: client side, model binding, business rules, configuration and database constraints. A decision tree inside helps pick an approach by complexity. Simple property constraints go to DataAnnotations with [Required], [Range] and [StringLength]. Rules that span several properties go to IValidatableObject or a custom ValidationAttribute.

There are separate sections on IValidateOptions<T> for checking options classes at startup and on FluentValidation for async validators that hit a database. Code samples cover a request model with attributes, a FutureDateAttribute, a class-level DateRangeAttribute comparing two dates, and a Validate() implementation in CreateOrderRequest that checks the ship-by date and order total.

The patterns target ASP.NET Core projects. On another stack the samples do not carry over. Some attributes — [AllowedValues], [DeniedValues], [Length], [Base64String] — are marked as .NET 8 and later, so they will not compile on an older runtime. Worth checking your target framework before pasting the code.

What it helps with

  • pick between DataAnnotations and FluentValidation for a model
  • express a rule that depends on two properties at once
  • validate an options class when the app starts
  • write a reusable attribute for a domain rule
  • add an async check that queries the database

Example prompts for the agent

  • Add validation to CreateProductRequest using the validation-patterns skill
  • Write a cross-field check for the ship-by date in CreateOrderRequest
  • Set up IValidateOptions for my options class and validate it at startup

How to install validation-patterns

1Skills CLI (Vercel)

npx skills add wshaddix/dotnet-skills --skill validation-patterns -a claude-code

2Manually: put the files in place

~/.claude/skills/validation-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/validation-patterns/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

From the same set5

Similar

Nearby in Backend and APIs

Everything for Backend and APIs →

Questions about validation-patterns

How do I install validation-patterns in Claude?

Run npx skills add wshaddix/dotnet-skills --skill validation-patterns -a claude-code. The skill file then lands at ~/.claude/skills/validation-patterns/SKILL.md.

What does validation-patterns do?

It collects validation patterns for ASP.NET Core: DataAnnotations, custom ValidationAttribute classes, IValidatableObject, IValidateOptions<T>, FluentValidation and client-side checks. The agent reaches for them when you ask to add or rework validation.

Which projects does this skill fit?

ASP.NET Core applications. The samples rely on C# and the System.ComponentModel.DataAnnotations namespace, and some attributes need .NET 8 or later.

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor