Back to Skills

building-with-medusa

Load automatically when planning, researching, or implementing ANY Medusa backend features (custom modules, API routes, workflows, data models, module links, business logic). REQUIRED for all Medusa backend work in ALL modes (planning, implementation, exploration). Contains architectural patterns, best practices, and critical rules that MCP servers don't provide.

179stars18forksUpdated 5/28/2026

Security Assessment

Critical Risk(0/100)

Detected risks:

Data Exfiltration([reference/frontend-integration.md] fetch("/store/my-route", { method: "POST, [reference/frontend-integration.md] fetch("/store/items", { method: "POST)
Persistence([reference/scheduled-jobs.md] crontab)
Sensitive File Access([reference/querying-data.md] .env, [reference/module-links.md] .env)
Security Score0/100

About building-with-medusa

This skill provides a structured guide for building backend systems using Medusa, focusing on enforcing a consistent and scalable architecture across all backend development tasks. It addresses common challenges in Medusa applications such as unclear separation of concerns, improper business logic placement, and unsafe or inconsistent data handling. By standardizing how modules, workflows, and API routes interact, it helps developers avoid architectural drift and ensures maintainable, production-ready systems.

The skill defines a strict layered architecture where modules handle data models and CRUD operations, workflows encapsulate business logic and mutations (including rollback behavior), API routes serve as HTTP interfaces with validation, and frontend applications interact via SDKs. It introduces important constraints such as using only GET, POST, and DELETE HTTP methods, requiring workflows for all mutations, and enforcing module isolation through module links. It also highlights correct data access patterns using query.graph() for cross-module queries and query.index() for filtered queries across linked modules, while emphasizing type safety through schema inference and request typing conventions.

This skill is intended for developers working on Medusa backend systems, including those building custom modules, workflows, API routes, authentication systems, or complex business logic. It is also relevant when integrating backend functionality with admin dashboards or storefront applications. Its primary goal is to ensure backend consistency, reduce architectural mistakes, and guide teams toward best practices in modular, scalable e-commerce backend development.

FAQ

When should I apply this skill during development?

It should be applied for any Medusa backend task, including creating modules, workflows, API routes, module links, business logic, authentication, or cross-module data queries.

Can I use PUT or PATCH HTTP methods in API routes?

No. The architecture strictly allows only GET, POST, and DELETE methods to maintain consistency and enforce proper workflow-driven mutations.

Where should business logic be implemented?

Business logic must be implemented inside workflow steps. API routes should only handle request validation and triggering workflows, not contain core logic.

Do I need to load additional reference files?

Yes. Before implementing specific components like modules, workflows, API routes, or authentication, you must load the corresponding reference files for complete implementation guidance.

Is this skill compatible with admin and storefront development?

Yes. It supports backend development that integrates with admin dashboards and storefronts, including SDK-based communication and API consumption.

All Files

14 files
SKILL.md14.9 KB
View
reference/error-handling.md5.3 KB
View
reference/frontend-integration.md6.8 KB
View
reference/scheduled-jobs.md11.5 KB
View
reference/workflows.md16.1 KB
View
reference/custom-modules.md8.2 KB
View
reference/subscribers-and-events.md13.7 KB
View
reference/querying-data.md24.0 KB
View
reference/troubleshooting.md4.7 KB
View
reference/api-routes.md22.6 KB
View
reference/data-models.md2.4 KB
View
reference/module-links.md11.4 KB
View
reference/authentication.md15.2 KB
View
reference/workflow-hooks.md2.2 KB
View

Install building-with-medusa

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill