agentskit.js
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-summarizer

Output:

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

Flags:

FlagDefaultPurpose
--provideranthropicPlanner provider
--modelprovider defaultPlanner model id
--api-keyenvExplicit key override
--base-urlFor OpenAI-compatible endpoints
--out./my-agentOutput directory
--overwritefalseOverwrite existing files
--dry-runfalsePrint 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')

See also

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page