mastra
Reference guide for building agents and workflows with current Mastra APIs.
- Always verify against embedded docs in
node_modules/@mastra/*/dist/docs/(installed version) or remote docs athttps://mastra.ai/llms.txtbefore writing code; training data is outdated - Core building blocks: Agents (autonomous, decision-making), Workflows (structured sequences), Tools (extend capabilities), Memory (maintain context), and RAG (external knowledge)
- Requires ES2022 modules in TypeScript config and model format of
"provider/model-name"(e.g.,"openai/gpt-5.4") - Includes embedded references for setup, common errors, migrations, and API lookup strategies to match your exact installed version
Mastra Framework Guide
Build AI applications with Mastra. This skill teaches you how to find current documentation and build agents and workflows.
⚠️ Critical: Do not trust internal knowledge
Everything you know about Mastra is likely outdated or wrong. Never rely on memory. Always verify against current documentation.
Your training data contains obsolete APIs, deprecated patterns, and incorrect usage. Mastra evolves rapidly - APIs change between versions, constructor signatures shift, and patterns get refactored.
Prerequisites
Before writing any Mastra code, check if packages are installed:
ls node_modules/@mastra/
- If packages exist: Use embedded docs first (most reliable)
More from mastra-ai/skills
create-mastra
Complete project setup guide for Mastra AI framework. Covers: CLI installation (create-mastra), manual installation, TypeScript configuration (ES2022 requirements), environment setup, adding to existing projects (Next.js, Express), troubleshooting (module not found, import errors, CommonJS issues), deployment preparation, and monorepo configuration. Includes both quick setup (user runs CLI) and automatic setup (step-by-step file creation). Use this skill for all Mastra installation and setup questions to ensure correct configuration and prevent common errors.
90mastra-best-practices
Quick reference for Mastra conventions. When to use agents vs workflows, required TypeScript config, project structure, and common code patterns.
89mastra-embedded-docs-look-up
Look up current API signatures from installed Mastra packages in node_modules/@mastra/*/dist/docs/. Use this skill to verify exact parameters, constructor arguments, and function signatures that match the installed version. Mastra APIs evolve rapidly - embedded docs ensure accuracy. Covers: Agent constructor parameters, Workflow API, Tool API, Memory configuration, Storage options, and all @mastra/* package exports. Returns actual TypeScript definitions and JSDoc from installed packages. Always use for API verification questions to prevent outdated answers.
67mastra-embeded-docs-look-up
Look up Mastra API documentation embedded in node_modules/@mastra/*/dist/docs/ for accurate API signatures. Use for Agent, Workflow, Tool, Memory configuration questions and code validation.
41