aspnet-patterns

Define and implement clean architecture patterns for ASP.NET Core applications.

Updated Jan 25, 2026
One-click install
npx skills add https://github.com/tridentsof/antigravity-dev-kit --skill aspnet-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aspnet-patterns
Source: https://github.com/tridentsof/antigravity-dev-kit/tree/main/skills/aspnet-patterns
Command: npx skills add https://github.com/tridentsof/antigravity-dev-kit --skill aspnet-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline ASP.NET Core development by applying a proven, layered architecture (Controller → Service → Repository) to promote maintainability, testability, and scalability.

Core Features & Use Cases

  • Controller Pattern: HTTP endpoints that delegate to services, with routing, validation, and clean separation.
  • Service Pattern: Domain/business logic encapsulated in services, orchestrating repositories.
  • Dependency Injection: Centralized wiring of interfaces to implementations for testability.
  • Response & Status Code Guidance: Standardized API responses and HTTP status semantics for consistent client experience.
  • Use Case: Build a RESTful API with clear separation of concerns and easy unit testing following the patterns illustrated.

Quick Start

Instantiate your ASP.NET Core project using these patterns and register services as shown in the examples, then implement endpoints using the Controller/Service/Repository structure.

Frequently Asked Questions about aspnet-patterns

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

FAQPage Schema
How do I structure an ASP.NET Core Web API with clean architecture?

Structure your ASP.NET Core Web API using clean architecture by separating concerns across Controllers, Services, and Repositories. This layered pattern delegates HTTP endpoints to services for business logic and repositories for data access via dependency injection.

What is the best way to separate business logic from controllers in ASP.NET Core?

The best way to separate business logic from controllers in ASP.NET Core is the Service pattern. Controllers delegate HTTP requests to services, which orchestrate domain logic and repositories, ensuring controllers remain focused on routing and validation.

How do I configure dependency injection for services and repositories in ASP.NET Core?

Configure dependency injection in ASP.NET Core by centrally wiring service and repository interfaces to their concrete implementations. This centralized registration promotes testability by allowing mock substitutions during unit testing.

How should standard HTTP responses and status codes be handled in an ASP.NET Core API?

Handle standard HTTP responses and status codes in an ASP.NET Core API by applying consistent response formats and HTTP status conventions. This standardization ensures a predictable client experience across all API endpoints.

Can I use clean architecture patterns for both web apps and APIs in ASP.NET Core?

Yes, you can apply clean architecture patterns for both web apps and APIs in ASP.NET Core. The Controller, Service, and Repository separation scales across typical web applications requiring dependency injection and maintainability.

Why use a repository pattern with dependency injection in ASP.NET Core?

Use a repository pattern with dependency injection in ASP.NET Core to abstract data access details from services. This separation improves testability and maintainability by decoupling business logic from infrastructure concerns.