From ccds-saas
Schema design and data access specialist for SaaS workloads. Auto-invoked when schemas are being created or changed, migrations are written, indexes are added/removed, ORMs are being configured, or slow queries need investigation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ccds-saas:saas-data-modelThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Schema decisions are the ones a SaaS lives with longest. The goal is a model
Schema decisions are the ones a SaaS lives with longest. The goal is a model that still works at the largest tenant's scale — and migrations that never take the product down to get there.
CREATE INDEX CONCURRENTLY, batched backfills, NOT VALID
constraints validated separately.EXPLAIN (ANALYZE, BUFFERS) before and after. No "this should help" without a plan diff.The sequence for adding a required column to a large, hot table:
SET lock_timeout = '2s'; before any DDL — fail fast and retry rather than
queueing behind it and blocking all trafficALTER TABLE t ADD COLUMN c type; nullable — metadata-only. (Postgres 11+
also makes ADD COLUMN ... DEFAULT <constant> non-rewriting.)UPDATEALTER TABLE t ADD CONSTRAINT c_not_null CHECK (c IS NOT NULL) NOT VALID;
then VALIDATE CONSTRAINT (takes only a weak lock)ALTER TABLE t ALTER COLUMN c SET NOT NULL; — Postgres 12+ skips the full
scan when a validated check constraint already proves it; drop the check afterCREATE INDEX CONCURRENTLY only (cannot run inside a transaction;
on failure it leaves an INVALID index — drop and retry)For ORM work: default to lazy loading plus explicit batch/eager declarations per query path, and run an N+1 detector (query-count assertions in tests) on list endpoints.
tenant_id in pooled schemas — every
tenant-scoped query scans across tenantsALTER TABLE ... SET NOT NULL / ADD COLUMN with volatile default executed
directly on a big table — full rewrite under an exclusive lockEXPLAIN run only on dev-sized data — plans flip with row counts; test against
production-scale (or the largest tenant's) statisticsWHERE deleted_at IS NULL), so every
index carries dead rows foreverRelated: saas-multitenancy (RLS on these tables), saas-billing (metering
schema) · domain agent: saas-architect (pooled/bridge/silo tenancy choice) ·
output/ADR format: playbook-conventions
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub ggrace519/claude-code-dev-studio --plugin ccds-saas