Token导航 LogoToken导航

Agent Skill · 研究检索

mastra-hono(马斯特拉霍诺)

mastra-hono 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

mastra-hono 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 19,575。

总安装 5,551周安装 229GitHub Stars 69下载 1,814核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mastra-hono(马斯特拉霍诺)
来源仓库:https://github.com/jwynia/agent-skills
仓库路径:skills/mastra-hono
安装命令:
npx skills add https://github.com/jwynia/agent-skills --skill mastra-hono
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/jwynia/agent-skills --skill mastra-hono

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

mastra-hono 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果时使用。通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限和维护状态。

使用前建议核实是否会触发联网、命令执行或文件读写操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/mastra-hono

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jwynia/agent-skills --skill mastra-hono;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

mastra-hono 怎么安装?

在终端执行 npx skills add https://github.com/jwynia/agent-skills --skill mastra-hono。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

mastra-hono 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

mastra-hono 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

mastra-hono 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

mastra-hono 用的人多吗?

公开数据是累计安装 5,551 次,近一周安装 229 次,下载 1,814 次,GitHub 69 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

mastra-hono 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
mastra-hono

马斯特拉霍诺 · 本页

5,55169调用外部服务MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Mastra + Hono Development

Build production-ready AI agents, tools, and workflows using Mastra v1 Beta with Hono API servers. This skill covers the complete stack from agent definition to deployment.

Target version: Mastra v1 Beta (stable release expected January 2026)

When to Use This Skill

Use when:

  • Creating Mastra agents with tools and memory
  • Defining tools with Zod input/output schemas
  • Building workflows with multi-step data flow
  • Setting up Hono API servers with Mastra adapters
  • Implementing agent networks for multi-agent collaboration
  • Authoring MCP servers to expose agents/tools
  • Integrating RAG and conversation memory

Do NOT use when:

  • Working with Mastra stable (0.24.x) - patterns differ significantly
  • Building non-AI web APIs (use Hono directly)
  • Simple LLM calls without agents/tools

Prerequisites

  • Node.js 22.13.0+ (required for v1 Beta)
  • Package manager: npm, pnpm, or bun
  • API keys: OpenAI, Anthropic, or other supported providers
# Install v1 Beta packages
npm install @mastra/core@beta @mastra/hono@beta
npm install @ai-sdk/openai  # or other provider
npm install zod hono @hono/node-server

Quick Start

Minimal Agent + Tool + Hono Server

// src/mastra/tools/weather-tool.ts
import { createTool } from "@mastra/core/tools";
import { z } from "zod";

export const weatherTool = createTool({
  id: "get-weather",
  description: "Fetches current weather for a location",
  inputSchema: z.object({
    location: z.string().describe("City name, e.g., 'Seattle'"),
  }),
  outputSchema: z.object({
    temperature: z.number(),
    conditions: z.string(),
  }),
  // v1 Beta signature: (inputData, context)
  execute: async (inputData, context) => {
    const { location } = inputData;
    const { abortSignal } = context;

    if (abortSignal?.aborted) throw new Error("Aborted");

    // Fetch weather data...
    return { temperature: 72, conditions: "sunny" };
  },
});
// src/mastra/agents/weather-agent.ts
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";
import { weatherTool } from "../tools/weather-tool.js";

export const weatherAgent = new Agent({
  name: "weather-agent",
  instructions: "You are a helpful weather assistant.",
  model: openai("gpt-4o-mini"),
  tools: { weatherTool },  // Object, not array
});
// src/mastra/index.ts
import { Mastra } from "@mastra/core/mastra";
import { weatherAgent } from "./agents/weather-agent.js";

export const mastra = new Mastra({
  agents: { weatherAgent },
});
// src/index.ts
import { serve } from "@hono/node-server";
import { Hono } from "hono";
import { MastraServer } from "@mastra/hono";
import { mastra } from "./mastra/index.js";

