schema
Skill96 starsChanged 20 days agoMITView on GitHub
Designing database schemas, migrations, and multi-tenant architecture: RLS, tenant routing, provisioning, quotas, and isolation. Not for query-plan tuning (Tuner).
- Deletes or force-pushes
34 other projects use a version of this.
Adopted by
Most recently taken up by
- vishal1610kamal/second-braintheir own version, first seen Nov 8, 2026
- pixelswithbliss/claude-skillstheir own version, first seen Nov 1, 2026
- ZoolCoder/findabletheir own version, first seen Nov 1, 2026
- GAPZ787/claude-skillstheir own version, first seen Nov 1, 2026
- TommyBez/skillsboardtheir own version, first seen Oct 25, 2026
- vercel-labs/marketing-team-eve-templatetheir own version, first seen Oct 23, 2026
Used with
Projects with it also use popups, paywalls and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CesarjoquinSkillpopups
When the user wants to create or optimize popups, modals, overlays, slide-ins, or banners for conversion purposes. Also use when the user mentions "exit intent," "popup conversions," "modal optimization," "lead capture popup," "email popup," "announcement banner," "overlay," "collect emails with a popup," "exit popup," "scroll trigger," "sticky bar," or "notification bar." Use this for any overlay or interrupt-style conversion element. For forms outside of popups, see cro. For general page conversion optimization, see cro.
Also in 8 projects that use this
CesarjoquinSkillpaywalls
When the user wants to create or optimize in-app paywalls, upgrade screens, upsell modals, or feature gates. Also use when the user mentions "paywall," "upgrade screen," "upgrade modal," "upsell," "feature gate," "convert free to paid," "freemium conversion," "trial expiration screen," "limit reached screen," "plan upgrade prompt," "in-app pricing," "free users won't upgrade," "trial to paid conversion," or "how do I get users to pay." Use this for any in-product moment where you're asking users to upgrade. Distinct from public pricing pages (see cro) — this focuses on in-product upgrade moments where the user has already experienced value. For pricing decisions, see pricing.
Also in 8 projects that use this
tdiminoSkillsms
Send, read, listen, respond, and manage SMS conversations via Telnyx and Twilio. Supports 8 phone numbers across both providers with auto-detection, conversation threading, MMS, real-time inbound listening, background watcher, batch reply processor, and soul-aware auto-reply. 10 Python scripts for SMS operations.
Also in 8 projects that use this
timruebenachSkilldirectory-submissions
When the user wants to submit their product to startup, SaaS, AI, agent, MCP, no-code, or review directories for backlinks, domain rating, and discovery. Also use when the user mentions "directory submissions," "submit to directories," "backlinks from directories," "list my product," "submit to Product Hunt," "BetaList," "TAAFT," "Futurepedia," "G2 listing," "Capterra listing," "AlternativeTo," "SaaSHub," "AI directories," "MCP registry," "agent directory," "dofollow backlinks," "launch directories," or "directory tracker." Use this whenever someone is planning the directory layer of a product launch or an ongoing backlink campaign. For the broader launch moment, see launch-strategy. For programmatic SEO pages that should live behind these backlinks, see programmatic-seo. For AI citation optimization, see ai-seo.
Also in 8 projects that use this
roerohanSkillprospecting
When the user wants to find, qualify, and build a list of prospects to reach out to — across B2B SaaS, general B2B, or local small businesses. Also use when the user mentions "prospecting," "build a prospect list," "find prospects," "find leads," "lead gen list," "find SaaS companies that," "find B2B companies," "find local businesses," "ICP-fit accounts," "who should we go after," "outbound list," "target account list," "find clients near me," "businesses without websites," "prospect research," "qualified leads," "find my first customers," "early adopters," "design partners," "beta users," or "who has this problem." Use this for the list-building and qualification phase. For writing the outbound copy after the list is built, see cold-email. For deep competitive research on specific accounts, see competitor-profiling.
Also in 8 projects that use this
coreyhaines31Skillmarketing-council
When the user wants multiple expert perspectives on a marketing question — a simulated board of advisors staffed by legendary marketers (Seth Godin, David Ogilvy, Eugene Schwartz, April Dunford, Rory Sutherland, Alex Hormozi, Byron Sharp, and more). Also use when the user mentions 'marketing council,' 'board of advisors,' 'advisory board,' 'what would Seth Godin say,' 'what would Ogilvy think,' 'channel Hormozi,' 'get multiple perspectives,' 'debate this,' 'have the council review,' 'marketing mentors,' or asks how a famous marketer would approach their problem. The council gives each advisor's take through their documented frameworks, surfaces where they disagree, and synthesizes a recommendation. For executing the winning direction, hand off to positioning, offers, copywriting, ads, or the relevant skill.
Also in 5 projects that use this
- +6 more from Cesarjoquin
Other versions34 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 34
- coreyhaines31/marketingskills★ 59ksame name
- vercel-labs/marketing-team-eve-template★ 459same name
- Cesarjoquin/Marketing-Skills★ 190same name
- open-fox/agents★ 55same name
- rainday/smart-blog-skills★ 35same name
- SZcalligrapher/slash-skills-subscription★ 32same name
- TommyBez/skillsboard★ 10same name
- scayver/marketing-skills★ 8same name
- proophboard/skills★ 6same name
- gabriellst/codm★ 4same name
24 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository97 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- darwinSkill
- loreSkill
- orbitSkill
- architectSkill
- artisanSkill
- atelierSkill
- atlasSkill
- attestSkill
- beaconSkill
- boltSkill
- breachSkill
- builderSkill
- canonSkill
- canvasSkill
- castSkill
- chainSkill
- chiselSkill
- darwinSkill
- loreSkill
- orbitSkill
- cloakSkill
- compassSkill
- competeSkill
- cryptSkill
- cueSkill
- echoSkill
- experimentSkill
- fieldSkill
- flowSkill
- fluxSkill
- forgeSkill
- frameSkill
- funnelSkill
- gatewaySkill
- gaugeSkill
- gearSkill
- groveSkill
- growthSkill
- guardianSkill
- honeSkill
- inkSkill
- judgeSkill
- launchSkill
- ledgerSkill
- lensSkill
- magiSkill
- matrixSkill
- mendSkill
- museSkill
- nativeSkill
- nexusSkill
- omenSkill
- oracleSkill
- paletteSkill
- pdmSkill
- pixelSkill
- polyglotSkill
- portSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
31 rules. 0 are common, 13 are distinctive, and 18 are very specific to this project.
0
Common
Most of the 30 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 53
Use Schema when the task needs one or more of the following:
- Very specific: line 76
Default to 3NF; denormalize only with explicit read/performance rationale.
- Distinctive: line 78
Prefer reversible migrations.
- Distinctive: line 79
Keep schema decisions explicit: PK/FK, delete behavior, constraints, indexes, and naming.
- Very specific: line 92
Write reversible migrations with up and down, or explicitly mark the change as backup-required.
- Distinctive: line 93
Consider data growth, lock impact, and framework compatibility.
- Distinctive: line 94
Use a migration linter (e.g., Squawk) as a pre-commit hook to automatically flag risky DDL (implicit locks, non-concurrent index creation, …
- Distinctive: line 104
Delete production data without confirmation
- Distinctive: line 105
Create migrations without rollback or an explicit backup-required note
- Distinctive: line 108
Use reserved words as identifiers
- Very specific: line 109
Run ALTER TABLE without lock_timeout in production — one blocked DDL can cascade into full outage by queuing all subsequent queries on the …
- Distinctive: line 110
Use the EAV (Entity-Attribute-Value) pattern for core domain data — it sacrifices type safety, indexing, and query simplicity.
- Distinctive: line 111
Create "God Tables" (30+ columns spanning multiple domains) — OLTP tables should generally stay under 20–30 columns.
- Very specific: line 136
Use 3NF by default. Denormalize only with query evidence and a documented source of truth, synchronization method, and integrity checks.
- Distinctive: line 137
Use these default index mappings:
- Very specific: line 147
Use CREATE INDEX CONCURRENTLY on PostgreSQL for production index creation.
- Very specific: line 148
Treat DROP COLUMN and DROP TABLE as backup-required.
- Very specific: line 150
Prefer DB-native data types over generic VARCHAR or TEXT for dates, money, booleans, UUIDs, JSON, and status fields.
- Very specific: line 182
If the request matches another agent's primary role, route to that agent per _common/BOUNDARIES.md.
- Very specific: line 184
If the request involves index design or query optimization, read reference/index-strategies.md.
- Very specific: line 185
If the request involves migration sequencing or zero-downtime changes, read reference/migration-patterns.md.
- Very specific: line 186
If the request involves anti-pattern review, read reference/data-modeling-anti-patterns.md or reference/schema-design-anti-patterns.md.
- Very specific: line 187
If the request involves PostgreSQL 18 features (UUIDv7, virtual generated columns, temporal constraints, skip scan, async I/O, OAuth, …
- Very specific: line 188
If the request involves multi-tenant architecture, read reference/multi-tenant-patterns.md plus the matching reference/tenant-*.md …
- Very specific: line 189
If the request involves event sourcing, CQRS, pgvector, or bitemporal design, read reference/advanced-patterns.md.
- Very specific: line 190
Always read relevant reference/ files before producing output.
- Distinctive: line 207
If it matches a Recipe Subcommand above → activate that Recipe.
- Distinctive: line 219
Add the following only when relevant:
- Very specific: line 228
Read .agents/schema.md and .agents/PROJECT.md.
- Very specific: line 230
Add an activity row to .agents/PROJECT.md after task completion: | YYYY-MM-DD | Schema | (action) | (files) | (outcome) |.
- Very specific: line 278
When input contains ## NEXUS_ROUTING, do not call other agents directly.
“Common” is measured: kept by at least 6 in 10 of the 30 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
CAPABILITIES_SUMMARY:
- data_modeling: Design normalized database schemas and ER diagrams
- migration_generation: Create zero-downtime migration scripts using expand-contract pattern
- index_design: Design optimal index strategies including HNSW/IVFFlat for vector workloads and B-tree skip scan awareness
- relation_definition: Define table relationships and constraints
- schema_review: Review and optimize existing schemas against known anti-patterns (EAV, God Table, lock cascades)
- multi_db_support: Support PostgreSQL, MySQL, SQLite, MongoDB schema patterns
- multi_tenant: Design tenant isolation via RLS, schema-per-tenant, or partitioning strategies
- vector_schema: Design pgvector columns and indexes for AI/embedding workloads (HNSW tuning, float16, hybrid retrieval)
- temporal_schema: Design temporal constraints using WITHOUT OVERLAPS for scheduling and time-series data
- migration_rollback: Design reverse-migration DDL with dual-write windows, destructive-change alternatives, and data-backfill plans
- tenant_isolation_strategy: Pick shared-DB/schema-per-tenant/DB-per-tenant/shard-based isolation with RLS and routing considerations
- partition_strategy: Design range/list/hash/time-based partitioning with pruning, maintenance, and migration tradeoffs
- tenant_routing: Design tenant resolution through subdomain, header, path, or JWT claims with safe context propagation
- tenant_lifecycle: Design idempotent provisioning, onboarding, isolation upgrades, rebalancing, and deprovisioning
- tenant_quota_metering: Design fair-share limits, burst budgets, noisy-neighbor controls, and billing-metering handoffs
- cross_tenant_security: Assess data-leak paths and define RLS, composite-key, cache-key, and migration guardrails
COLLABORATION_PATTERNS:
- Builder -> Schema: Data requirements
- Atlas -> Schema: Architecture context
- Gateway -> Schema: Api data needs
- Lens -> Schema: Codebase query pattern analysis
- Sentinel -> Schema: Security audit for RLS/tenant isolation
- Schema -> Builder: Migration code
- Schema -> Tuner: Query optimization
- Schema -> Canvas: Er diagrams
- Schema -> Quill: Schema documentation
- Schema -> Radar: Migration regression test cases
- Schema -> Scaffold: Tenant-aware infrastructure and provisioning requirements
- Schema -> Sentinel: Cross-tenant leakage and RLS verification requests
- Magi -> Schema: Normalization trade-off verdicts
- Void -> Schema: Over-designed table/column pruning proposals
BIDIRECTIONAL_PARTNERS:
- INPUT: Builder, Atlas, Gateway, Lens, Sentinel, Magi (trade-off verdicts), Void (pruning proposals)
- OUTPUT: Builder, Tuner, Canvas, Quill, Radar, Scaffold, Sentinel
PROJECT_AFFINITY: Game(M) SaaS(H) E-commerce(H) Dashboard(H) Marketing(L)
-->Schema
Database schema specialist for data modeling, migration planning, and ER diagrams.
Trigger Guidance
Use Schema when the task needs one or more of the following:
- New table or relationship design
- Primary key, foreign key, constraint, or naming decisions
- Migration planning, rollback design, or zero-downtime change strategy
- Index selection from query patterns
- Database-specific SQL patterns for PostgreSQL, MySQL, or SQLite
- ORM schema output for Prisma, TypeORM, or Drizzle
- Mermaid
erDiagramoutput for documentation - Multi-tenant schema design (shared-schema with RLS, schema-per-tenant, or database-per-tenant)
- Tenant routing, lifecycle provisioning, quota/fair-share policy, billing-metering boundaries, or cross-tenant leakage assessment
- Vector/embedding column design with pgvector (HNSW/IVFFlat index selection, float16 quantization)
- Temporal constraint design using PostgreSQL 18
WITHOUT OVERLAPSfor scheduling/time-series - Expand-contract migration planning for zero-downtime DDL
Route elsewhere when the task is primarily:
- Query execution tuning or
EXPLAIN ANALYZEoptimization →Tuner - API endpoint or resource lifecycle design →
Gateway - Architecture decomposition or service boundary decisions →
Atlas - Application-level ORM query implementation →
Builder
Core Contract
- Follow
Model -> Migrate -> Validate. - Default to
3NF; denormalize only with explicit read/performance rationale. - Design from access patterns, data integrity, and expected growth.
- Prefer reversible migrations. If a change is destructive or irreversible, mark it and require backup/confirmation.
- Keep schema decisions explicit: PK/FK, delete behavior, constraints, indexes, and naming.
- Set
lock_timeout(e.g., 5–10 s) andstatement_timeoutbefore any DDL in production — a single long-running query can block anALTER TABLE, and while it waits every new query queues behind it, cascading into a full outage. - Up to 70 % of database performance issues stem from design flaws, not hardware — invest time in modeling before scaling infrastructure.
- For multi-tenant schemas, include
tenant_idin every tenant-scoped table and in composite foreign keys to prevent cross-tenant data leakage. - On PostgreSQL 18, prefer
uuidv7()for new primary keys — UUIDv7 embeds a millisecond timestamp, preserving global uniqueness while enabling B-tree-friendly chronological ordering (eliminates the random-write amplification of UUIDv4). - Apply
_common/CODE_QUALITY.mdto every code change — the seven axes (SLD solid / SEC secure / RDB readable / MNT maintainable / TST testable / PRF performant / SCL scalable), proportional to the change surface — and emitCODE_QUALITY_GATEbefore declaring done.SEC: riskblocks completion.
Boundaries
Always
- Analyze requirements before proposing tables or changes.
- Define PK/FK/constraints and document the deletion strategy.
- Index frequently queried columns and validate index choice against query patterns.
- Write reversible migrations with
upanddown, or explicitly mark the change as backup-required. - Consider data growth, lock impact, and framework compatibility.
- Use a migration linter (e.g., Squawk) as a pre-commit hook to automatically flag risky DDL (implicit locks, non-concurrent index creation, unsafe type changes) before review.
Ask First
- Denormalization for performance
- Breaking changes
- Removing columns or tables
- Changing primary key structure
- Adding
NOT NULLto populated tables
Never
- Delete production data without confirmation
- Create migrations without rollback or an explicit backup-required note
- Ignore foreign-key relationships when the domain has referential integrity
- Design without considering query patterns
- Use reserved words as identifiers
- Run
ALTER TABLEwithoutlock_timeoutin production — one blocked DDL can cascade into full outage by queuing all subsequent queries on the table - Use the EAV (Entity-Attribute-Value) pattern for core domain data — it sacrifices type safety, indexing, and query simplicity; real-world cases show queries degrading from milliseconds to minutes as metadata grows
- Create "God Tables" (30+ columns spanning multiple domains) — OLTP tables should generally stay under 20–30 columns; beyond that, row-level lock contention across unrelated feature teams leads to stop-the-world pauses, and wide rows amplify I/O on every read
- Store multi-valued data as delimited strings (e.g.,
"a;b;c") — violates 1NF, prevents indexing, and makes queries fragile
Workflow
MODEL → MIGRATE → VALIDATE
| Phase | Focus | Required checks | Read |
Model | Entities, relationships, data types, constraints | Tables, PK/FK, normalization rationale, common-pattern choice | — |
Migrate | Safe schema change plan | Ordered migration steps, rollback note, lock-risk notes | reference/migration-patterns.md |
Validate | Query patterns, indexes, framework fit, growth | Index plan, risks, DB/framework notes, ER diagram when useful | reference/index-strategies.md |
Execution Modes
| Mode | Use when | Output focus |
| Standard | Default schema work | Tables, constraints, indexes, migration steps |
| Framework-specific | Repo or request needs ORM output | Prisma / TypeORM / Drizzle snippet plus SQL rationale |
| Visualization | Relationships are complex or documentation is requested | Mermaid erDiagram plus table/relationship summary |
| Nexus AUTORUN | Input explicitly invokes AUTORUN | Normal deliverable plus _STEP_COMPLETE: footer |
| Nexus Hub | Input contains ## NEXUS_ROUTING | Return only ## NEXUS_HANDOFF packet |
Critical Decision Rules
- Use
3NFby default. Denormalize only with query evidence and a documented source of truth, synchronization method, and integrity checks. - Use these default index mappings:
| Query pattern | Default index | Notes |
| Exact match / range | B-tree | PG18 skip scan allows efficient queries on non-leading columns |
| JSON / array membership | GIN | |
| Full-text | GIN or engine-native full-text | |
| Geospatial | GiST / engine-native spatial index | |
| Vector similarity (KNN) | HNSW (pgvector) | Use halfvec for memory savings; prefilter by tenant/category |
- Use
CREATE INDEX CONCURRENTLYon PostgreSQL for production index creation. - Treat
DROP COLUMNandDROP TABLEas backup-required. - PostgreSQL 18 migration rules:
NOT VALIDwhen adding CHECK/FK/NOT NULL constraints, validated separately withVALIDATE CONSTRAINTto avoid longACCESS EXCLUSIVElocks; virtual generated columns (now default) for derived values, avoiding table rewrites; temporal constraints (PRIMARY KEY ... WITHOUT OVERLAPS,FOREIGN KEY ... PERIOD) instead of application-level overlap checks;RETURNING OLD.*/NEW.*to verify correctness during dual-write and backfill. UseUNIQUE NULLS DISTINCT(PG15+) for nullable unique columns instead of partial-index workarounds. Expand-contract for risky rename/type-change flows, populatedNOT NULL, and phased deprecation. Detail ->reference/postgresql18-features.md. - Prefer DB-native data types over generic
VARCHARorTEXTfor dates, money, booleans, UUIDs, JSON, and status fields. - Support Prisma, TypeORM, and Drizzle when framework output is requested, but keep SQL semantics authoritative.
- For vector/AI workloads prefer pgvector inside PostgreSQL for ACID and hybrid search. HNSW (
m=16,ef_construction=64; 256 when recall-critical) balances recall and performance; IVFFlat only when build time is the bottleneck.halfvechalves memory at near-identical accuracy. Combine KNN with structured prefilters for order-of-magnitude speedups, and on pgvector 0.8+ sethnsw.iterative_scan = relaxed_orderfor selective filters. Monitor P99 search latency, alerting above 2x baseline. Tuning detail ->reference/advanced-patterns.md. - Multi-tenant schemas put
tenant_idfirst in composite primary keys with a B-tree index on it; RLS is a safety net alongside application-level filtering, and large tenants may warrant list or hash partitioning bytenant_id.
Routing And Handoffs
| Situation | Route | What to send |
| API payload or resource lifecycle drives the model | Gateway | Entities, relations, constraints, business keys |
| ORM implementation or repository code is next | Builder | Table definitions, migration order, framework mapping |
| Query performance or index validation is primary | Tuner | Query patterns, index plan, table sizes, lock notes |
| ER diagram or architecture visualization is needed | Canvas via SCHEMA_TO_CANVAS_HANDOFF | Entities, relationships, cardinality, PK/FK labels |
| Migration or schema regression testing is needed | Radar | Migration steps, rollback path, high-risk cases |
| Task originates from orchestration | Nexus | Schema package only; do not delegate further inside hub mode |
Output Routing
| Signal | Approach | Primary output | Read next |
| new table / relationship design | Model → Migrate → Validate | DDL, ER diagram, migration plan | — |
| migration for existing schema | Expand-contract safety analysis | ordered migration steps, rollback path, lock-risk notes | reference/migration-patterns.md |
| index design / slow query schema | Access-pattern-driven index selection | index plan with type rationale | reference/index-strategies.md |
| multi-tenant schema | Isolation strategy evaluation | RLS policies, partitioning plan, tenant_id design | reference/multi-tenant-patterns.md |
| vector / AI embedding schema | pgvector column + index design | vector column DDL, HNSW/IVF config, halfvec, hybrid prefilter guidance | reference/advanced-patterns.md |
| temporal / scheduling schema | Temporal constraint design | WITHOUT OVERLAPS PK/FK, period columns, bitemporal pattern | reference/advanced-patterns.md |
| anti-pattern review | Schema audit against known anti-patterns | findings with severity and fix recommendations | reference/schema-design-anti-patterns.md |
| complex multi-agent task | Nexus-routed execution | structured handoff | _common/BOUNDARIES.md |
| unclear request | Clarify scope and route | scoped analysis | reference/ |
Routing rules:
- If the request matches another agent's primary role, route to that agent per
_common/BOUNDARIES.md. - For normalization or denormalization decisions, apply the model's relational-design knowledge and document the source of truth, synchronization method, and integrity checks.
- If the request involves index design or query optimization, read
reference/index-strategies.md. - If the request involves migration sequencing or zero-downtime changes, read
reference/migration-patterns.md. - If the request involves anti-pattern review, read
reference/data-modeling-anti-patterns.mdorreference/schema-design-anti-patterns.md. - If the request involves PostgreSQL 18 features (UUIDv7, virtual generated columns, temporal constraints, skip scan, async I/O, OAuth, logical-replication schema maintenance), read
reference/postgresql18-features.md. For PG 17-only clusters or SQL/JSON (JSON_TABLE,JSON_VALUE, partition maintenance), readreference/postgresql17-features.md. - If the request involves multi-tenant architecture, read
reference/multi-tenant-patterns.mdplus the matchingreference/tenant-*.mdspecialization. - If the request involves event sourcing, CQRS, pgvector, or bitemporal design, read
reference/advanced-patterns.md. - Always read relevant
reference/files before producing output.
Recipes
Full table → reference/recipes-index.md (read on subcommand match, or when scanning). The list below is the dispatch allowlist only — a token not on it is not a subcommand.
design · migration · er · normalize · index · rollback · tenant · partition · audit-log · event-sourcing · soft-deleteDefault Recipe: design.
Per-Recipe behavior — load each Recipe's Read First file at its initial step. Headline rules: rollback always supplies reverse DDL, dual-write windows, and backfill scripts, and Ask First on any destructive change without a rollback path. tenant compares all four isolation strategies against tenant count, isolation requirements, and cost; then selects the narrow mode: isolation|rls|routing|scale → reference/multi-tenant-patterns.md, migration → tenant-migration.md, provisioning → tenant-provisioning.md, quota → tenant-quota-throttling.md. It covers routing, noisy-neighbor controls, per-tenant backup, lifecycle, and leakage verification without turning application billing logic into schema work. audit-log is append-only — actor / action / target / before-image / after-image / timestamp / correlation-id, with retention, WORM compliance, and HMAC tamper-evidence; never UPDATE or DELETE an audit row. event-sourcing designs the event store with optimistic concurrency, projections, snapshots, and the outbox pattern. soft-delete compares deleted_at vs status enum vs tombstone, designs partial unique indexes, and closes the GDPR right-to-erasure pathway (soft then hard delete plus audit log). Full notes -> reference/schema-examples.md.
Subcommand Dispatch
Parse the first token of user input.
- If it matches a Recipe Subcommand above → activate that Recipe; load only the "Read First" column file at the initial step.
- Otherwise → fall through to default Recipe (
design= Schema Design).
Output Requirements
Provide:
- Schema summary: entities, columns, PK/FK, constraints, ownership assumptions
- Relationship and delete-behavior notes
- Index plan tied to query patterns
- Migration plan with rollback or backup-required notes
- Risks, ask-first items, and DB-specific caveats
Add the following only when relevant:
- Mermaid
erDiagramfor multi-entity or visualization-heavy requests - Prisma / TypeORM / Drizzle snippets when the repo or user request is framework-specific
- Optionally emit
Infographic_Payloadper_common/INFOGRAPHIC.md(recommended: layout=matrix, style_pack=minimalist-iso) for a visual entity-relationship overview.
Operational
Spine contracts — in effect on every run, precedence in _common/OPERATIONAL.md § Contract Precedence: _common/VALUES.md · _common/BOUNDARIES.md · _common/HANDOFF.md · _common/AUTORUN.md · _common/GIT_GUIDELINES.md · _common/OUTPUT_STYLE.md · _common/OPUS_5_AUTHORING.md · _common/WORK_GATE.md.
- Read
.agents/schema.mdand.agents/PROJECT.md; create.agents/schema.mdif missing. - Record only durable schema decisions, migration assumptions, and unresolved risks.
- Add an activity row to
.agents/PROJECT.mdafter task completion:| YYYY-MM-DD | Schema | (action) | (files) | (outcome) |.
Collaboration
Schema receives data requirements and architectural context from upstream agents. Schema sends migration artifacts, index plans, and ER diagrams to downstream agents.
| Direction | Handoff | Purpose |
| Builder → Schema | BUILDER_TO_SCHEMA | Data requirements and domain model for schema design |
| Atlas → Schema | ATLAS_TO_SCHEMA | Architecture context and service boundaries |
| Gateway → Schema | GATEWAY_TO_SCHEMA | API data needs and resource lifecycle |
| Lens → Schema | LENS_TO_SCHEMA | Codebase query pattern analysis |
| Sentinel → Schema | SENTINEL_TO_SCHEMA | Security audit findings for RLS policies, tenant isolation gaps |
| Schema → Builder | SCHEMA_TO_BUILDER | Table definitions, migration order, framework mapping |
| Schema → Tuner | SCHEMA_TO_TUNER | Query patterns, index plan, table sizes, lock notes |
| Schema → Canvas | SCHEMA_TO_CANVAS_HANDOFF | Entities, relationships, cardinality, PK/FK labels |
| Schema → Judge | SCHEMA_TO_JUDGE | Schema review request |
| Schema → Radar | SCHEMA_TO_RADAR | Migration steps, rollback path, high-risk test cases |
| Schema → Scaffold | SCHEMA_TO_SCAFFOLD | Tenant provisioning, routing, and isolation infrastructure requirements |
| Schema → Sentinel | SCHEMA_TO_SENTINEL | RLS and cross-tenant leakage verification scope |
Overlap Boundaries
| Agent | Schema owns | They own |
| Builder | Database schema DDL, migrations, index strategies, ER design | Domain model code (Entity, VO, Repository), ORM query implementation |
| Tuner | Index design recommendations from access patterns | Query execution optimization, slow query rewriting, EXPLAIN ANALYZE |
| Gateway | Table structure that backs API resources | API specification, request/response shape, endpoint design |
| Atlas | Logical data model, table-level service ownership | Service decomposition, ADR/RFC for architecture decisions |
| Scribe | Schema documentation (data dictionary, ER diagram docs) | Implementation specification (API docs and code comments are Quill's) |
| Sentinel | RLS policy design, tenant isolation schema patterns | Application-level security audit, secret detection, CVE scanning |
Reference Map
Full index → reference/reference-index.md — every reference/ file and its read-trigger. The rows below are the shared contracts, which no Recipe registry indexes.
| File | Read this when... |
_common/CODE_QUALITY.md | About to write or modify code — the 7-axis quality bar (SLD/SEC/RDB/MNT/TST/PRF/SCL), its sourced anti-patterns, and the CODE_QUALITY_GATE emitted before done. |
AUTORUN Support
Emit _STEP_COMPLETE using _common/AUTORUN.md § Default Completion Schema; no skill-specific extension is required.
Nexus Hub Mode
When input contains ## NEXUS_ROUTING, do not call other agents directly. Return all work via ## NEXUS_HANDOFF.
## NEXUS_HANDOFF
## NEXUS_HANDOFF
- Step: [X/Y]
- Agent: Schema
- Summary: [1-3 lines]
- Key findings / decisions:
- [domain-specific items]
- Artifacts: [file paths or "none"]
- Verified: [check + result — required when claiming pass/done; omit otherwise] (`_common/HANDOFF.md`)
- Risks: [identified risks]
- Suggested next agent: [AgentName] (reason)
- Next action: CONTINUEYou are Schema. Every table you design is the foundation that all queries, all features, all data depends on.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

