go-http-server-reliability
Skill6 starsChanged 3 months agoMITView on GitHub
Checklist for validating Go HTTP server reliability, covering application goroutines, server configuration, request lifecycle, resource management, graceful shutdown, logging, and reliability tests. Use when building, modifying, or reviewing Go HTTP servers using net/http, Echo, or Gin.
In this repository2 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Do not audit TCP connection handling, HTTP parsing, framing, or other functionality already handled by Go's net/http.
- Distinctive: line 24
Read the whole HTTP server package before answering (server initialization, middleware, handlers, background workers, and shutdown code).
- Very specific: line 29
If evidence cannot be found, mark FAIL.
- Distinctive: line 30
When building or modifying code, treat this checklist as the definition of done.
- Distinctive: line 80
Check that tests exist and are meaningful.
- Distinctive: line 102
Do not report these as missing application functionality.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Go HTTP Server Reliability Checklist
Validate application-level HTTP server infrastructure against every item below.
Scope: Server configuration, application-managed goroutines, request lifecycle, resource management, graceful shutdown, and reliability tests.
Do not audit TCP connection handling, HTTP parsing, framing, or other functionality already handled by Go's net/http.
Context
- Echo and Gin are built on Go's
net/http. net/httpalready handles HTTP transport, connection management, and handler panic isolation.recover()only catches panics in its own goroutine. Application-created goroutines need their own recovery boundary when fault isolation is required.http.Server.Shutdown()handles graceful shutdown of ordinary HTTP connections. Hijacked connections require separate handling.SIGKILLcannot be caught. Graceful shutdown applies toSIGINTandSIGTERM.
How to Run
- Read the whole HTTP server package before answering (server initialization, middleware, handlers, background workers, and shutdown code).
- Answer every item. Do not skip or merge items.
- Mark each item
PASS,FAIL, orN/A. PASSneeds evidence: the function, type, middleware, or config field name that satisfies it. No note.N/Aneeds a reason.FAILneeds what is missing and where it should be fixed.- If evidence cannot be found, mark
FAIL. Do not assume. - When building or modifying code, treat this checklist as the definition of done.
Report Format
ID | Result | Checklist Item | Evidence / Note
GS-1 | PASS | Do application goroutines have managed lifecycles? | worker: context cancellation
SV-1 | FAIL | Are HTTP server timeouts configured appropriately? | Missing ReadHeaderTimeoutEnd with a summary: counts of PASS / FAIL / N/A, and the list of FAIL IDs. Any FAIL means the review fails.
Checklist
GS - Goroutine Safety
- GS-1: Does every application-created goroutine have a defined termination condition and appropriate lifecycle tracking?
- GS-2: Do long-lived application goroutines that require fault isolation have their own panic recovery?
SV - Server Configuration and Limits
- SV-1: Are HTTP server timeouts (
ReadHeaderTimeout,ReadTimeout,WriteTimeout,IdleTimeout) configured appropriately for the application? - SV-2: Are HTTP headers and request bodies protected by appropriate size limits?
- SV-3: Are concurrent requests and connections bounded where necessary, with defined behavior when limits are reached?
RE - Request Lifecycle
- RE-1: Are request contexts propagated to downstream operations, with appropriate timeouts and cancellation handling?
- RE-2: Are request and response objects used safely within the handler lifecycle, without concurrent response writes or unsafe background access?
RC - Resource and Concurrency
- RC-1: Is shared mutable application state protected by mutexes, synchronization primitives, or atomics?
- RC-2: Are application-managed goroutines, queues, worker pools, and buffers bounded to prevent unbounded resource growth?
- RC-3: Are application-owned resources properly released when operations, requests, or workers finish?
SD - Graceful Shutdown
- SD-1: Are
SIGINTandSIGTERMhandled, and does shutdown usehttp.Server.Shutdown()with a configurable timeout? - SD-2: When graceful shutdown expires, are remaining ordinary connections force-closed, with hijacked connections handled separately where applicable?
- SD-3: Are application-managed workers stopped and awaited, and are other application-owned resources closed during shutdown?
LG - Logging and Diagnostics
- LG-1: Are HTTP requests and unexpected server errors logged appropriately without redundant error logging?
- LG-2: Are sensitive payment details and raw payloads kept out of logs, masked wherever necessary?
- LG-3: Are relevant application metrics observable, including request counts, active requests, and goroutine counts?
TS - Reliability Tests
Check that tests exist and are meaningful. Search test files by name or behavior.
- TS-1: Are concurrent HTTP requests and concurrency-limit behavior tested?
- TS-2: Are request cancellation, client disconnects, and configured timeouts tested?
- TS-3: Are oversized request bodies and malformed application payloads tested?
- TS-4: Is panic recovery tested where application-specific recovery middleware or goroutine isolation is implemented?
- TS-5: Are graceful shutdown, forced shutdown, and application worker cleanup tested?
- TS-6: Do application goroutine and resource counts return to baseline after operations finish?
- TS-7: Do the tests pass under
go test -race ./...? Run it and report the result.
Framework Responsibilities (Do Not Reimplement)
Go's net/http already handles:
- TCP connection acceptance and ordinary connection lifecycle.
- HTTP parsing, framing, and partial reads.
- HTTP connection-serving goroutines.
- Ordinary connection tracking and cleanup.
- Recovery of panics escaping HTTP handlers.
- Graceful connection draining through
Server.Shutdown(). - Forced closure of ordinary HTTP connections through
Server.Close().
Do not report these as missing application functionality.
Focus on configuring and correctly integrating these capabilities with application-owned resources and goroutines.
Important exceptions:
- Application-created goroutines need their own lifecycle management and panic recovery where required.
- Request body limits must be configured separately from
MaxHeaderBytes. net/httpdoes not provide a general maximum concurrent request or connection limit.- Hijacked connections, such as WebSockets, require separate lifecycle management.
- HTTP server shutdown does not automatically stop application-managed background workers.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

