database-data-guardrails
Skill0 starsChanged 3 months agoMITView on GitHub
Use when database, SQL, ORM, query builder, migration, transaction, cache, index, EXPLAIN, backfill, data repair, data integrity, or shared data access work is in scope.
In this repository66 other files it gives its agents.
- adb-android-app-opsSkill
- agents-sdkSkill
- api-documentationSkill
- atlasSkill
- backend-api-auth-guardrailsSkill
- browser-useSkill
- bundleSkill
- changelogSkill
- chatgpt-appsSkill
- chrome-devtools-testSkill
- chronicleSkill
- cloudflare-deploySkill
- cloudflare-email-serviceSkill
- cloudflare-one-migrationsSkill
- cloudflare-oneSkill
- cloudflareSkill
- computer-useSkill
- create-planSkill
- database-analysisSkill
- debug-memory-leakSkill
- deep-initSkill
- deploySkill
- develop-web-gameSkill
- dev-workflowSkill
- docSkill
- durable-objectsSkill
- explainSkill
- figmaSkill
- firmware-feature-writerSkill
- fix-bugSkill
- fix-lintSkill
- frontend-mobile-uiux-designerSkill
- frontend-ui-guardrailsSkill
- gemini-cliSkill
- grok-x-searchSkill
- hermes-chromeSkill
- image-file-readerSkill
- imagegenSkill
- infra-ops-mobile-guardrailsSkill
- layout-reviewSkill
- localizeSkill
- multimodal-lookerSkill
- openai-docsSkill
- optimizeSkill
- parallel-devSkill
- plan-modeSkill
- playwrightSkill
- project-planningSkill
- qa-testerSkill
- refactorSkill
- review-changesSkill
- review-fix-shipSkill
- rust-programmerSkill
- sandbox-sdkSkill
- screenshotSkill
- security-auditSkill
- security-scanSkill
- security-threat-modelSkill
- source-command-collab-startSkill
- turnstile-spinSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 10 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
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 12
Prefer the existing ORM, query builder, or repository pattern.
- Very specific: line 14
Never put user input directly into SQL identifiers, table names, column names, ORDER BY, LIMIT, or OFFSET.
- Distinctive: line 17
Do not use silent fallback to hide DB, model, query, or transaction failures.
- Distinctive: line 18
Avoid magic SQL, hidden side effects, and multi-purpose data helpers.
- Distinctive: line 22
Keep transactions to the smallest set of operations that must succeed or fail together.
- Distinctive: line 23
Do not include long-running work, external API calls, or unnecessary reads inside transactions.
- Distinctive: line 25
Avoid N+1 queries, full table scans, and unconstrained bulk writes.
- Distinctive: line 30
Prefer backward-compatible expand/contract migrations: support compatible reads/writes first, then remove old paths later.
- Distinctive: line 33
Do not rewrite queries, add cache, or add indexes based only on intuition.
- Distinctive: line 39
Do not use cache to hide slow queries, data-model issues, or DB errors.
- Very specific: line 41
Use KV only for read-heavy data where eventual consistency is acceptable.
- Very specific: line 42
Use Durable Objects when stateful coordination, atomic updates, centralized invalidation, or Redis-like primitives are needed.
- Distinctive: line 43
Use managed Redis / Valkey when broad Redis / Valkey compatibility is required.
≈ “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
Database Data Guardrails
This is a domain-specific expansion of the project's AGENTS.md (or equivalent agent rules). It may add database and data requirements, but it must never weaken AGENTS.md, SECURITY, parameterized SQL, input validation, production safety, or destructive-command restrictions.
Data Access
- Prefer the existing ORM, query builder, or repository pattern. Use raw SQL only when the existing pattern is insufficient.
- SQL must be
parameterized; never concatenate strings to build SQL. - Never put user input directly into SQL identifiers, table names, column names,
ORDER BY,LIMIT, orOFFSET. - Dynamic identifiers, sort keys, pagination values, and filter fields must use allowlists or mappings.
- Query and transaction failures must be handled explicitly and retain traceable context.
- Do not use silent fallback to hide DB, model, query, or transaction failures.
- Avoid magic SQL, hidden side effects, and multi-purpose data helpers. Complex queries should be split into named steps or helpers.
Transactions And Integrity
- Keep transactions to the smallest set of operations that must succeed or fail together.
- Do not include long-running work, external API calls, or unnecessary reads inside transactions.
- For balances, inventory, state transitions, or shared resources, use transactions, locking, unique constraints, or idempotency to prevent race conditions.
- Avoid N+1 queries, full table scans, and unconstrained bulk writes.
- Large reads/writes should use batches, pagination, or chunking.
Migrations, Backfills, And Indexes
- Prefer backward-compatible expand/contract migrations: support compatible reads/writes first, then remove old paths later.
- For
DROP, broadDELETE/UPDATE, backfill, index rebuild, or high-lock-risk work, state blast radius, rollback/restore path, and verification. - Database optimization must be based on measurements such as query latency, row scan, index usage, lock wait,
EXPLAIN, or query plan. - Do not rewrite queries, add cache, or add indexes based only on intuition.
- Index design must follow real
WHERE,JOIN,ORDER BY, and frequent query patterns. Call out write, storage, and read trade-offs.
Cache Policy
- Cache must define eligible data, cache key,
TTL, invalidation strategy, and consistency requirements. - Do not use cache to hide slow queries, data-model issues, or DB errors.
- Cloudflare HTTP/page cache should prefer Cloudflare cache,
fetchcache controls, orCache API. - Use
KVonly for read-heavy data where eventual consistency is acceptable. - Use
Durable Objectswhen stateful coordination, atomic updates, centralized invalidation, or Redis-like primitives are needed. - Use managed Redis / Valkey when broad Redis / Valkey compatibility is required.
- For permissions, personalized content, balances, inventory, or high-consistency data, state stale-data protection against cache poisoning, cache stampede, and cross-user leakage.
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.

