diff --git a/CLAUDE.md b/CLAUDE.md index 8c78711..4c88c4d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -56,13 +56,14 @@ Key Go libraries: - `github.com/nats-io/nats.go` - NATS client - `github.com/nats-io/nkeys` - NKey authentication - `github.com/mark3labs/mcp-go` - MCP server implementation +- `github.com/google/uuid` - UUID generation for reply subjects ## Build Commands Run commands through the Nix development shell using `nix develop -c`: ```bash -# Build +# Build (for quick syntax checking) nix develop -c go build ./... # Run tests @@ -77,10 +78,7 @@ nix develop -c golangci-lint run # Vulnerability check nix develop -c govulncheck ./... -# Test Nix build -nix build - -# Run the binary (prefer this over go build + running binary) +# Run the binary (preferred method - builds and runs via Nix) # To pass arguments, use -- before them: nix run .#default -- --help nix run .#default ``` @@ -92,7 +90,7 @@ Before committing, run the following checks: 1. `nix develop -c go test ./...` - Unit tests 2. `nix develop -c golangci-lint run` - Linting 3. `nix develop -c govulncheck ./...` - Vulnerability scanning -4. `nix build` - Verify nix build works +4. `nix run .#default -- --version` - Verify nix build works ## Commit Message Format @@ -115,6 +113,18 @@ Follow semantic versioning: - **Minor** (0.x.0): Non-breaking changes adding features - **Major** (x.0.0): Breaking changes -Update the `const version` in `main.go`. The Nix build extracts the version from there automatically. +Update the version in **both** locations: +1. `const version` in `cmd/homelab-deploy/main.go` +2. `version` field in `flake.nix` **When to bump**: If any Go code has changed, bump the version before committing. Do this automatically when asked to commit. On feature branches, only bump once per branch (check if version has already been bumped compared to master). + +## Updating Dependencies + +When adding or updating Go dependencies: + +1. Run `go get ` or `go mod tidy` +2. Update `vendorHash` in `flake.nix`: + - Set to a fake hash: `vendorHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";` + - Run `nix run .#default -- --version` - the error will show the correct hash + - Replace with the correct hash from the error message