go-service
Skill0 starsChanged 23 days agoMITView on GitHub
Create a new small Go service from scratch in the user's style - standard library HTTP, PostgreSQL or Redis, Docker, tests and Russian docs. Use when the user asks to "создай сервис на Go", "новый Go проект", "scaffold a Go service", or wants to start a Go learning project.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Dankosik/golang-backend-skillstheir own version, first seen Sep 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Dankosik/golang-backend-skills★ 0same name
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 repository3 other files it gives its agents.
- interview-prepSkill
- learning-articleSkill
- php-reviewSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Ask, in one message, only what is not clear from the request:
- Very specific: line 22
Keep it flat. A single package main with files split by responsibility is the default.
- Very specific: line 47
No comments in the code at all.
- Very specific: line 61
Before finishing, run gofmt -l ., go vet ./...
- Very specific: line 77
Do not create a GitHub repository or push: give the user the gh repo create command to run themselves.
≈ “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 service
Build a small, working Go service that looks like a learning project: simple, readable, honest about its limits. Prefer clarity over cleverness every time.
Agree on the scope first
Ask, in one message, only what is not clear from the request:
- what the service does, in one sentence;
- storage: none, PostgreSQL, Redis, or something else;
- the repository name (default: kebab-case of the purpose).
Then propose the API or the main loop in a short list and wait for a yes before writing code.
Layout
Keep it flat. A single package main with files split by responsibility is the default; a separate package only when the code is meant to be imported as a library.
<name>/
main.go config, connections, start, graceful shutdown
config.go env variables with defaults
api.go HTTP handlers, if there is an API
<core>.go the main logic: worker.go, relay.go, limiter.go
<core>_test.go
integration_test.go tests against real dependencies
migrations/001_init.sql
examples/ small programs that show how to use it
docs/how-it-works.md
docs/limitations.md
Dockerfile
docker-compose.yml
Makefile
README.md
.gitignoreCode rules
- Module path
github.com/kasevvlad/<name>. - Standard library first:
net/httpwith Go 1.22 patterns (mux.HandleFunc("POST /items/{id}", ...),r.PathValue),database/sqlwithgithub.com/jackc/pgx/v5/stdlib,log,encoding/json. Add a dependency only when the standard library has nothing. - No comments in the code at all. If something needs explaining, it goes into
docs/how-it-works.md. - Plain error handling:
if err != nil { return ..., err }, wrap withfmt.Errorf("...: %w", err)only where context helps. No panics outsidemain. - Config from environment via a small
getEnv(name, default)helper. Every variable has a working default for local runs. - Graceful shutdown:
signal.NotifyContextforSIGINT/SIGTERM,server.Shutdownwith a timeout, background workers stop through the context and are awaited withsync.WaitGroup. - Work that must not be cut in half on shutdown (sending a request, a DB transaction) runs with its own context, not the cancelled one.
- Concurrency only where the task needs it, and always with a test that runs it in parallel.
- Time is injectable (
now func() time.Time) in anything that depends on it, so tests never sleep for real. - Names are boring and clear:
processOne,publishBatch,loadConfig.
Tests
- Unit tests for pure logic with table-driven cases.
- Integration tests against real dependencies. PostgreSQL tests skip when
TEST_DATABASE_URLis empty; Redis can usegithub.com/alicebob/miniredis/v2; NATS can run in-process viagithub.com/nats-io/nats-server/v2/server. make test-integration(ormake test) starts what is needed in Docker and creates a separate test database.- Before finishing, run
gofmt -l .,go vet ./...andgo test -race ./...and fix everything. Then run the service withdocker compose upand exercise it once end to end withcurlor the example program.
Docker
- Multi-stage
Dockerfile:golang:<version from go.mod>-alpineto build withCGO_ENABLED=0,alpineto run. docker-compose.ymlwith the dependencies, healthchecks, migrations mounted intodocker-entrypoint-initdb.d, and the service itself. Pick host ports that do not clash with the user's other projects (check withdocker psand existing compose files nearby).
Documentation
README.mdin English: first line says it is a learning project and what it practises; then what it does, how to run, API table, config table, how to run tests. Short.docs/how-it-works.mdin Russian: why the service exists, the path of one request or event, the interesting decisions explained in plain words with small diagrams, and which test proves each important property.docs/limitations.mdin Russian: honest list of what is simplified and what a production version would do differently.
Finishing
git init -b mainand one commit with a plain message. No AI attribution, no Co-Authored-By trailer.- Do not create a GitHub repository or push: give the user the
gh repo createcommand to run themselves. - Tell the user which parts to read first so they can explain the project in an interview.
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.

