make test- Run all testsmake test-unit- Run unit tests with coveragemake test-vet- Run go vetmake test-staticcheck- Run staticcheckgo test ./path/to/package -run TestName- Run a specific testmake lint- Run golangci-lintmake gen-proto- Generate protocol buffer codego mod tidy- Update dependencies
make test-coverage- Generate test coverage for all packages (human-readable summary)make test-coverage TARGET=./plugins/auth- Generate coverage for specific packagemake test-coverage PORCELAIN=1- Machine-readable output (for AI/automation use)make clean-coverage- Remove coverage report files
The test-coverage target automatically excludes generated protobuf files (.pb.go, .pb.gw.go) from coverage calculations. By default, it shows a human-readable summary. Use PORCELAIN=1 for detailed function-by-function output suitable for AI analysis or automated processing.
- Errors: Use custom errors package with stack traces; utilize
errors.New(),errors.NewC(),errors.Wrap(),errors.WithCode() - Imports: Standard library first, followed by third-party; use aliasing to resolve conflicts
- Naming: Go standard camelCase for variables, PascalCase for exported items; consistent plugin naming (
PluginName) - Plugins: Follow plugin interface patterns; expose via
Plugin()function and exportPluginNameconstant - Documentation: Document public APIs with clear GoDoc comments; provide examples
- Testing: Write tests alongside implementation; provide comprehensive test coverage
- Error Handling: Distinguish between user-facing and internal errors; propagate context
- Configuration: Follow established config patterns using koanf
- Logging: Use structured logging with field tracking and request context
Follow patterns in existing code for consistency. Use provided Go tools and linters.
Prefab includes a Claude Code plugin at .claude-plugin/ with comprehensive skills and resources
for building Prefab servers. The plugin provides topic-specific documentation that is dynamically loaded
based on the task at hand. Additional documentation is in the /docs/ folder.