Skip to main content
skill CX Codex

creating-internal-agents — Claude Code skill: Medusa admin AI agents

creating-internal-agents — a skill for building an admin-side AI agent in Medusa: conversation models, module service, streamText() runtime, NDJSON route and a chat page.

no license 500 installs ★ 237 updated 2026-10-21

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add medusajs/medusa-agent-skills --skill creating-internal-agents -a claude-code
Open on GitHub

What creating-internal-agents does

The skill walks through the whole stack of an admin-side AI agent in Medusa: conversation models, a module service that holds the Anthropic client and a stream() method, the runtime built on streamText(), a POST route streaming NDJSON, and a chat page inside the dashboard.

Data work goes through MedusaExec, where the agent writes TypeScript and runs it. A custom tool earns its place only when code can't do the job, an outside API behind a secret key for instance. Every agent shares AgentSession and AgentMessage; the agent_type field keeps their sessions apart. Pass the container through experimental_context — importing services straight into tool files creates circular dependencies.

Admin auth is not optional. Routes sit under src/api/admin/ and take AuthenticatedMedusaRequest, since MedusaExec executes arbitrary code with database access. An endpoint left open there means remote code execution. Model changes need migrations (npx medusa db:generate agent && npx medusa db:migrate), and the skill wants the matching reference file loaded before any code gets written.

What it helps with

  • define conversation models for an admin chat agent in Medusa
  • set up a module service with the Anthropic client and stream()
  • stream an agent reply as NDJSON from a POST route
  • add a chat page to the Medusa admin dashboard
  • let the agent execute TypeScript through MedusaExec

Example prompts for the agent

  • Set up the agent module with AgentSession and AgentMessage plus an agent_type field
  • Create the POST route under src/api/admin/agent/ with AuthenticatedMedusaRequest and NDJSON streaming
  • Add an admin chat page for a store operations agent

How to install creating-internal-agents

1Skills CLI (Vercel)

npx skills add medusajs/medusa-agent-skills --skill creating-internal-agents -a claude-code

2Manually: put the files in place

~/.claude/skills/creating-internal-agents/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/creating-internal-agents/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about creating-internal-agents

How do I install creating-internal-agents in Claude Code?

Run npx skills add medusajs/medusa-agent-skills --skill creating-internal-agents -a claude-code. The skill file lands at ~/.claude/skills/creating-internal-agents/SKILL.md.

What does creating-internal-agents do?

It covers each layer of an internal Medusa agent: data models, the module service, tools and system prompt, NDJSON streaming, and the admin UI. Before code, it asks you to load the reference file for the task at hand.

Does it work for a storefront chatbot?

No. It targets agents run by merchants and operators behind admin authentication. Customer-facing bots need a different setup: public routes, storefront auth, no MedusaExec.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set17

The whole set →
mcloud-logs Teaches your agent to read backend and storefront logs with mcloud logs, filter them by time or deployment, and pipe them to JSON. CX Codex +1 1,600installs mcloud-projects mcloud-projects is a Claude Code skill that runs Cloud project commands through mcloud. It lists projects, looks up handles by name, retrieves details, or deletes a project. CX Codex +1 1,600installs mcloud-environments Manage mcloud environments from your agent: inspect, create, or remove them, then rerun a deployment or start a fresh build. Useful when changing environment settings or shipping committed code. CX Codex +1 1,600installs mcloud-variables An agent skill that drives mcloud variables for Medusa Cloud environments: list keys, read one, write, delete, export to .env. CX Codex +1 1,600installs mcloud-deployments mcloud-deployments is a Claude Code skill that lists deployments, checks their status, and fetches build logs. It runs when inspecting a deployment or investigating a failed build. CX Codex +1 1,600installs mcloud-local Run a Medusa Cloud build on your machine with mcloud local build. Use the skill to investigate a failed build or test build-variable changes before pushing. CX Codex +1 1,100installs mcloud-auth mcloud-auth — a skill for Medusa Cloud CLI authentication and context commands: login, logout, status checks, switching organizations and projects. CX Codex +1 429installs medusa-dev The medusa-dev plugin gives Claude Code guidance for building Medusa backends, admin interfaces, and storefronts. Use it while adding features to a Medusa project. ★ 237repo stars

Project sponsors

Companies that keep this analytics open