skills/create-voltagent/SKILL.md
Skill for creating AI agent projects using the VoltAgent framework. Guide for CLI setup and manual bootstrapping.
npx skillsauth add VoltAgent/skills create-voltagentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete guide for creating new VoltAgent projects. Includes the CLI flow and a full manual setup.
Official documentation: https://voltagent.dev/docs/
When a user wants to create a VoltAgent project, ask:
"How would you like to create your VoltAgent project?"
npm create voltagent-app@latest and handle promptsBased on their choice:
Create a new VoltAgent project with one command:
npm create voltagent-app@latest
Other package managers:
pnpm create voltagent-app@latest
yarn create voltagent-app@latest
bun create voltagent-app@latest
The create-voltagent-app command:
my-voltagent-app).env, README.md, tsconfig.json, tsdown.config.ts, and Docker filesRun:
npm create voltagent-app@latest
When prompted:
Start the dev server:
cd <your-project-directory>
npm run dev
If you chose Ollama:
ollama pull llama3.2
Create in a specific directory:
npm create voltagent-app@latest my-voltagent-app
Download an example from the VoltAgent repo:
npm create voltagent-app@latest -- --example with-workflow
pnpm / yarn / bun equivalents:
pnpm create voltagent-app@latest -- --example with-workflow
yarn create voltagent-app@latest -- --example with-workflow
bun create voltagent-app@latest -- --example with-workflow
Notes:
-- before --example.npm install and npm run dev.my-voltagent-app/
|-- src/
| |-- index.ts
| |-- tools/
| | |-- index.ts
| | `-- weather.ts
| `-- workflows/
| `-- index.ts
|-- .env
|-- .voltagent/
|-- Dockerfile
|-- .dockerignore
|-- .gitignore
|-- README.md
|-- package.json
|-- tsconfig.json
`-- tsdown.config.ts
If you run the docs sync script in this repo, you may also see packages/core/docs generated.
The CLI writes .env with your provider key (or a placeholder). Common keys:
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
GOOGLE_GENERATIVE_AI_API_KEY=...
GROQ_API_KEY=...
MISTRAL_API_KEY=...
OLLAMA_HOST=http://localhost:11434
VOLTAGENT_PUBLIC_KEY=...
VOLTAGENT_SECRET_KEY=...
If you prefer not to use the CLI, follow these steps:
mkdir my-voltagent-app && cd my-voltagent-app
npm init -y
mkdir -p src/tools src/workflows .voltagent
Choose one server package:
npm install @voltagent/core @voltagent/libsql @voltagent/logger @voltagent/server-hono @voltagent/cli ai zod dotenv
or
npm install @voltagent/core @voltagent/libsql @voltagent/logger @voltagent/server-elysia @voltagent/cli ai zod dotenv
Dev dependencies:
npm install -D typescript tsx tsdown @types/node @biomejs/biome
{
"scripts": {
"dev": "tsx watch --env-file=.env ./src",
"build": "tsdown",
"start": "node dist/index.js",
"lint": "biome check ./src",
"lint:fix": "biome check --write ./src",
"typecheck": "tsc --noEmit",
"volt": "volt"
}
}
volt is the VoltAgent CLI. Use it for project utilities (for example init, deploy, eval, prompts, tunnel, update).
Create tsconfig.json:
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"outDir": "dist",
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
Create tsdown.config.ts:
import { defineConfig } from "tsdown";
export default defineConfig({
entry: ["./src/index.ts"],
sourcemap: true,
outDir: "dist",
});
OPENAI_API_KEY=your-api-key-here
VOLTAGENT_PUBLIC_KEY=your-public-key
VOLTAGENT_SECRET_KEY=your-secret-key
NODE_ENV=development
For Ollama:
OLLAMA_HOST=http://localhost:11434
Create src/tools/weather.ts:
import { createTool } from "@voltagent/core";
import { z } from "zod";
export const weatherTool = createTool({
name: "getWeather",
description: "Get the current weather for a specific location",
parameters: z.object({
location: z.string().describe("City or location to get weather for"),
}),
execute: async ({ location }) => {
return {
weather: {
location,
temperature: 21,
condition: "Sunny",
humidity: 45,
windSpeed: 8,
},
message: `Current weather in ${location}: 21 C and sunny.`,
};
},
});
Create src/tools/index.ts:
export { weatherTool } from "./weather";
Create src/workflows/index.ts:
import { createWorkflowChain } from "@voltagent/core";
import { z } from "zod";
export const expenseApprovalWorkflow = createWorkflowChain({
id: "expense-approval",
name: "Expense Approval Workflow",
purpose: "Process expense reports with manager approval for high amounts",
input: z.object({
employeeId: z.string(),
amount: z.number(),
category: z.string(),
description: z.string(),
}),
result: z.object({
status: z.enum(["approved", "rejected"]),
approvedBy: z.string(),
finalAmount: z.number(),
}),
})
.andThen({
id: "check-approval-needed",
resumeSchema: z.object({
approved: z.boolean(),
managerId: z.string(),
comments: z.string().optional(),
adjustedAmount: z.number().optional(),
}),
execute: async ({ data, suspend, resumeData }) => {
if (resumeData) {
return {
...data,
approved: resumeData.approved,
approvedBy: resumeData.managerId,
finalAmount: resumeData.adjustedAmount || data.amount,
managerComments: resumeData.comments,
};
}
if (data.amount > 500) {
await suspend("Manager approval required", {
employeeId: data.employeeId,
requestedAmount: data.amount,
category: data.category,
});
}
return {
...data,
approved: true,
approvedBy: "system",
finalAmount: data.amount,
};
},
})
.andThen({
id: "process-decision",
execute: async ({ data }) => {
return {
status: data.approved ? "approved" : "rejected",
approvedBy: data.approvedBy,
finalAmount: data.finalAmount,
};
},
});
Create src/index.ts:
import "dotenv/config";
import {
Agent,
Memory,
VoltAgent,
VoltAgentObservability,
VoltOpsClient,
} from "@voltagent/core";
import { LibSQLMemoryAdapter, LibSQLObservabilityAdapter } from "@voltagent/libsql";
import { createPinoLogger } from "@voltagent/logger";
import { honoServer } from "@voltagent/server-hono";
import { expenseApprovalWorkflow } from "./workflows";
import { weatherTool } from "./tools";
const logger = createPinoLogger({ name: "my-voltagent-app", level: "info" });
const memory = new Memory({
storage: new LibSQLMemoryAdapter({
url: "file:./.voltagent/memory.db",
logger: logger.child({ component: "libsql" }),
}),
});
const observability = new VoltAgentObservability({
storage: new LibSQLObservabilityAdapter({
url: "file:./.voltagent/observability.db",
}),
});
const agent = new Agent({
name: "my-voltagent-app",
instructions: "A helpful assistant that can check weather and help with various tasks",
model: "openai/gpt-4o-mini",
tools: [weatherTool],
memory,
});
new VoltAgent({
agents: { agent },
workflows: { expenseApprovalWorkflow },
server: honoServer(),
logger,
observability,
voltOpsClient: new VoltOpsClient({
publicKey: process.env.VOLTAGENT_PUBLIC_KEY || "",
secretKey: process.env.VOLTAGENT_SECRET_KEY || "",
}),
});
Model format is provider/model. Examples:
openai/gpt-4o-minianthropic/claude-3-5-sonnetgoogle/gemini-2.0-flashgroq/llama-3.3-70b-versatilemistral/mistral-large-latestollama/llama3.2If you chose Elysia, replace honoServer with elysiaServer and update the import.
npm run dev
development
Look up VoltAgent documentation embedded in node_modules/@voltagent/core/docs for version-matched docs. Use for API signatures, guides, and examples.
data-ai
--- name: voltagent-core-reference # prettier-ignore description: Reference for the VoltAgent class: constructor options, lifecycle methods, and runtime behavior. license: MIT metadata: author: VoltAgent version: "1.0.0" repository: https://github.com/VoltAgent/skills --- # VoltAgent Core Reference Reference for the VoltAgent class in `@voltagent/core`. Source files: - packages/core/src/voltagent.ts - packages/core/src/types.ts --- ## Options Overview `VoltAgentOptions` supports: -
data-ai
VoltAgent architectural patterns and conventions. Covers agents vs workflows, project layout, memory, servers, and observability.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.