Cursor rule
.cursor/rules/namespace-scopes.mdc[object Object]
Cursor rules
Quality
56/100
Scores the file, not the repository.Length
215 words
4 headings · 1 code blocksRepository
13
— · pushed 4 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Splitting Namespace Functions into Scopes78This rule defines how to organize functionality in a namespace by scope.910## Structure11121. Split functionality into three scopes:13 - `customer` - Functions related to customer operations14 - `store` - Functions related to store operations15 - `admin` - Functions related to admin operations16172. Create separate files for each scope:18 - `customer.functions.ts` - Customer-related functions19 - `store.functions.ts` - Store-related functions20 - `admin.functions.ts` - Admin-related functions21223. Create a main functions file (e.g., `functions.ts`) that:23 - Imports all scope files24 - Exports a context mapping function (`contextTo<namespace>FunctionMapping`)2526## Implementation Rules27281. **No cross-imports**: Do not import between scope files (customer/store/admin)292. **Context mapping**: Create a mapping function that determines which function to use based on context parameters303. **Exports**: Export all functions through the main functions file3132## Example (Order namespace)3334In `functions.ts`:35```typescript36import * as customer from './customer.functions';37import * as admin from './admin.functions';38import * as store from './store.functions';3940export const contextToOrderFunctionMapping = ({41 customerId,42 storeKey,43}: {44 customerId?: string;45 storeKey?: string;46}): Record<string, Function> => {47 if (customerId) {48 return {49 read_order: customer.readCustomerOrder,50 };51 }52 if (storeKey) {53 return {54 read_order: store.readStoreOrder,55 create_order_from_cart: store.createOrderFromCartInStore,56 create_order_from_quote: store.createOrderFromQuoteInStore,57 update_order: store.updateOrderByIdInStore,58 };59 }60 return {61 read_order: admin.readOrder,62 create_order_from_cart: admin.createOrderFromCart,63 create_order_from_quote: admin.createOrderFromQuote,64 create_order_by_import: admin.createOrderByImport,65 update_order: admin.updateOrder,66 };67};68```
Also in commercetools/mcp-essentials
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 |
|---|---|---|---|---|---|
| commercetools/mcp-essentials.cursor/rules/docs.mdc · 13 | Cursor rules | agent-behaviourdocs | 39/100 | 3 days ago | |
| commercetools/mcp-essentials.cursor/rules/extending-function-params.mdc · 13 | Cursor rules | testing-strategy | 36/100 | 3 days ago | |
| commercetools/mcp-essentials.cursor/rules/main.mdc · 13 | Cursor rules | style | 34/100 | 3 days ago | |
| commercetools/mcp-essentials.cursor/rules/project-structure.mdc · 13 | Cursor rules | testlint-formatarchsecurity+1 | 60/100 | 3 days ago | |
| commercetools/mcp-essentials.cursor/rules/refactor-functions.mdc · 13 | Cursor rules | do-notagent-behaviour | 56/100 | 3 days ago | |
| commercetools/mcp-essentials.cursor/rules/test.mdc · 13 | Cursor rules | no sections | 24/100 | 3 days ago | |
| commercetools/mcp-essentials.cursor/rules/updated-new-function.mdc · 13 | Cursor rules | testing-strategyagent-behaviour | 49/100 | 3 days ago |
Diff against .cursor/rules/docs.mdc Diff against .cursor/rules/extending-function-params.mdc Diff against .cursor/rules/main.mdc Diff against .cursor/rules/project-structure.mdc Diff against .cursor/rules/refactor-functions.mdc Diff against .cursor/rules/test.mdc Diff against .cursor/rules/updated-new-function.mdc
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 |
