create-voltagent
Skill for creating AI agent projects using the VoltAgent framework. Guide for CLI setup and manual bootstrapping.
What this skill does
# Create VoltAgent Skill
Complete guide for creating new VoltAgent projects. Includes the CLI flow and a full manual setup.
Official documentation: https://voltagent.dev/docs/
---
## Start Here
When a user wants to create a VoltAgent project, ask:
"How would you like to create your VoltAgent project?"
1. Automatic Setup - run `npm create voltagent-app@latest` and handle prompts
2. Interactive Guide - walk through each step and confirm choices
3. Manual Installation - set up dependencies and a full working example
Based on their choice:
- Option 1: run the CLI, capture server and provider choices, and finish setup
- Option 2: gather server, provider, and API key, then run the CLI
- Option 3: follow the manual steps below
---
## Before You Start
- Node.js 20+ (>= 20.19.0 recommended)
- Git (optional, for auto git init)
- An API key for your model provider (not needed for Ollama)
---
## Fast Path
Create a new VoltAgent project with one command:
```bash
npm create voltagent-app@latest
```
Other package managers:
```bash
pnpm create voltagent-app@latest
yarn create voltagent-app@latest
bun create voltagent-app@latest
```
---
## CLI Flow
The create-voltagent-app command:
1. Asks for a project name (default: `my-voltagent-app`)
2. Prompts for a server framework (Hono or Elysia)
3. Prompts for an AI provider (OpenAI, Anthropic, Google, Groq, Mistral, Ollama)
4. Prompts for an API key when required
5. Installs dependencies and scaffolds the project
6. Writes `.env`, `README.md`, `tsconfig.json`, `tsdown.config.ts`, and Docker files
7. Initializes a git repo when available
---
## CLI Walkthrough
1. Run:
```bash
npm create voltagent-app@latest
```
2. When prompted:
- Choose a server (Hono recommended or Elysia)
- Choose an AI provider
- Enter your API key (skip if using Ollama)
3. Start the dev server:
```bash
cd <your-project-directory>
npm run dev
```
4. If you chose Ollama:
```bash
ollama pull llama3.2
```
---
## CLI Flags and Examples
Create in a specific directory:
```bash
npm create voltagent-app@latest my-voltagent-app
```
Download an example from the VoltAgent repo:
```bash
npm create voltagent-app@latest -- --example with-workflow
```
pnpm / yarn / bun equivalents:
```bash
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:
- Examples are pulled from https://github.com/voltagent/voltagent/tree/main/examples
- Some package managers require `--` before `--example`.
- After an example download, run `npm install` and `npm run dev`.
---
## Generated Layout
```
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.
---
## Env Keys
The CLI writes `.env` with your provider key (or a placeholder). Common keys:
```env
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=...
```
---
## Manual Setup (Full)
If you prefer not to use the CLI, follow these steps:
### Step 1: Create the project directory
```bash
mkdir my-voltagent-app && cd my-voltagent-app
npm init -y
mkdir -p src/tools src/workflows .voltagent
```
### Step 2: Install dependencies
Choose one server package:
```bash
npm install @voltagent/core @voltagent/libsql @voltagent/logger @voltagent/server-hono @voltagent/cli ai zod dotenv
```
or
```bash
npm install @voltagent/core @voltagent/libsql @voltagent/logger @voltagent/server-elysia @voltagent/cli ai zod dotenv
```
Dev dependencies:
```bash
npm install -D typescript tsx tsdown @types/node @biomejs/biome
```
### Step 3: Add scripts to package.json
```json
{
"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`).
### Step 4: Configure TypeScript
Create `tsconfig.json`:
```json
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "bundler",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"outDir": "dist",
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
```
### Step 5: Add tsdown config
Create `tsdown.config.ts`:
```typescript
import { defineConfig } from "tsdown";
export default defineConfig({
entry: ["./src/index.ts"],
sourcemap: true,
outDir: "dist",
});
```
### Step 6: Create .env
```env
OPENAI_API_KEY=your-api-key-here
VOLTAGENT_PUBLIC_KEY=your-public-key
VOLTAGENT_SECRET_KEY=your-secret-key
NODE_ENV=development
```
For Ollama:
```env
OLLAMA_HOST=http://localhost:11434
```
### Step 7: Create a tool
Create `src/tools/weather.ts`:
```typescript
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`:
```typescript
export { weatherTool } from "./weather";
```
### Step 8: Create a workflow
Create `src/workflows/index.ts`:
```typescript
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,
};
},
});
```
### Step 9: Create the entry point
Create `src/index.ts`:
```typescript
import "dotenv/config";
import {
AgentRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.