agentsclimarketplace

Go api

Skill nyquistwilder/personal-pi/skills/go-api

My personal pi harness configuration.

Install
npx -y skills add nyquistwilder/personal-pi --skill go-api

Assembled 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/http and Go's modern http.ServeMux for simple APIs.
  • Use go-chi/chi/v5 when path params, middleware composition, route groups, or larger API shape justify it.
  • Use typed request/response structs with encoding/json at the transport boundary.
  • Use json.Decoder.DisallowUnknownFields when strict request contracts matter.
  • Limit request body sizes with http.MaxBytesReader or 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

  1. Define route, method, schema, status codes, errors, auth, and compatibility needs.
  2. Choose stdlib mux or chi based on concrete routing needs.
  3. Implement thin handlers over services/stores.
  4. Add middleware for request IDs, logging, recovery, auth, and timeouts only when needed.
  5. Add handler/service tests for success, validation, auth, errors, and cancellation.
  6. Run targeted tests, go test ./..., race checks when concurrency is involved, lint, and just 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.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.