openclaw-agent-builder
Build specialized openclaw agents with proper workspace structure, identity, and skills
What this skill does
# OpenClaw Agent Builder
Create specialized openclaw agents with complete workspace structure, identity files, and skills.
## When to Use
When building a new openclaw agent for a specific purpose:
- Domain-specific agents (Android dev, SEO, content writing, etc.)
- Multi-agent routing scenarios
- Isolated agent personalities
- Workspace-based AI assistants
## Core Concepts
### OpenClaw Agent Structure
Each agent = isolated brain with:
- **Workspace**: Files (AGENTS.md, SOUL.md, USER.md, IDENTITY.md, TOOLS.md, etc.)
- **State dir**: `~/.openclaw/agents/<agentId>/agent` (auth, config)
- **Sessions**: `~/.openclaw/agents/<agentId>/sessions` (chat history)
### Workspace Files
**Required:**
- `AGENTS.md` - Operating instructions, memory management, behavior rules
- `SOUL.md` - Persona, tone, communication style
- `USER.md` - User context and how to address them
- `IDENTITY.md` - Agent name, emoji, role, mission
- `TOOLS.md` - Tool notes and conventions
**Optional:**
- `HEARTBEAT.md` - Heartbeat checklist (keep short)
- `BOOT.md` - Startup checklist when gateway restarts
- `memory/` - Daily memory logs (YYYY-MM-DD.md)
- `MEMORY.md` - Curated long-term memory
- `skills/` - Workspace-specific skills
## Agent Builder Workflow
### 1. Ask Questions First
Before building, clarify:
- **Agent purpose**: What problem does this agent solve?
- **Domain expertise**: What specialized knowledge needed?
- **Communication style**: Professional? Casual? Technical?
- **Tools/integrations**: APIs, databases, external systems?
- **Skills needed**: Custom capabilities or workflows?
### 2. Create Workspace Structure
```bash
# Create agent workspace
mkdir -p ~/.openclaw/workspace-<agent-name>
cd ~/.openclaw/workspace-<agent-name>
# Initialize git (recommended)
git init
```
### 3. Build Core Files
**IDENTITY.md** - Who the agent is:
```markdown
# IDENTITY.md
## Name
[Agent Name]
## Emoji
[1-2 relevant emojis]
## Role
[Short role description - e.g., "Android spec writer", "SEO optimizer"]
## Mission
[Concise mission statement - what the agent does and why]
```
**SOUL.md** - Personality and tone:
```markdown
# SOUL.md - [Agent Name]
## Who You Are
[Description of expertise, background, strengths]
## Your Expertise
### [Domain 1]
- [Specific skill or knowledge area]
- [Another capability]
### [Domain 2]
- [Capability]
## Your Approach
### [Trait 1 - e.g., Analytical, Pragmatic]
- [How this manifests]
### [Trait 2]
- [Behavior pattern]
## Your Tone
[Communication style - concise/verbose, formal/casual, technical level]
## Your Values
1. **[Value 1]** - [Why it matters]
2. **[Value 2]** - [Explanation]
```
**AGENTS.md** - Operating instructions:
```markdown
# AGENTS.md - [Agent Name]
[Brief agent description and primary role]
## Primary Responsibilities
1. **[Task 1]** - [Description]
2. **[Task 2]** - [Description]
## Workflow
### On User Request: "[Trigger Pattern]"
1. **[Step 1]** [Action description]
[Details, commands, or sub-steps]
2. **[Step 2]** [Next action]
### On User Request: "[Another Pattern]"
[Workflow steps]
## [Domain-Specific Section - e.g., "iOS Codebase Structure"]
[Relevant context, file paths, patterns]
## [Another Section - e.g., "Translation Guidelines"]
[Reference tables, mappings, rules]
## Memory
- Log [what to track] in `memory/YYYY-MM-DD.md`
- [Memory strategy specific to agent purpose]
## Tools
See `TOOLS.md` for [domain-specific tools or integrations]
## Skills
- **[skill-name]** - [Purpose]
- **[another-skill]** - [Purpose]
```
**USER.md** - User context:
```markdown
# USER.md
## Who You Are
[User description, preferences, context]
## Your Goals
[What user wants to achieve with this agent]
## Communication Preferences
[How user prefers to interact]
```
**TOOLS.md** - Tool conventions:
```markdown
# TOOLS.md
## [Domain] Tools
- **[Tool/API name]**: [Purpose and usage notes]
- **[Another tool]**: [Notes]
## Authentication
[If agent needs API keys, credentials, etc.]
## Conventions
[Domain-specific conventions or patterns]
```
### 4. Add Skills (Optional)
Create workspace-specific skills:
```bash
mkdir -p skills/<skill-name>
```
Each skill needs `SKILL.md`:
```markdown
---
name: skill-name
description: What the skill does
---
# Skill Name
[Skill documentation following agentskills.io format]
## When to Use
[Trigger conditions]
## Steps
[Detailed workflow]
## Examples
[Usage examples]
```
### 5. Setup Memory System
```bash
mkdir -p memory
touch memory/$(date +%Y-%m-%d).md
```
Optional `MEMORY.md` for curated knowledge:
```markdown
# MEMORY.md
## [Category]
- [Key fact or pattern]
- [Lesson learned]
## [Another Category]
[Organized knowledge]
```
### 6. Register Agent
```bash
# Add agent to openclaw
openclaw agents add <agent-name>
# Set workspace path
# Edit ~/.openclaw/openclaw.json:
{
"agents": {
"list": [
{
"id": "<agent-name>",
"workspace": "~/.openclaw/workspace-<agent-name>"
}
]
}
}
```
### 7. Add Bindings (Multi-Agent Routing)
Route specific channels/users to this agent:
```json5
{
"bindings": [
{
"agentId": "<agent-name>",
"match": {
"channel": "whatsapp",
"peer": { "kind": "direct", "id": "+1234567890" }
}
}
]
}
```
## Design Principles
### Agent Identity
- **Clear purpose**: Single, focused responsibility
- **Distinct personality**: Unique tone/approach vs other agents
- **Expertise depth**: Deep knowledge in specific domain
### Communication Style
- **Concise**: Default to brevity unless domain requires detail
- **Professional**: Match industry standards
- **Actionable**: Focus on what to do, not just description
### Memory Strategy
- **Daily logs**: Track important events/decisions
- **Curated knowledge**: Extract patterns into MEMORY.md
- **Context preservation**: Save state before `/new` or `/reset`
### Skill Organization
- **Workspace skills**: Agent-specific capabilities
- **Shared skills**: Common utilities in `~/.openclaw/skills/`
- **Override pattern**: Workspace skills override shared/bundled
## Example Agents
### Android Spec Generator
```
Purpose: Analyze iOS features, generate Android requirement specs
Style: Concise, technical, requirement-focused
Skills: ios-analyzer, android-spec-generator, github-issue-creator
```
### SEO Expert
```
Purpose: Content optimization, keyword research, SEO strategy
Style: Data-driven, analytical, actionable
Skills: keyword-research, content-analyzer, competitor-analysis
```
### Content Writer
```
Purpose: Blog posts, documentation, technical writing
Style: Clear, engaging, audience-aware
Skills: content-planner, seo-writer, editor
```
## Anti-Patterns
❌ **Don't:**
- Mix multiple unrelated domains in one agent
- Create verbose, chatty agents unless purpose requires it
- Duplicate content across AGENTS.md, SOUL.md, TOOLS.md
- Store secrets in workspace (use `~/.openclaw/credentials/`)
✅ **Do:**
- Keep single, clear focus per agent
- Match communication style to domain norms
- Organize by responsibility (identity/soul/operations)
- Use git for workspace backup (private repo)
## Testing Agent
```bash
# Start gateway with agent
openclaw gateway --agent <agent-name>
# Or use binding to route to agent
openclaw gateway
# Send test message via WhatsApp/Telegram/Discord
# Verify agent responds with expected personality/capability
```
## Maintenance
### Update Agent
```bash
cd ~/.openclaw/workspace-<agent-name>
git add .
git commit -m "Update [what changed]"
git push
```
### Add New Skill
```bash
cd ~/.openclaw/workspace-<agent-name>/skills
mkdir new-skill
# Create SKILL.md
```
### Backup Agent
```bash
# Workspace already in git
# Separately backup sessions if needed:
tar -czf sessions-backup.tar.gz ~/.openclaw/agents/<agent-name>/sessions/
```
## Resources
- [OpenClaw Multi-Agent Routing](https://docs.openclaw.org/concepts/multi-agent)
- [Agent Workspace Structure](https://docs.openclaw.org/concepts/agent-worRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.