rules-backend
Skill1 starsChanged 5 months agoMITView on GitHub
Binding personal rules for backend data — load before adding config/env vars, writing migrations/SQL/transactions/money fields, or building consumers, crons, retries, timeouts or backfills.
- Reads credentials
In this repository40 other files it gives its agents.
- authoring-project-skillsSkill
- background-jobs-and-cachingSkill
- code-conventionsSkill
- containerize-and-ship-a-serviceSkill
- database-migrationsSkill
- design-an-error-modelSkill
- git-flowSkill
- handle-files-frontendSkill
- import-data-from-csvSkill
- integrate-external-servicesSkill
- integrate-identity-providersSkill
- integrate-internal-servicesSkill
- keep-service-memory-leanSkill
- operate-ecs-services-safelySkill
- prevent-secret-and-pii-leaksSkill
- release-safetySkill
- render-transactional-emailsSkill
- rules-code-styleSkill
- rules-debuggingSkill
- rules-gitSkill
- rules-infraSkill
- rules-pr-reviewSkill
- rules-shippingSkill
- rules-workflowSkill
- schedule-effective-dated-changesSkill
- secure-a-frontend-appSkill
- security-auditSkill
- send-slackSkill
- serve-realtime-with-websocketsSkill
- structure-a-backend-serviceSkill
- structure-a-frontend-appSkill
- structure-a-shared-backend-libSkill
- structure-a-shared-ui-libSkill
- tdd-http-firstSkill
- use-feature-flagsSkill
- write-cross-cutting-codeSkill
- write-frontend-codeSkill
- write-frontend-testsSkill
- write-service-codeSkill
- write-unit-testsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Never hardcode config; new env vars → .env.example + Joi/Zod schema (fail boot if missing).
- Distinctive: line 14
Follow database-migrations skill.
- Distinctive: line 17
Avoid OR across columns in WHERE (kill NULLs with NOT NULL DEFAULT, same-column → IN, else UNION ALL/derived column).
- Distinctive: line 20
Every consumer idempotent (natural-key upsert / atomic status transition / processed marker in same trx).
≈ “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
rules-backend
These rules are binding (moved verbatim from ~/.claude/CLAUDE.md). Each heading names its full-text file in ~/.claude/rulebook/: Read that file before acting in its area — the one-liners are the trigger, not the whole rule.
Config & Env — 21-config-environment-rules.md
- Never hardcode config; new env vars →
.env.example+ Joi/Zod schema (fail boot if missing); noprocess.env.Xin business logic.
Database — 22-database-migration-rules.md
- Follow database-migrations skill; never alter schema manually; migrations immutable once merged, reversible; filters in SQL.
- ACID: 2+ dependent writes in ONE trx, every query uses the trx, no external calls inside; invariants in schema (unique index > check-then-insert, map violations to 4xx); derived data in same trx or computed on read; locks only for read-decide-write under concurrency — atomic conditional UPDATE + affected rows > atomic arithmetic >
FOR UPDATEinside the same trx; short trx, retry whole trx on deadlock; report success only after commit; durable state in DB (outbox for critical side effects). - Money never FLOAT —
DECIMAL(p,2)/cents, no float math, round once. - Avoid OR across columns in WHERE (kill NULLs with NOT NULL DEFAULT, same-column → IN, else UNION ALL/derived column); sargable predicates + index; never column-vs-column selection — use a constant recency window.
Reliability — 23-reliability-rules-idempotency-bounded-everything.md
- Every consumer idempotent (natural-key upsert / atomic status transition / processed marker in same trx); crons need overlap guard + max tries; migrations/backfills idempotent.
- Everything bounded: explicit timeouts under the caller's deadline; paginate/chunk growing scans, select only needed columns; retries capped with backoff + jitter.
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.

