Go api
My personal pi harness configuration.
npx -y skills add nyquistwilder/personal-pi --skill go-apiAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Greenfield Go HTTP API workflow for net/http or chi services, routing, handlers, middleware, validation, status codes, structured errors, auth hooks, OpenAPI concerns, and service tests.
SKILL.md
2.6 KB, as published. Nobody here has run it
Go API
Rule
Build HTTP APIs around explicit contracts. Keep handlers thin, domain logic testable, and network/server concerns at the edge.
Hard Stops
Ask before:
- Choosing or changing routing frameworks, public routes, request/response schemas, status codes, auth policy, CORS, rate limits, or error formats.
- Calling live services, production databases, real secrets, or external identity providers in tests.
- Adding OpenAPI generators, middleware stacks, or validation libraries.
- Weakening TLS, auth, tenant isolation, request limits, or audit behavior.
Defaults
- Prefer stdlib
net/httpand Go's modernhttp.ServeMuxfor simple APIs. - Use
go-chi/chi/v5when path params, middleware composition, route groups, or larger API shape justify it. - Use typed request/response structs with
encoding/jsonat the transport boundary. - Use
json.Decoder.DisallowUnknownFieldswhen strict request contracts matter. - Limit request body sizes with
http.MaxBytesReaderor upstream limits. - Return structured JSON errors with stable codes/messages; do not expose internal errors.
- Set server timeouts (
ReadHeaderTimeout,ReadTimeout,WriteTimeout,IdleTimeout). - Keep domain errors framework-independent and map them in handlers.
Testing
Use httptest for handlers and servers. Avoid fixed ports and live network dependencies.
Assert status code, headers when meaningful, JSON body shape, validation failures, auth
hooks, context cancellation, and side effects through isolated stores.
Workflow
- Define route, method, schema, status codes, errors, auth, and compatibility needs.
- Choose stdlib mux or chi based on concrete routing needs.
- Implement thin handlers over services/stores.
- Add middleware for request IDs, logging, recovery, auth, and timeouts only when needed.
- Add handler/service tests for success, validation, auth, errors, and cancellation.
- Run targeted tests,
go test ./..., race checks when concurrency is involved, lint, andjust check.
Antipatterns
- Business logic embedded in handlers.
- Starting servers at import/init time or in tests with fixed ports.
- Ignoring
r.Context()for downstream I/O. - Logging request bodies or auth headers.
- Returning raw
error.Error()to clients.
Completion
Report API contract, router/dependency choices, validation and error behavior, auth assumptions, tests, and validation results.