Skip to content
Back to skills

Api Server Hoangnguyen0403 Agent Skills Standar

ASecurity

Standards for building HTTP services, REST APIs, and middleware in Golang.

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 2, 2026
ai-agentsgoapiperformance

Works with

  • api

Security analysis

A100/100

Scanned June 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill api-server-hoangnguyen0403-agent-skills-standar --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Server Hoangnguyen0403 Agent Skills Standar?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Server Hoangnguyen0403 Agent Skills Standar
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-api-server-hoangnguyen0403-agent-skills-standar/badge)](https://www.skillsdirectory.com/skills/majiayu000-api-server-hoangnguyen0403-agent-skills-standar)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: API Server
description: Standards for building HTTP services, REST APIs, and middleware in Golang.
metadata:
  labels: [golang, http, api, rest, middleware]
  triggers:
    files: ['cmd/server/*.go', 'internal/adapter/handler/**']
    keywords: [http server, rest api, gin, echo, middleware]
---

# Golang API Server Standards

## **Priority: P0 (CRITICAL)**

## Router Selection

- **Standard Lib (`net/http`)**: Use for simple services or when zero deps is required. Use `http.ServeMux` (Go 1.22+ has decent routing).
- **Echo (`labstack/echo`)**: Recommended for production REST APIs. Excellent middleware support, binding, and error handling.
- **Gin (`gin-gonic/gin`)**: High performance alternative.

## Guidelines

- **Graceful Shutdown**: MUST implement graceful shutdown to handle in-flight requests on termination (SIGINT/SIGTERM).
- **DTOs**: Separate Domain structs from API Request/Response structs. Map between them.
- **Middleware**: Use middleware for cross-cutting concerns (Logging, Recovery, CORS, Auth, Tracing).
- **Health Checks**: Always include `/health` and `/ready` endpoints.
- **Content-Type**: Enforce `application/json` for REST APIs.

## Middleware Pattern

- Standard: `func(next http.Handler) http.Handler`
- Echo implementation: `func(next echo.HandlerFunc) echo.HandlerFunc`

## Anti-Patterns

- **Business Logic in Handlers**: Handlers should only parse request -> call service -> format response.
- **Global Router**: Don't use global router variables. Pass router instance.

## References

- [Middleware Patterns](references/middleware-patterns.md)
- [Graceful Shutdown](references/graceful-shutdown.md)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.