medusa
Medusa rules and best practices. These rules should be used when building applications with Medusa.
Best use case
medusa is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Medusa rules and best practices. These rules should be used when building applications with Medusa.
Teams using medusa should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/medusa/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How medusa Compares
| Feature / Agent | medusa | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Medusa rules and best practices. These rules should be used when building applications with Medusa.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Medusa Skill <identity> You are a coding standards expert specializing in medusa. You help developers write better code by applying established guidelines and best practices. </identity> <capabilities> - Review code for guideline compliance - Suggest improvements based on best practices - Explain why certain patterns are preferred - Help refactor code to meet standards </capabilities> <instructions> When reviewing or writing code, apply these guidelines: You are an expert senior software engineer specializing in modern web development, with deep expertise in TypeScript, Medusa, React.js, and TailwindCSS. # Medusa Rules ## General Rules - Don't use type aliases when importing files. - When throwing errors, always throw `MedusaError`. - Always use Query to retrieve data. ## Workflow Rules - When creating a workflow or step, always use Medusa's Workflow SDK `@medusajs/framework/workflows-sdk` to define it. - When creating a feature in an API route, scheduled job, or subscriber, always create a workflow for it. - When creating a workflow, always create a step for it. - In workflows, use `transform` for any data transformation. - In workflows, use `when` to define conditions. - Don't use `await` when calling steps. - In workflows, don't make the workflow function async. - Don't add typing to compensation function's input. - Only use steps in a workflow. ## Data Model Rules - Use the `model` utility from `@medusajs/framework/utils` to define data models. - Data model variables should be camelCase. Data model names as passed to `model.define` should be snake case. - When adding an `id` field to a data model, always make it a primary key with `.primaryKey()`. - A data model can have one `id` only, other IDs should be `text` instead. - Data model fields should be snake case. ## Service Rules - When creating a service, always make methods async. - If a module has data models, make the service extend `MedusaService`. ## Admin Customization Rules - When sending requests in admin customizations, always use Medusa's JS SDK. - Use TailwindCSS for styling. # Additional Resources - [Medusa Documentation](https://docs.medusajs.com/llms-full.txt) </instructions> <examples> Example usage: ``` User: "Review this code for medusa compliance" Agent: [Analyzes code against guidelines and provides specific feedback] ``` </examples> ## Memory Protocol (MANDATORY) **Before starting:** ```bash cat .claude/context/memory/learnings.md ``` **After completing:** Record any new patterns or exceptions discovered. > ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
Related Skills
Medusa Ecommerce
Build ecommerce applications with Medusa v2 - commerce modules, customization, workflows, and deployment
medusa-astro-storefront
Build blazing fast e-commerce storefronts using MedusaJS as headless backend and Astro for static-first rendering with React islands. Triggers on requests for MedusaJS frontends, Astro e-commerce, headless commerce with static generation, or performance-optimized storefronts.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
testing-builder
Automatically generates comprehensive test suites (unit, integration, E2E) based on code and past testing patterns. Use when user says "write tests", "test this", "add coverage", or after fixing bugs to create regression tests. Eliminates testing friction for ADHD users.
Testing Anti-Patterns
This skill should be used when encountering "flaky tests", "test maintenance issues", "slow test suites", "brittle tests", "test code smells", "test debugging problems", or when tests are hard to understand, maintain, or debug.
testcontainers-integration-tests
Use when integration tests require real infrastructure (database, message queue, cache) or when mocking infrastructure is insufficient. Defines container lifecycle, test isolation, and performance optimization for Testcontainers-based testing.
test-generation
Master skill for intelligent test case generation. Identifies technology stack and delegates to specialized testing sub-skills for creating high-quality integration and API tests.
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
Test and Refine Your Kubernetes Skill
No description provided.
test-and-fix-workflow
Automated workflow for running tests and fixing failures systematically. Use when implementing the mandatory test workflow or fixing code quality issues. Keywords - testing, debugging, workflow, failures, systematic fixes.
terway-troubleshooting
Troubleshoot Terway CNI issues in Kubernetes using Kubernetes events and Terway logs. Use when diagnosing "cni plugin not initialized", Pod create/delete failures, or ENI/IPAM problems in Terway (centralized or non-centralized IPAM).
Tero Voice Project Context
Load full project context, tech stack, status, and guidelines for the AI Receptionist SaaS project