How to Build Custom Skills for OpenClaw
I often find myself stuck when an AI assistant doesn’t know how to handle my specific workflow. It is frustrating to have the right tools but no way to bridge the gap between the LLM and my local environment. I want my assistant to follow my exact rules without having to repeat myself in every new chat session.
Custom skills are the answer here. They allow me to bake specific instructions and tool definitions directly into the assistant. If you want to make your assistant smarter or more specialized, follow this guide to get your first skill running.
What You’ll Need
Section titled “What You’ll Need”- OpenClaw installed on your machine.
- A workspace directory located at
~/.openclaw/workspace/skills/.
Quick Start
Section titled “Quick Start”You can set up a new skill in about five minutes. Here is the fastest path to getting a “Hello World” skill working.
1. Create the Directory
Section titled “1. Create the Directory”Skills live in a specific folder. Open your terminal and create a new directory for your skill:
mkdir -p ~/.openclaw/workspace/skills/hello-world2. Define the SKILL.md
Section titled “2. Define the SKILL.md”Every skill needs a SKILL.md file. This file tells the assistant what the skill is called and how to use it. Create the file in your new folder and paste this content:
---name: hello_worlddescription: A simple skill that says hello.---
# Hello World Skill
When the user asks for a greeting, use the `echo` tool to say "Hello from your custom skill!".3. Refresh OpenClaw
Section titled “3. Refresh OpenClaw”The assistant needs to index the new file. You can do this by asking the agent to “refresh skills” or by restarting the gateway.
4. Test Your Skill
Section titled “4. Test Your Skill”To make sure everything is working, run a test command in your terminal:
openclaw agent --message "use my new skill"Troubleshooting
Section titled “Troubleshooting”If things aren’t working as expected, check these two common areas:
- Skill not discovered: If the assistant doesn’t recognize your skill, ensure the
SKILL.mdis in the correct directory. Remember to trigger a “refresh skills” command or restart the gateway so OpenClaw can find the new directory. - Security risks with bash: If your skill uses the
bashtool, be careful. Ensure your prompts do not allow the model to run arbitrary commands based on untrusted user input to avoid command injection.
Need more help getting your environment configured? Check out the AI Setup Assistant.
What’s Next
Section titled “What’s Next”- Browse existing skills on ClawHub.
- Add custom tools to your YAML frontmatter.
OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.