Add Claude agents and review-and-commit skill

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 15:56:22 -04:00
parent dc7be0c53a
commit 55f68c571e
8 changed files with 257 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
---
description: Auto-trigger review and commit when feature implementation is complete
alwaysApply: true
---
# Auto-Trigger Review & Commit
When a feature implementation is complete, automatically execute the `/review-and-commit` workflow without waiting for the user to manually request it. Do not automatically push and watch.

View File

@@ -0,0 +1,40 @@
---
description: Go conventions and patterns for this project
globs: "**/*.go"
alwaysApply: false
---
# Go Conventions
## Context
Every exported function that does I/O takes `context.Context` as its first argument.
## Errors
- Define package-level sentinel errors for expected conditions:
```go
var ErrNotFound = fmt.Errorf("not found")
```
- Wrap unexpected errors with `fmt.Errorf("doing X: %w", err)` to preserve the chain.
- Callers check expected errors with `errors.Is(err, store.ErrNotFound)`.
## UUIDs
- Use `github.com/google/uuid` for all UUID types.
- Model structs use `uuid.UUID`, not `string`, for ID fields.
## Database
- Use `?` parameter placeholders (MySQL style), never string interpolation.
- Use `gen_random_uuid()` for server-generated UUIDs (Postgres built-in).
- **Queries**: use [sqlc](https://sqlc.dev/) to generate type-safe Go from SQL.
Write annotated SQL in `internal/store/queries/*.sql`; run `task sqlc` to
regenerate. Never hand-write query code in Go — edit the `.sql` source instead.
## Testing
- Use the standard `testing` package. No external assertion libraries.
- Test functions follow `TestTypeName_MethodName` naming

66
.claude/agents/go-dev.md Normal file
View File

@@ -0,0 +1,66 @@
---
description: Standard Go development commands for this project
globs: "**/*.go"
alwaysApply: false
---
# Go Development Commands
## Testing
```bash
# Run all tests
go test ./...
# Run tests in a specific package
go test ./internal/checkin/...
# Run a single test by name
go test ./internal/checkin/... -run TestCheckOut
# Run tests with verbose output
go test -v ./...
# Run tests with race detector
go test -race ./...
```
## Formatting and Linting
```bash
# Format all Go files
gofmt -w .
# Organize imports (group stdlib, external, internal)
goimports -w .
# Vet for common mistakes
go vet ./...
```
## Code Generation
```bash
# Regenerate sqlc query code after editing internal/store/queries/*.sql
task sqlc
# Regenerate proto/gRPC code after editing .proto files
task generate
```
## Building
```bash
# Compile all packages (catches errors without producing binaries)
go build ./...
# Tidy module dependencies after adding/removing imports
go mod tidy
```
## After any code change
1. `gofmt -w .`
2. `goimports -w .` (if imports changed)
3. `go vet ./...`
4. `go test ./...`

View File

@@ -0,0 +1,12 @@
---
description: Make only the changes the user asked for
alwaysApply: true
---
# Minimal Changes
When implementing a requested change, make **only** the changes the user asked for.
- Do not make additional "cleanup" or "consistency" changes alongside the requested work (e.g. removing annotations you consider redundant, restructuring related code, adding backward-compatibility guards).
- If you notice something that *should* be changed but wasn't requested, mention it after completing the requested work — don't silently include it.
- When presenting multiple implementation paths, wait for the user to choose before writing any code.

View File

@@ -0,0 +1,13 @@
---
description: Use go-task (Taskfile) instead of Make for task automation
alwaysApply: true
---
# Use Taskfile, not Make
This project uses [go-task](https://taskfile.dev/) (`Taskfile.yaml`) for task automation. **Do not** use Makefiles.
- Task definitions go in `Taskfile.yaml` at the repo root.
- Use `task <name>` to run tasks (e.g. `task test`, `task db`).
- Use colon-separated namespacing for related tasks (e.g. `task db:stop`).
- When adding new automation, add a task to `Taskfile.yaml` rather than creating a Makefile or shell script.

View File

@@ -0,0 +1,14 @@
---
description: Tests must be self-contained; mock external service dependencies
globs: "**/*_test.go"
alwaysApply: false
---
# Test Isolation
Tests must be self-contained. The only shared infrastructure allowed is the database.
- **Database**: tests may depend on a real database connection — this is expected and acceptable.
- **External services** (gRPC clients, HTTP APIs, third-party SDKs, etc.): must be mocked or stubbed. Tests must never make real calls to external services.
- Use interfaces for service dependencies so they are straightforward to mock in tests.
- Keep mocks minimal — only stub the methods the test actually exercises.

View File

@@ -0,0 +1,11 @@
---
description: Preferences for testing and mocks
globs: ["**/*_test.go", "e2e/**/*.go"]
---
# Testing Mocks
When writing or updating tests:
- Always prefer real code, a local version of a server (like `httptest`), etc., to static mocks.
- Prefer dependency injection if useful for testing.
- A mock implementation should be the absolute last resort.