const app = new Hono();
const server = new MastraServer({ app, mastra });
await server.init();

app.get("/", (c) => c.text("Mastra + Hono Server"));

serve({ fetch: app.fetch, port: 3000 });
console.log("Server running at http://localhost:3000");
// Agent endpoint: POST /api/agents/weather-agent/generate

Core Patterns

Agent Definition

import { Agent } from "@mastra/core/agent";

const agent = new Agent({
  name: "my-agent",                           // Required: unique identifier
  instructions: "You are a helpful assistant.", // Required: system prompt
  model: openai("gpt-4o-mini"),               // Required: LLM model
  tools: { weatherTool, searchTool },         // Optional: object with named tools
});

// Model routing (1113+ models from 53 providers)
model: "openai/gpt-4o-mini"
model: "anthropic/claude-3-5-sonnet"
model: "google/gemini-2.5-flash"

// Model fallbacks for resilience
model: [
  { model: "anthropic/claude-3-opus", maxRetries: 3 },
  { model: "openai/gpt-4o", maxRetries: 2 },
  { model: "google/gemini-pro", maxRetries: 1 },
]

// Agent execution with memory
const response = await agent.generate("Remember my name is Alex", {
  memory: {
    thread: "conversation-123",   // Isolates conversation
    resource: "user-456",         // Associates with user
  },
});

Tool Signatures (v1 Beta - CRITICAL)

// v1 Beta: execute(inputData, context)
execute: async (inputData, context) => {
  const { location } = inputData;  // First parameter: parsed input
  const { mastra, runtimeContext, abortSignal } = context;  // Second: context

  // Access nested agents via mastra
  const helper = mastra?.getAgent("helperAgent");

  // Always check abort signal for long operations
  if (abortSignal?.aborted) throw new Error("Aborted");

  return { temperature: 72, conditions: "sunny" };
}

// WRONG for v1 Beta:
execute: async ({ context }) => { ... }  // This is stable 0.24.x signature

Workflow Data Flow (CRITICAL)

This is where most errors occur. See references/workflow-data-flow.md for complete patterns.

import { createWorkflow, createStep } from "@mastra/core/workflows";

const step1 = createStep({
  id: "step-1",
  inputSchema: z.object({ message: z.string() }),
  outputSchema: z.object({ formatted: z.string() }),
  execute: async ({ inputData }) => {
    // inputData = workflow input (for first step)
    return { formatted: inputData.message.toUpperCase() };
  },
});

const step2 = createStep({
  id: "step-2",
  inputSchema: z.object({ formatted: z.string() }),  // MUST match step1 output
  outputSchema: z.object({ emphasized: z.string() }),
  execute: async ({ inputData }) => {
    // inputData = step1's return value directly
    return { emphasized: `${inputData.formatted}!!!` };
  },
});

const workflow = createWorkflow({
  id: "my-workflow",
  inputSchema: z.object({ message: z.string() }),     // MUST match step1 input
  outputSchema: z.object({ emphasized: z.string() }), // MUST match final output
})
  .then(step1)
  .then(step2)
  .commit();

Schema matching rules:

RuleDescription
Workflow input → Step 1 inputMust match exactly
Step N output → Step N+1 inputMust match exactly
Final step output → Workflow outputMust match exactly

Data access in steps:

execute: async ({
  inputData,      // Previous step's output (or workflow input for step 1)
  getStepResult,  // Access ANY step's output by ID
  getInitData,    // Get original workflow input
  mastra,         // Access agents, tools, storage
}) => {
  const step1Result = getStepResult("step-1");
  const originalInput = getInitData();
  return { result: inputData.formatted };
}

Hono Server Setup

import { MastraServer } from "@mastra/hono";

const app = new Hono();
const server = new MastraServer({ app, mastra });
await server.init();

// Endpoints auto-registered:
// POST /api/agents/{agent-name}/generate
// POST /api/agents/{agent-name}/stream
// POST /api/workflows/{workflow-id}/start

