ericrisco/rsc-harness / skills/go
go
VerifiedUse when writing, reviewing, testing, or shipping Go code and HTTP services: idioms, `%w` error wrapping, goroutine/context/errgroup concurrency, net/http 1.22 routing, log/slog, project layout, table-driven tests, Go hardening. NOT language-agnostic threat modeling (that is `security-audit`), NOT Dockerfile/CI shipping (that is `deployment`).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.2 KB |
| evals/README.md | markdown | 2.6 KB |
| evals/cases.yaml | config | 5.1 KB |
| references/concurrency.md | markdown | 15.8 KB |
| references/http-services.md | markdown | 14.7 KB |
| references/testing.md | markdown | 10.3 KB |
| scripts/verify.shexecutable | script | 5.3 KB |
evals/cases.yaml
View on GitHubskill: go
should_trigger:
- prompt: "Write a Go HTTP service that exposes GET /users/{id} backed by Postgres, with graceful shutdown."
why: "Authoring a Go net/http service with 1.22 routing and shutdown is the skill's core use case."
- prompt: "Is this idiomatic? func NewStore(db *sql.DB) Store { return &store{db} } — should the constructor return the interface?"
why: "Idiom review (accept-interfaces/return-structs, consumer-side interfaces) is explicitly owned here, even without naming a tool."
- prompt: "My background worker keeps running after the request is cancelled and the process never exits cleanly. How do I fix it?"
why: "Goroutine-leak / context-plumbing debugging is a named trigger; the user never says 'Go' but the symptom is a classic Go leak this skill diagnoses."
- prompt: "Add table-driven tests with subtests for this parser and make sure CI catches data races."
why: "Table-driven tests + -race in CI is the skill's testing contract."
- prompt: "Review this code for problems before I ship it: it does fmt.Sprintf the id straight into a SELECT and has no http.Server timeouts."
why: "Go-specific security controls (SQL parametrization, server timeouts) are embedded here; this is a review-this-Go-code trigger."
- prompt: "How should I wrap and classify errors across my repository, service, and handler layers so I return the right HTTP status?"
why: "Go error wrapping with %w and errors.Is/As plus the 3-layer status mapping is canonically owned by this skill."
- prompt: "I have 5000 IDs to fetch from an API concurrently but I'm hammering it — how do I cap in-flight goroutines and cancel the rest on first failure?"
why: "Bounded concurrency with errgroup (SetLimit + derived ctx cancellation) is a core concurrency pattern here; user describes the problem without naming errgroup."
should_not_trigger:
- prompt: "Do a threat model and OWASP-style authz review of my multi-tenant app's permission boundaries."
route_to: "security-audit"
why: "Language-agnostic threat modeling and authz/abuse review is explicitly delegated to security-audit; only Go-specific controls stay here."
- prompt: "Write a multi-stage Dockerfile and a GitHub Actions CI pipeline to build and deploy my service to Hetzner."
route_to: "deployment"
why: "Containerfile / CI / shipping is delegated to deployment; this skill ships only a Docker note plus ldflags."
- prompt: "Optimize this PostgreSQL query and design the indexes for a users table with a composite lookup."
route_to: "postgresdb"
why: "Pure SQL query/index design is a database concern; the Go skill only covers parametrization from the Go side, not schema/index tuning."
- prompt: "Build a FastAPI endpoint with Pydantic validation and async SQLAlchemy."
route_to: "fastapi"
why: "Python/FastAPI service work belongs to the fastapi skill, not the Go skill."
- prompt: "Record our team's chosen Go router, error conventions, and timeout defaults in the project wiki and index them from CLAUDE.md."
route_to: "harness"
why: "Authoring/indexing the 02-DOCS workspace wiki is the harness skill's job; the Go skill only writes its own stack article when that layer already exists."
- prompt: "Set up a Next.js App Router page that streams server components and calls our API."
route_to: "nextjs"
why: "Frontend/Next.js work is unrelated to Go services and routes to nextjs."
capability:
- scenario: "Implement a Go HTTP endpoint GET /users/{id} that loads a user from Postgres and returns 404 when the user is missing, 500 on unexpected errors."
must_include:
- "Uses Go 1.22 routed mux pattern (mux.HandleFunc(\"GET /users/{id}\", h)) and r.PathValue(\"id\") instead of a manual router or path parsing"
- "Repository translates sql.ErrNoRows into a domain sentinel via fmt.Errorf(\"...: %w\", ErrNotFound), preserving the wrap chain"
- "Handler classifies with errors.Is(err, ErrNotFound) -> http.StatusNotFound and a default branch -> http.StatusInternalServerError (no string-matching of messages)"
- "Parametrizes the SQL query with $1 (no fmt.Sprintf string interpolation into the query)"
- "Logs only the unexpected error with slog (e.g. slog.Error) rather than leaking internal errors to the client body"
- "Dependencies injected via constructor (handler holds a service/store), no package-level mutable db/logger globals"
- scenario: "Wire up main() for the service: configure the http.Server, structured logging, and shutdown."
must_include:
- "Sets all four http.Server timeouts (ReadHeaderTimeout, ReadTimeout, WriteTimeout, IdleTimeout) as a Slowloris/DoS control"
- "Graceful shutdown using signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM) and srv.Shutdown(shutdownCtx) on <-ctx.Done()"
- "Configures log/slog JSON handler and calls slog.SetDefault, with level read from env"
- "Wires layers with constructor injection outermost-inward (repo := repository.New(db); svc := service.New(repo); h := handler.New(svc))"
- "Mentions running govulncheck ./... and go test -race before shipping"
- "context.Context threaded as the first parameter, never stored in a struct or passed as nil"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |