neo-dotnet-tag-helper

Solid

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.

AI & Automation 7 stars 2 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
30
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# .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: 1. **Target HTML Tag**: What is the name of the custom tag in HTML? (e.g., `<my-button>`, `<user-card>`) 2. **Properties**: What parameters/attributes should this tag accept? (e.g., `theme`, `is-active`, `user-id`) 3. **Dependencies (DI)**: Does this tag need to query a database or call a service? (Needs Dependency Injection) 4. **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`. ### Step 3: Act (Code...

Details

Author
Benknightdark
Repository
Benknightdark/neo-skills
Created
6 months ago
Last Updated
yesterday
Language
JavaScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category