RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/we-promise/sure

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 blocks

Repository

9.3k

— · pushed 0 days ago

Last changed

2 days ago

First indexed 2 days ago.
we-promise/sure/.cursor/rules/project-conventions.mdcRawGitHub
1---
2description:
3globs:
4alwaysApply: true
5---
6This rule serves as high-level documentation for how you should write code in this codebase.
7 
8## Project Tech Stack
9 
10- Web framework: Ruby on Rails
11 - Minitest + fixtures for testing
12 - Propshaft for asset pipeline
13 - Hotwire Turbo/Stimulus for SPA-like UI/UX
14 - TailwindCSS for styles
15 - Lucide Icons for icons
16 - OpenAI for AI chat
17- Database: PostgreSQL
18- Jobs: Sidekiq + Redis
19- External
20 - Payments: Stripe
21 - User bank data syncing: Plaid
22 
23## Project conventions
24 
25These conventions should be used when writing code for the project.
26 
27### Convention 1: Minimize dependencies, vanilla Rails is plenty
28 
29Dependencies 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.
30 
31- Push Rails to its limits before adding new dependencies
32- When a new dependency is added, there must be a strong technical or business reason to add it
33- When adding dependencies, you should favor old and reliable over new and flashy
34 
35### Convention 2: Leverage POROs and concerns over "service objects"
36 
37This 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/`.
38 
39- 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`.
43 
44### Convention 3: Leverage Hotwire, write semantic HTML, CSS, and JS, prefer server-side solutions
45 
46- Native HTML is always preferred over JS-based components
47 - Example 1: Use `<dialog>` element for modals instead of creating a custom component
48 - Example 2: Use `<details><summary>...</summary></details>` for disclosures rather than custom components
49- Leverage Turbo frames to break up the page over JS-driven client-side solutions
50 - 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 layout
51- 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 it
53- Format currencies, numbers, dates, and other values server-side, then pass to Stimulus controllers for display only
54- 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.
56 
57The Hotwire suite (Turbo/Stimulus) works very well with these native elements and we optimize for this.
58 
59### Convention 4: Optimize for simplicitly and clarity
60 
61All code should maximize readability and simplicity.
62 
63- Prioritize good OOP domain design over performance
64- 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 layouts
66 - Example 2: Avoid N+1 queries
67 
68### Convention 5: Use ActiveRecord for complex validations, DB for simple ones, keep business logic out of DB
69 
70- Enforce `null` checks, unique indexes, and other simple validations in the DB
71- 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 ActiveRecord
73 
74 

Sections

  • Project Tech Stack
  • Project conventions
  • Convention 1: Minimize dependencies, vanilla Rails is plenty
  • Convention 2: Leverage POROs and concerns over "service objects"
  • Convention 3: Leverage Hotwire, write semantic HTML, CSS, and JS, prefer server-side solutions
  • Convention 4: Optimize for simplicitly and clarity
  • Convention 5: Use ActiveRecord for complex validations, DB for simple ones, keep business logic out of DB

What it covers

code-styledependenciesdatabaseuiperformancedo-not

Stack — with the evidence

ruby

(1.00)

rails

(1.00)

biome

(1.00)

postgres

(0.70)

redis

(0.70)

vite

(0.70)

cloudflare

(0.70)

aws

(0.70)

desktop-app

(0.70)

typescript

(0.60)

javascript

(0.60)

swift

(0.60)

docker

(0.60)

kubernetes

(0.60)

github-actions

(0.60)

Glob targeting

  • [object Object]

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
we-promise
Language
—
License
—
Archived
no

All configs in this repo

Also in we-promise/sure

Diff this repo’s formats

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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
we-promise/sure.cursor/rules/api-endpoint-consistency.mdc · 9.3kCursor rulesrubyrails+13styletesting-strategygitsecurity+257/1002 days ago
we-promise/sure.cursor/rules/cursor_rules.mdc · 9.3kCursor rulesrubyrails+13no sections36/1002 days ago
we-promise/sure.cursor/rules/general-rules.mdc · 9.3kCursor rulesrubyrails+13styledo-not44/1002 days ago
we-promise/sure.cursor/rules/project-design.mdc · 9.3kCursor rulesrubyrails+13style58/1002 days ago
we-promise/sure.cursor/rules/self_improve.mdc · 9.3kCursor rulesrubyrails+13no sections36/1002 days ago
we-promise/sure.cursor/rules/stimulus_conventions.mdc · 9.3kCursor rulesrubyrails+13no sections44/1002 days ago
we-promise/sure.cursor/rules/testing.mdc · 9.3kCursor rulesrubyrails+13styletesting-strategy52/1002 days ago
we-promise/sure.cursor/rules/ui-ux-design-guidelines.mdc · 9.3kCursor rulesrubyrails+13styledo-not49/1002 days ago
we-promise/sure.cursor/rules/view_conventions.mdc · 9.3kCursor rulesrubyrails+13style52/1002 days ago
we-promise/sure.github/copilot-instructions.md · 9.3kCopilot instructionsrubyrails+13setuptestlint-formatstyle+1088/1002 days ago
we-promise/sureAGENTS.md · 9.3kAGENTS.mdrubyrails+13buildtestlint-formatstyle+778/1002 days ago
we-promise/sureCLAUDE.md · 9.3kCLAUDE.mdrubyrails+13setuptestlint-formatstyle+1193/1002 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.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
hiromaily/go-crypto-wallet.cursor/rules/proto.mdc · 126Cursor rulesgobiome+4buildlint-formatstylearch+396/1003 days ago
nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49Cursor rulestypescriptcypress+14setupbuildteststyle+496/1003 days ago
K-Mistele/opensearch.cursor/rules/default.mdc · 30Cursor rulestypescriptbun+3buildtestlint-formatstyle+294/1003 days ago
hiromaily/go-crypto-wallet.cursor/rules/task-context-loading.mdc · 126Cursor rulesgobiome+4archtypesdatabasedo-not+193/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack