Chi Router

Define HTTP routes and middleware in Go applications using Chi.

Updated Jan 22, 2026
One-click install
npx skills add https://github.com/ngxtm/skill-rule --skill chi-router
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Chi Router
Source: https://github.com/ngxtm/skill-rule/tree/main/rules/golang/chi-router
Command: npx skills add https://github.com/ngxtm/skill-rule --skill chi-router

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized way to set up and manage routing for Go HTTP applications using the Chi router, ensuring consistent structure and best practices.

Core Features & Use Cases

  • Efficient Routing: Define routes, handle path parameters, and group endpoints logically.
  • Middleware Integration: Easily add and manage middleware for logging, authentication, and more.
  • Use Case: Quickly scaffold a new set of API endpoints for a Go microservice, ensuring all routes are properly defined and common middleware like logging and request ID are applied.

Quick Start

Use the Chi Router skill to set up a basic HTTP server with logging and a GET endpoint for '/health'.

Frequently Asked Questions about Chi Router

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

FAQPage Schema
How do I structure HTTP routes and middleware in a Go web service?▼

Structuring HTTP routes and middleware in a Go web service is streamlined by using the Chi router to define logical route groups and sub-routers while adhering to standard net/http handler interfaces.

What is the best way to group API endpoints in a Golang microservice?▼

The best way to group API endpoints in a Golang microservice is using Chi's routing conventions to create modular sub-routers, ensuring your HTTP services remain maintainable and logically organized.

How do I add logging and authentication middleware to a Go HTTP server?▼

You add logging and authentication middleware to a Go HTTP server by utilizing Chi's middleware integration capabilities, which allow you to easily apply standard request ID and logging wrappers to defined routes.

Can I use standard net/http handlers with the Chi router library?▼

Yes, you can use standard net/http handlers with the Chi router library, as it requires strict adherence to Go's native net/http handler interface for defining HTTP routes and managing web service requests.

How do I handle path parameters when building Go HTTP services?▼

You handle path parameters in Go HTTP services by leveraging Chi's efficient routing patterns, which facilitate clean extraction and context management for variables within your defined API endpoints.