monorepo / databases
AGENTS.md2 starsChanged 2 months agoApache-2.0View on GitHub
Family-shared notes for databases/ (OpenThrottle Postgres schema + migrations). There are no child project files here; monorepo-wide rules live in the root AGENTS.md / CLAUDE.md. Deep reference: README.md (schema, embedding dimension strategy, commit links, status semantics, full migration list). No package.json here. Everything runs through root pnpm run database:* scripts (implemented in root scripts/) against the root docker-compose.yml Postgres/Redis.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- applications/AGENTS.mdAGENTS.md
- infra/AGENTS.mdAGENTS.md
- packages/AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- tools/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/nx-rules.mdcCursor rule
- frontend-designSkill
- grillingSkill
- improveSkill
- link-workspace-packagesSkill
- monitor-ciSkill
- nx-workspaceSkill
- agents-ralphSkill
- github-commitSkill
- github-pull-requestSkill
- github-squashSkill
- ot-foldersSkill
- ot-generatorsSkill
- ot-loopSkill
- ot-onboardingSkill
- ot-plansSkill
- ot-postgresSkill
- ot-skill-syncSkill
- ot-stackSkill
- ot-worktreeSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Never edit an applied migration in place — add a new numbered file.
- Very specific: line 15
Every CREATE TABLE must have COMMENT ON TABLE in the same migration file (tone model: migrations/038_create_plan_runs_table.sql.
- Very specific: line 16
Use idempotent DDL (CREATE TABLE IF NOT EXISTS, guarded ALTERs).
- Very specific: line 17
After a schema change, sync the TypeORM entities in @openthrottle/nestjs-repositories (entity JSDoc cites the migration numbers).
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
databases/ — agent notes
Family-shared notes for databases/ (OpenThrottle Postgres schema + migrations). There are no child project files here; monorepo-wide rules live in the root AGENTS.md / CLAUDE.md. Deep reference: README.md (schema, embedding dimension strategy, commit links, status semantics, full migration list).
Not an Nx project
No package.json here. Everything runs through root pnpm run database:* scripts (implemented in root scripts/) against the root docker-compose.yml Postgres/Redis.
Migrations
- Numbered
NNN_snake_case.sqlfiles inmigrations/, applied in filename order bypnpm run database:migrate(scripts/openthrottle-database-migrations.ts). - Entrypoints for that runner: (1)
pnpm run database:migrate— manual/standalone; (2)monorepo:ensure-migrations— the dev/start Nx gate (scripts/ensure-migrations.ts) wired intoopenthrottle-serverdev/dev-api/worker/start, which waits for Postgres then auto-applies pending migrations before boot (fails fast pointing atpnpm run database:startif the DB is down); (3)Dockerfile.Migrations+ the composemigrationsinit service — authoritative for container installs, unchanged. - SQL files are the single source of truth for schema. TypeORM is runtime-only (DataSource pooling, entities for type safety); the TypeORM migration runner is deliberately not used.
- Never edit an applied migration in place — add a new numbered file. Comment backfills go in batch files (≤10 tables per file).
- Every
CREATE TABLEmust haveCOMMENT ON TABLEin the same migration file (tone model:migrations/038_create_plan_runs_table.sql; say "OpenThrottle").COMMENT ON COLUMNfor non-obvious columns. Enforced diff-scoped vsmainbypnpm nx run monorepo:check-migration-table-comments(also incheck:local). - Use idempotent DDL (
CREATE TABLE IF NOT EXISTS, guardedALTERs). Patterns and naming: skills/ot-postgres/SKILL.md. - After a schema change, sync the TypeORM entities in
@openthrottle/nestjs-repositories(entity JSDoc cites the migration numbers).
Other contents
backups/— zip dumps frompnpm run database:backup. The migrate script itself does not back up; run a backup first before risky migrations.seed.sql— ~45 MB dump copied into the consumer-install seeded Postgres image (applications/openthrottle/Dockerfile.Postgres); don't grep or edit it casually.TABLE_COMMENTS_AUDIT.md— audit trail for the comment backfill effort.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

