1.6 KiB
1.6 KiB
Agent Guidelines for CAATSM Repository
Build/Test Commands
- Build:
make buildortask build(compiles tobin/receiver) - Run dev:
make run-devortask run-dev(usesconfigs/config.dev.toml) - Lint:
make lintortask lint(golangci-lint required) - Unit tests:
make test(Ginkgo) orginkgo -r -v ./path/to/packagefor single test - Integration tests:
make test-int(requires Docker) - All tests:
make test-all - Coverage:
make coverage(target: maintain >80% coverage)
Code Style Guidelines
- Formatting: Use tabs,
go fmt ./...orgoimportsbefore commits - Naming:
camelCasefor locals/unexported,CamelCasefor exported; package names match directories - Imports: Standard library → third-party → internal (alphabetized within groups)
- Types: Use interfaces for ports, appropriate Go types; avoid
anyunless necessary - Error handling: Wrap errors with context, use
errors.Is()for checking - Generated code: Never edit
/pkg/di/wire_gen.goor other generated files - Linting:
golangci-lint run ./...required; fix all issues before PR
Testing Guidelines
- Unit tests: Ginkgo BDD style next to implementation (
*_test.go); declarative descriptions - Integration: Testcontainers in
test/integration; spin up NATS/TimescaleDB - Coverage: Run
make coveragebefore merging; address regressions
Architecture
- Structure: Clean Architecture -
domain(business logic),app(use cases),adapter(I/O),infra(framework deps) - Entry point:
cmd/main - Config:
configs/config.<env>.toml; secrets viaCAATSM_*env vars