go-engineeringlisted
Install: claude install-skill mfmezger/ai_agent_dotfiles
# Go Engineering
Produce Go that is small in surface area, explicit in behavior, and easy to read under review. Prefer straightforward package boundaries, concrete types first, small interfaces where they help callers, explicit error handling, and concurrency that can be reasoned about.
## Workflow
1. Identify the package boundary.
Library: optimize for small exports, concrete behavior, and compatibility.
Application: optimize for operability, wiring clarity, and cancellation-aware execution.
2. Model the package API before adding helpers.
Keep exported identifiers minimal and make zero values useful when practical.
3. Choose concrete types first.
Introduce interfaces where consumers benefit, not as a reflex.
4. Design error flow early.
Wrap with context, support `errors.Is` and `errors.As`, and keep sentinel errors narrow.
5. Add concurrency only where it simplifies latency or throughput.
Cancellation, shutdown, ownership, and goroutine lifetime must be explicit.
6. Verify before finalizing.
Run `gofmt`, `go test ./...`, and `go vet ./...` when appropriate. Add `go test -race ./...` for concurrency-sensitive code. Keep examples and benchmarks honest.
## Load References By Need
| Need | Reference |
|---|---|
| Package layout, modules, exported API shape, CLI/app structure | `references/workflow.md` |
| Errors, wrapping, sentinels, concrete types vs interfaces | `references/api-and-errors.md` |
| Concurrency, channels, contexts, goroutines, shutdown |