.claude/skills/review-entity-store/SKILL.md
Review an entity store PR
npx skillsauth add viqueen/claude-go-playground .claude/skills/review-entity-storeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit an entity-store PR. Answer the question: "Is the data model right?"
A domain may contain multiple entities. Verify all entities in the domain are covered.
The PR targets one project: connect-rpc-backend/ or grpc-backend/.
Identify which project from the PR file paths.
Fetch the PR diff:
gh pr diff <number>
Identify the domain and all its entities. Cross-reference with proto definitions in protos/. Note: the domain name may group multiple proto packages (e.g., collaboration domain covers space.v1 and content.v1 protos).
Check every item below. For each, report PASS or FAIL with a brief explanation.
sql/migrations/<NNNN>_create_<domain>.sqlCREATE SCHEMA IF NOT EXISTS <domain><domain>.<entity>)0001, 0002) with no gaps or conflicts-- +goose Up and -- +goose Down annotationsDEFAULT gen_random_uuid()created_at TIMESTAMPTZ NOT NULL DEFAULT now()updated_at TIMESTAMPTZ NOT NULL DEFAULT now()deleted_at TIMESTAMPTZ nullable column (soft delete)repeated string maps to TEXT[]google.protobuf.Timestamp maps to TIMESTAMPTZON DELETE behaviorIF EXISTS, then drops schemasql/queries/<domain>/For each entity in the domain:
.sql file per entity (e.g., <entity_a>.sql, <entity_b>.sql)Get<Entity> :one query selecting by idList<Entity> :many query with LIMIT and OFFSET using sqlc.arg()Count<Entity> :one queryCreate<Entity> :one with RETURNING *Update<Entity> :one using sqlc.narg() + COALESCE for optional fieldsupdated_at = now()SoftDelete<Entity> :one setting deleted_at = now(), returning the rowRestore<Entity> :one setting deleted_at = NULL, returning the rowAND deleted_at IS NULLAND deleted_at IS NULLsqlc.arg() / sqlc.narg() names are snake_caseListBy<Parent> queries where applicableengine: "postgresql"queries points to sql/queries/<domain>/schema points to sql/migrations/out points to gen/db/<domain>sql_package: "pgx/v5"github.com/gofrs/uuid/v5time.TimeFor each entity:
## Entity Store PR Audit — <domain>
### Summary
<one sentence: pass or issues found>
### Entities Found
| Entity | Table | Query File | CRUD Complete |
|--------|-------|------------|---------------|
| <entity_a> | <entity_a> | <entity_a>.sql | yes |
| <entity_b> | <entity_b> | <entity_b>.sql | yes |
### Proto ↔ SQL Consistency (per entity)
| Entity | Proto Field | Type | SQL Column | Type | Match |
|--------|-------------|------|------------|------|-------|
| <entity_a> | id | string | id | UUID | yes |
| ... | ... | ... | ... | ... | ... |
### Results
| Check | Status | Notes |
|-------|--------|-------|
| migration numbering | PASS | |
| ... | FAIL | <explanation> |
### Issues
<numbered list of FAIL items with details and suggested fixes>
gh pr diff $ARGUMENTSgh pr view $ARGUMENTS --json number,title,body,state,baseRefName,headRefName,urltesting
Review a test PR
tools
Review a search indexing PR
tools
Review a scaffold PR
tools
Review a proto PR