

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456You are an expert in Ruby on Rails and PostgreSQL78## Code Style and Structure910- Write concise, idiomatic Ruby code with accurate examples.11- Follow Rails conventions and best practices.12- Use object-oriented and functional programming patterns as appropriate.13- Prefer iteration and modularization over code duplication.14- Use descriptive variable and method names (e.g., user_signed_in?, calculate_total).15- Structure files according to Rails conventions (MVC, concerns, helpers, etc.).1617## Naming Conventions1819- Use snake_case for file names, method names, and variables.20- Use CamelCase for class and module names.21- Follow Rails naming conventions for models, controllers, and views.2223## Ruby and Rails Usage2425- Use Ruby 3.x features when appropriate (e.g., pattern matching, endless methods).26- Leverage Rails' built-in helpers and methods.27- Use ActiveRecord effectively for database operations.28- Follow the official Ruby on Rails guides for best practices in routing, controllers, models, views, and other Rails components.2930## Syntax and Formatting3132- Follow the Ruby Style Guide (https://rubystyle.guide/)33- Use Ruby's expressive syntax (e.g., unless, ||=, &.)34- Prefer single quotes for strings unless interpolation is needed.3536## Error Handling and Validation3738- Use exceptions for exceptional cases, not for control flow.39- Implement proper error logging and user-friendly messages.40- Use ActiveModel validations in models.41- Handle errors gracefully in controllers and display appropriate flash messages.4243## UI and Styling4445- Remember that data flows to the front end using Inertia.js46- The Rails view layer is not used, front end is done using React, loaded by Inertia.js4748## Internationalization (i18n)4950- Properly define strings in locale yml files; use a nested directory structure for locale files to keep things organized.51- Define strings for the frontend in yml files as well; use the i18n-js gem to generate json files for the front end.52- Implement proper locale detection.53- Use proper number and date formatting.54- Use proper currency formatting.55- Implement proper RTL support.5657### Controller Patterns5859- Using "decent exposure" gem for defining common queries in controllers60- Custom `strong_params` method on ApplicationController for defining strong parameters61- `sortable_fields` method on ApplicationController helps define sortable fields for React Table components6263## Performance Optimization6465- Use database indexing effectively.66- Implement caching strategies (fragment caching, Russian Doll caching).67- Use eager loading to avoid N+1 queries.68- Optimize database queries using includes, joins, or select.6970## Key Conventions7172- Follow RESTful routing conventions.73- Use concerns for shared behavior across models or controllers.74- Implement service objects for complex business logic.75- Use background jobs (e.g., Goodjob) for time-consuming tasks.7677## Testing7879- Write comprehensive tests using RSpec.80- Follow TDD/BDD practices.81- Use factories (FactoryBot) for test data generation.82- Do not use `let` for locally available definitions. Only use `let` when passing the test subject to a test defined in another file, or if it's the simpler approach for that specific test.8384 ### Unit Testing8586 - Write thorough unit tests to validate individual functions and components.87 - Follow patterns like Arrange-Act-Assert to ensure clarity and consistency in tests.88 - Mock external dependencies and API calls to isolate unit tests.8990 ### Integration Testing9192 - Focus on user workflows to ensure app functionality.93 - Set up and tear down test environments properly to maintain test independence.9495 ### Inertia Testing9697 - Inertia has its own set of rspec assertions, use them when appropriate to test inertia specific actions. Examples below:9899```ruby100 RSpec.describe '/events', inertia: true do101 describe '#index' do102 let!(:event) { Event.create!(title: 'Foo', start_date: '2024-02-21', description: 'Foo bar') }103104 it "renders inertia component" do105 get events_path106107 # check the component108 expect(inertia).to render_component 'Event/Index'109 # or110 expect_inertia.to render_component 'Event/Index'111 # same as above112 expect(inertia.component).to eq 'Event/Index'113114 # props (including shared props)115 expect(inertia).to have_exact_props({title: 'Foo', description: 'Foo bar'})116 expect(inertia).to include_props({title: 'Foo'})117118 # access props119 expect(inertia.props[:title]).to eq 'Foo'120121 # view data122 expect(inertia).to have_exact_view_data({meta: 'Foo bar'})123 expect(inertia).to include_view_data({meta: 'Foo bar'})124125 # access view data126 expect(inertia.view_data[:meta]).to eq 'Foo bar'127 end128 end129 end130```131132## Security133134- Implement proper authentication and authorization (e.g., Devise, Rolify, Pundit).135- Use strong parameters in controllers, using the strong_params method defined in the strong_params.rb concern.136- Protect against common web vulnerabilities (XSS, CSRF, SQL injection).137
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 |
|---|---|---|---|---|---|
| aviemet/inventory.cursor/rules/conventions.mdc · 0 | Cursor rules | testing-strategy | 16/100 | 14 days ago | |
| aviemet/inventory.cursor/rules/inventory.mdc · 0 | Cursor rules | no sections | 16/100 | 14 days ago | |
| aviemet/inventory.cursor/rules/rspec.mdc · 0 | Cursor rules | style | 8/100 | 14 days ago | |
| aviemet/inventory.cursor/rules/styles.mdc · 0 | Cursor rules | style | 34/100 | 14 days ago | |
| aviemet/inventory.cursor/rules/typescript.mdc · 0 | Cursor rules | testlint-formatstylearch+4 | 78/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 | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/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 | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 46 | Cursor rules | teststyletesting-strategysecurity+3 | 97/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/aviemet-inventory-cursor-rules-rails)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.