thoughts/shared/research/2026-01-05-claude-md-research.md
Date: 2026-01-05T07:06:33Z Researcher: Claude Git Commit: 43305a562cfba914654da056b0a7e03c40849678 Branch: develop Repository: medusa-core
Research the Medusa Core codebase to gather information needed to create a CLAUDE.md file following Claude Code best practices. The file should be concise and focused.
This research documents the Medusa Core monorepo structure, build system, testing conventions, and code style to enable creation of an effective CLAUDE.md file. Key findings:
Monorepo Organization:
/packages/
├── medusa/ # Main Medusa package
├── core/ # Core framework packages
│ ├── framework/ # Core runtime
│ ├── types/ # TypeScript definitions
│ ├── utils/ # Utilities
│ ├── workflows-sdk/ # Workflow composition
│ ├── core-flows/ # Predefined workflows
│ └── modules-sdk/ # Module development
├── modules/ # 30+ commerce modules
│ ├── product/, order/, cart/, payment/...
│ └── providers/ # 15+ provider implementations
├── admin/ # Dashboard packages
│ └── dashboard/ # React admin UI
├── cli/ # CLI tools
└── design-system/ # UI components
/integration-tests/ # Full-stack tests
/www/ # Documentation site
Key Directories:
packages/core/framework/ - Core runtime, HTTP, databasepackages/medusa/src/api/ - API routespackages/modules/ - Commerce feature modulespackages/admin/dashboard/ - Admin React appPackage Manager: Yarn 3.2.1 with node-modules linker
Essential Commands:
# Install dependencies
yarn install
# Build all packages
yarn build
# Build specific package
yarn workspace @medusajs/medusa build
# Watch mode (in package directory)
yarn watch
# Lint
yarn lint
# Format
yarn prettier --write <files>
Testing Commands:
# All unit tests
yarn test
# Package integration tests
yarn test:integration:packages
# HTTP integration tests
yarn test:integration:http
# API integration tests
yarn test:integration:api
# Module integration tests
yarn test:integration:modules
Frameworks:
Test Locations:
__tests__/ directories alongside sourcepackages/*/integration-tests/__tests__/integration-tests/http/__tests__/Test Runners:
medusaIntegrationTestRunner - HTTP integration testsmoduleIntegrationTestRunner - Module integration tests@medusajs/test-utilsPatterns:
.spec.ts or .test.tsdescribe/it blocksFormatting (Prettier):
TypeScript:
Naming Conventions:
define-config.ts)Import Organization:
Export Patterns:
export * frompackage.json.eslintrc.js.prettierrc_tsconfig.base.jsonturbo.jsonCONTRIBUTING.mdjest.config.js.yarnrc.ymlBased on research, the CLAUDE.md should include:
Keep each section to 3-5 bullet points maximum for conciseness.
None - sufficient information gathered for CLAUDE.md creation.