OpenClaw comes with powerful built-in skills. But every workflow is different. When you need something specific — a company API, a custom calculation, a unique integration — you build a custom skill.
This guide shows you how to create your own OpenClaw skill from scratch. No complex framework to learn. Just JavaScript and a simple API.
What Is an OpenClaw Skill?
A skill is a JavaScript module that:
- Exposes one or more tools to the agent
- Accepts parameters from natural language
- Returns results for the agent to use
- Has access to the file system and network
Think of skills as plugins that extend what your OpenClaw agent can do.
Setting Up Your Development Environment
You'll need:
- Node.js 18+ installed
- A text editor (VS Code recommended)
- OpenClaw installed:
npm install -g openclaw
# Verify your setup
node --version # v18.x or higher
openclaw --versionSkill Structure
A minimal skill has three files:
my-skill/
├── index.js # Main entry point
├── skill.json # Metadata and tool definitions
└── README.md # Documentationskill.json
Defines your skill's tools:
{
"name": "weather-skill",
"version": "1.0.0",
"description": "Get weather information for any city",
"tools": [
{
"name": "get_weather",
"description": "Get current weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name (e.g., 'New York')"
}
},
"required": ["city"]
}
}
]
}index.js
Implements the tools:
// index.js
const axios = require('axios');
module.exports = {
async get_weather({ city }) {
const response = await axios.get(
`https://api.weather.com/v1/current?city=${encodeURIComponent(city)}`
);
return {
temperature: response.data.temp,
condition: response.data.condition,
humidity: response.data.humidity
};
}
};Building Your First Skill
Let's build a skill that fetches stock prices:
# Create skill directory
mkdir stock-price-skill
cd stock-price-skill
npm init -y
npm install axiosCreate skill.json:
{
"name": "stock-price",
"version": "1.0.0",
"description": "Get current stock prices",
"tools": [
{
"name": "get_stock_price",
"description": "Get current price for a stock symbol",
"parameters": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Stock symbol (e.g., 'AAPL', 'TSLA')"
}
},
"required": ["symbol"]
}
}
]
}Create index.js:
const axios = require('axios');
module.exports = {
async get_stock_price({ symbol }) {
try {
const response = await axios.get(
`https://api.example.com/stocks/${symbol.toUpperCase()}`
);
return {
symbol: symbol.toUpperCase(),
price: response.data.price,
change: response.data.change_percent,
currency: 'USD'
};
} catch (error) {
return { error: `Could not fetch price for ${symbol}` };
}
}
};Testing Your Skill
Test locally before deploying:
# Test the skill
openclaw skill test .
# Or test a specific tool
openclaw skill test . --tool get_stock_price --input '{"symbol": "AAPL"}'Deploying to OpenClaw
Install your skill in an agent:
# Local installation
openclaw skill install /path/to/stock-price-skill
# Or from npm (after publishing)
openclaw skill install stock-price-skillAdd to your agent's openclaw.yaml:
skills:
- name: stock-price
enabled: trueExample Skills
Database Query
Query SQL databases and return results to the agent.
File Converter
Convert between CSV, JSON, Excel formats.
Slack Notifier
Send messages to Slack channels.
Calculator
Advanced math with unit conversions.
Frequently Asked Questions
What programming language do I need?
Can I use external APIs?
How do I share my skill?
Can skills store data?
Are there limits on what skills can do?
Final Thoughts
Building custom skills is how you make OpenClaw truly yours. Start simple — a single API call, a file operation, a calculation. Then expand as you identify more needs.
The best skills solve specific problems you face daily. Build for your workflow, share with the community, and see what others create.