Getting Started
Codebuff agents are TypeScript modules that define specialized AI assistants. Each agent has a specific purpose, tools, and behavior patterns.Using /init Command
The/init command scaffolds the necessary files for creating custom agents:
.agents/directory in your project root.agents/types/with TypeScript definitions- Template files for your first agent
Agent File Structure
A typical agent file looks like this:Required Files
- Agent definition file:
.agents/your-agent.ts - Type definitions:
.agents/types/agent-definition.ts(auto-generated) - Export: Must use
export defaultfor the agent definition
Simple Agent Example
Here’s a complete example based on theresearcher-web agent from the Codebuff source:
Key Concepts
Agent ID
Theid field must:
- Be unique within your project
- Use lowercase letters, numbers, and hyphens only
- Match the filename (e.g.,
researcher-web.ts→id: 'researcher-web')
Model Selection
Choose from OpenRouter models:Tools
Specify which tools your agent can use:Next Steps
Agent Definition
Complete reference for all agent properties
Generators
Learn about handleSteps and programmatic control
Spawning Agents
Compose agents for complex workflows
Publishing
Share your agents in the Codebuff store

