From 8b510c1db1c3897f1ba3d751c2a1dfd390a9e5ea Mon Sep 17 00:00:00 2001 From: Prad N Date: Sun, 30 Mar 2025 22:52:04 -0400 Subject: [PATCH] docs: establish codebase conventions and developer guidelines --- .gitignore | 1 - CONVENTIONS.md | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 CONVENTIONS.md diff --git a/.gitignore b/.gitignore index 91cca08b0..710d699c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Aider related generated files .aider-context -CONVENTIONS.md bin .env diff --git a/CONVENTIONS.md b/CONVENTIONS.md new file mode 100644 index 000000000..47f941cae --- /dev/null +++ b/CONVENTIONS.md @@ -0,0 +1,25 @@ +# CLAUDE.md - Developer Guidelines for SNRD Codebase + +## Build & Test Commands +- `make build` - Build application binary +- `make install` - Install application +- `make test` - Run unit tests +- `make test-unit` - Run all unit tests +- `make test-race` - Run tests with race detection +- `make test-cover` - Run tests with coverage +- `make lint` - Run golangci-lint and formatting checks +- `make format` - Format code using gofumpt +- `make proto-gen` - Generate Protobuf files +- `make testnet` - Setup and run local testnet with IBC + +## Code Style Guidelines +- **Imports**: Group by standard library, third-party, then project-specific with blank lines between +- **Error Handling**: Use custom errors from `types/errors.go` with `sdkerrors.Register` and prefix errors with `Err` +- **Naming**: Use camelCase for variables, PascalCase for functions/exported types +- **Organization**: Follow Cosmos SDK module pattern (`x/{module}/`, `types/`, `keeper/`) +- **Documentation**: Use standard Go doc comments, document public APIs thoroughly +- **Types**: Prefer explicit types over interface{}, use pointers for mutable state +- **Design**: Follow dependency injection pattern for module components +- **Formatting**: Run `make format` before committing + +Follows standard Go conventions and Cosmos SDK patterns with clear organization and consistent error handling. \ No newline at end of file