Defines the schema-to-factory-to-seeder contract chain — NOT NULL alignment, factory/seeder ownership boundaries, and schema drift rules
62
72%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.claude/skills/data-layer-contracts/SKILL.mdDefines the contract chain from migration schema to factory to seeder, and prevents drift between them.
Every NOT NULL column defined in a migration must be supported by:
This is a schema-only rule, not a validation rule. MySQL/MariaDB is the canonical database — SQLite differences are invalid for schema validation assumptions.
Factories MUST:
Factories MUST NOT:
If a migration introduces a NOT NULL column, the factory MUST be updated immediately — omission is invalid state.
Factories SHOULD align with service-layer expectations but do NOT depend on it: service layer = behavior, factory = valid structure.
Seeders MUST:
Seeders MUST NOT:
Seeders assemble data. They do not define data correctness.
The following indicate schema drift: migration changes, factory mismatch, seeder mismatch, SQLSTATE constraint violations, CI vs local DB mismatch.
Schema validation requires migrate:fresh + seed before running test suites.
Primary keys are non-deterministic. Tests MUST NOT rely on hardcoded IDs.
fb83b36
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.