1# Crush Development Guide
2
3## Build/Test/Lint Commands
4- **Build**: `go build .` or `go run .`
5- **Test**: `task test` or `go test ./...` (run single test: `go test ./internal/llm/prompt -run TestGetContextFromPaths`)
6- **Lint**: `task lint` (golangci-lint run) or `task lint-fix` (with --fix)
7- **Format**: `task fmt` (gofumpt -w .)
8- **Dev**: `task dev` (runs with profiling enabled)
9
10## Code Style Guidelines
11- **Imports**: Use goimports formatting, group stdlib, external, internal packages
12- **Formatting**: Use gofumpt (stricter than gofmt), enabled in golangci-lint
13- **Naming**: Standard Go conventions - PascalCase for exported, camelCase for unexported
14- **Types**: Prefer explicit types, use type aliases for clarity (e.g., `type AgentName string`)
15- **Error handling**: Return errors explicitly, use `fmt.Errorf` for wrapping
16- **Context**: Always pass context.Context as first parameter for operations
17- **Interfaces**: Define interfaces in consuming packages, keep them small and focused
18- **Structs**: Use struct embedding for composition, group related fields
19- **Constants**: Use typed constants with iota for enums, group in const blocks
20- **Testing**: Use testify/assert and testify/require, parallel tests with `t.Parallel()`
21- **JSON tags**: Use snake_case for JSON field names
22- **File permissions**: Use octal notation (0o755, 0o644) for file permissions