Go Stack Guide
This guide covers using Sequant with Go projects.
Detection
Section titled “Detection”Sequant automatically detects Go projects by looking for:
go.mod
Default Commands
Section titled “Default Commands”When initialized with the Go stack, Sequant configures these commands:
| Command | Default |
|---|---|
| Test | go test ./... |
| Build | go build ./... |
| Lint | golangci-lint run |
| Format | go fmt ./... |
File Patterns
Section titled “File Patterns”The workflow skills use these patterns to locate files:
| Pattern | Glob |
|---|---|
| Source | **/*.go |
| Tests | **/*_test.go |
Workflow Integration
Section titled “Workflow Integration”/spec Phase
Section titled “/spec Phase”During planning, Sequant will:
- Review package structure
- Check existing interfaces and types
- Look for test patterns in
*_test.gofiles
/exec Phase
Section titled “/exec Phase”During implementation, the agent will:
- Run
golangci-lint runfor linting - Run
go test ./...for verification - Run
go build ./...to ensure it compiles
/qa Phase
Section titled “/qa Phase”Quality review includes:
- golangci-lint checks
- Go vet analysis
- Test coverage review
- Race condition detection (
-race)
Customization
Section titled “Customization”Override commands in .claude/.local/memory/constitution.md:
## Build Commands
- Test: `go test -v -race ./...`- Build: `go build -o bin/ ./cmd/...`- Lint: `golangci-lint run --enable-all`Common Patterns
Section titled “Common Patterns”Standard Layout
Section titled “Standard Layout”cmd/└── myapp/ └── main.gointernal/├── config/├── handlers/└── models/pkg/└── utils/go.modgo.sumSimple Binary
Section titled “Simple Binary”main.goconfig.gohandlers.gohandlers_test.gogo.modLibrary
Section titled “Library”mylib.gomylib_test.gointernal/└── helpers.gogo.mod-
Use
golangci-lint- Install it for comprehensive linting. Sequant expects it by default. -
Table-Driven Tests - The agent will follow Go conventions for table-driven tests.
-
Interfaces - Define interfaces where consumers need them, not where implementations live.
-
Error Handling - Use error wrapping with
fmt.Errorf("context: %w", err)for better debugging. -
Packages - Keep package names short and lowercase; avoid stuttering (e.g.,
http.HTTPClient).
golangci-lint Configuration
Section titled “golangci-lint Configuration”Create .golangci.yml for custom linting:
linters: enable: - gofmt - govet - errcheck - staticcheck - gosimple - ineffassign - unused
linters-settings: govet: check-shadowing: true