From repository-adapters
Implement or modify database repository adapters. Use when adding adapter methods, changing queries, or mapping database errors while preserving domain boundaries.
How this skill is triggered — by the user, by Claude, or both
Slash command
/repository-adapters:repository-adaptersThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Adding a repository method, changing a query, or touching an adapter between domain and DB.
database-migrations).cloudflare-d1-query-tuning.Domain interface (repository.go) ← handlers depend on this
↓
Adapter implementation (sqlite.go, postgres.go, etc.)
↓
Generated query layer (if using sqlc, gorm gen, etc.) ← never edit by hand
make generatemake testMap DB-level errors to domain errors at the adapter boundary — never let DB-specific errors leak to callers:
| DB error | Domain error |
|---|---|
| Uniqueness/constraint violation | ErrDuplicate or equivalent |
| No rows / not found | ErrNotFound or equivalent |
| Unknown DB error | Wrap with context: fmt.Errorf("operation context: %w", err) |
Never include raw DB error strings in responses or logs — they expose implementation details and may contain sensitive data.
%w to preserve the error chain for errors.Is / errors.As.make test # SQLite (or primary DB) must pass; optional DBs skip when unavailable
references/examples.md when you need concrete user utterances, expected behaviour, or a model answer shape to mirror.references/edge-cases.md when the request is a near miss, partially matches this skill, or the first attempt fails.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub matt-riley/lucky-hat --plugin repository-adapters