scaffold-go-service
Skill7 starsChanged 17 days agoMITView on GitHub
Use when starting a Go HTTP service or adding one to a repo with no Go module yet — scaffolds stdlib net/http (1.22+ routing), cmd/ and internal/ layers, slog JSON logs, validated env config, problem+json errors, health/readiness, graceful shutdown and a golangci-lint v2 config.
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- VelimirMueller/claude-skillsword for word, first seen Oct 11, 2026
Other versions1 project uses a version of this.
Word for word · 1
- VelimirMueller/claude-skills★ 7100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository156 other files it gives its agents.
- skills/swift/swiftui-design-principles/AGENTS.mdAGENTS.md
- skills/swift/ios-code-audit/CLAUDE.mdCLAUDE.md
- skills/swift/swift-focusengine-pro/llms.txtllms.txt
- build-llm-seamSkill
- build-mcp-serverSkill
- build-rag-pipelineSkill
- secure-llm-featuresSkill
- set-up-llm-evalsSkill
- build-nextjs-backendSkill
- build-supabase-edge-functionSkill
- configure-backend-testsSkill
- design-http-apiSkill
- harden-backendSkill
- scaffold-fastapi-serviceSkill
- scaffold-hono-serviceSkill
- secure-supabase-rlsSkill
- set-up-backend-authSkill
- set-up-background-jobsSkill
- set-up-databaseSkill
- set-up-nextjs-supabase-authSkill
- set-up-observabilitySkill
- set-up-supabaseSkill
- build-cliSkill
- release-cliSkill
- set-up-dev-toolchainSkill
- audit-securitySkill
- audit-toolchainSkill
- extend-skillsetSkill
- promote-releaseSkill
- set-up-stack-profileSkill
- write-commit-messagesSkill
- write-pull-requestsSkill
- analyze-complexitySkill
- apply-algorithmsSkill
- apply-design-patternsSkill
- apply-design-principlesSkill
- apply-solidSkill
- choose-data-structureSkill
- debug-systematicallySkill
- enforce-dependency-ruleSkill
- refactor-safelySkill
- slice-and-estimateSkill
- write-clean-testsSkill
- write-readable-codeSkill
- clean-frontend-scaffoldingSkill
- configure-accessibilitySkill
- configure-analyticsSkill
- configure-ciSkill
- configure-error-trackingSkill
- configure-lintingSkill
- configure-test-stackSkill
- configure-typescriptSkill
- create-moduleSkill
- optimize-performanceSkill
- scaffold-frontend-projectSkill
- set-up-authSkill
- set-up-design-systemSkill
- set-up-document-headSkill
- set-up-error-boundariesSkill
- set-up-feature-flagsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Read the profile first; detect only what it leaves open (stack-profile.md).
- Distinctive: line 22
No Go toolchain: tell the user which Go line to install (stack-versions.md).
- Distinctive: line 28
All present and step 7 passes: report "already in place" and stop.
- Very specific: line 52
Create the files from go-files.md, skipping any that exist.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Scaffold Go Service
Rationale and rules: go-patterns.md. Full file contents: go-files.md. Shared standards: service-layout.md, config.md, stack-versions.md.
1. Audit (change nothing)
cat .claude/stack-profile.md ~/.claude/stack-profile.md 2>/dev/null # backend.track, database.orm, tests.layout, task_runner, observability
ls go.mod go.work .golangci.yml .golangci.yaml cmd internal 2>/dev/null
head -3 go.mod 2>/dev/null; go version; golangci-lint --version 2>/dev/null
grep -rlE 'go-chi/chi|gin-gonic/gin|labstack/echo|gofiber' --include=go.mod . 2>/dev/nullRead the profile first; detect only what it leaves open (stack-profile.md).
backend.trackis set and is notgo: stop and name the track the profile says; suggest the matching scaffold skill.backend.trackis unset and a router framework (chi,gin,echo,fiber) is already ingo.mod: keep it, adapt step 5 (routes registered on that router). Do not ask.- No Go toolchain: tell the user which Go line to install (stack-versions.md); do not scaffold blind.
2. Decide
- No
go.mod: full scaffold (steps 3 to 7). The module path comes fromgit remote get-url origin(github.com/<org>/<repo>), else ask once; never leaveexample.com/svc. go.modpresent, nocmd/<svc>orinternal/: add the layers around the existing code; do not move existing packages without being asked.- All present and step 7 passes: report "already in place" and stop.
3. Detect track
| Question | Source | Default |
| Router | profile or go.mod | stdlib http.ServeMux with GET /notes/{id} patterns. chi only if already used, see go-patterns.md |
| Service name | repo folder name, kebab-case | svc in the files becomes this name |
| Database | database.orm | sqlc: add internal/repository/db/ (sqlc output) and a pgxpool seam in internal/platform/db/ via the sqlc skill of this catalogue; then a readiness check. none: skip |
| Tests | tests.layout | unit tests always *_test.go beside the code (Go convention); tests-dir applies to integration tests in tests/ |
| Observability | observability.otel | true: bootstrap the SDK in internal/platform/ before the logger (observability.md) |
| Task runner | task_runner | just: recipes run, test, lint, build that call the commands in step 7 |
4. Install only what is missing
go mod init <module-path> # only when go.mod is missing; writes the current go line
brew install golangci-lint # or mise / the release binary; confirm it prints v2.xThe scaffold has no third-party runtime dependencies. Check golangci-lint --version against stack-versions.md; v1 configs do not load in v2.
5. Generate the seams
Create the files from go-files.md, skipping any that exist. Replace example.com/svc with the module path in every import.
cmd/<svc>/main.go composition root, signal handling, graceful shutdown
internal/config/config.go Load(lookup) -> Config, every invalid key reported
internal/platform/logging/logging.go slog JSON, contract field names, redaction
internal/transport/httpapi/{server,problem}.go routes, middleware, problem+json, readiness
internal/service/*.go use cases, no net/http
internal/repository/*.go storage; the only layer with SQL
.golangci.yml .env.example
*_test.go beside each packageRename notes to the first real module, or keep it as the worked example until one exists.
6. Wire
.gitignore: add/bin/,.env,coverage.out.- Local run:
set -a; . ./.env; set +a; go run ./cmd/<svc>. Go does not read.env; see config.md. - Readiness: add one
httpapi.ReadinessCheck{Name, Check}per dependency inmain.go.Checkreceives a context with a 2 s deadline. - Shutdown: put pool close and telemetry flush after
srv.Shutdown, inrun(). KeepReadHeaderTimeoutset: the zero value ofhttp.Serverhas no timeouts. - Request context: handlers and services pass
r.Context()down; repositories takectxfirst.BaseContextties every request to the signal context. go.mod:go mod tidyonce; commitgo.sum; CI runsgo mod verify(version-protocol.md).- OpenAPI is not generated here: stdlib handlers carry no schema. Add
oapi-codegenor a hand-keptopenapi.yamlwhen clients need one. - CI, Docker and deploy are out of scope; the
devcoreandinfraskillsplugins own them.
7. Verify
gofmt -l . # expect: no output
go vet ./... && go test ./... # expect: ok for config, logging, httpapi
golangci-lint config verify && golangci-lint run ./... # expect: 0 issues
go build -o bin/<svc> ./cmd/<svc> && PORT=8131 ./bin/<svc> & # expect JSON line "message":"listening"
curl -s localhost:8131/readyz # expect {"status":"ok"}
curl -si localhost:8131/nope # expect 404 and Content-Type: application/problem+json
PORT=abc ./bin/<svc> # expect "fatal: config: PORT: ..." and exit 1
kill -TERM %1 # expect "shutting down" in the log, exit code 0A second run of this skill finds everything in place and changes nothing.
References
- go-patterns.md: why each choice, when to deviate.
- go-files.md: the files.
- service-layout.md, config.md.
- logging-contract.md, security-baseline.md.
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.

