Cursor rule
.cursor/rules/domain-logic.mdcBusiness rules and domain logic
Cursor rules
Quality
57/100
Scores the file, not the repository.Length
173 words
5 headings · 1 code blocksRepository
40
— · pushed 120 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# Business Rules (Domain Layer)89## Principles1011- **Total isolation**: zero imports from `infrastructure/`, `presentation/`, or external libs12- **Immutability**: value entities (`Money`, `StockQuantity`) must be immutable13- **Pure methods**: given the same input, always the same output14- **Self-validation**: entities validate their own invariants in the constructor1516```typescript17// ✅ Value entity with validation18class Money {19 constructor(20 readonly amount: number,21 readonly currency: Currency,22 ) {23 if (amount < 0) throw new Error('Amount cannot be negative');24 }2526 add(other: Money): Money {27 if (this.currency !== other.currency) throw new Error('Currency mismatch');28 return new Money(this.amount + other.amount, this.currency);29 }30}31```3233## Domain Services3435- `PortfolioCalculationService`: position calculations, gain/loss, average cost36- `PortfolioAnalyticsService`: snapshots and analytical aggregations37- Receive dependencies via interface (e.g., `IExchangeRateService`)3839## Operations4041- `VestingOperation`: represents RSU/ESPP vesting42- `TradeOperation`: represents stock buy/sell43- Each operation is an immutable record with all required data4445## When Modifying Business Rules46471. Change only in `domain/` — never in presentation482. Write unit tests for every scenario493. Validate against the business guide (`docs/guia_negocio.md`)50
Also in miguelslemos/stock_portfolio
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 |
|---|---|---|---|---|---|
| miguelslemos/stock_portfolio.cursor/rules/architecture.mdc · 40 | Cursor rules | styledependencies | 48/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/code-style.mdc · 40 | Cursor rules | lint-formatstyletypesdo-not+1 | 65/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/new-features.mdc · 40 | Cursor rules | styledo-not | 61/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/project-overview.mdc · 40 | Cursor rules | testlint-formatarchdo-not | 72/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/testing.mdc · 40 | Cursor rules | setupteststylearch+1 | 62/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/ui-presentation.mdc · 40 | Cursor rules | ui | 50/100 | 3 days ago |
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 | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/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 | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
