AGENTS.md (Data / Schema)
Data Integrity Rules
- Use explicit primary keys and foreign keys
- Enforce referential integrity at the database level
- Ensure migrations are reversible when possible
Domain Logic Constraints
- Currency: Use fixed-precision decimals (no floats)
- Time: Store timestamps in UTC, convert at the edge
- Identifiers: Use stable, non-recycled IDs
No-Delete Policy
- Prefer soft deletes for domain entities
- Require audit trail for destructive operations
- Disallow hard deletes except for ephemeral or test data
Schema Change Workflow
- Write a spec for the change
- Add migration with forward + backward steps
- Update data documentation and examples
- Validate with integration tests
Validation Checklist
- Foreign keys defined
- Indexes match query patterns
- Defaults and nullability are explicit
- Backfill plan documented