go-create-chi-handler

Generate Chi HTTP handlers with DTOs, use-case orchestration, and error handling.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/cristiano-pacheco/ai-rules --skill go-create-chi-handler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-create-chi-handler
Source: https://github.com/cristiano-pacheco/ai-rules/tree/main/skills/go-create-chi-handler
Command: npx skills add https://github.com/cristiano-pacheco/ai-rules --skill go-create-chi-handler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate Chi HTTP handlers following GO modular architechture conventions (request/response DTOs, use case orchestration, error handling, swagger annotations, Fx DI). Use when creating HTTP endpoint handlers in internal/modules/<module>/http/chi/handler/ for REST operations (List, Create, Update, Delete, Get) that need to decode requests, call use cases, map responses, and handle errors with proper logging and tracing.

Core Features & Use Cases

  • Scaffold a Chi-based HTTP handler structure aligned with a modular Go architecture, including request decoding, use-case orchestration, response mapping, and error handling.
  • Enforce separation between HTTP DTOs and domain/use-case inputs/outputs, along with Swagger annotations and Fx DI wiring.
  • Provide a consistent pattern for List, Create, Update, Delete, and Get endpoints with standardized logging and tracing hooks.

Quick Start

Create a new Chi handler for a module by wiring use cases, decoding requests, and returning mapped responses.

Frequently Asked Questions about go-create-chi-handler

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

FAQPage Schema
How do I generate Chi HTTP handlers for a modular Go architecture?

Generating Chi HTTP handlers for modular Go architecture involves scaffolding request decoding, use-case orchestration, response mapping, and structured error handling with tracing. This enforces DTO separation and Fx DI wiring for consistent REST operations.

What is the best way to structure Chi handlers for Create, Update, and Delete endpoints in Go?

Structuring Chi handlers for REST operations requires separating HTTP DTOs from domain inputs, applying Swagger annotations, and routing through use-case orchestration. This delivers standardized logging and traceable errors for List, Create, Update, Delete, and Get endpoints.

How does Fx dependency injection work with Chi handlers in Go modular applications?

Fx dependency injection wires Chi handlers by automatically providing use cases and logging utilities to the HTTP layer. This ensures handlers under the internal/modules pattern are properly orchestrated and traceable without manual instantiation.

Can I use this Chi handler pattern to enforce Swagger annotations and DTO separation?

Yes, this Chi handler pattern enforces Swagger annotations and strict DTO separation. It separates HTTP request and response DTOs from domain use-case inputs and outputs, ensuring clear boundaries and consistent API documentation.

Do I need to manually map responses and handle errors when creating Go Chi handlers?

No, you do not need to manually map responses and handle errors. The Chi handler pattern standardizes response mapping and applies structured error handling with proper logging and tracing hooks automatically during generation.