Recipes
agentskit ai — natural-language agent generator
Describe an agent in plain English, get a typed AgentSchema + tool stubs + runtime wiring.
Writing the first cut of an agent from scratch is tedious busy-work.
npx agentskit ai "<description>" drives any provider adapter with a
planner prompt, validates the returned schema, and scaffolds a fresh
project: agent.json, agent.ts, one tool stub per tool, and a
README.md.
Install
Comes with @agentskit/cli.
Quick start
npx agentskit ai "A bot that summarizes long PDFs and drafts a Slack message with the 3 key findings." \
--provider anthropic --model claude-sonnet-4-6 \
--out ./pdf-summarizerOutput:
Planning agent for: "A bot that summarizes..."
Wrote 5 file(s) to ./pdf-summarizer
+ agent.json
+ agent.ts
+ README.md
+ tools/extract_pdf.ts
+ tools/post_slack.tsFlags:
| Flag | Default | Purpose |
|---|---|---|
--provider | anthropic | Planner provider |
--model | provider default | Planner model id |
--api-key | env | Explicit key override |
--base-url | — | For OpenAI-compatible endpoints |
--out | ./my-agent | Output directory |
--overwrite | false | Overwrite existing files |
--dry-run | false | Print plan + file list without writing |
What you get
agent.json — the validated AgentSchema.
agent.ts — a typed createAgent(adapter) factory that wires tools.
tools/<name>.ts — one defineTool(...) stub per declared tool, with the planner's implementation hint in the docstring.
README.md — human-readable summary of the agent.
Programmatic use
The CLI is a thin wrapper around two exported helpers:
import { scaffoldAgent, writeScaffold, createAdapterPlanner } from '@agentskit/cli/ai'
import { anthropic } from '@agentskit/adapters'
const planner = createAdapterPlanner(anthropic({ apiKey: process.env.ANTHROPIC_API_KEY!, model: 'claude-sonnet-4-6' }))
const schema = await planner('A bot that reviews pull requests.')
const files = scaffoldAgent(schema)
await writeScaffold(files, './pr-reviewer')