RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/commercetools/mcp-essentials

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 blocks

Repository

13

— · pushed 4 days ago

Last changed

3 days ago

First indexed 3 days ago.
commercetools/mcp-essentials/.cursor/rules/namespace-scopes.mdcRawGitHub
1---
2description:
3globs:
4alwaysApply: false
5---
6# Splitting Namespace Functions into Scopes
7 
8This rule defines how to organize functionality in a namespace by scope.
9 
10## Structure
11 
121. Split functionality into three scopes:
13 - `customer` - Functions related to customer operations
14 - `store` - Functions related to store operations
15 - `admin` - Functions related to admin operations
16 
172. Create separate files for each scope:
18 - `customer.functions.ts` - Customer-related functions
19 - `store.functions.ts` - Store-related functions
20 - `admin.functions.ts` - Admin-related functions
21 
223. Create a main functions file (e.g., `functions.ts`) that:
23 - Imports all scope files
24 - Exports a context mapping function (`contextTo<namespace>FunctionMapping`)
25 
26## Implementation Rules
27 
281. **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 parameters
303. **Exports**: Export all functions through the main functions file
31 
32## Example (Order namespace)
33 
34In `functions.ts`:
35```typescript
36import * as customer from './customer.functions';
37import * as admin from './admin.functions';
38import * as store from './store.functions';
39 
40export 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```

Sections

  • Splitting Namespace Functions into Scopes
  • Structure
  • Implementation Rules
  • Example (Order namespace)

What it covers

architecturedo-not

Stack — with the evidence

typescript

(1.00)

node

(1.00)

langchain

(1.00)

express

(0.70)

jest

(0.70)

eslint

(0.70)

javascript

(0.60)

monorepo

(0.60)

pnpm

(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
commercetools
Language
—
License
—
Archived
no

All configs in this repo

Also in commercetools/mcp-essentials

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
commercetools/mcp-essentials.cursor/rules/docs.mdc · 13Cursor rulestypescriptnode+8agent-behaviourdocs39/1003 days ago
commercetools/mcp-essentials.cursor/rules/extending-function-params.mdc · 13Cursor rulestypescriptnode+8testing-strategy36/1003 days ago
commercetools/mcp-essentials.cursor/rules/main.mdc · 13Cursor rulestypescriptnode+8style34/1003 days ago
commercetools/mcp-essentials.cursor/rules/project-structure.mdc · 13Cursor rulestypescriptnode+8testlint-formatarchsecurity+160/1003 days ago
commercetools/mcp-essentials.cursor/rules/refactor-functions.mdc · 13Cursor rulestypescriptnode+8do-notagent-behaviour56/1003 days ago
commercetools/mcp-essentials.cursor/rules/test.mdc · 13Cursor rulestypescriptnode+8no sections24/1003 days ago
commercetools/mcp-essentials.cursor/rules/updated-new-function.mdc · 13Cursor rulestypescriptnode+8testing-strategyagent-behaviour49/1003 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.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/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
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/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