agentleFS
YGhorbelYGhorbel/awesome-mastra-skills/skills/mastra-studio-editor/SKILL.md

mastra-studio-editor

Skill2 starsChanged 29 days agoApache-2.0View on GitHub

Run, secure, and deploy Mastra Studio, the local and hosted UI for chatting with agents, running workflows and tools, reviewing traces, logs, metrics, scores, datasets, experiments, and knowledge, and set up the Mastra Editor so non-developers can change agent instructions, tools, and prompt blocks with drafts, publishing, and version selection. Use this skill whenever the user wants to open or configure Studio, put Studio behind login or RBAC, host Studio standalone or alongside the server, let a team edit prompts without a deploy, reuse prompt blocks, or pin agents to a draft or published version. Triggers on mastra dev, localhost:4111, mastra studio, mastra build --studio, MASTRA_STUDIO_PATH, Studio auth, StaticRBACProvider, @mastra/editor, MastraEditor, mastra.getEditor, prompt blocks, prompt_block_ref, editor field on Agent, ComposioToolProvider, getAgentById status draft, KNOWLEDGE_ROUTES. Also triggers when a product or support team wants to tune an agent without touching code.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Studio to build, test, and observe a Mastra app, secure and deploy it for a team, and add the Editor so collaborators can change agents …

    line 14
  2. Very specific:

    Verify the API: If node_modules/@mastra/ exists, read node_modules/@mastra/editor/dist/docs/, node_modules/@mastra/core/dist/docs/, and the …

    line 99
  3. Very specific:

    Model editing on a function-valued model: Not supported. Use a static array with stable ids.

    line 145
  4. Very specific:

    Knowledge page says browsing is not enabled: Add server: { apiRoutes: [...KNOWLEDGE_ROUTES] } and register knowledge on Mastra.

    line 146

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mastra Studio and Editor

Use Studio to build, test, and observe a Mastra app, secure and deploy it for a team, and add the Editor so collaborators can change agents without code.


When to use

  • Starting Studio locally and knowing what each section does
  • Testing agents, workflows, tools, processors, MCP servers, and request context in the UI
  • Reviewing traces, logs, metrics, scores, datasets, and experiments in Studio
  • Adding login, roles, or permissions to a shared Studio
  • Deploying Studio standalone, alongside the server, or as a static SPA
  • Enabling the Knowledge browser
  • Letting non-developers edit instructions, tools, and prompt blocks with draft and publish
  • Selecting a published, draft, or exact agent version per request

When NOT to use

  • Configuring tracing, exporters, logging, metrics (use mastra-observability)
  • Writing scorers (use mastra-evals) or building datasets and experiments in code (use mastra-datasets-experiments)
  • Auth providers in depth (use mastra-auth)
  • Hosted Studio on Mastra platform (use mastra-platform)
  • Deploying the Mastra server itself (use mastra-deployment)
  • Knowledge scopes, pages, and APIs (use mastra-knowledge)
  • Defining agents in code (use mastra-agents) or file-based agents (use mastra-file-based-agents)
  • Connect tool integrations (use mastra-tool-integrations)

Required inputs

  • Who uses Studio: only developers locally, or a team on a shared deployment
  • Where it runs: mastra dev, standalone mastra studio, alongside the server, a CDN, or Mastra platform
  • Auth provider and the roles each person needs
  • For Editor: which agent fields collaborators may own (instructions, tools, tool descriptions, model)
  • Where Editor changes live: database (default) or JSON files in the repo
  • Which tool sources collaborators may pick from (project tools, Composio, Arcade, MCP)

The framework: Studio surfaces and Editor ownership

Studio is a React SPA talking to a Mastra server. mastra dev serves both: UI at http://localhost:4111, REST explorer at http://localhost:4111/swagger-ui.

SectionWhat it doesNeeds
AgentsChat, switch models, tweak settings, Models panel, EditorRegistered agents
WorkflowsGraph view, step-by-step runs, Resource ID run optionRegistered workflows
Tools, Processors, MCP servers, WorkspacesRun tools alone, inspect processors, browse files and skillsRegistered on Mastra
Request contextJSON or schema form that flows into instructions and toolsrequestContextSchema for the form
Scorers, Datasets, ExperimentsScore results, CSV/JSON import, version compare, experiment comparestorage, registered scorers
ObservabilityMetrics, Traces, LogsObservability storage (metrics need DuckDB, ClickHouse, or PostgresStoreVNext)
KnowledgeRead-only tree, graph, page, activity, searchKNOWLEDGE_ROUTES (@mastra/core 1.81.0+)
SettingsInstance URL, API prefix, custom headers, themenone

Editor works like a CMS for code-defined agents. The agent's editor field decides ownership:

import { Agent } from '@mastra/core/agent'
import { searchOrders } from './tools/search-orders'

export const supportAgent = new Agent({
  id: 'support-agent',
  name: 'Support agent',
  model: 'openai/gpt-6.1-sol',
  tools: { searchOrders },
  editor: {
    instructions: true, // Studio owns instructions: omit them from code
    tools: { description: true }, // collaborators only rewrite tool descriptions
  },
})
editor valueCollaborators can changeCode must provide
OmittedInstructions, tools, tool descriptionsinstructions
falseNothinginstructions
{ instructions: true }InstructionsNo instructions
{ tools: true }Tools and descriptionsinstructions, no tools
{ tools: { description: true } }Descriptions of code toolsinstructions and the tools
{ model: true }A static fallback listStatic model array with stable entry ids

