mastra

Guides building Mastra agents and workflows using verified current documentation.

130|14|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/LiorVainer/data-israel --skill mastra-liorvainer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mastra
Source: https://github.com/LiorVainer/data-israel/tree/main/.agents/skills/mastra
Command: npx skills add https://github.com/LiorVainer/data-israel --skill mastra-liorvainer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Mastra evolves rapidly, so AI assistants often write code with outdated APIs, deprecated patterns, and wrong constructor signatures. This Skill forces verification against current documentation before writing any Mastra code, eliminating errors caused by stale training data. ## Core Features & Use Cases - Documentation Lookup Strategies: Prioritizes embedded docs in node_modules matching the installed version, falls back to source code and remote docs at mastra.ai. - Project Setup Guidance: Covers CLI quickstart and manual installation with correct TypeScript ES2022 configuration and provider/model naming format. - Troubleshooting & Migration: Diagnoses common agent, workflow, memory, tool, and storage errors, and walks through version upgrades using official migration guides. - Use Case: When building a Mastra agent with tools and memory, the Skill checks node_modules/@mastra/core/dist/docs for the exact installed API signatures before generating any TypeScript code. ## Quick Start Ask the assistant to create a Mastra weather agent with a tool and verify the API against the installed package documentation.

Frequently Asked Questions about mastra

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

FAQPage Schema
How do I create a new Mastra project?

Run npm create mastra@latest for the interactive CLI, or install manually with npm install @mastra/core zod and the mastra dev dependency. Configure tsconfig.json with ES2022 modules and bundler resolution, then define agents in src/mastra and start with npm run dev.

How do I look up current Mastra API documentation?

Check embedded docs first in node_modules/@mastra/core/dist/docs, which match your installed version exactly. Use SOURCE_MAP.json to find type definitions, or fetch remote docs from https://mastra.ai/llms.txt when packages are not installed.

Why does my Mastra code show 'Property X does not exist on type Y' errors?

These errors usually mean the code uses an outdated API from older Mastra versions. Verify the current signature in the embedded docs under node_modules/@mastra/core/dist/docs and confirm all @mastra packages share the same version.

What TypeScript configuration does Mastra require?

Mastra requires target ES2022, module ES2022, and moduleResolution bundler in tsconfig.json. CommonJS configurations cause import and module resolution failures, and package.json should include type module.

Why is my Mastra agent not remembering previous messages?

Memory requires a configured storage backend such as PostgresStore, a Memory instance assigned to the agent, and a consistent threadId passed to each generate call. Semantic recall additionally needs a vector store and embedder.

How do I migrate Mastra from v0.x to v1.x?

Start with the official migration guide at https://mastra.ai/llms.txt, update all @mastra packages together, run available codemods, then verify each changed API against the embedded docs in the updated node_modules before testing.