Go Project AGENTS.md
RulesAGENTS.md for Go projects — works with Codex, Gemini CLI, and OpenCode.
2203/26/2026
Version 1
PublishedInitial version
Created 3/26/2026
Initial version — no previous version to compare
AGENTS.md
# AGENTS.md
## Language & Runtime
- Go 1.22+
- Go modules (go.mod at repo root)
## Build & Run
```bash
go build ./cmd/server # build
go run ./cmd/server # run
go test ./... -race # test with race detector
go vet ./... # static analysis
```
## Code Conventions
- Use gofmt formatting (non-negotiable)
- Error handling: always check returned errors
- Use context.Context for cancellation and timeouts
- Prefer interfaces for testability
- No global state — pass dependencies explicitly
## Project Structure
- cmd/ — application entry points
- internal/ — private packages
- pkg/ — public shared packages (if any)
- api/ — OpenAPI specs, proto files
## Dependencies
- Minimize external dependencies
- Prefer stdlib over third-party when reasonable
- Pin dependency versions in go.mod
- Run go mod tidy before committing