|
| 1 | +# Codebuff Agents |
| 2 | + |
| 3 | +This directory contains your custom Codebuff agents. Each agent is a TypeScript file that defines an AI agent with specific capabilities and behavior. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +1. **Edit an existing agent**: Start with `my-custom-agent.ts` and modify it for your needs |
| 8 | +2. **Check out the examples and types**: See the examples and types directories to draw inspiration and learn what's possible. |
| 9 | +3. **Test your agent**: Run `codebuff --agent your-agent-name` |
| 10 | +4. **Publish your agent**: Run `codebuff publish your-agent-name` |
| 11 | + |
| 12 | +## File Structure |
| 13 | + |
| 14 | +- `types/` - TypeScript type definitions |
| 15 | +- `examples/` - Example agents for reference |
| 16 | +- `my-custom-agent.ts` - Your first custom agent (edit this!) |
| 17 | +- Add any new agents you wish to the .agents directory |
| 18 | + |
| 19 | +## Agent Basics |
| 20 | + |
| 21 | +Each agent file exports an `AgentDefinition` object with: |
| 22 | + |
| 23 | +- `id`: Unique identifier (lowercase, hyphens only) |
| 24 | +- `displayName`: Human-readable name |
| 25 | +- `model`: AI model to use (see OpenRouter for options) |
| 26 | +- `toolNames`: Tools the agent can use |
| 27 | +- `instructionsPrompt`: Instructions for the agent's behavior |
| 28 | +- `spawnerPrompt`: When other agents should spawn this one |
| 29 | +- `spawnableAgents`: Which agents *this* agent can spawn |
| 30 | + |
| 31 | +## Common Tools |
| 32 | + |
| 33 | +- `read_files` - Read file contents |
| 34 | +- `write_file` - Create or modify files |
| 35 | +- `str_replace` - Make targeted edits |
| 36 | +- `run_terminal_command` - Execute shell commands |
| 37 | +- `code_search` - Search for code patterns |
| 38 | +- `spawn_agents` - Delegate to other agents |
| 39 | +- `end_turn` - Finish the response |
| 40 | + |
| 41 | +See `types/tools.ts` for more information on each tool! |
| 42 | + |
| 43 | +## Need Help? |
| 44 | + |
| 45 | +- Check the type definitions in `types/agent-definition.ts` |
| 46 | +- Look at examples in the `examples/` directory |
| 47 | +- Join the Codebuff Discord community (https://discord.com/invite/mcWTGjgTj3) |
| 48 | + |
| 49 | +Happy agent building! 🤖 |
0 commit comments