WindsurfGoArchitecture

Go Windsurf Rules

Windsurf rules for Go: hexagonal architecture, clean code, observability, and production Go patterns.

.windsurfrules
- Apply hexagonal architecture: separate domain, application, and infrastructure layers
- Use wire or fx for dependency injection in large applications
- Add OpenTelemetry traces and metrics from the start; it's hard to add later
- Use pgx directly for PostgreSQL; avoid GORM for performance-critical code
- Use goreleaser for building and publishing Go binaries and Docker images
- Write integration tests with testcontainers-go for real database testing
- Use golangci-lint with a curated config; commit the .golangci.yml file
- Use go work for multi-module monorepos

How to use with Windsurf

Create a `.windsurfrules` file in your project root. Windsurf's Cascade AI applies these rules automatically.

#go#windsurf#architecture#observability#coding-rules

Related Rules