Skip to content
🤖 AI-optimized docs: llms-full.txt

Create a Custom Agent

Build your own AI agent with a unique personality, specialized commands, and optional persistent memory using the BMad Builder workflow.

  • How to run the create-agent workflow
  • Choose between hasSidecar: true or false
  • Define your agent’s persona (role, identity, communication style, principles)
  • Design effective menu commands
  • Package and install your custom agent

BMad uses one agent type with a hasSidecar boolean configuration:

hasSidecar: false # or true

The difference is not capability — all agents have equal power. The difference is in memory and state management.

Need memory across sessions OR need to restrict file access?
├── YES → hasSidecar: true
└── NO → hasSidecar: false
hasSidecarStructureBest For
falseSingle YAML (~250 lines)Single-purpose utilities, personality-driven agents
trueYAML + sidecar folderPersistent memory, long-term tracking, domain specialists

Without Sidecar Examples: Commit Poet, Snarky Weather Bot, Pun Barista, Gym Bro

With Sidecar Examples: Journal companion, Novel writing buddy, Fitness coach, Language tutor

In your IDE (Claude Code, Cursor, etc.), invoke the create-agent workflow with the agent-builder agent.

The workflow guides you through eight steps:

StepWhat You’ll Do
Brainstorm (optional)Explore ideas with creative techniques
DiscoveryDefine the agent’s purpose and goals
Type & MetadataChoose hasSidecar, name your agent
PersonaCraft the agent’s personality and principles
CommandsDefine what the agent can do
ActivationSet up critical_actions (optional/mandatory)
BuildGenerate the agent file
ValidationReview and verify everything works

Your agent’s personality is defined by four fields:

FieldPurposeExample
RoleWhat they do”Senior code reviewer who catches bugs and suggests improvements”
IdentityWho they are”Friendly but exacting, believes clean code is a craft”
Communication StyleHow they speak”Direct, constructive, explains the ‘why’ behind suggestions”
PrinciplesWhy they act”Security first, clarity over cleverness, test what you fix”

Keep each field focused on its purpose:

FieldContainsDoes NOT Contain
roleKnowledge/skills/capabilitiesBackground, experience, speech patterns, beliefs
identityBackground/experience/contextSkills, speech patterns, beliefs
communication_styleTone/voice/mannerisms (1-2 sentences)Behavioral words, capabilities, beliefs
principlesOperating philosophyVerbal patterns, capabilities

Define what your agent can do through menu items:

menu:
- trigger: WC or fuzzy match on write
action: "#write-commit"
description: "[WC] Write commit message"
ComponentFormatExample
triggerXX or fuzzy match on command-nameWC or fuzzy match on write
description[XX] Display text[WC] Write commit message
action#prompt-id or inline text#write-commit
HandlerUse CaseSyntax
actionAgent self-contained operationsaction: '#prompt-id' or action: 'inline text'
execModule external workflowsexec: '{project-root}/path/to/workflow.md'

These are auto-injected:

  • MH: Menu/Help
  • CH: Chat
  • PM: Party Mode
  • DA: Dismiss Agent

Instructions that execute before the agent starts.

critical_actions:
- "Show inspirational quote before menu"
- "Fetch latest stock prices before displaying menu"
critical_actions:
- "Load COMPLETE file {project-root}/_bmad/_memory/{sidecar-folder}/memories.md"
- "Load COMPLETE file {project-root}/_bmad/_memory/{sidecar-folder}/instructions.md"
- "ONLY read/write files in {project-root}/_bmad/_memory/{sidecar-folder}/"

Once created, package your agent for installation:

my-custom-stuff/
├── module.yaml # Contains: unitary: true
├── agents/
│ └── {agent-name}/
│ ├── {agent-name}.agent.yaml
│ └── {agent-name}-sidecar/ # hasSidecar: true only
│ ├── memories.md
│ ├── instructions.md
│ └── [custom-files].md
└── workflows/ # Optional: custom workflows

Install using the BMad installer, then invoke your new agent in your IDE.

You’ve created a custom AI agent with:

  • A defined purpose and role in your workflow
  • A unique persona with communication style and principles
  • Custom menu commands for your specific tasks
  • Optional persistent memory for ongoing context

Your project now includes:

_bmad/
├── _config/
│ └── agents/
│ └── {your-agent}/ # Your agent customizations
└── {module}/
└── agents/
└── {your-agent}/
└── {your-agent}.agent.yaml
ActionHow
Start workflow"Run the BMad Builder create-agent workflow"
Edit agent directlyModify {agent-name}.agent.yaml
Edit customizationModify _bmad/_config/agents/{agent-name}
Rebuild agentnpx bmad-method build <agent-name>
Study examplesCheck src/workflows/agent/data/reference/

Should I use hasSidecar true or false? Use false for focused, one-off tasks. Use true when you need memory across sessions or restricted file access.

How do I add more commands later? Edit the agent YAML directly or use the customization file in _bmad/_config/agents/. Then rebuild.

Can I share my agent with others? Yes. Package your agent as a standalone module and share it with your team or the community.

Where can I see example agents? Study the reference agents in src/workflows/agent/data/reference/:

ResourceDescription
What Are AgentsDeep technical details on agent architecture
Agent SchemaComplete field reference
Custom Content InstallationPackage and distribute your agents
Persona Development GuideAdvanced persona crafting
Principles Crafting GuideWrite effective principles