koan-api-building

Generates REST CRUD APIs for entities with authentication and routing built in.

4|3|Updated Aug 18, 2025
One-click install
npx skills add https://github.com/sylin-org/koan-framework --skill koan-api-building
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: koan-api-building
Source: https://github.com/sylin-org/koan-framework/tree/main/.claude/skills/api-building
Command: npx skills add https://github.com/sylin-org/koan-framework --skill koan-api-building

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually creating REST API endpoints for CRUD operations is repetitive and error-prone. This Skill automates the generation of full CRUD APIs, allowing developers to focus on custom business logic and security.

Core Features & Use Cases

  • Auto-Generated CRUD: Instantly get GET, POST, PUT, DELETE, and PATCH endpoints for any entity by inheriting EntityController<T>.
  • Custom Routes: Easily add specific business operations beyond CRUD with standard ASP.NET Core routing.
  • Authentication & Authorization: Secure your APIs with declarative [Authorize] attributes and fine-grained policy enforcement.
  • Payload Transformers: Customize API responses to fit specific client needs or implement HATEOAS patterns.
  • Use Case: Quickly expose a Todo entity as a full REST API, then add a custom endpoint like /api/products/{id}/discount with specific authorization rules, all with minimal code.

Quick Start

To create a full CRUD API for your 'Todo' entity, define a controller like this: [Route("api/[controller]")] public class TodosController : EntityController<Todo> { }

Frequently Asked Questions about koan-api-building

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

FAQPage Schema
How do I automatically generate CRUD REST API endpoints for my ASP.NET Core entities?

Inherit from EntityController<T> in ASP.NET Core to auto-generate GET, POST, PUT, DELETE, and PATCH endpoints for any entity. Decorate your controller with [Route] attributes, and the framework creates full CRUD operations without manual endpoint wiring.

Can I add custom authorization and authentication policies to REST API endpoints?

Yes. Use declarative [Authorize] attributes and policy-based access control to secure endpoints with fine-grained permission rules. Apply policies per endpoint or controller to enforce authentication and authorization across your REST API.

What's the best way to customize REST API responses for different client needs?

Use payload transformers to shape API responses and implement patterns like HATEOAS. Register transformers via KoanAutoRegistrar to automatically apply custom response formatting across endpoints.

How do I add business-specific endpoints beyond standard CRUD operations in REST APIs?

Define custom routes using standard ASP.NET Core routing attributes alongside your EntityController<T> inheritance. This lets you add specialized endpoints like `/api/products/{id}/discount` with dedicated authorization rules.

Does this approach support API versioning and custom error handling?

Yes. The framework supports declarative routing attributes for API versioning and custom error handling across tasks like endpoint wiring and response shaping, enabling consistent version management and exception handling.