Custom route prefix:

const server = new MastraServer({
  app,
  mastra,
  prefix: "/v1/ai"  // Routes at /v1/ai/agents/...
});

Custom API routes:

import { registerApiRoute } from "@mastra/core/server";

registerApiRoute("/my-custom-route", {
  method: "POST",
  handler: async (c) => {
    const mastra = c.get("mastra");
    const agent = mastra.getAgent("my-agent");
    const result = await agent.generate("Hello");
    return c.json({ response: result.text });
  },
});

Common Mistakes Quick Reference

TopicWrongCorrect
Importsimport {Agent} from "@mastra/core"import {Agent} from "@mastra/core/agent"
Tools arraytools: [tool1, tool2]tools: {tool1, tool2}
Memory context{threadId: "123"}{memory: {thread: "123", resource: "user"}}
Workflow datacontext.steps.step1.outputinputData or getStepResult("step-1")
After parallelinputData.resultinputData["step-id"].result
After branchinputData.resultinputData["step-id"]?.result (optional)
Nested agentsimport agent; agent.generate()mastra.getAgent("name").generate()
State mutationstate.counter++setState({...state, counter: state.counter + 1})
v1 tool execexecute: async ({context})execute: async (inputData, context)

Scripts Reference

ScriptPurposeUsage
scaffold-project.tsCreate new Mastra+Hono projectdeno run --allow-all scripts/scaffold-project.ts --name my-project
scaffold-agent.tsCreate agent with toolsdeno run --allow-all scripts/scaffold-agent.ts --name weather
scaffold-workflow.tsCreate workflow with stepsdeno run --allow-all scripts/scaffold-workflow.ts --name process-data
scaffold-tool.tsCreate tool with schemasdeno run --allow-all scripts/scaffold-tool.ts --name fetch-weather
validate-workflow-schemas.tsValidate step schema matchingdeno run --allow-read scripts/validate-workflow-schemas.ts./src/mastra/workflows/
check-version-patterns.tsDetect v1/stable pattern mixingdeno run --allow-read scripts/check-version-patterns.ts./src/mastra/

Additional Resources

Reference Files

  • references/workflow-data-flow.md - Complete data flow patterns (CRITICAL)
  • references/common-mistakes.md - Extended anti-patterns and fixes
  • references/agent-patterns.md - Agent definition deep-dive
  • references/tool-patterns.md - Tool signatures, wrappers
  • references/hono-server-patterns.md - Server setup, routes, middleware
  • references/testing-patterns.md - Vitest setup, mocking LLMs
  • references/mcp-server-patterns.md - Model Context Protocol authoring
  • references/agent-networks.md - Multi-agent collaboration, A2A
  • references/rag-memory-patterns.md - Vector stores, embeddings, memory
  • references/context-network-memory.md - Context networks for agent memory

Asset Templates

  • assets/agent-template.ts - Agent boilerplate
  • assets/tool-template.ts - Tool boilerplate (v1 signature)
  • assets/workflow-template.ts - Workflow boilerplate
  • assets/hono-server-template.ts - Hono+Mastra server setup
  • assets/vitest-setup-template.ts - Test configuration

External Documentation


Limitations

  • Targets v1 Beta only; stable (0.24.x) patterns differ significantly
  • Scripts require Deno runtime with appropriate permissions
  • MCP server patterns require MCP-compatible clients
  • Agent networks require all participating agents to be registered in same Mastra instance

Related Skills

  • research-workflow - Deep dive research for AI agent design
  • web-search - Real-time information retrieval for agents

平台分布

Claude Code

28.52%
按下载量换算517

OpenCode

20.87%
按下载量换算379

Codex

18.03%
按下载量换算327

Antigravity

12.2%
按下载量换算221

Gemini CLI

7.28%
按下载量换算132

windsurf

3.63%
按下载量换算66

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills