neo-dotnet-tag-helper
Installation
SKILL.md
.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)?