state-migrations
Skill5 starsChanged 13 days agoMITView on GitHub
Add a state-DB or permissions-store migration and prove it applies. Use for migration, migrations, schema, sqlx, audit_calls, permissions table.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- stackSkill
- verify-changeSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 9
Add a new file with the next zero-padded number: migrations/0010_<name>.sql (existing: 0001_sessions.sql … 0009_oauth_refresh_tokens.sql) …
- Very specific: line 10
Write the SQL for the target engine: Postgres 16 for migrations/, MySQL 8 for migrations-mysql/.
- Very specific: line 13
Update the spec in website/docs/initial-idea/ when the schema change is visible to an operator or an agent — same PR.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
House skill — established by dz-runner setup mode from this repo's own evidence, then owned by its maintainers. Correct it in place; setup never overwrites a skill that exists.
- Know which store you are changing: the gateway's own state DB (sessions, audit log, OAuth clients, permissions) is Postgres and lives in
migrations/; the MySQL permissions store lives inmigrations-mysql/with its own numbering. Both are embedded bysqlx::migrate!insrc/state/mod.rsand applied at boot — a failing migration refuses to start the process. - Add a new file with the next zero-padded number:
migrations/0010_<name>.sql(existing: 0001_sessions.sql … 0009_oauth_refresh_tokens.sql) ormigrations-mysql/0004_<name>.sql(existing: 0001_permissions.sql … 0003_permissions_resolver_indexes.sql). Never edit a migration that has already been applied — its checksum changes and the migrator refuses to run. - Write the SQL for the target engine: Postgres 16 for
migrations/, MySQL 8 formigrations-mysql/; keep the existing table names (audit_calls,permissions,permissions_audit). - Prove it on an empty database:
bin/dev reset(removes the volumes),bin/dev up, thenbin/test— the integration tests boot the gateway against the dev state DB and apply the pending migrations. fail -> "failed to run state DB migrations" means the statement was rejected; copy it intobin/dev psql stateto see the server's own error. - Name indexes the way the existing ones are named (e.g.
audit_calls_user_occurred_idxfrom migration 0003) and add them in their own migration file. - Update the spec in
website/docs/initial-idea/when the schema change is visible to an operator or an agent — same PR.
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.

