building-with-medusa

Guide Medusa backend development with module, workflow, and API route patterns.

2|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/NagyVikt/codex-plugins --skill building-with-medusa-nagyvikt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-with-medusa
Source: https://github.com/NagyVikt/codex-plugins/tree/main/plugins/medusa/skills/building-with-medusa
Command: npx skills add https://github.com/NagyVikt/codex-plugins --skill building-with-medusa-nagyvikt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of maintaining architectural integrity and type safety when developing custom backend features for Medusa, preventing common pitfalls like layer bypassing and incorrect business logic placement.

Core Features & Use Cases

  • Architectural Enforcement: Ensures strict adherence to the Module-Workflow-API Route pattern.
  • Type Safety & Validation: Provides standardized patterns for Zod schema validation and MedusaRequest typing.
  • Use Case: When building a custom loyalty points module, use this Skill to correctly structure the data model, define the workflow for point mutations, and expose the API route with proper authentication and validation.

Quick Start

Load the building-with-medusa skill to begin planning your custom backend module architecture and implementation steps.

Frequently Asked Questions about building-with-medusa

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a custom Medusa backend module to avoid layer bypassing?

To avoid layer bypassing in a custom Medusa backend module, enforce strict separation by adhering to the Module-Workflow-API Route pattern. This ensures correct business logic placement and respects data access rules.

What is the best way to ensure type safety when building Medusa API routes?

The best way to ensure type safety in Medusa API routes is by using standardized Zod schema validation alongside MedusaRequest typing. This prevents common architectural pitfalls and maintains strict data integrity during backend development.

How do I create a custom workflow for mutations in Medusa?

To create a custom workflow for mutations in Medusa, you define the workflow process following framework conventions for service resolution and authenticated request handling. This maintains architectural integrity while securely mutating commerce data.

Can I use Zod validation with MedusaRequest typing for API route development?

Yes, you can use Zod validation with MedusaRequest typing for API route development. Standardized patterns for these tools provide type safety and validate incoming requests, ensuring scalable commerce features.

When do I need to use module links in Medusa backend architecture?

You need to use module links in Medusa backend architecture when establishing relationships between custom modules and the core commerce data. Adherence to framework conventions for module links ensures proper service resolution and scalable data access.