medusa-development

medusa-development is a cursor rule for Cursor from lambda-curry/medusa2-starter. It costs 2,222 tokens per session, scanned A, original, MIT.

A set of development rules for Medusa v2, a framework for building e-commerce backends. It covers TypeScript APIs, modules, services, workflows, events, jobs, validation, and PostgreSQL.

In plain words
What is it for?
Use it to build REST endpoints, reusable modules and services, multi-step workflows, event handlers, background jobs, and database-backed features.
Why use it?
It helps keep backend code aligned with Medusa's structure and reduces mistakes in business logic, data handling, and API design.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Cursor.

Good fit Use it to build REST endpoints, reusable modules and services, multi-step workflows, event handlers, background jobs, and database-backed features.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/lambda-curry/medusa2-starter/medusa-development
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/lambda-curry/medusa2-starter

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for medusa-development

README.md
[![agentmods](https://agentmods.dev/badge/rules/lambda-curry/medusa2-starter/medusa-development/github.svg)](https://agentmods.dev/rules/lambda-curry/medusa2-starter/medusa-development)
Your own site
<a href="https://agentmods.dev/rules/lambda-curry/medusa2-starter/medusa-development"><img src="https://agentmods.dev/badge/rules/lambda-curry/medusa2-starter/medusa-development/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for medusa-development

Your own site · 80×15
<a href="https://agentmods.dev/rules/lambda-curry/medusa2-starter/medusa-development"><img src="https://agentmods.dev/badge/rules/lambda-curry/medusa2-starter/medusa-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,222 This file is loaded in full into every session.
When invoked 2,222 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02222 $0.02222
Opus 5.5 $0.00889 $0.00889
Sonnet 5.5 $0.00444 $0.00444
Haiku 4.5 $0.00222 $0.00222

Measured 15d ago against content hash c3dd4ab60865, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

medusa-development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/medusa-development.mdc · 403 lines

How it starts

The opening of the file, as written. The whole thing — 403 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Medusa v2 Development Rules

You are an expert in Medusa v2, TypeScript, Node.js, PostgreSQL, and modern e-commerce development patterns.

Core Principles

  • Write clean, maintainable, and well-documented TypeScript code
  • Follow Medusa v2 architectural patterns and conventions
  • Prioritize type safety and proper error handling
  • Use dependency injection and modular design patterns
  • Implement proper validation and sanitization
  • Follow RESTful API design principles
  • Write comprehensive tests for all business logic

Medusa v2 Architecture

Framework Structure

  • Modules: Self-contained packages with domain-specific functionality
  • Services: Business logic layer with dependency injection
  • API Routes: RESTful endpoints in /api/admin and /api/store
  • Workflows: Multi-step business processes with error handling
  • Subscribers: Event-driven handlers for business events
  • Jobs: Background task processing
  • Links: Data relationships between modules

Module Development

// Module definition pattern
import { Module } from "@medusajs/framework/utils"

export const MY_MODULE = "my-module"

export default Module(MY_MODULE, {
  service: MyService,
})

Service Pattern with Dependency Injection

import { MedusaService } from "@medusajs/framework/utils"
import MyModel from "./models/my-model"

class MyService extends MedusaService({
  MyModel,
}) {
  // CRUD methods are automatically generated by MedusaService
  // You can add custom methods here
  async customMethod(data: CustomInput): Promise<CustomOutput> {
    return await this.myModelRepository_.customQuery(data)
  }
}

Module Registration

// medusa-config.ts
import { defineConfig } from "@medusajs/framework/utils"

export default defineConfig({
  projectConfig: {
    // ... other config
  },
  modules: [
    {
      resolve: "./src/modules/my-module",
    },
  ],
})

API Route Patterns

// Admin API route
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
import { z } from "zod"

const schema = z.object({
  name: z.string().min(1),
  description: z.string().optional(),
})

export async function POST(
  req: MedusaRequest,
  res: MedusaResponse
): Promise<void> {
  const validatedBody = schema.parse(req.body)
  
  const myService = req.scope.resolve("myService")
  const result = await myService.create(validatedBody)
  
  res.status(200).json({ data: result })
}

Read the full file on GitHub · 403 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago First seen · 403 lines · 2,222 tokens per session scan A c3dd4ab60865

Subscribe to this mod's changes

medusa-development is a cursor rule published in the GitHub repository lambda-curry/medusa2-starter (164 stars, last pushed 17d ago), licensed MIT. It adds 2,222 tokens to every session, about $0.0089 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-15.

Related

medusa-development compared with cursor rules from other repositories

medusa-development next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
medusa-developmentlambda-curry/medusa2-starterCursor rule16417d agoMITA2,222Cursor
cursormrwogu/promptscriptCursor rule3247d agoMITA53Cursor
storage-plugintrueLoving/PixuliCursor rule662d agoMITA0Cursor
tray-apitray-tecnologia/tray-api-ai-pluginCursor rule153mo agoMITA70Cursor
marketplace-allvtex/skillsCursor rule471mo agononeA25,584Cursor
payment-payment-ppp-posvtex/skillsCursor rule471mo agononeA7,970Cursor
marketplace-marketplace-order-hookvtex/skillsCursor rule471mo agononeA5,539Cursor