关于 mastra-embedded-docs-look-up
面向使用 Mastra 包的开发者的文档查询技能,可从已安装依赖附带的文档中查找 API 签名和主题指南。它结合导出映射、类型定义与包文档,使查询对应当前安装版本。
主要功能
- 01检索已安装的 Mastra 包文档
- 02将导出项映射到类型定义文件
- 03查看 API 签名与 JSDoc
- 04查阅主题文档
- 05使用 Shell 命令执行查询
适用场景
- 01核对已安装 Mastra API 的签名
- 02查找包导出项对应的定义
- 03查询 Agent 或工作流文档
- 04按已安装的包版本核实说明
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ mastra-ai/ skills --skill mastra-embedded-docs-look-up安装后在 Claude Code 中输入/mastra-embedded-docs-look-up确认已加载。
详细介绍
Mastra 嵌入式文档查询
从 node_modules/@mastra/*/dist/docs/ 中查找 API 签名——这些文档与已安装的版本一致。
文档结构
node_modules/@mastra/core/dist/docs/
├── SKILL.md # Package overview, exports
├── SOURCE_MAP.json # Export→file mappings
└── [topics]/ # Feature docs (agents/, workflows/, etc.)
查询流程
1. 查找导出项:
cat node_modules/@mastra/core/dist/docs/SOURCE_MAP.json | grep '"Agent"'
返回:{ "Agent": { "types": "dist/agent/agent.d.ts", ... } }
2. 读取类型定义:
cat node_modules/@mastra/core/dist/agent/agent.d.ts
3. 查看主题文档:
cat node_modules/@mastra/core/dist/docs/agents/01-overview.md
常见程序包
| 程序包 | 路径 | 包含内容 |
|---|---|---|
@mastra/core | node_modules/@mastra/core/dist/docs/ | Agent、工作流、工具 |
@mastra/memory | node_modules/@mastra/memory/dist/docs/ | 记忆系统 |
@mastra/rag | node_modules/@mastra/rag/dist/docs/ | RAG 功能 |
快速命令
# List installed packages
ls node_modules/@mastra/
# Find export in SOURCE_MAP
cat node_modules/@mastra/core/dist/docs/SOURCE_MAP.json | grep '"ExportName"'
# Read type definition
cat node_modules/@mastra/core/dist/[path-from-source-map]
# List available topics
ls node_modules/@mastra/core/dist/docs/
使用理由
- 嵌入式文档与已安装版本完全一致
- Mastra 迭代迅速——已安装的文档始终保持同步
- 训练数据可能已经过时
- 类型定义包含 JSDoc 和示例
评论
支持 Markdown