neo-dotnet-tag-helper
Skill7 starsChanged 6 months agoMITView on GitHub
Use this skill when the user asks to design, implement, refactor, or review custom ASP.NET Core Tag Helpers in C#, including TagBuilder usage, strongly typed attributes, dependency injection, ProcessAsync, and reusable Razor UI behavior.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- generate-skillSkill
- neo-azure-pipelinesSkill
- neo-clarificationSkill
- neo-clean-architectureSkill
- neo-code-reviewSkill
- neo-csharp-interface-generatorSkill
- neo-csharpSkill
- neo-dotnet-ef-coreSkill
- neo-dotnet-minimal-apisSkill
- neo-dotnet-mvcSkill
- neo-dotnetSkill
- neo-dotnet-webapiSkill
- neo-harness-projectSkill
- neo-harnessSkill
- neo-javascriptSkill
- neo-opentelemetrySkill
- neo-prSkill
- neo-python-managerSkill
- neo-pythonSkill
- neo-rabbitmqSkill
- neo-rustSkill
- neo-stop-slopSkill
- neo-sub-agentSkill
- neo-swiftSkill
- neo-swift-uiSkill
- neo-typescriptSkill
- neo-vueSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Follow these steps exactly to create robust, high-performance C# Tag Helpers.
- Distinctive: line 27
Before writing any code, ask the user to clarify the following if not already provided:
- Very specific: line 35
Class Naming: Ensure the class name ends with TagHelper (e.g., MyButtonTagHelper).
- Very specific: line 39
If no IO/Async operations, override Process.
- Very specific: line 40
If using DI for database/API calls, override ProcessAsync.
- Very specific: line 45
Do NOT generate .cshtml files.
- Very specific: line 46
If ViewContext is needed, use [ViewContext] and [HtmlAttributeNotBound].
- Distinctive: line 48
Ensure Thread-Safety (do not store request-specific state in instance fields unless injected as scoped/transient).
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
.NET Tag Helper Expert Skill
Trigger On
- The user requests to create, generate, or design a custom Razor Tag Helper in C#.
- The user wants to encapsulate complex HTML/UI logic into reusable custom tags without using Partial Views or CSHTML.
- The target framework is .NET 6.0 (LTS) and above.
Workflow (Generator Pattern)
Follow these steps exactly to create robust, high-performance C# Tag Helpers.
Step 1: Perceive & Gather Requirements (Inversion)
Before writing any code, ask the user to clarify the following if not already provided:
- Target HTML Tag: What is the name of the custom tag in HTML? (e.g.,
<my-button>,<user-card>) - Properties: What parameters/attributes should this tag accept? (e.g.,
theme,is-active,user-id) - Dependencies (DI): Does this tag need to query a database or call a service? (Needs Dependency Injection)
- Context: Does it need to access
ViewContext(e.g., to generate URLs or check model state)?
Step 2: Reason & Design (Planning)
Based on the answers:
- Class Naming: Ensure the class name ends with
TagHelper(e.g.,MyButtonTagHelper). - Target Element: Apply
[HtmlTargetElement("my-button")]. - Properties: Map HTML kebab-case attributes to C# PascalCase properties. Apply
[HtmlAttributeName("is-active")]if necessary. - Method Selection:
- If no IO/Async operations, override
Process. - If using DI for database/API calls, override
ProcessAsync.
- If no IO/Async operations, override
Step 3: Act (Code Generation)
Generate the complete C# class. Strictly adhere to the following rules:
- Inherit from
Microsoft.AspNetCore.Razor.TagHelpers.TagHelper. - Do NOT generate
.cshtmlfiles. All HTML must be constructed usingTagBuilderinside the C# class. - If
ViewContextis needed, use[ViewContext]and[HtmlAttributeNotBound]. - Manage content properly using
output.TagName,output.Attributes.SetAttribute, andoutput.Content.SetHtmlContent. - Ensure Thread-Safety (do not store request-specific state in instance fields unless injected as scoped/transient).
Step 4: Validate (Quality Check)
Review the generated code against these criteria before presenting it:
- Are all properties strongly typed?
- Is
TagBuilderused instead of string concatenation for HTML elements? - Is
ProcessAsyncused correctly if awaiting tasks?
Deliverable
Present the C# code wrapped in a markdown code block. Briefly explain how to register it in _ViewImports.cshtml (e.g., @addTagHelper *, YourAssemblyName).
Documentation
Official References
Internal References
- Tag Helper Coding Style & Advanced Patterns
- Tag Helper Coding Conventions
- Tag Helper Anti-Patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

