

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1234567# API endpoint consistency (post-commit checklist)89When adding or modifying API v1 endpoints, ensure the following so behavior, docs, and auth stay consistent.1011## 1. Minitest behavioral coverage1213- **Location**: `test/controllers/api/v1/{resource}_controller_test.rb`14- **Scope**: All new or changed actions must have Minitest coverage here. Do not rely on rswag specs for behavioral assertions.15- **Pattern**:16 - Use `ApiKey.create!` (read and read_write scopes) and `api_headers(api_key)` → `{ "X-Api-Key" => api_key.display_key }`. Do not use OAuth/Bearer in these tests.17 - Cover: index/show (and create/update/destroy for write endpoints), read-only key blocking writes (403), invalid params (422), invalid date (422), not found (404), missing auth (401).18 - Follow existing API v1 test style: see [valuations_controller_test.rb](mdc:test/controllers/api/v1/valuations_controller_test.rb) and [transactions_controller_test.rb](mdc:test/controllers/api/v1/transactions_controller_test.rb).1920## 2. rswag is docs-only2122- **Location**: `spec/requests/api/v1/{resource}_spec.rb`23- **Rule**: These specs exist only for OpenAPI generation. Do not add `expect(...)` or `assert_*` (or any behavioral assertions). Use `run_test!` without custom assertion blocks so the spec only documents request/response and regenerates `docs/api/openapi.yaml`.24- **Regenerate**: After edits, run `RAILS_ENV=test bundle exec rake rswag:specs:swaggerize`.2526## 3. Same API key auth in all rswag specs2728- **Rule**: Every request spec in `spec/requests/api/v1/` must use the same API key auth pattern so generated docs are consistent.29- **Pattern** (match holdings_spec, trades_spec, transactions_spec, etc.):3031```ruby32 let(:api_key) do33 key = ApiKey.generate_secure_key34 ApiKey.create!(35 user: user,36 name: 'API Docs Key',37 key: key,38 scopes: %w[read_write],39 source: 'web'40 )41 end4243 let(:'X-Api-Key') { api_key.plain_key }44```4546- Do not use Doorkeeper/OAuth in these specs (no `Doorkeeper::Application`, `Doorkeeper::AccessToken`, or `Authorization: "Bearer ..."`). Use API key only. Note: [valuations_spec.rb](mdc:spec/requests/api/v1/valuations_spec.rb) currently uses OAuth; update it to the API key pattern above when editing that file.47
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 |
|---|---|---|---|---|---|
| we-promise/sure.cursor/rules/cursor_rules.mdc · 9.5k | Cursor rules | no sections | 36/100 | 13 days ago | |
| we-promise/sure.cursor/rules/general-rules.mdc · 9.5k | Cursor rules | styledo-not | 44/100 | 13 days ago | |
| we-promise/sure.cursor/rules/project-conventions.mdc · 9.5k | Cursor rules | styledependenciesdatabaseui+2 | 59/100 | 13 days ago | |
| we-promise/sure.cursor/rules/project-design.mdc · 9.5k | Cursor rules | style | 58/100 | 13 days ago | |
| we-promise/sure.cursor/rules/self_improve.mdc · 9.5k | Cursor rules | no sections | 36/100 | 13 days ago | |
| we-promise/sure.cursor/rules/stimulus_conventions.mdc · 9.5k | Cursor rules | no sections | 44/100 | 13 days ago | |
| we-promise/sure.cursor/rules/testing.mdc · 9.5k | Cursor rules | styletesting-strategy | 52/100 | 13 days ago | |
| we-promise/sure.cursor/rules/ui-ux-design-guidelines.mdc · 9.5k | Cursor rules | styledo-not | 49/100 | 13 days ago | |
| we-promise/sure.cursor/rules/view_conventions.mdc · 9.5k | Cursor rules | style | 52/100 | 13 days ago | |
| we-promise/sure.github/copilot-instructions.md · 9.5k | Copilot instructions | setuptestlint-formatstyle+10 | 88/100 | 13 days ago | |
| we-promise/sureAGENTS.md · 9.5k | AGENTS.md | buildtestlint-formatstyle+7 | 78/100 | 13 days ago | |
| we-promise/sureCLAUDE.md · 9.5k | CLAUDE.md | setuptestlint-formatstyle+11 | 93/100 | 13 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 | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | 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 | |
| hiromaily/go-crypto-wallet.cursor/rules/proto.mdc · 126 | Cursor rules | buildlint-formatstylearch+3 | 96/100 | 14 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 14 days ago | |
| K-Mistele/opensearch.cursor/rules/default.mdc · 30 | Cursor rules | buildtestlint-formatstyle+2 | 94/100 | 14 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/task-context-loading.mdc · 126 | Cursor rules | archtypesdatabasedo-not+1 | 93/100 | 14 days ago |
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/we-promise-sure-cursor-rules-api-endpoint-consistency)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.