voltagent-best-practices
VoltAgent architectural patterns and conventions. Covers agents vs workflows, project layout, memory, servers, and observability.
- License 许可
- MIT
- 最近更新
- 2026-05-06
- Stars
- ★ 14
- Forks
- 1
01 前言 Front Matter
- name
- voltagent-best-practices
- author
- luo-kai
- license
- MIT
- metadata
- { "author": "VoltAgent", "version": "1.0.0", "repository": "https://github.com/VoltAgent/skills" }
- description
- VoltAgent architectural patterns and conventions. Covers agents vs workflows, project layout, memory, servers, and observability.
02 资源文件 1
- 其他customize.toml3.3 KB
03 SKILL.md 正文
VoltAgent Best Practices
Quick reference for VoltAgent conventions and patterns.
Choosing Agent or Workflow
| Use | When |
|---|---|
| Agent | Open-ended tasks that require tool selection and adaptive reasoning |
| Workflow | Multi-step pipelines with explicit control flow and suspend/resume |
Layout
src/
|-- index.ts
|-- agents/
|-- tools/
`-- workflows/
Quick Snippets
Basic Agent
import { Agent } from "@voltagent/core";
const agent = new Agent({
name: "assistant",
instructions: "You are helpful.",
model: "openai/gpt-4o-mini",
});
Model format is provider/model (for example openai/gpt-4o-mini or anthropic/claude-3-5-sonnet).
Basic Workflow
import { createWorkflowChain } from "@voltagent/core";
import { z } from "zod";
const workflow = createWorkflowChain({
id: "example",
input: z.object({ text: z.string() }),
result: z.object({ summary: z.string() }),
}).andThen({
id: "summarize",
execute: async ({ data }) => ({ summary: data.text }),
});
VoltAgent Bootstrap
import { VoltAgent } from "@voltagent/core";
import { honoServer } from "@voltagent/server-hono";
new VoltAgent({
agents: { agent },
workflows: { workflow },
server: honoServer(),
});
Memory Defaults
- Use
memoryfor a shared default across agents and workflows. - Use
agentMemoryorworkflowMemorywhen defaults need to differ.
Server Options
- Use
@voltagent/server-honofor Node HTTP servers. - Use
@voltagent/server-elysiaas an alternative Node server provider. - Use
serverlessprovider for fetch runtimes (Cloudflare, Netlify).
Observability Notes
- Use
VoltOpsClientorcreateVoltAgentObservabilityfor tracing. - VoltAgent will auto-configure VoltOps if
VOLTAGENT_PUBLIC_KEYandVOLTAGENT_SECRET_KEYare set.
Recipes
Short best-practice recipes live in the embedded docs:
packages/core/docs/recipes/- Search:
rg -n "keyword" packages/core/docs/recipes -g"*.md" - Read:
cat packages/core/docs/recipes/<file>.md
Footguns
- Do not use
JSON.stringifyinside VoltAgent packages. UsesafeStringifyfrom@voltagent/internal.
Resources
04 同仓库更多 Skills
write-contracts
Generates secure Aptos Move V2 smart contracts with Object model, Digital Asset integration, security patterns, and storage type guidance. Includes comprehensive storage decision framework for optimal data structure selection. Triggers on: 'write contract', 'create NFT collection', 'build marketplace', 'implement minting', 'generate Move module', 'create token contract', 'build DAO', 'implement staking'. Ask storage questions when: 'store', 'track', 'registry', 'mapping', 'list', 'collection'.
web-search
通用网络搜索技能,支持多引擎搜索(百度、必应、DuckDuckGo),无需API密钥即可获取实时信息
solo-build
Execute implementation plan tasks with TDD workflow, auto-commit, and phase gates. Use when user says "build it", "start building", "execute plan", "implement tasks", "ship it", or references a track ID. Do NOT use for planning (use /plan) or scaffolding (use /scaffold).
react-email
Use when building HTML email templates with React components, adding a visual email editor to an application using the React Email visual editor, rendering emails to HTML, or sending emails with Resend. Covers welcome emails, password resets, notifications, order confirmations, newsletters, transactional emails, and the embeddable email editor component.
APITester Agent-Driven API Testing
Test API endpoints and document responses. Define tests in plain English, run them, get formatted results. Agent-driven Postman alternative.
hubspot-implementation-plan
Generate a phased implementation plan from a HubSpot audit report. Creates prioritized, sequenced cleanup processes with effort estimates, dependencies, and automation feasibility. Use after running /hubspot-audit.