Workflow

  1. Verify the API. If node_modules/@mastra/ exists, read node_modules/@mastra/editor/dist/docs/, node_modules/@mastra/core/dist/docs/, and the installed types. Otherwise fetch https://mastra.ai/docs/studio/overview.md, https://mastra.ai/docs/studio/editor.md, and https://mastra.ai/reference/editor/mastra-editor.md. Trust these over memory.
  2. Run Studio. npm run dev (or npx mastra dev). Change host and port through server in src/mastra/index.ts. Use mastra dev --https for local HTTPS.
  3. Register everything you want visible: agents, workflows, tools, scorers, MCP servers on new Mastra({...}).
  4. Add storage and observability so threads, scores, datasets, and traces persist (see mastra-observability).
  5. Secure before sharing. Set server.auth (one config covers Studio and API). Add server.rbac with StaticRBACProvider. Production SSO, RBAC, and FGA need an EE license.
  6. Deploy. Choose: Mastra platform, mastra studio standalone (port 3000), mastra build --studio plus MASTRA_STUDIO_PATH, or a Vite SPA build.
  7. Add Editor. npm install @mastra/editor, then editor: new MastraEditor() with storage. Set editor on agents to hand fields to Studio.
  8. Expose tools to collaborators. Register project tools on Mastra.tools, add toolProviders (Composio, Arcade), or let them create MCP clients.
  9. Ship changes through versions. Save drafts, test, publish. Select versions in code with mastra.getAgentById(id, { status | versionId }).
  10. Script changes with mastra.getEditor() when bulk edits or eval-driven tuning are needed.

Deep dive: versions and prompt blocks

const live = await mastra.getAgentById('support-agent', { status: 'published' })
const draft = await mastra.getAgentById('support-agent', { status: 'draft' })
const pinned = await mastra.getAgentById('support-agent', { versionId: 'abc-123' })

const editor = mastra.getEditor()!
await editor.prompt.create({
  id: 'brand-voice',
  name: 'Brand voice',
  content: 'Write in a friendly, concise tone. Address the user as {{userName || "there"}}.',
})
await editor.agent.update({
  id: 'support-agent',
  instructions: [
    { type: 'prompt_block_ref', id: 'brand-voice' },
    { type: 'text', content: 'Answer only questions about Acme products.' },
  ],
}) // creates an inactive draft

update() never publishes by itself. Publish with editor.agent.update({ id, status: 'published', activeVersionId }), or PATCH /api/stored/agents/:id with autoPublish: true. Referenced prompt blocks resolve to their published version at runtime and to drafts in previews.


Failure patterns

  • Studio left public. Without server.auth, Studio and every API route are open. Add auth before deploying.
  • Agent fails with Studio-owned instructions. editor.instructions: true fails closed until a version with instructions is published. Publish one in Studio first.
  • TypeScript error on instructions or tools. The field is handed to Studio. Remove it from code.
  • Editor edit not visible in production. It is still a draft. Publish, or request status: 'draft' on purpose.
  • Expecting Models panel edits to persist. Without editor: { model: true } they change only the running server's memory.
  • Model editing on a function-valued model. Not supported. Use a static array with stable ids.
  • Knowledge page says browsing is not enabled. Add server: { apiRoutes: [...KNOWLEDGE_ROUTES] } and register knowledge on Mastra.
  • Knowledge returns 403 with auth. Set MASTRA_KNOWLEDGE_PRINCIPALS_KEY in authorize for /api/knowledge paths, and keep the app's decision for other paths.
  • Studio under a subpath shows a blank page. Set MASTRA_STUDIO_BASE_PATH before mastra studio.
  • Copying built Studio assets straight to a CDN. They need runtime config. Use the Vite SPA build with %%PLACEHOLDER%% replacement.
  • auth_header URL tokens in logs. The token rides in the URL. Generate and transmit those links carefully.
  • No metrics or token columns. The observability store lacks metrics support (see mastra-observability).

Output format

A finished Studio or Editor delivery contains:

  • Updated src/mastra/index.ts with server.auth, optional server.rbac, storage, and editor: new MastraEditor({...})
  • Agents with an explicit editor field stating what collaborators own
  • Deployment instructions for the chosen mode, with env vars (MASTRA_STUDIO_PATH, MASTRA_STUDIO_BASE_PATH, provider keys)
  • Tool provider keys (COMPOSIO_API_KEY, ARCADE_API_KEY) in .env.example
  • A release note on how drafts are tested and who publishes

Reference files

  • references/api.md - Studio sections, auth and RBAC, deployment env vars, MastraEditor options and namespaces, prompt blocks, versioning, REST routes.
  • references/examples.md - Team Studio with RBAC, Studio with the server, Editor with repo files, prompt block fallback, sub-agent versions.
  • references/checklist.md - Studio deployment and Editor rollout checklist.

Live docs

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.