204 lines
4.2 KiB
Markdown
Raw Normal View History

# Create Agent Workflow
2025-10-16 21:50:50 -05:00
Interactive agent builder creating BMad Core compliant agents as YAML source files that compile to .md during installation.
2025-10-16 21:50:50 -05:00
## Table of Contents
2025-10-16 21:50:50 -05:00
- [Quick Start](#quick-start)
- [Agent Types](#agent-types)
- [Workflow Phases](#workflow-phases)
- [Output Structure](#output-structure)
- [Installation](#installation)
- [Examples](#examples)
2025-10-16 21:50:50 -05:00
## Quick Start
2025-10-16 21:50:50 -05:00
```bash
# Direct workflow
2025-10-16 21:50:50 -05:00
workflow create-agent
# Via BMad Builder
2025-10-16 21:50:50 -05:00
*create-agent
```
## Agent Types
2025-10-16 21:50:50 -05:00
### Simple Agent
2025-10-16 21:50:50 -05:00
- Self-contained functionality
- Basic command structure
- No external resources
2025-10-16 21:50:50 -05:00
### Expert Agent
2025-10-16 21:50:50 -05:00
- Sidecar resources for domain knowledge
- Extended capabilities
- Knowledge base integration
2025-10-16 21:50:50 -05:00
### Module Agent
2025-10-16 21:50:50 -05:00
- Full-featured with workflows
- Module-specific commands
- Integrated with module structure
2025-10-16 21:50:50 -05:00
## Workflow Phases
2025-10-16 21:50:50 -05:00
### Phase 0: Optional Brainstorming
2025-10-16 21:50:50 -05:00
- Creative ideation session
- Explore concepts and personalities
- Generate command ideas
- Output feeds into persona development
2025-10-16 21:50:50 -05:00
### Phase 1: Agent Setup
2025-10-16 21:50:50 -05:00
1. Choose agent type (Simple/Expert/Module)
2. Define identity (name, title, icon, filename)
3. Assign to module (if Module agent)
2025-10-16 21:50:50 -05:00
### Phase 2: Persona Development
2025-10-16 21:50:50 -05:00
- Define role and responsibilities
- Craft unique identity/backstory
- Select communication style
2025-10-16 21:50:50 -05:00
- Establish guiding principles
- Add critical actions (optional)
### Phase 3: Command Building
2025-10-16 21:50:50 -05:00
- Add required commands (*help, *exit)
- Define workflow commands
- Add task commands
- Create action commands
- Configure attributes
2025-10-16 21:50:50 -05:00
### Phase 4: Finalization
2025-10-16 21:50:50 -05:00
- Generate .agent.yaml file
- Create customize file (optional)
- Setup sidecar resources (Expert agents)
- Validate and compile
2025-10-16 21:50:50 -05:00
- Provide usage instructions
## Output Structure
2025-10-16 21:50:50 -05:00
### Generated Files
**Standalone Agents:**
2025-10-16 21:50:50 -05:00
- Source: `bmad/agents/{filename}.agent.yaml`
- Compiled: `bmad/agents/{filename}.md`
2025-10-16 21:50:50 -05:00
**Module Agents:**
2025-10-16 21:50:50 -05:00
- Source: `src/modules/{module}/agents/{filename}.agent.yaml`
- Compiled: `bmad/{module}/agents/{filename}.md`
2025-10-16 21:50:50 -05:00
### YAML Structure
2025-10-16 21:50:50 -05:00
```yaml
agent:
metadata:
id: bmad/{module}/agents/{filename}.md
name: Agent Name
title: Agent Title
icon: 🤖
module: module-name
2025-10-16 21:50:50 -05:00
persona:
role: '...'
identity: '...'
communication_style: '...'
principles: ['...', '...']
menu:
- trigger: command-name
workflow: path/to/workflow.yaml
description: Command description
2025-10-16 21:50:50 -05:00
```
### Optional Customize File
Location: `bmad/_cfg/agents/{module}-{filename}.customize.yaml`
2025-10-16 21:50:50 -05:00
Allows persona and menu overrides that persist through updates.
2025-10-16 21:50:50 -05:00
## Installation
2025-10-16 21:50:50 -05:00
### Compilation Methods
2025-10-16 21:50:50 -05:00
**Quick Rebuild:**
2025-10-16 21:50:50 -05:00
```bash
bmad compile-agents
2025-10-16 21:50:50 -05:00
```
**During Module Install:**
Automatic compilation when installing modules
2025-10-16 21:50:50 -05:00
**Manual Compilation:**
2025-10-16 21:50:50 -05:00
```bash
node tools/cli/bmad-cli.js compile-agents
2025-10-16 21:50:50 -05:00
```
## Examples
2025-10-16 21:50:50 -05:00
### Creating a Code Review Agent
2025-10-16 21:50:50 -05:00
```
User: I need a code review agent
Builder: Let's brainstorm first...
[Brainstorming generates ideas for strict vs friendly reviewer]
Builder: Now let's build your agent:
- Type: Simple
- Name: Code Reviewer
- Role: Senior developer conducting thorough reviews
- Style: Professional but approachable
- Commands:
- *review-pr: Review pull request
- *review-file: Review single file
- *review-standards: Check coding standards
```
2025-10-16 21:50:50 -05:00
### Creating a Domain Expert
2025-10-16 21:50:50 -05:00
```
Type: Expert
Name: Legal Advisor
Sidecar: legal-knowledge/
Commands:
- *contract-review
- *compliance-check
- *risk-assessment
```
2025-10-16 21:50:50 -05:00
## Workflow Files
2025-10-16 21:50:50 -05:00
```
create-agent/
├── workflow.yaml # Configuration
├── instructions.md # Step guide
├── checklist.md # Validation
├── README.md # This file
├── agent-types.md # Type details
├── agent-architecture.md # Patterns
├── agent-command-patterns.md # Commands
└── communication-styles.md # Styles
```
2025-10-16 21:50:50 -05:00
## Best Practices
1. **Use brainstorming** for complex agents
2. **Start simple** - Add commands incrementally
3. **Test commands** before finalizing
4. **Document thoroughly** in descriptions
5. **Follow naming conventions** consistently
2025-10-16 21:50:50 -05:00
## Related Documentation
2025-10-16 21:50:50 -05:00
- [Agent Types](./agent-types.md)
- [Command Patterns](./agent-command-patterns.md)
- [Communication Styles](./communication-styles.md)
- [BMB Module](../../README.md)