/godmode:schemafrom godmode
Guides data modeling and schema design for relational and NoSQL databases, including normalization, denormalization, migrations, and schema evolution.
Ships in godmode. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
/godmode:schema, "data model", "design the schema"DOMAIN ANALYSIS:
Application: <purpose>
Entities: <core business objects>
Access patterns: <primary read/write ops>
Scale: <volume per entity>
Consistency: <strong | eventual | mixed>
Database: <PostgreSQL | MySQL | MongoDB | etc>
Key questions:
1. What are the core entities? (nouns)
2. How do they relate? (1:1, 1:N, M:N)
3. Most frequent queries? (reads drive schema)
4. Write-to-read ratio? (heavy writes vs reads)
5. Expected volume? (thousands vs billions)
6. Consistency guarantees? (financial vs analytics)
7. Will schema evolve frequently?
8. Multi-tenancy requirements?
ENTITY CATALOG:
| Entity | Key Attributes | Volume |
|----------|----------------------------|--------|
| User | id, email, name, role | 100K |
| Project | id, name, org_id | 500K |
| Task | id, title, status, user_id | 5M |
| Comment | id, body, author_id | 20M |
Organization 1:N -> Project 1:N -> Task 1:N -> Comment
Task N:1 -> User (assignee), Task M:N -> Tag
1NF: Atomic values, no repeating groups
2NF: No partial dependencies on composite key
3NF: No transitive dependencies
BCNF: Every determinant is a candidate key
Start at 3NF. Denormalize only when EXPLAIN proves joins are the bottleneck.
IF read frequency >> write frequency: denormalize
IF join is bottleneck in EXPLAIN: materialized view
IF data is point-in-time: snapshot at creation
IF aggregation is expensive AND frequent:
counter cache (e.g., comment_count on Task)
CREATE TABLE organizations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
plan VARCHAR(50) NOT NULL DEFAULT 'free'
CHECK (plan IN ('free','pro','enterprise')),
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX idx_org_plan ON organizations(plan);
EMBED vs REFERENCE:
IF data always read together (1:few): EMBED
IF child rarely changes independently: EMBED
IF data shared across many documents: REFERENCE
IF child changes frequently: REFERENCE
IF array could grow unbounded: REFERENCE (always)
# Create migration
npx prisma migrate dev --name add_user_role
# Or with Flyway
flyway migrate -url=jdbc:postgresql://localhost/mydb
Safe changes (no downtime): add nullable column, add column with default, add table, add index CONCURRENTLY, widen column type.
Phase 1 EXPAND: Add new column, dual-write, backfill
Phase 2 MIGRATE: Read/write only new column
Phase 3 CONTRACT: Drop old column
Timeline: days to weeks between phases
import { z } from 'zod';
export const userSchema = z.object({
id: z.string().uuid(),
email: z.string().email().max(255),
name: z.string().min(1).max(255),
role: z.enum(['owner','admin','member','viewer']),
});
export type User = z.infer<typeof userSchema>;
IF many small tenants: shared schema + tenant_id
(row-level security, low complexity)
IF moderate isolation: schema per tenant (SET search_path)
IF enterprise compliance: database per tenant
(full isolation, high complexity)
SCHEMA DESIGN: {description}
Database: {engine} | Model: {type}
Entities: {N} | Relationships: {N} | Indexes: {N}
Evolution: {expand-contract|versioned|additive}
Commit: "schema: design <desc> data model"
ls prisma/ migrations/ db/migrate/ alembic/ 2>/dev/null
grep -r "CREATE TABLE\|CREATE INDEX" \
--include="*.sql" -l 2>/dev/null | head -5
grep -r "z.object\|Joi.object\|yup.object" \
--include="*.ts" -l 2>/dev/null | head -5
Log to .godmode/schema-results.tsv:
timestamp\tdatabase\tmodel_type\tentities\tindexes\tverdict
KEEP if: migration applies AND rollback works
AND EXPLAIN shows index usage
DISCARD if: migration locks table >5s
OR rollback fails OR seq scan on indexed column
STOP when:
- All entities have verified up+down migrations
- All FK columns have indexes
- Validation schema matches DB schema
- User requests stop
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
SQL, PostgreSQL, MySQL, MongoDB, Prisma
data-modeling, schema-design, er-diagrams, database-migrations
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
135 skills in this plugin
/a11yAccessibility. WCAG 2.1 AA/AAA, a11y audit, color contrast, keyboard navigation, screen reader, Axe, Pa11y, Lighthouse./agentAI agent development. ReAct/plan-and-execute/multi-agent architectures, tool design, memory systems, guardrails, orchestration (LangChain, LlamaIndex, CrewAI, AutoGen)./analyticsProduct analytics implementation — event tracking, funnel analysis, A/B testing, Segment/Amplitude/Mixpanel/PostHog, privacy-compliant instrumentation./angularAngular architecture. NgRx, Signals, RxJS, standalone components, lazy loading, dependency injection, Jasmine, Jest.Other plugins' skills for the same job