Cursor rule
.cursor/rules/project-conventions.mdc[object Object]
Cursor rules
Quality
59/100
Scores the file, not the repository.Length
666 words
7 headings · 0 code blocksRepository
9.3k
— · pushed 0 days agoLast changed
2 days ago
First indexed 2 days ago.123456This rule serves as high-level documentation for how you should write code in this codebase.78## Project Tech Stack910- Web framework: Ruby on Rails11 - Minitest + fixtures for testing12 - Propshaft for asset pipeline13 - Hotwire Turbo/Stimulus for SPA-like UI/UX14 - TailwindCSS for styles15 - Lucide Icons for icons16 - OpenAI for AI chat17- Database: PostgreSQL18- Jobs: Sidekiq + Redis19- External20 - Payments: Stripe21 - User bank data syncing: Plaid2223## Project conventions2425These conventions should be used when writing code for the project.2627### Convention 1: Minimize dependencies, vanilla Rails is plenty2829Dependencies are a natural part of building software, but we aim to minimize them when possible to keep this open-source codebase easy to understand, maintain, and contribute to.3031- Push Rails to its limits before adding new dependencies32- When a new dependency is added, there must be a strong technical or business reason to add it33- When adding dependencies, you should favor old and reliable over new and flashy3435### Convention 2: Leverage POROs and concerns over "service objects"3637This codebase adopts a "skinny controller, fat models" convention. Furthermore, we put almost _everything_ directly in the `app/models/` folder and avoid separate folders for business logic such as `app/services/`.3839- Organize large pieces of business logic into Rails concerns and POROs (Plain ole' Ruby Objects)40- While a Rails concern _may_ offer shared functionality (i.e. "duck types"), it can also be a "one-off" concern that is only included in one place for better organization and readability.41- When concerns are used for code organization, they should be organized around the "traits" of a model; not for simply moving code to another spot in the codebase.42- When possible, models should answer questions about themselves—for example, we might have a method, `account.balance_series` that returns a time-series of the account's most recent balances. We prefer this over something more service-like such as `AccountSeries.new(account).call`.4344### Convention 3: Leverage Hotwire, write semantic HTML, CSS, and JS, prefer server-side solutions4546- Native HTML is always preferred over JS-based components47 - Example 1: Use `<dialog>` element for modals instead of creating a custom component48 - Example 2: Use `<details><summary>...</summary></details>` for disclosures rather than custom components49- Leverage Turbo frames to break up the page over JS-driven client-side solutions50 - Example 1: A good example of turbo frame usage is in [application.html.erb](mdc:app/views/layouts/application.html.erb) where we load [chats_controller.rb](mdc:app/controllers/chats_controller.rb) actions in a turbo frame in the global layout51- Leverage query params in the URL for state over local storage and sessions. If absolutely necessary, utilize the DB for persistent state.52- Use Turbo streams to enhance functionality, but do not solely depend on it53- Format currencies, numbers, dates, and other values server-side, then pass to Stimulus controllers for display only54- Keep client-side code for where it truly shines. For example, @bulk_select_controller.js is a case where server-side solutions would degrade the user experience significantly. When bulk-selecting entries, client-side solutions are the way to go and Stimulus provides the right toolset to achieve this.55- Always use the `icon` helper in [application_helper.rb](mdc:app/helpers/application_helper.rb) for icons. NEVER use `lucide_icon` helper directly.5657The Hotwire suite (Turbo/Stimulus) works very well with these native elements and we optimize for this.5859### Convention 4: Optimize for simplicitly and clarity6061All code should maximize readability and simplicity.6263- Prioritize good OOP domain design over performance64- Only focus on performance for critical and global areas of the codebase; otherwise, don't sweat the small stuff.65 - Example 1: be mindful of loading large data payloads in global layouts66 - Example 2: Avoid N+1 queries6768### Convention 5: Use ActiveRecord for complex validations, DB for simple ones, keep business logic out of DB6970- Enforce `null` checks, unique indexes, and other simple validations in the DB71- ActiveRecord validations _may_ mirror the DB level ones, but not 100% necessary. These are for convenience when error handling in forms. Always prefer client-side form validation when possible.72- Complex validations and business logic should remain in ActiveRecord7374
Also in we-promise/sure
Diff this repo’s formatsOne 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/api-endpoint-consistency.mdc · 9.3k | Cursor rules | styletesting-strategygitsecurity+2 | 57/100 | 2 days ago | |
| we-promise/sure.cursor/rules/cursor_rules.mdc · 9.3k | Cursor rules | no sections | 36/100 | 2 days ago | |
| we-promise/sure.cursor/rules/general-rules.mdc · 9.3k | Cursor rules | styledo-not | 44/100 | 2 days ago | |
| we-promise/sure.cursor/rules/project-design.mdc · 9.3k | Cursor rules | style | 58/100 | 2 days ago | |
| we-promise/sure.cursor/rules/self_improve.mdc · 9.3k | Cursor rules | no sections | 36/100 | 2 days ago | |
| we-promise/sure.cursor/rules/stimulus_conventions.mdc · 9.3k | Cursor rules | no sections | 44/100 | 2 days ago | |
| we-promise/sure.cursor/rules/testing.mdc · 9.3k | Cursor rules | styletesting-strategy | 52/100 | 2 days ago | |
| we-promise/sure.cursor/rules/ui-ux-design-guidelines.mdc · 9.3k | Cursor rules | styledo-not | 49/100 | 2 days ago | |
| we-promise/sure.cursor/rules/view_conventions.mdc · 9.3k | Cursor rules | style | 52/100 | 2 days ago | |
| we-promise/sure.github/copilot-instructions.md · 9.3k | Copilot instructions | setuptestlint-formatstyle+10 | 88/100 | 2 days ago | |
| we-promise/sureAGENTS.md · 9.3k | AGENTS.md | buildtestlint-formatstyle+7 | 78/100 | 2 days ago | |
| we-promise/sureCLAUDE.md · 9.3k | CLAUDE.md | setuptestlint-formatstyle+11 | 93/100 | 2 days ago |
Diff against .cursor/rules/api-endpoint-consistency.mdc Diff against .cursor/rules/cursor_rules.mdc Diff against .cursor/rules/general-rules.mdc Diff against .cursor/rules/project-design.mdc Diff against .cursor/rules/self_improve.mdc Diff against .cursor/rules/stimulus_conventions.mdc Diff against .cursor/rules/testing.mdc Diff against .cursor/rules/ui-ux-design-guidelines.mdc Diff against .cursor/rules/view_conventions.mdc Diff against .github/copilot-instructions.md Diff against AGENTS.md Diff against CLAUDE.md
Similar configs
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 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/proto.mdc · 126 | Cursor rules | buildlint-formatstylearch+3 | 96/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 3 days ago | |
| K-Mistele/opensearch.cursor/rules/default.mdc · 30 | Cursor rules | buildtestlint-formatstyle+2 | 94/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/task-context-loading.mdc · 126 | Cursor rules | archtypesdatabasedo-not+1 | 93/100 | 3 days ago |
