关于 mastra-embeded-docs-look-up
mastra-embeded-docs-look-up 用于在已安装 Mastra 包附带的文档中查找 API 签名。它结合版本匹配的类型定义与主题文档,适用于 Mastra API 频繁变化的情况。
主要功能
- 01搜索包导出映射
- 02读取已安装的类型定义
- 03查找功能主题文档
- 04涵盖 core、memory 和 RAG 包
适用场景
- 01检查已安装 Mastra 的 API 签名
- 02按本地包版本核对 API
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ mastra-ai/ skills --skill mastra-embeded-docs-look-up安装后在 Claude Code 中输入/mastra-embeded-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 仍处于活跃测试阶段(API 经常变化)
- 训练数据可能已经过时
- 类型定义包含 JSDoc 和示例
评论
支持 Markdown