Index of every page on this site: llms.txt
All skills
mastra-ai avatar

/mastra

@0457401 official
by Mastramastra-ai/skills105 stars
13
Run it yourself

Comprehensive Mastra framework guide for building agents, workflows, tools, memory, workspaces, and storage with current APIs. Use for native capability discovery, logging, tracing, metrics/cost estimates, dataset experiments, documentation lookup, API verification, TypeScript setup, common errors, migrations, building and deploying apps to Mastra Platform via Platform APIs and `mastra deploy`, and `mastra api` CLI tasks: inspect or call resources on local, Mastra platform, or remote servers. For Mastra Factory operations, discover and activate the companion mastra-factory skill. Also report verified bugs and concrete documentation defects to the Mastra team automatically via the feedback endpoint.

Use this Skill: https://skilld.dev/gh/mastra-ai/skills/mastra

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesremote-docs.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Remote Docs Reference

How to look up current documentation from https://mastra.ai when local packages aren't available or you need conceptual guidance.

Use this when:

  • Mastra packages aren't installed locally
  • You need conceptual explanations or guides
  • You want the latest documentation (may be ahead of installed version)

Documentation site structure

Mastra docs are organized at https://mastra.ai:

  • Docs: Core documentation covering concepts, features, and implementation details
  • Models: Mastra provides a unified interface for working with LLMs across multiple providers
  • Guides: Step-by-step tutorials for building specific applications
  • Reference: API reference documentation

Finding relevant documentation

Method 1: Use llms.txt (Recommended)

The main llms.txt file provides an agent-friendly overview of all documentation: https://mastra.ai/llms.txt

This returns a structured markdown document with:

  • Documentation organization and hierarchy
  • All available topics and sections
  • Direct links to relevant documentation
  • Agent-optimized content structure

Use this first to understand what documentation is available and where to find specific topics.

Method 2: Direct URL patterns

Documentation follows predictable URL patterns:

  • Overview pages: https://mastra.ai/docs/{topic}/overview
  • API reference: https://mastra.ai/reference/{topic}/
  • Guides: https://mastra.ai/guides/{topic}/

Examples:

  • https://mastra.ai/docs/agents/overview
  • https://mastra.ai/docs/workflows/overview
  • https://mastra.ai/reference/workflows/workflow-methods/

Agent-friendly documentation

Critical feature: Send the text-markdown request header or add .md to any documentation URL to get clean, agent-friendly markdown.

Standard URL:

https://mastra.ai/reference/workflows/workflow-methods/then

Agent-friendly URL (Markdown):

https://mastra.ai/reference/workflows/workflow-methods/then.md

The .md version:

  • Removes navigation, headers, footers
  • Returns pure markdown content
  • Optimized for LLM consumption
  • Includes all code examples and explanations

Lookup Workflow

1. Check the main documentation index

Start here to understand what's available:

https://mastra.ai/llms.txt

This provides:

  • Complete documentation structure
  • Available topics and sections
  • Links to relevant documentation pages

2. Find relevant documentation

Option A: Use information from llms.txt The main llms.txt will guide you to the right section.

Option B: Construct URL directly

https://mastra.ai/docs/{topic}/overview
https://mastra.ai/reference/{topic}/

3. Fetch agent-friendly version

Add .md to the end of any documentation URL:

https://mastra.ai/reference/workflows/workflow-methods/then.md

4. Extract relevant information

The markdown will include:

  • Function signatures
  • Parameter descriptions
  • Return types
  • Usage examples
  • Best practices

Common documentation paths

Agents

  • Overview: https://mastra.ai/docs/agents/overview
  • Creating agents: https://mastra.ai/docs/agents/overview
  • Agent tools: https://mastra.ai/docs/agents/tools
  • Memory: https://mastra.ai/docs/memory/overview

Workflows

  • Overview: https://mastra.ai/docs/workflows/overview
  • Creating workflows: https://mastra.ai/docs/workflows/overview
  • Workflow methods: https://mastra.ai/reference/workflows/workflow-methods/

Tools

  • Overview: https://mastra.ai/docs/tools/overview
  • Creating tools: https://mastra.ai/docs/agents/tools

Memory

  • Overview: https://mastra.ai/docs/memory/overview
  • Configuration: https://mastra.ai/docs/memory/overview

RAG

  • Overview: https://mastra.ai/docs/rag/overview
  • Vector stores: https://mastra.ai/reference/rag/vector-databases

Example: Looking up workflow .then() method

1. Check main documentation index

WebFetch({
  url: "https://mastra.ai/llms.txt",
  prompt: "Where can I find documentation about workflow methods like .then()?"
})

This will point you to the workflows reference section.

2. Fetch specific method documentation

https://mastra.ai/reference/workflows/workflow-methods/then.md

3. Use WebFetch tool

WebFetch({
  url: "https://mastra.ai/reference/workflows/workflow-methods/then.md",
  prompt: "What are the parameters for the .then() method and how do I use it?"
})

When to use remote vs embedded docs

Situation Use
Packages installed locally Embedded docs (guaranteed version match)
Packages not installed Remote docs
Need conceptual guides Remote docs
Need exact API signatures Embedded docs (if available)
Exploring new features Remote docs (may be ahead of installed version)
Need working examples Both (embedded for types, remote for guides)

Best practices

  1. Always use .md for fetching documentation
  2. Check sitemap.xml when unsure about URL structure
  3. Prefer embedded docs when packages are installed (version accuracy)
  4. Use remote docs for conceptual understanding and guides
  5. Combine both for comprehensive understanding

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

2 warnings17d5 checks · Risk SAFE
  • Gen Agent Trust Hub18d

    The skill provides a comprehensive guide for the Mastra framework, including documentation lookup, project scaffolding, and CLI interaction. All external resources, including documentation URLs, GitHub repositories, and API endpoints, belong to the official vendor infrastructure. No malicious patterns, obfuscation, or unsafe data handling were detected.

  • Socket17d

    No alerts

  • Snyk18d

    Risk: MEDIUM · 1 issue

  • Runlayer9mo

    3/6 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 0457401. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 3 weeks ago
Other metadata
metadata
{
  "author": "Mastra",
  "version": "2.5.0",
  "repository": "https://github.com/mastra-ai/skills"
}

README badge

README badge for mastra-ai/skills/mastra

Provides documentation lookup, API verification, and CLI reference for the Mastra framework—a TypeScript library for building AI agents, workflows, tools, and storage integrations. Use this skill to verify current Mastra APIs, resolve type errors from outdated knowledge, inspect resources via the `mastra api` CLI, and troubleshoot common setup issues like ES2022 module configuration.

Generated from the current SKILL.md.

Does this skill work without Mastra packages installed?
Yes. The skill includes references to remote documentation at mastra.ai/llms.txt for cases where packages aren't installed. If packages are installed, the skill prioritizes embedded docs in node_modules for accuracy.
What should I do if I get a TypeScript error when using Mastra?
Check references/common-errors.md first, then verify the current API in embedded docs or remote docs. Type errors often signal outdated knowledge rather than user mistakes, since Mastra APIs change between versions.
How do I verify a model name or provider is valid?
Run scripts/provider-registry.mjs to look up current providers and models in the model router before using any model. Model names change frequently and should never be guessed from memory.
What does the `mastra api` CLI do?
It inspects or calls resources on local dev servers, Mastra platform deployments, or remote endpoints. Use it to access agent state, execution traces, logs, threads, and workflow operations.
Does Mastra support CommonJS?
No. Mastra requires ES2022 modules and will fail with CommonJS. Verify your tsconfig.json is set up correctly.

Generated from the current SKILL.md. These answers refresh after source changes.