add-feature

Generate vertical-slice command or query artifacts for FSH modules.

6.7k|2.0k|Updated Aug 20, 2021
One-click install
npx skills add https://github.com/fullstackhero/dotnet-starter-kit --skill add-feature-fullstackhero
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-feature
Source: https://github.com/fullstackhero/dotnet-starter-kit/tree/main/.agents/skills/add-feature
Command: npx skills add https://github.com/fullstackhero/dotnet-starter-kit --skill add-feature-fullstackhero

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It eliminates the guesswork and inconsistent patterns when adding a new API endpoint or business operation to an existing FullStackHero (FSH) module that already follows the vertical-slice architecture.

Core Features & Use Cases

  • Creates the required vertical-slice artifacts: contracts-level command/query types, runtime handler, validator, and endpoint wiring.
  • Ensures correct layering and conventions: contracts live in the module’s .Contracts project, while handler/endpoint code lives in the runtime Features/ area.
  • Supports the platform’s safety expectations: includes required validators and endpoint permissions/idempotency conventions for production readiness.
  • Use case: you need to add a “CreateOrder” operation to an existing module and want it implemented with the expected DbContext injection, validation, and permissioned route mapping.

Quick Start

Use the add-feature skill to scaffold a command/query, handler with DbContext injection, required validator, endpoint, and wire it into the target module’s MapEndpoints.

Frequently Asked Questions about add-feature

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new API endpoint to an existing dotnet vertical slice module?

To add a new API endpoint to an existing dotnet vertical slice module, you scaffold the contracts, handler, validator, and endpoint wiring. This ensures correct layering by placing command or query types in the Contracts project and runtime code in the Features area.

What is the best way to structure a Mediator command or query in a vertical slice architecture?

Structuring a Mediator command or query in vertical slice architecture involves defining ICommand or IQuery types in a Contracts project. The runtime handler injects the module DbContext directly without repositories, ensuring business operations remain decoupled and consistent.

Do I need a validator and idempotency configuration when creating an API operation in dotnet?

Yes, a validator and idempotency configuration are required when creating an API operation in dotnet. The vertical slice feature requires a validator for production readiness, and the endpoint mapping must include permissions and idempotency conventions mapped to the correct route.

How does DbContext injection work for feature handlers without using repositories?

DbContext injection works by having the runtime feature handler directly inject the module DbContext. This approach eliminates the need for separate repositories, allowing the handler to perform data access directly while maintaining the vertical slice module conventions.

Can I use this scaffolding approach for any dotnet module or does it require specific conventions?

This scaffolding approach requires existing dotnet modules that already follow specific module conventions. It applies specifically to the FullStackHero architecture, ensuring the new feature integrates with the established permissions model and MapEndpoints group wiring.

Why are my feature handlers not mapping correctly to the API endpoint route?

Feature handlers fail to map correctly when they are not integrated into the module's MapEndpoints group. Correct endpoint wiring requires mapping the route with the appropriate permissions and idempotency settings to align with the module's established conventions.