AGENT SKILL

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

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 memory for a shared default across agents and workflows.
  • Use agentMemory or workflowMemory when defaults need to differ.

Server Options

  • Use @voltagent/server-hono for Node HTTP servers.
  • Use @voltagent/server-elysia as an alternative Node server provider.
  • Use serverless provider for fetch runtimes (Cloudflare, Netlify).

Observability Notes

  • Use VoltOpsClient or createVoltAgentObservability for tracing.
  • VoltAgent will auto-configure VoltOps if VOLTAGENT_PUBLIC_KEY and VOLTAGENT_SECRET_KEY are 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.stringify inside VoltAgent packages. Use safeStringify from @voltagent/internal.

Resources

04 同仓库更多 Skills

luokai0
luokai0/ai-agent-skills-by-luo-kai

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'.

★ 14
luokai0
luokai0/ai-agent-skills-by-luo-kai

web-search

通用网络搜索技能,支持多引擎搜索(百度、必应、DuckDuckGo),无需API密钥即可获取实时信息

★ 14
luokai0
luokai0/ai-agent-skills-by-luo-kai

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).

Skill与智能体开发
★ 14
luokai0
luokai0/ai-agent-skills-by-luo-kai

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.

邮件与沟通前端开发
★ 14
luokai0
luokai0/ai-agent-skills-by-luo-kai

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.

开发工程师测试与质量后端与接口
★ 14
luokai0
luokai0/ai-agent-skills-by-luo-kai

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.

★ 14