mastra

mastra is a skill for Claude Code, Codex from Array-Ventures/coworker. It costs 83 tokens per session (1,321 once invoked), scanned A, original, Apache-2.0.

A guide to Mastra, a TypeScript framework for building AI applications with agents, workflows, tools, memory, and retrieval-augmented generation (RAG), which adds outside information to model responses.

In plain words
What is it for?
Finding reliable Mastra documentation and building or troubleshooting agents, workflows, tools, memory, and RAG features.
Why use it?
Mastra changes over time, so the guide directs the agent to check current documentation and API details before writing code.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/array-ventures/coworker/mastra
Any agent
npx skills add Array-Ventures/coworker --skill mastra
Clone the repo
git clone --depth 1 https://github.com/Array-Ventures/coworker

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mastra

README.md
[![agentmods](https://agentmods.dev/badge/skills/array-ventures/coworker/mastra.svg)](https://agentmods.dev/skills/array-ventures/coworker/mastra)
Your own site
<a href="https://agentmods.dev/skills/array-ventures/coworker/mastra"><img src="https://agentmods.dev/badge/skills/array-ventures/coworker/mastra.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,321 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00083 $0.01321
Opus 5 $0.00042 $0.00660
Sonnet 5 $0.00017 $0.00264
Haiku 4.5 $0.00008 $0.00132

Measured 4d ago against content hash 6401fb1a6299, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mastra scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/mastra/SKILL.md · 160 lines

How it starts

The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Read the full file on GitHub · 160 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 160 lines · 83 tokens per session scan A 6401fb1a6299

Subscribe to this mod's changes

mastra is a skill published in the GitHub repository Array-Ventures/coworker (41 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 83 tokens to every session and 1,321 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

document-qa

文档问答工具。对 PDF/Word/TXT/MD/CSV 文件进行自然语言问答,自动提取内容、检索相关段落并用 LLM 给出精准回答。支持单文件和整个目录。.

xyva-yuangui/XyvaClaw · 53 tokens

rag-knowledge-base

Skill "rag-knowledge-base" from xyva-yuangui/XyvaClaw, covering rag knowledge base, 功能, 使用方式, 添加文档到知识库 and 添加整个目录.

xyva-yuangui/XyvaClaw · 0 tokens

design-taste-frontend

Anti-slop frontend direction for landing pages, portfolios, editorial pages, and design-forward redesigns. Use after reading the brief to infer a fitting visual system, preserve existing product constraints, and run a strict pre-flight audit.

Amery2010/open-builder · 51 tokens

frontend-design

Create distinctive, production-grade product interfaces and web components with strong hierarchy, accessibility, and a coherent visual direction. Use for dashboards, settings, forms, application flows, and general frontend styling.

Amery2010/open-builder · 41 tokens

accessibility

Web accessibility essentials covering semantic HTML, keyboard navigation, ARIA usage, focus management, contrast, and accessible forms. Load before building any interactive component.

Amery2010/open-builder · 33 tokens

code-review

Review a diff, file set, or current project changes for correctness, security, performance, reliability, and maintainability. Use project evidence, prioritize actionable findings, and report only unless the user explicitly asks for fixes.

Amery2010/open-builder · 46 tokens