🎨 Custom Agents

Create your own specialized agents using simple JSON configuration files. Custom agents are stored in ~/.code_puppy/agents/.

💡 Tip

For an interactive experience, use the Agent Creator wizard with /agent agent-creator!

JSON Agent Schema

Every custom agent is defined by a JSON file with this structure:

{
  "id": "unique-uuid-here",
  "name": "my-custom-agent",
  "display_name": "My Custom Agent 🤖",
  "description": "A helpful description of what this agent does",
  "system_prompt": "Your detailed instructions for the AI...",
  "tools": [
    "list_files",
    "read_file",
    "edit_file",
    "grep",
    "agent_share_your_reasoning"
  ],
  "user_prompt": "Optional custom greeting shown to the user",
  "model": "optional-pinned-model-name"
}

Required Fields

Field Type Description
id string Unique identifier (UUID recommended)
name string Short name for switching (e.g., "my-agent")
display_name string Human-readable name with emoji
description string Brief description of agent purpose
system_prompt string Instructions that define agent behavior
tools array List of tool names the agent can use

Optional Fields

Field Type Description
user_prompt string Custom greeting shown when switching to agent
model string Pin a specific model to this agent

Available Tools

Choose from these tools for your agent:

File Operations

System Operations

Agent Operations

Browser Tools (for QA/automation agents)

Complete Example

Here's a complete example of a documentation writer agent:

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "doc-writer",
  "display_name": "Documentation Writer 📝",
  "description": "Generates comprehensive documentation for code",
  "system_prompt": "You are a technical documentation expert. Your role is to:\n\n1. Read and understand code thoroughly\n2. Write clear, comprehensive documentation\n3. Include examples and usage instructions\n4. Follow documentation best practices (JSDoc, docstrings, etc.)\n5. Create README files when needed\n\nAlways explain complex concepts simply. Use markdown formatting for readability.\n\nBefore writing docs, share your reasoning about:\n- What the code does\n- Who the audience is\n- What documentation format to use",
  "tools": [
    "list_files",
    "read_file",
    "edit_file",
    "grep",
    "agent_share_your_reasoning"
  ],
  "user_prompt": "📝 Ready to write some awesome documentation! What code should I document?"
}

Creating Your Agent

  1. Create a JSON file in ~/.code_puppy/agents/
  2. Use a unique .json filename (e.g., doc-writer.json)
  3. Define your agent schema
  4. Switch to it with /agent your-agent-name
# Create the agents directory if it doesn't exist
mkdir -p ~/.code_puppy/agents

# Create your agent file
cat > ~/.code_puppy/agents/doc-writer.json << 'EOF'
{
  "id": "doc-writer-001",
  "name": "doc-writer",
  ...
}
EOF

# In Code Puppy, switch to your agent
/agent doc-writer

Tips for Writing System Prompts

💡 Best Practices
  • Be specific - Clearly define the agent's role and responsibilities
  • Set boundaries - Explain what the agent should and shouldn't do
  • Include examples - Show expected behavior patterns
  • Define personality - Make your agent unique and engaging
  • Require reasoning - Ask the agent to explain its thought process

Using the Agent Creator Wizard

For an easier experience, use the interactive wizard:

/agent agent-creator

# Then describe what you want:
"I need an agent that reviews database schemas and suggests optimizations"

The wizard will guide you through creating a complete agent configuration!

Learn more about the Agent Creator →