data-integrity SKILL.md skillA

This file is byte-identical to the first copy the registry indexed, one of 8 indexed copies. Same content hash, so the same checks give both the same grade.

data-integrity from globalmpc/backendskills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add globalmpc/backendskills/data-integrity@git:20261105.6131a31

Pins git:20261105.6131a31 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
globalmpc/backendskills
Path
bench/results/2026-11-04/checkout-with-2-20261104173809-13068/skills/data-integrity/SKILL.md
Versions recorded
1
Latest version
git:20261105.6131a31, committed Nov 5, 2026
Size
5,434 bytes
Repository stars
25
License
MIT

Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that changes money, stock, balances, counters or statuses, creates rows that must be unique, or calls a payment provider, email or other outside service. Applies in endpoints, webhooks and background jobs.

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# Data integrity

Examples are TypeScript with `pg`. The rules apply to any stack. Assume every write can run twice at the
same time: two clicks, a client retry, two servers picking up the same job.

## 1. Read-then-write is one conditional statement, or one transaction with a lock

Why: two requests at once both read "1 seat left", both book it. Counts go negative and money gets created.

```ts
// Bad: check and write are separate; a concurrent request slips in between
const { rows: [e] } = await pool.query("select seats_left from events where id = $1", [id]);
if (e.seats_left < seats) return sendError(res, 409, "sold_out", "Not enough seats");
await pool.query("update events set seats_left = seats_left - $1 where id = $2", [seats, id]);

// Good: the check is part of the write
const { rowCount } = await client.query(
  "update events set seats_left = seats_left - $1 where id = $2 and seats_left >= $1", [seats, id]);
if (rowCount === 0) throw new HttpError(409, "sold_out", "Not enough seats");
```

When several rows must change together (every line of a booking, both accounts in a payment), do it in one
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add globalmpc/backendskills/data-integrity@sha256:dc3cf0ab531b421d

The line at the top of this page pins the label git:20261105.6131a31, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_i3v5ocawolviiah5.svg)](https://markdownregistry.com/a/art_i3v5ocawolviiah5)

1 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 1 version of this file, committed on Nov 5, 2026.

versioncommittedcommitsizeaudit
git:20261105.6131a31 latest2026-11-05 6131a31 5,434 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (5434 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

globalmpc/backendskills · 25 stars · license MIT · pushed 2026-11-06 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_i3v5ocawolviiah5
GET https://markdownregistry.com/api/v1/resolve?ref=globalmpc/backendskills/data-integrity
GET https://markdownregistry.com/api/v1/blob/dc3cf0ab531b421d93acd85441ddabc7f513e44dda34ce0b848c419099763e20

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from globalmpc/backendskills

api-endpoint SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261104164959-6498/skills/api-endpoint/SKILL.md · Rules for HTTP API endpoints. Use when adding or changing any endpoint (route, request or response shape, status…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261104164959-6498/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
db-migration SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261104164959-6498/skills/db-migration/SKILL.md · Rules for database schema changes. Use for any new table, column, index, constraint, enum or trigger, any data…
git:20261105.6131a31 · audit A · 25 stars
api-endpoint SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261104173809-28998/skills/api-endpoint/SKILL.md · Rules for HTTP API endpoints. Use when adding or changing any endpoint (route, request or response shape, status…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261104173809-28998/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
db-migration SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261104173809-28998/skills/db-migration/SKILL.md · Rules for database schema changes. Use for any new table, column, index, constraint, enum or trigger, any data…
git:20261105.6131a31 · audit A · 25 stars
api-endpoint SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261105081443-28376/skills/api-endpoint/SKILL.md · Rules for HTTP API endpoints. Use when adding or changing any endpoint (route, request or response shape, status…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261105081443-28376/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
db-migration SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261105081443-28376/skills/db-migration/SKILL.md · Rules for database schema changes. Use for any new table, column, index, constraint, enum or trigger, any data…
git:20261105.6131a31 · audit A · 25 stars
api-endpoint SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-2-20261104164959-23336/skills/api-endpoint/SKILL.md · Rules for HTTP API endpoints. Use when adding or changing any endpoint (route, request or response shape, status…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-2-20261104164959-23336/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
db-migration SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-2-20261104164959-23336/skills/db-migration/SKILL.md · Rules for database schema changes. Use for any new table, column, index, constraint, enum or trigger, any data…
git:20261105.6131a31 · audit A · 25 stars

Every file in globalmpc/backendskills

Other files named data-integrity

data-integrity SKILL.md skill
nahid-sparktales/agent-dispatcher · skills/database/data-integrity/SKILL.md · Keep data correct over time — write the invariants down, push each one to the lowest layer that can enforce it, cover…
git:20260919.a0d4f55 · audit A · 58 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-2-20261105081443-12446/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261104173809-28998/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261105081443-28376/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-3-20261104173809-29907/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-3-20261104164959-7407/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-1-20261104164959-6498/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars
data-integrity SKILL.md skill
globalmpc/backendskills · bench/results/2026-11-04/checkout-with-2-20261104164959-23336/skills/data-integrity/SKILL.md · Rules for code that writes to the database where two requests, retries or jobs can run at once. Use for anything that…
git:20261105.6131a31 · audit A · 25 stars

Browse by kind, by grade A, or by owner.