@tank/go-api-patterns

Design Go HTTP API architectures with net/http, middleware, and Docker deployment.

1|1|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/tankpkg/packages --skill tank-go-api-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: @tank/go-api-patterns
Source: https://github.com/tankpkg/packages/tree/main/skills/go-api-patterns
Command: npx skills add https://github.com/tankpkg/packages --skill tank-go-api-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you design and implement production-ready Go HTTP APIs without reinventing the same architecture, middleware, routing, error handling, and deployment decisions each time.

Core Features & Use Cases

  • API Architecture Guidance: Choose between net/http ServeMux, Chi, Gin, Echo, or Fiber based on route complexity and team needs.
  • Production Concerns: Apply middleware, context propagation, structured logging, graceful shutdown, configuration loading, and consistent error mapping.
  • Testing and Delivery: Build reliable handler and repository tests with httptest, and prepare the service for Docker-based deployment and OpenAPI workflows.
  • Use Case: You are building a Go backend for a SaaS product and need a clear, battle-tested blueprint for project layout, request handling, database access, and operational readiness.

Quick Start

Ask for a production Go API plan for your service, including router choice, project structure, middleware order, error handling, testing strategy, and deployment guidance.

Frequently Asked Questions about @tank/go-api-patterns

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

FAQPage Schema
How do I structure a production Go HTTP API with middleware and graceful shutdown?

Production Go HTTP API architecture requires explicit dependency injection, request-scoped context propagation, structured slog logging, and graceful shutdown mechanisms. This Skill designs these patterns, mapping consistent errors and enforcing validation boundaries for reliable backend services.

What's the best way to choose a Go HTTP router for complex APIs?

Choosing a Go HTTP router depends on route complexity and team needs. This Skill compares net/http ServeMux against third-party routers like Chi, Gin, Echo, and Fiber to determine the best fit for your service's specific requirements.

How do I test Go HTTP API handlers and database access?

Testing Go HTTP API handlers involves using the httptest package to build reliable handler and repository tests. This Skill provides testing strategies that ensure your request handling and database access layers function correctly.

Can I use Docker and OpenAPI workflows with a Go backend service?

Docker and OpenAPI workflows integrate directly with Go backend services. This Skill prepares your HTTP API for Docker-based deployment and OpenAPI workflows, ensuring production-safe observability and operational readiness.

How does context propagation and error mapping work in Go HTTP APIs?

Context propagation in Go HTTP APIs uses request-scoped contexts to manage timeouts and cancellation, while consistent error mapping standardizes HTTP responses. This Skill enforces these patterns to maintain clean dependency injection and structured logging.