Instructions file for coding agents.
- Use the minimum Go version specified in go.mod
- Warn the user about an old Go version
- The project uses GNU make for building binaries and images. See Makefile
For fast feeback run tests using go test (or gotest if available).
go test -v ./... # run all tests with Go directly
go test -v ./pkg/... # run Loki package tests
go test -v ./pkg/<pkg>/... # run tests in specific package
go test -v -test.run TestName ./pkg/<pkg>/... # run a specific testFor full verification use dedicated make targets (only when requested).
make test # run full test suite
make test-integration # run integration test suite
make test-fuzz # run fuzz tests
- Follow standard Go formatting (gofmt/goimports)
- Follow import order:
- standard lib
- external packages
- Loki packages (
github.com/grafana/loki/v3)
- Error handling: Always check errors with
if err != nil { return ... } - Use structured logging with leveled logging (
github.com/go-kit/log) - Document all exported functions, types, and variables
- Always prefer
github.com/stretchr/testify/requireovergithub.com/stretchr/testify/assert - Use table-driven tests when appropriate
- Always run Loki package tests
gotest -v ./pkg/...before commiting - Focus on "why", rather than "what" in the commit message and PR description
- Follow conventional commits format:
<type>(<scope>): Your change(note the uppercase after colon)
- Follow the Grafana Writers' Toolkit Style Guide
- Use CommonMark flavor of markdown for documentation
- Create LIDs (Loki Improvement Documents) for large functionality changes
- Document upgrading steps in
docs/sources/setup/upgrade/_index.md - Preview docs locally with
make docsfrom the/docsdirectory - Include examples and clear descriptions for public APIs
- When using the
mcp__acp__Writetool, write to a path within the current worktree to avoid sandboxing/permissions issues. This includes when writing plan files.