

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# Validate Contracts78> **HARD GATE** — Do NOT deploy or migrate data without running `validate-contracts` first. Silent data divergence between system boundaries causes the hardest-to-debug production bugs.9>10> **HARD GATE** — Contract files MUST be version-controlled alongside code. Outdated contracts are worse than no contracts. If a contract hasn't been reviewed in 30 days, flag it as stale.1112Validate that data structures stay in sync across system boundaries — front-end vs back-end, API responses vs expected schemas, config files vs code assumptions, migration output vs target shape.1314## Contract types1516| Mode | What it catches | When to use |17|------|----------------|-------------|18| **Schema** | API response shape mismatches | Before every deploy, after API changes |19| **Key-set** | Missing/unexpected keys across two data sources | Translation files, configs, enum definitions |20| **Shape** | Column type or format violations | After migrations, before consuming exports |2122## Contract file convention2324All contract files live in `specs/contracts/` as YAML. See [REFERENCE.md](REFERENCE.md) for extended examples.2526### Key-set example2728```yaml29# specs/contracts/i18n-keys.yaml30sources:31 reference: src/locales/en.json32 target: src/messages/en.json33mode: subset34```3536## Process3738### 1. Define contract3940Create a YAML file in `specs/contracts/` following the schema for the mode.4142### 2. Run validation4344```bash45bash scripts/validate-contracts.sh specs/contracts/<contract>.yaml46```4748The runner auto-detects key-set contracts (`sources:` block). Schema and shape modes are documented in REFERENCE.md for consumer projects.4950### 3. Read the report5152```53PASS: key-set contract54# or55FAIL: key-set — N keys in reference missing from target56```5758JSON Lines output for CI is planned for schema/shape modes; key-set failures exit non-zero.5960### 4. Fix divergence6162- **Missing keys** → add to target source63- **Type mismatches** → update schema or fix producer64- **Shape violations** → fix migration or consumer6566### 5. Re-validate6768```bash69bash scripts/validate-contracts.sh specs/contracts/<contract>.yaml70```7172## Verify arc7374Part of **★ VERIFY ★**: `verify-work` → `validate-contracts` → `smoke-test` → `run-evals` → `audit-code`7576## Verify7778→ verify: `test -x scripts/validate-contracts.sh && bash scripts/validate-contracts.sh --self-test && grep -q 'validate-contracts.sh' skills/validate-contracts/SKILL.md && echo OK`7980---8182# Validate Contracts — Reference8384## Navigation8586| Lines | Section |87|-------|---------|88| 1 | Title |89| 3–23 | Navigation |90| 24–32 | Integration |91| 33–44 | Configuration |92| 45–54 | Verification |93| 55–71 | Reference block 1 |94| 72–92 | Reference block 2 |95| 93–104 | Example 1 |96| 105–121 | Example 2 |97| 122–133 | Example 3 |98| 134–144 | Example 4 |99| 145–165 | Example 5 |100| 166–176 | Example 6 |101| 177–185 | Integration |102| 186–197 | Configuration |103| 198–204 | Verification |104105## Integration106107- **Pre-deploy gate:** The `deploy` skill runs `validate-contracts` before smoke-test.108- **CI pipeline:** JSON Lines output is CI-friendly; pipe to `jq` for assertions.109- **Pre-migration:** Run `validate-contracts --shape` before consuming migration output.110111112---113114## Configuration115116| Variable | Default | Description |117|----------|---------|-------------|118| `CONTRACTS_DIR` | `specs/contracts/` | Directory containing contract YAML files |119| `VALIDATE_ALL` | `false` | If true, run all contracts in the directory |120| `STRICT_MODE` | `false` | Treat warnings as failures |121| `OUTPUT_FORMAT` | `text` | `text` or `json` |122123124---125126## Verification127128→ verify: `test -f validate-contracts/SKILL.md && grep -q 'name: validate-contracts' validate-contracts/SKILL.md && echo OK`129→ verify: `grep -qi 'specs/contracts\|JSON Schema\|key.set\|data.shape' validate-contracts/SKILL.md && echo OK`130→ verify: `grep -ci 'divergence\|missing key\|type mismatch\|diff\|conforms\|column' validate-contracts/SKILL.md | awk '{if($1>=3) print "OK"; else print "FAIL"}'`131→ verify: `grep -ci 'JSON Lines\|machine.parse\|CI\|deploy.*gate\|pre.deploy' validate-contracts/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`132→ verify: `grep -q 'validate-contracts' SKILL-INDEX.md && echo OK`133134---135136## Reference block 1137138```yaml139# specs/contracts/users.schema.yaml140endpoint: /api/users141method: GET142schema:143 type: object144 required: [id, name, email]145 properties:146 id: { type: number }147 name: { type: string }148 email: { type: string, format: email }149```150151---152153## Reference block 2154155```yaml156# specs/contracts/migration-output.yaml157file: data/users-export.json158format: json159fields:160 - name: user_id161 type: number162 required: true163 - name: full_name164 type: string165 required: true166 - name: created_at167 type: string168 format: date-time169 required: false170```171172---173174## Example 1175176```177specs/contracts/178├── users.schema.yaml # API response schema179├── i18n-keys.yaml # Key-set comparison180├── migration-output.yaml # Data shape contract181└── README.md # Local conventions182```183184---185186## Example 2187188```yaml189# specs/contracts/users.schema.yaml190endpoint: /api/users191method: GET192schema:193 type: object194 required: [id, name, email]195 properties:196 id: { type: number }197 name: { type: string }198 email: { type: string, format: email }199```200201---202203## Example 3204205```yaml206# specs/contracts/i18n-keys.yaml207sources:208 reference: src/frontend/locales/en.json209 target: src/backend/messages/en.json210mode: subset # all target keys must exist in reference211```212213---214215## Example 4216217```bash218validate-contracts --key-set specs/contracts/i18n-keys.yaml219# → missing: 2 keys in reference not found in target: ['settings.privacy', 'help.faq']220# → added: 1 key in target not in reference: ['deprecated.field']221# → exit 1 (divergence)222```223224---225226## Example 5227228```yaml229# specs/contracts/migration-output.yaml230file: data/users-export.json231format: json232fields:233 - name: user_id234 type: number235 required: true236 - name: full_name237 type: string238 required: true239 - name: created_at240 type: string241 format: date-time242 required: false243```244245---246247## Example 6248249```bash250validate-contracts --shape specs/contracts/migration-output.yaml251# → PASS: 3/3 fields validated, 5000 rows OK252# → WARN: field 'full_name' has 12 null values (0.24%)253# → FAIL: field 'user_id' has 3 rows with type string (expected number)254```255256---257258## Integration259260- **Pre-deploy gate:** The `deploy` skill runs `validate-contracts` before smoke-test.261- **CI pipeline:** JSON Lines output is CI-friendly; pipe to `jq` for assertions.262- **Pre-migration:** Run `validate-contracts --shape` before consuming migration output.263264265---266267## Configuration268269| Variable | Default | Description |270|----------|---------|-------------|271| `CONTRACTS_DIR` | `specs/contracts/` | Directory containing contract YAML files |272| `VALIDATE_ALL` | `false` | If true, run all contracts in the directory |273| `STRICT_MODE` | `false` | Treat warnings as failures |274| `OUTPUT_FORMAT` | `text` | `text` or `json` |275276277---278279## Verification280281→ verify: `test -f validate-contracts/SKILL.md && grep -q 'name: validate-contracts' validate-contracts/SKILL.md && echo OK`282→ verify: `grep -qi 'specs/contracts\|JSON Schema\|key.set\|data.shape' validate-contracts/SKILL.md && echo OK`283→ verify: `grep -ci 'divergence\|missing key\|type mismatch\|diff\|conforms\|column' validate-contracts/SKILL.md | awk '{if($1>=3) print "OK"; else print "FAIL"}'`284→ verify: `grep -ci 'JSON Lines\|machine.parse\|CI\|deploy.*gate\|pre.deploy' validate-contracts/SKILL.md | awk '{if($1>=2) print "OK"; else print "FAIL"}'`285→ verify: `grep -q 'validate-contracts' SKILL-INDEX.md && echo OK`286
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| danielvm-git/bigpowers.cursor/rules/simple-english.mdc · 139 | Cursor rules | styletypesgitdatabase+6 | 47/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/assess-impact.mdc · 139 | Cursor rules | testtesting-strategydeployment | 66/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/audit-plan.mdc · 139 | Cursor rules | buildteststylegit | 74/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/build-epic.mdc · 139 | Cursor rules | buildgit | 58/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/change-request.mdc · 139 | Cursor rules | no sections | 48/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/commit-message.mdc · 139 | Cursor rules | lint-formatstyletypesgit+3 | 82/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/compose-workflow.mdc · 139 | Cursor rules | styledo-notagent-behaviour | 65/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/context7-mcp.mdc · 139 | Cursor rules | style | 54/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/deepen-architecture.mdc · 139 | Cursor rules | testtesting-strategydo-not | 57/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-language.mdc · 139 | Cursor rules | lint-formatdo-not | 65/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/define-success.mdc · 139 | Cursor rules | no sections | 4/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/delegate-task.mdc · 139 | Cursor rules | git | 62/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/deploy.mdc · 139 | Cursor rules | setupbuildtestdeployment | 77/100 | 14 days ago | |
| danielvm-git/bigpowers.windsurf/rules/verify-work.md · 139 | Windsurf rules | buildtestlint-formatagent-behaviour | 74/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/develop-tdd.mdc · 139 | Cursor rules | teststylearchtesting-strategy+5 | 85/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-root.mdc · 139 | Cursor rules | no sections | 39/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/diagnose-stall.mdc · 139 | Cursor rules | no sections | 44/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/dispatch-agents.mdc · 139 | Cursor rules | git | 54/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/edit-document.mdc · 139 | Cursor rules | no sections | 39/100 | 14 days ago | |
| danielvm-git/bigpowers.cursor/rules/elaborate-spec.mdc · 139 | Cursor rules | test | 58/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| bybren-llc/safe-agentic-workflow.cursor/rules/10-backend-python.mdc · 399 | Cursor rules | testlint-formatstylegit+4 | 97/100 | today |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/danielvm-git-bigpowers-cursor-rules-validate-contracts)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.