agentleFS
OpenThrottleOpenThrottle/monorepo/databases/AGENTS.md

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.

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
  1. Distinctive:

    Never edit an applied migration in place — add a new numbered file.

    line 14
  2. Very specific:

    Every CREATE TABLE must have COMMENT ON TABLE in the same migration file (tone model: migrations/038_create_plan_runs_table.sql.

    line 15
  3. Very specific:

    Use idempotent DDL (CREATE TABLE IF NOT EXISTS, guarded ALTERs).

    line 16
  4. Very specific:

    After a schema change, sync the TypeORM entities in @openthrottle/nestjs-repositories (entity JSDoc cites the migration numbers).

    line 17

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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.sql files in migrations/, applied in filename order by pnpm 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 into openthrottle-server dev/dev-api/worker/start, which waits for Postgres then auto-applies pending migrations before boot (fails fast pointing at pnpm run database:start if the DB is down); (3) Dockerfile.Migrations + the compose migrations init 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 TABLE must have COMMENT ON TABLE in the same migration file (tone model: migrations/038_create_plan_runs_table.sql; say "OpenThrottle"). COMMENT ON COLUMN for non-obvious columns. Enforced diff-scoped vs main by pnpm nx run monorepo:check-migration-table-comments (also in check:local).
  • Use idempotent DDL (CREATE TABLE IF NOT EXISTS, guarded ALTERs). 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 from pnpm 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.