voltagent-best-practices — Claude Code skill: VoltAgent conventions
A skill that feeds your agent VoltAgent's conventions: agents versus workflows, project layout, memory, servers and tracing.
npx skills add VoltAgent/skills --skill voltagent-best-practices -a claude-codeWhat voltagent-best-practices does
The skill hands the agent a reference for VoltAgent conventions. It opens with a table for picking between an agent and a workflow, then shows the usual src/ layout with agents/, tools/ and workflows/ folders, plus short TypeScript snippets for an agent, a workflow and the VoltAgent bootstrap.
Memory and servers get their own sections. Use memory for one shared default, or agentMemory and workflowMemory when agents and workflows need different values. Servers run through @voltagent/server-hono, with @voltagent/server-elysia as an alternative and a serverless provider for fetch runtimes such as Cloudflare and Netlify. Tracing goes through VoltOpsClient or createVoltAgentObservability, and VoltOps configures itself once VOLTAGENT_PUBLIC_KEY and VOLTAGENT_SECRET_KEY are set.
There is a footguns section too: inside VoltAgent packages, skip JSON.stringify and call safeStringify from @voltagent/internal instead. Recipes live in packages/core/docs/recipes/, found with rg and read straight from disk. The skill assumes @voltagent/core is already in the project — without it the memory and server advice has nothing to attach to.
What it helps with
- decide between an agent and a workflow for a given task
- lay out project files under
agents/,tools/andworkflows/ - set shared memory or separate values for agents and workflows
- stand up an HTTP server on Hono or Elysia and wire the serverless provider
- turn on tracing through VoltOps without manual setup
Example prompts for the agent
- Create a new VoltAgent agent following the skill's conventions
- Help me lay out the project: which folders do agents, tools and workflows go in?
- Set memory separately for agents and workflows, and explain how it differs from shared
memory
How to install voltagent-best-practices
1Skills CLI (Vercel)
npx skills add VoltAgent/skills --skill voltagent-best-practices -a claude-code2Manually: put the files in place
~/.claude/skills/voltagent-best-practices/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/voltagent-best-practices/
1Skills CLI (Vercel)
npx skills add VoltAgent/skills --skill voltagent-best-practices -a codex2Manually: put the files in place
.agents/skills/voltagent-best-practices/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add VoltAgent/skills --skill voltagent-best-practices -a cursor2Manually: put the files in place
.cursor/skills/voltagent-best-practices/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install VoltAgent/skills voltagent-best-practices2Manually: put the files in place
.github/skills/voltagent-best-practices/SKILL.md1Skills CLI (Vercel)
npx skills add VoltAgent/skills --skill voltagent-best-practices -a gemini-cli2Platform CLI
gemini skills install https://github.com/VoltAgent/skills --path skills/voltagent-best-practicesManually: put the files in place
.devin/skills/voltagent-best-practices/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add VoltAgent/skills --skill voltagent-best-practices -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about voltagent-best-practices
How do I install voltagent-best-practices in Claude?
Run npx skills add VoltAgent/skills --skill voltagent-best-practices -a claude-code. The skill lands in ~/.claude/skills/voltagent-best-practices/SKILL.md.
What does voltagent-best-practices do?
It gives the agent a reference for VoltAgent architecture: when to use an agent versus a workflow, how to lay out files, and how to configure memory, servers and tracing.
Which projects is it meant for?
Projects already using @voltagent/core. The snippets and the memory and server guidance build on that package.
Source text
SKILL.md · MIT
---
name: voltagent-best-practices
# prettier-ignore
description: VoltAgent architectural patterns and conventions. Covers agents vs workflows, project layout, memory, servers, and observability.
license: MIT
metadata:
author: VoltAgent
version: "1.0.0"
repository: https://github.com/VoltAgent/skills
---
# 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
```typescript
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
```typescript
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
```typescript
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
- https://voltagent.dev/docs
- https://github.com/voltagent/voltagent
- https://github.com/voltagent/voltagent/tree/main/examples
© VoltAgent · MIT · VoltAgent/skills