storage-schema-change
Skill346 starsChanged 7 days agoApache-2.0View on GitHub
Use when planning, implementing, or reviewing agentic-api changes to the database schema, migrations, storage models, stored JSON, or what a response or item persists.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agentic-api-engineeringSkill
- executor-architecture-reviewSkill
- pr-reviewSkill
- rust-skillsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 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.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Keep persistence portable across SQLite and PostgreSQL, keep every stored value typed, and put each piece of data in the column whose …
- Very specific: line 15
Read AGENTS.md and TERMINOLOGY.md.
- Very specific: line 16
Read the storage/ section of ARCHITECTURE.md, including "Schema, migrations, and where data goes".
- Very specific: line 18
Read crates/agentic-server-core/migrations/ in order, storage/schema.rs, and the affected storage/models/, storage/types/, and store files.
- Very specific: line 32
Incompatible data: If existing rows can no longer be read, raise MINIMUM_SUPPORTED_MIGRATION instead of adding decoders for the old format, …
- Very specific: line 42
Everything that names the column: Check the row struct, its SQL (including explicit column lists), the types/ conversion, the supervisor …
≈ “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
Storage Schema Change
Keep persistence portable across SQLite and PostgreSQL, keep every stored value typed, and put each piece of data in the column whose readers need it.
Authoritative inputs
Apply the shared engineering preparation first; reuse any completed discovery.
- Read
AGENTS.mdandTERMINOLOGY.md. - Read the
storage/section ofARCHITECTURE.md, including "Schema, migrations, and where data goes". Treat it as the source of truth; this skill does not replace it. - Read
crates/agentic-server-core/migrations/in order,storage/schema.rs, and the affectedstorage/models/,storage/types/, and store files.
Checklist
- Layering. SQL lives only in
storage/models/, as one function per operation over one row struct per table. Rows convert to Rust types only instorage/types/, through one conversion pair per column. Stores take and return typed values; onlyexecutor/modes/calls them. - No backend in queries. Model SQL is portable over
sqlx::Any. Backend checks belong inpool.rs(connection tuning) andschema.rs(migration and verification), plus the existinglock_in_tx. Reject dialect functions in queries; restructure into portable queries or move the work into Rust. - Migration. A schema change is a new numbered SQL file that runs on both backends. Released migrations are
never edited. Prefer
ALTER TABLE ADD/DROP COLUMNto rebuilding a table, and drop a column's indexes first. New columns on tables that may hold rows are nullable or have a default; new integer columns areBIGINT. - Incompatible data. If existing rows can no longer be read, raise
MINIMUM_SUPPORTED_MIGRATIONinstead of adding decoders for the old format, and document that the default SQLite database is recreated and other databases are rejected. - Column or metadata.
responses.metadataholds only what a continuation needs and stays small, because every continuation decodes it and session checkpoints retain it.items.metadataholds storage facts about an item, never content, anditems.datais the item's plain serde JSON. Data read by a different path (retrieval, for example), large data, data used in SQL predicates, ordering, joins, or indexes, data that needs a constraint, and data updated on its own each get a dedicated column. Reject a second copy of data another column holds. - Typed values. Stored JSON round-trips through a typed Rust struct or enum. No
serde_json::Valueat a store boundary, no hidden keys inside wire-shaped JSON, and no placeholder arguments. - Everything that names the column. Check the row struct, its SQL (including explicit column lists), the
types/conversion, the supervisor verification column list and counts inschema.rs, the readiness probe,ARCHITECTURE.md, and the deployment docs when operators are affected. - Tests. Cover a fresh SQLite database, the ignored PostgreSQL suites (
postgres_*tests, run withTEST_POSTGRES_URLand--ignored), supervisor-mode verification, and the outdated-database path when the minimum migration changes. Re-run the storage benchmarks when a hot read or write path changes.
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.

