mastra
Skill4 starsChanged 9 months agoApache-2.0Archived repositoryView on GitHub
Comprehensive Mastra framework guide. Teaches how to find current documentation, verify API signatures, and build agents and workflows. Covers documentation lookup strategies (embedded docs, remote docs), core concepts (agents vs workflows, tools, memory, RAG), TypeScript requirements, and common patterns. Use this skill for all Mastra development to ensure you're using current APIs from the installed version or latest documentation.
6 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- mastra-ai/skillsedited, first seen Sep 21, 2026
- deathrashed/agentsedited, first seen Jul 25, 2026
- vobase/vobaseedited, first seen Apr 25, 2026
- ssdeanx/AgentStackedited, first seen Apr 20, 2026
- FelipeAngeli/skillsword for word, first seen Apr 10, 2026
- Array-Ventures/coworkeredited, first seen Feb 14, 2026
Other versions6 projects use a version of this.
Word for word · 1
- FelipeAngeli/skills★ 2100% same
Edited · 5
- mastra-ai/skills★ 9630% same
- vobase/vobase★ 6177% same
- ssdeanx/AgentStack★ 4493% same
- Array-Ventures/coworker★ 4393% same
- deathrashed/agents★ 139% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository62 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- agentforge-a2aSkill
- agentforge-browser-toolingSkill
- agentforge-channel-adaptersSkill
- agentforge-cliSkill
- agentforge-convexSkill
- agentforge-dashboardSkill
- agentforge-mcp-integrationSkill
- agentforge-research-orchestratorSkill
- agentforge-runtime-daemonSkill
- agentforge-sandbox-executionSkill
- agentforgeSkill
- agentforge-skills-marketplaceSkill
- agentforge-template-syncSkill
- agentforge-testingSkill
- convex-advisorSkill
- convex-auth-setupSkill
- convex-best-practicesSkill
- convex-component-authoringSkill
- convex-components-guideSkill
- convex-cron-jobsSkill
- convex-file-storageSkill
- convex-function-creatorSkill
- convex-helpers-guideSkill
- convex-http-actionsSkill
- convex-mcp-setupSkill
- convex-migration-helperSkill
- convex-quickstartSkill
- convex-realtimeSkill
- convex-reviewerSkill
- convex-schema-builderSkill
- convex-security-auditSkill
- convex-security-checkSkill
- convexSkill
- specsafe-agentforgeSkill
- specsafeSkill
- specSkill
- validateSkill
- working-with-sqliteSkill
- agentforge-convexSkill
- gh-workflowSkill
- spec-createSkill
- specsafe-agentforgeSkill
- specsafe-doneSkill
- specsafe-exploreSkill
- specsafe-newSkill
- specsafeSkill
- specsafe-specSkill
- specsafe-test-applySkill
- specsafe-test-createSkill
- specsafe-verifySkill
- specSkill
- template-sync-checkSkill
- validateSkill
- working-with-sqliteSkill
- agentforge-convexSkill
- browser-automationSkill
- example-skillSkill
- skill-creatorSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. 6 are common, 1 is distinctive, and 3 are very specific to this project.
6
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
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
- Common: line 23
Before writing any Mastra code, check if packages are installed:
- Common: line 29
If packages exist: Use embedded docs first (most reliable)
- Very specific: line 50
Look up current docs in node_modules for a package.
- Distinctive: line 62
If you can't find what you need in the embedded docs, look directly at the source code.
- Common: line 93
Use for: Open-ended tasks (support, research, analysis)
- Common: line 96
Use for: Defined processes (pipelines, approvals, ETL)
- Common: line 143
Verify current API in embedded docs
- Common: line 144
Don't assume the error is a user mistake - it might be your outdated knowledge
- Very specific: line 157
If installed → Use embedded docs references/embedded-docs.md
- Very specific: line 158
If not → Use remote docs references/remote-docs.md
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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)
- If no packages: Install first or use remote docs
Documentation lookup guide
Quick Reference
| User Question | First Check | How To |
| "Create/install Mastra project" | references/create-mastra.md | Setup guide with CLI and manual steps |
| "How do I use Agent/Workflow/Tool?" | references/embedded-docs.md | Look up in node_modules/@mastra/*/dist/docs/ |
| "How do I use X?" (no packages) | references/remote-docs.md | Fetch from https://mastra.ai/llms.txt |
| "I'm getting an error..." | references/common-errors.md | Common errors and solutions |
| "Upgrade from v0.x to v1.x" | references/migration-guide.md | Version upgrade workflows |
Priority order for writing code
⚠️ Never write code without checking current docs first.
Embedded docs first (if packages installed)
Look up current docs in
node_modulesfor a package. Example of looking up "Agent" docs in@mastra/core:grep -r "Agent" node_modules/@mastra/core/dist/docs/references- Why: Matches your EXACT installed version
- Most reliable source of truth
- See:
references/embedded-docs.md
Source code second (if packages installed)
If you can't find what you need in the embedded docs, look directly at the source code. This is more time consuming but can provide insights into implementation details.
# Check what's available cat node_modules/@mastra/core/dist/docs/assets/SOURCE_MAP.json | grep '"Agent"' # Read the actual type definition cat node_modules/@mastra/core/dist/[path-from-source-map]- Why: Ultimate source of truth if docs are missing or unclear
- Use when: Embedded docs don't cover your question
- See:
references/embedded-docs.md
Remote docs third (if packages not installed)
You can fetch the latest docs from the Mastra website:
https://mastra.ai/llms.txt- Why: Latest published docs (may be ahead of installed version)
- Use when: Packages not installed or exploring new features
- See:
references/remote-docs.md
Core concepts
Agents vs workflows
Agent: Autonomous, makes decisions, uses tools Use for: Open-ended tasks (support, research, analysis)
Workflow: Structured sequence of steps Use for: Defined processes (pipelines, approvals, ETL)
Key components
- Tools: Extend agent capabilities (APIs, databases, external services)
- Memory: Maintain context (message history, working memory, semantic recall)
- RAG: Query external knowledge (vector stores, graph relationships)
- Storage: Persist data (Postgres, LibSQL, MongoDB)
Critical requirements
TypeScript config
Mastra requires ES2022 modules. CommonJS will fail.
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler"
}
}Model format
Always use "provider/model-name":
"openai/gpt-5.2""anthropic/claude-sonnet-4-5""google/gemini-2.5-pro"
When you see errors
Type errors often mean your knowledge is outdated.
Common signs of outdated knowledge:
Property X does not exist on type YCannot find moduleType mismatcherrors- Constructor parameter errors
What to do:
- Check
references/common-errors.md - Verify current API in embedded docs
- Don't assume the error is a user mistake - it might be your outdated knowledge
Development workflow
Always verify before writing code:
Check packages installed
ls node_modules/@mastra/- Look up current API
- If installed → Use embedded docs
references/embedded-docs.md - If not → Use remote docs
references/remote-docs.md
- If installed → Use embedded docs
- Write code based on current docs
- Test in Studio
npm run dev # http://localhost:4111
Resources
- Setup:
references/create-mastra.md - Embedded docs lookup:
references/embedded-docs.md- Start here if packages are installed - Remote docs lookup:
references/remote-docs.md - Common errors:
references/common-errors.md - Migrations:
references/migration-guide.md
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
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.

