huma

Generate OpenAPI schemas and RFC 9457-compliant errors from Go REST API code.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/danielmichaels/cskills --skill huma
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: huma
Source: https://github.com/danielmichaels/cskills/tree/main/go/skills/huma
Command: npx skills add https://github.com/danielmichaels/cskills --skill huma

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Huma provides a cohesive framework to design, implement, and document Go REST APIs by aligning route registration, input validation, error handling (RFC 9457), middleware, security schemes, and OpenAPI generation. It reduces boilerplate and enforces consistent API patterns across services.

Core Features & Use Cases

  • OpenAPI generation from Go code: Generates stable API schemas directly from handlers and operation definitions.
  • Consistent request handling: Enforces a uniform handler signature, structured inputs, and built-in validation tags for request data.
  • Security and middleware support: Integrates per-operation security schemes and reusable middleware for authorization, logging, and resilience.
  • Streaming and SSE support: Supports streaming responses and Server-Sent Events with a clear contract.
  • Testing and tooling: Includes utilities like humatest for end-to-end testing and RFC-compliant error handling.

Quick Start

Create a new Go REST API project using Huma and annotate routes to generate OpenAPI docs.

Frequently Asked Questions about huma

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

FAQPage Schema
How do I generate OpenAPI schemas from Go REST API code?

Generate OpenAPI schemas from Go REST API code by defining operation metadata and handler signatures, which automatically produces stable API documentation directly from your routes. This eliminates manual schema maintenance and keeps docs synchronized with code.

What is the best way to enforce consistent request validation in Go APIs?

Enforce consistent request validation in Go APIs by using structured inputs with built-in validation tags within a uniform handler signature. This approach standardizes data parsing and reduces boilerplate across all endpoints.

How do I implement streaming responses and Server-Sent Events in a Go REST API?

Implement streaming responses and Server-Sent Events in a Go REST API by utilizing built-in streaming support with a clear contract. This handles continuous data flows efficiently without breaking the structured routing pattern.

Can I use RFC 9457 compliant error handling with Go API middleware?

Yes, you can use RFC 9457 compliant error handling with Go API middleware by integrating per-operation security schemes and reusable middleware. This standardizes error responses and handles authorization consistently across services.

How do I test Go REST API endpoints end-to-end during development?

Test Go REST API endpoints end-to-end during development by using the humatest utility included in the framework. This allows you to validate routing, input validation, and responses without deploying a live server.

Does this Go REST API framework support per-operation security schemes?

Yes, this Go REST API framework supports per-operation security schemes by allowing you to define authorization rules within operation metadata. This integrates seamlessly with reusable middleware for logging and resilience.