| name | implement |
| description | Use when making any code change to this repo. Covers the full edit-lint-build-test loop with exact commands. Examples: 'implement this feature', 'fix this bug', 'add a new package'. |
Implement
Foundation for any code change in luthersystems/svc. Follow this loop for every change.
Workflow
1. Understand the Change
- Read CLAUDE.md for project conventions and domain glossary
- Read existing code in the target package before modifying
- Check if the package has existing tests (
*_test.go) to understand testing patterns
2. Create a Feature Branch
git checkout main && git pull
git checkout -b sam-at-luther/Short_description
3. Make Changes
- Follow existing code style in the package
- Add copyright header to new files:
// Copyright © <year> Luther Systems, Ltd. All right reserved.
- If adding a new package, create it at the top level (flat package structure)
- Do NOT edit generated code in
oracle/testservice/gen/
4. Format & Lint
gofmt -w .
golangci-lint run
Fix any lint issues before proceeding. The gosec linter is enabled — pay attention to security findings.
5. Build
go build ./...
6. Test
go test -timeout 10m ./your-package/...
go test -timeout 10m ./...
If working on oracle/ tests, the substrate plugin must be available:
./scripts/obtain-plugin.sh
make plugin
7. Verify Round-Trip
If your change adds a new public API, verify it with a simple test. If modifying behavior, write a test that captures the expected behavior first (TDD).
Key Reminders
- Use
testify for assertions in tests (existing pattern in codebase)
- The
svcerr package maps errors to gRPC status codes — use it for error handling
- Context propagation uses
grpclogging.AddLogrusField(ctx, key, value) for structured logging
- Oracle tests need
SUBSTRATEHCP_FILE env var pointing to the plugin binary (set by Makefile)
Checklist