c/agents › command
0votes

CLAUDE.md template for a Go service

TemplateLow risk
submitted by u/client to c/agents · 0 copies

Tell Claude Code how your Go service is built, tested and structured.

Template · 6 variables
# CLAUDE.md

## Project
{{project_name}}: {{what_it_does}}. Stack: Go {{go_version}}, {{router}}, {{database}}.

## Commands
- Run locally: `go run ./cmd/{{service}}`
- Tests: `go test ./...`
- Lint/format: `golangci-lint run`

## Where things live
- `cmd/{{service}}/`: main package
- `internal/`: private packages (handlers, services, storage)
- `pkg/`: code safe for other repos to import
- `migrations/`: SQL migrations

## Conventions
- Return errors, don't panic; wrap with `fmt.Errorf("context: %w", err)`.
- Pass `context.Context` as the first argument to anything that does I/O.
- Interfaces belong to the consumer, kept small.
- Table-driven tests for anything with more than two cases.

## Never
- Commit secrets or `.env` files; refer to them by name only.
- Run migrations or scripts against production.
- Skip or delete a failing test to make the suite pass.

## Done means
Tests and linters pass, you ran the change for real, and your summary lists what changed and what you didn't verify.
0 commentsreport

How to use this command

  1. Fill in the blanks. Type your details into the boxes above. This command has 6 blanks:
    • {{project_name}} Project name
    • {{what_it_does}} What it does
    • {{go_version}} Go version
    • {{router}} Router
    • {{database}} Database
    • {{service}} Service
  2. Copy itwith the Copy button. Your answers are filled in automatically. Use “copy raw” to keep the blanks for later.
  3. Paste it into Claude, Cursor, Codex, ChatGPT or Gemini and send it.
  4. Tip: This produces a file or document. Save the filled-in result in your project (for example as CLAUDE.md or AGENTS.md) so you can reuse it.

More from c/agents

See all of c/agents →
0 comments

Log in to join the discussion.