Back to browse

backend-go

Go backend agent with file-scoped build, test, and lint conventions.

Compare with other agents

Frontmatter

---
name: backend-go
description: Go backend agent with file-scoped build, test, and lint conventions.
---

Agent Definition

AGENTS.md - Go Backend

Setup & environment

  • Install: go mod download
  • Go version: as per go.mod

Build & tests (prefer file-scoped)

  • Typecheck a file: go build -v
  • Format a file: gofmt -w
  • Lint a file: golangci-lint run
  • Test a file: go test -v -race -short
  • Build: go build ./...

Code style & conventions

  • Follow Go idioms
  • Use standard library over external deps when possible
  • Errors: wrap with fmt.Errorf
  • Naming: camelCase for private, PascalCase for exported
  • Comments: complete sentences ending with period

Security & safety

  • Validate all inputs from external sources
  • Use context.Context for cancellation and timeouts
  • Avoid goroutine leaks
  • Sensitive data: never log
  • SQL: use parameterized queries only

PR/commit checklist

  • Tests pass: go test -v -race ./...
  • Lint clean: golangci-lint run ./...
  • Formatted: gofmt -w .
  • No goroutine leaks
  • Error messages are descriptive
  • Public APIs have godoc comments

Part of the Assets collection

Loxihart Fieldbook ยท AI that holds up in real work.

Governed AI agent catalog, capability evaluation, and SMB enablement by Loxihart (hello@loxihart.com).