Hono Idioms
irahardianto/awesome-agv
Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.
Develop AI agents, tools, and workflows with Mastra v1 Beta and Hono servers.
$ npx skills add jwynia/agent-skills --skill mastra-hono -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jwynia/agent-skills mastra-hono --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jwynia/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tech/ai/mastra-hono .claude/skills/mastra-hono && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "mastra-hono" agent skill from https://github.com/jwynia/agent-skills/tree/main/skills/tech/ai/mastra-hono into .claude/skills/mastra-hono/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mastra-hono", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jwynia/agent-skills/tree/main/skills/tech/ai/mastra-honoType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jwynia/agent-skills --skill mastra-hono -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jwynia/agent-skills mastra-hono --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jwynia/agent-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/tech/ai/mastra-hono .agents/skills/mastra-hono && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "mastra-hono" agent skill from https://github.com/jwynia/agent-skills/tree/main/skills/tech/ai/mastra-hono into .agents/skills/mastra-hono/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mastra-hono", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jwynia/agent-skills --skill mastra-hono -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jwynia/agent-skills mastra-hono --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jwynia/agent-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/tech/ai/mastra-hono .cursor/skills/mastra-hono && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "mastra-hono" agent skill from https://github.com/jwynia/agent-skills/tree/main/skills/tech/ai/mastra-hono into .cursor/skills/mastra-hono/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mastra-hono", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jwynia/agent-skills.git --path skills/tech/ai/mastra-hono--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jwynia/agent-skills --skill mastra-hono -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jwynia/agent-skills mastra-hono --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jwynia/agent-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/tech/ai/mastra-hono .gemini/skills/mastra-hono && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "mastra-hono" agent skill from https://github.com/jwynia/agent-skills/tree/main/skills/tech/ai/mastra-hono into .gemini/skills/mastra-hono/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mastra-hono", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jwynia/agent-skills mastra-honoInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jwynia/agent-skills --skill mastra-hono -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jwynia/agent-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/tech/ai/mastra-hono .github/skills/mastra-hono && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "mastra-hono" agent skill from https://github.com/jwynia/agent-skills/tree/main/skills/tech/ai/mastra-hono into .github/skills/mastra-hono/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mastra-hono", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jwynia/agent-skills --skill mastra-hono -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jwynia/agent-skills mastra-hono --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jwynia/agent-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/tech/ai/mastra-hono .opencode/skills/mastra-hono && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "mastra-hono" agent skill from https://github.com/jwynia/agent-skills/tree/main/skills/tech/ai/mastra-hono into .opencode/skills/mastra-hono/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mastra-hono", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
mastra-honoDevelop AI agents, tools, and workflows with Mastra v1 Beta and Hono servers.
Mastra Hono is an agent skill from jwynia/agent-skills. Develop AI agents, tools, and workflows with Mastra v1 Beta and Hono servers. This skill should be used when creating Mastra agents, defining tools with Zod schemas, building workflows with step data flow, setting up Hono API servers with Mastra adapters, or implementing agent networks. Keywords: mastra, hono, agent, tool, workflow, AI, LLM, typescript, API, MCP.
Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 24 other files, including scripts, reference files and assets (for example `assets/agent-template.ts`, `assets/hono-server-template.ts` and `assets/tool-template.ts`). Compatibility notes: Node.js 22.13.0+ required for v1 Beta
It sits in Frontend & Design, covering Forms and validation. It works with Hono, Mastra, Model Context Protocol and Zod. The licence is MIT.
Read from SKILL.md and the folder at commit e02ec7e. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 2 files in scripts/ (TypeScript, from the files we listed), which the agent can run.
Shell commands in SKILL.md call:
denonpmFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
mastra.aihono.devgithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Node.js 22.13.0+ required for v1 Beta
From compatibility in the SKILL.md frontmatter.
Mastra Hono loads about 2.9k tokens when it runs, and up to ~34k if it reads all its reference files. Until then it costs about 94 tokens; SKILL.md has 485 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from jwynia/agent-skills at commit e02ec7e, republished under its MIT licence (© jwynia). 485 words, ~2,875 tokens.
.claude/skills/mastra-hono/SKILL.md (or your agent's skills folder). This skill also uses 21 other files; get the full folder from GitHub.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)
Use when:
Do NOT use when:
# 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// 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/generateimport { 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
},
});// 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 signatureThis 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:
| Rule | Description |
|---|---|
| Workflow input → Step 1 input | Must match exactly |
| Step N output → Step N+1 input | Must match exactly |
| Final step output → Workflow output | Must 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 };
}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}/startCustom 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 });
},
});| Topic | Wrong | Correct |
|---|---|---|
| Imports | import { Agent } from "@mastra/core" | import { Agent } from "@mastra/core/agent" |
| Tools array | tools: [tool1, tool2] | tools: { tool1, tool2 } |
| Memory context | { threadId: "123" } | { memory: { thread: "123", resource: "user" } } |
| Workflow data | context.steps.step1.output | inputData or getStepResult("step-1") |
| After parallel | inputData.result | inputData["step-id"].result |
| After branch | inputData.result | inputData["step-id"]?.result (optional) |
| Nested agents | import agent; agent.generate() | mastra.getAgent("name").generate() |
| State mutation | state.counter++ | setState({ ...state, counter: state.counter + 1 }) |
| v1 tool exec | execute: async ({ context }) | execute: async (inputData, context) |
| Script | Purpose | Usage |
|---|---|---|
scaffold-project.ts | Create new Mastra+Hono project | deno run --allow-all scripts/scaffold-project.ts --name my-project |
scaffold-agent.ts | Create agent with tools | deno run --allow-all scripts/scaffold-agent.ts --name weather |
scaffold-workflow.ts | Create workflow with steps | deno run --allow-all scripts/scaffold-workflow.ts --name process-data |
scaffold-tool.ts | Create tool with schemas | deno run --allow-all scripts/scaffold-tool.ts --name fetch-weather |
validate-workflow-schemas.ts | Validate step schema matching | deno run --allow-read scripts/validate-workflow-schemas.ts ./src/mastra/workflows/ |
check-version-patterns.ts | Detect v1/stable pattern mixing | deno run --allow-read scripts/check-version-patterns.ts ./src/mastra/ |
references/workflow-data-flow.md - Complete data flow patterns (CRITICAL)references/common-mistakes.md - Extended anti-patterns and fixesreferences/agent-patterns.md - Agent definition deep-divereferences/tool-patterns.md - Tool signatures, wrappersreferences/hono-server-patterns.md - Server setup, routes, middlewarereferences/testing-patterns.md - Vitest setup, mocking LLMsreferences/mcp-server-patterns.md - Model Context Protocol authoringreferences/agent-networks.md - Multi-agent collaboration, A2Areferences/rag-memory-patterns.md - Vector stores, embeddings, memoryreferences/context-network-memory.md - Context networks for agent memoryassets/agent-template.ts - Agent boilerplateassets/tool-template.ts - Tool boilerplate (v1 signature)assets/workflow-template.ts - Workflow boilerplateassets/hono-server-template.ts - Hono+Mastra server setupassets/vitest-setup-template.ts - Test configuration© jwynia, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 21 other files (scripts, references, assets) in skills/tech/ai/mastra-hono of jwynia/agent-skills.
Open the folder on GitHubat commit e02ec7e
Mastra Hono next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Mastra Hono this skilljwynia/agent-skills | 170 | — | ~2.9k | Automated safety check: Pass | MIT | |
| Hono Idiomsirahardianto/awesome-agv | 156 | — | ~3k | Automated safety check: Pass | MIT | |
| MCP Server Patternsaffaan-m/ECC | 277k | 1 repos | ~551 | Automated safety check: Pass | MIT | |
| Typescript Idiomsirahardianto/awesome-agv | 156 | — | ~6.1k | Automated safety check: Pass | MIT | |
| MCP Server Patternsaffaan-m/ECC | 277k | 5 repos | ~1k | Automated safety check: Pass | MIT | |
| Desloppifydatabuddy-analytics/Databuddy | 1.2k | — | ~2.7k | Automated safety check: Pass | AGPL-3.0 |
irahardianto/awesome-agv
Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.
affaan-m/ECC
使用Node/TypeScript SDK构建MCP服务器——工具、资源、提示、Zod验证、stdio与可流式HTTP对比。使用Context7或官方MCP文档获取最新API信息。
irahardianto/awesome-agv
TypeScript strict typing: type narrowing, discriminated unions, Zod runtime validation, generic utility types, and Vitest testing.
affaan-m/ECC
Build MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP.
databuddy-analytics/Databuddy
Reduce codebase slop by deleting code, flattening abstractions, and replacing custom helpers/types/assertions with native SDK/npm helpers or straightforward schemas (for example Zod).
davila7/claude-code-templates
Expert in Zod — TypeScript-first schema validation. An agent skill from davila7/claude-code-templates.
jwynia/agent-skills
Diagnose devcontainer configuration problems and guide development environment setup.
jwynia/agent-skills
Create distinctive, production-grade frontend interfaces with high design quality.
jwynia/agent-skills
Orchestrate agile development workflows for Gitea repositories using the tea CLI.
jwynia/agent-skills
Generate game assets using AI image generation APIs (DALL-E, Replicate, fal.ai) and prepare them for Godot.
jwynia/agent-skills
Create and manipulate PowerPoint PPTX files programmatically.
jwynia/agent-skills
Build Progressive Web Apps with React and Vite. An agent skill from jwynia/agent-skills.
Categories
Develop AI agents, tools, and workflows with Mastra v1 Beta and Hono servers. Mastra Hono is an agent skill from jwynia/agent-skills. Develop AI agents, tools, and workflows with Mastra v1 Beta and Hono servers.
Mastra Hono fits situations like: tasks that involve Forms and validation.
Run `npx skills add jwynia/agent-skills --skill mastra-hono -a claude-code`. Or copy the skill folder (skills/tech/ai/mastra-hono in jwynia/agent-skills) into .claude/skills/mastra-hono in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jwynia/agent-skills --skill mastra-hono -a codex`. Or copy the skill folder (skills/tech/ai/mastra-hono in jwynia/agent-skills) into .agents/skills/mastra-hono in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jwynia/agent-skills --skill mastra-hono -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mastra-hono, .gemini/skills/mastra-hono, .github/skills/mastra-hono and .opencode/skills/mastra-hono in your project.
Going by SKILL.md and its folder, Mastra Hono needs TypeScript for the scripts in its folder and the command-line tools its instructions call (deno and npm). Our summary lists: Node.js. Compatibility (from SKILL.md): Node.js 22.13.0+ required for v1 Beta.
SKILL.md names 3 domains. As links in the text: mastra.ai, hono.dev and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Mastra Hono is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 31k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Mastra Hono: Hono Idioms (irahardianto/awesome-agv, 156 stars), MCP Server Patterns (affaan-m/ECC, 277k stars), Typescript Idioms (irahardianto/awesome-agv, 156 stars) and MCP Server Patterns (affaan-m/ECC, 277k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jwynia (a GitHub user) maintains it in jwynia/agent-skills, which has 170 GitHub stars. The repository holds 111 skills in this directory. The repository was last updated on February 24, 2026.
Source: jwynia/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.