Build Custom OpenClaw Skills: Complete Guide

OpenClaw agents are powerful out of the box, but their true potential unlocks when you teach them custom skills. Whether you’re automating workflows, integrating with APIs, or building specialized tools, custom skills let you package reusable capabilities that make your agents smarter over time.

In this guide, I’ll walk you through creating, testing, and publishing custom OpenClaw skills from scratch. By the end, you’ll know how to build skills that other agents can discover and use through ClawHub.

What Are OpenClaw Skills?

Think of skills as specialized instruction manuals for your AI agent. When an agent encounters a task that matches a skill’s description, it reads the skill’s documentation and follows the instructions to complete the task.

Skills typically include:

  • SKILL.md — The main instruction file that tells agents how to use the skill
  • Scripts — Helper scripts (bash, Node.js, Python) that do the heavy lifting
  • Reference files — API documentation, templates, or examples
  • Assets — Images, data files, or other resources

The beauty of skills is that they’re portable. Once you build a skill, you can share it on ClawHub, where any OpenClaw user can install and use it.

Why Build Custom Skills?

Here are some real-world scenarios where custom skills shine:

  • API integrations — Wrap complex APIs (Stripe, Shopify, Twilio) in simple commands
  • Workflow automation — Create repeatable processes for your specific business
  • Data processing — Build specialized tools for parsing, transforming, or analyzing data
  • Internal tools — Package your company’s internal systems for agent access
  • Knowledge sharing — Document best practices in a format agents can follow

Skills turn one-time solutions into reusable assets that compound in value over time.

Anatomy of a Skill: The SKILL.md File

Every skill starts with a SKILL.md file. This is where you tell the agent what the skill does and how to use it.

Here’s a minimal example for a weather skill:

# Weather Skill

Get current weather and forecasts for any location.

## When to Use This Skill

Use this skill when the user asks about:
- Current weather conditions
- Temperature forecasts
- Weather alerts or warnings

## Commands

### Get current weather
node scripts/get-weather.js --location "City, Country"

### Get 7-day forecast
node scripts/get-forecast.js --location "City, Country" --days 7

## Examples

Get weather for Dubai:
node scripts/get-weather.js --location "Dubai, UAE"

Get weekly forecast for London:
node scripts/get-forecast.js --location "London, UK" --days 7

## Notes

- No API key required
- Supports any global location
- Returns temperature, humidity, conditions, and wind speed

Notice the structure:

  1. Title and description — What the skill does
  2. When to use — Triggers that tell the agent when this skill applies
  3. Commands — The actual CLI commands to run
  4. Examples — Concrete usage patterns
  5. Notes — Important details or limitations

Step-by-Step: Building Your First Skill

Let’s build a simple skill that tracks cryptocurrency prices. We’ll call it crypto-tracker.

Step 1: Create the Skill Directory

Skills live in your workspace’s skills/ directory:

$ cd ~/.openclaw/workspace
$ mkdir -p skills/crypto-tracker/scripts
$ cd skills/crypto-tracker

Step 2: Write the SKILL.md

Create the instruction file:

$ cat > SKILL.md << 'EOF'
# Crypto Tracker

Get real-time cryptocurrency prices and market data.

## When to Use This Skill

Use when the user asks about:
- Current crypto prices (Bitcoin, Ethereum, etc.)
- Market cap or trading volume
- Price changes over time

## Commands

### Get current price
node scripts/get-price.js --symbol BTC

### Get multiple coins
node scripts/get-price.js --symbols BTC,ETH,SOL

### Get price in specific currency
node scripts/get-price.js --symbol BTC --currency EUR

## Examples

Bitcoin price in USD:
node scripts/get-price.js --symbol BTC

Multiple coins:
node scripts/get-price.js --symbols BTC,ETH,SOL,ADA

Price in Euros:
node scripts/get-price.js --symbol ETH --currency EUR

## Notes

- Uses free CoinGecko API (no key required)
- Supports 10,000+ cryptocurrencies
- Default currency is USD
EOF

Step 3: Build the Script

Now create the actual logic that fetches prices:

$ cat > scripts/get-price.js << 'EOF'
#!/usr/bin/env node

const https = require('https');

const args = process.argv.slice(2);
const symbolArg = args.find(a => a.startsWith('--symbol='));
const symbolsArg = args.find(a => a.startsWith('--symbols='));
const currencyArg = args.find(a => a.startsWith('--currency='));

const symbols = symbolsArg 
  ? symbolsArg.split('=')[1].split(',')
  : [symbolArg.split('=')[1]];
const currency = currencyArg ? currencyArg.split('=')[1].toLowerCase() : 'usd';

const ids = symbols.map(s => s.toLowerCase()).join(',');
const url = `https://api.coingecko.com/api/v3/simple/price?ids=${ids}&vs_currencies=${currency}&include_24hr_change=true`;

https.get(url, (res) => {
  let data = '';
  res.on('data', chunk => data += chunk);
  res.on('end', () => {
    const prices = JSON.parse(data);
    symbols.forEach(symbol => {
      const id = symbol.toLowerCase();
      if (prices[id]) {
        const price = prices[id][currency];
        const change = prices[id][`${currency}_24h_change`];
        const changeSymbol = change >= 0 ? '+' : '';
        console.log(`${symbol.toUpperCase()}: ${currency.toUpperCase()} ${price.toLocaleString()} (${changeSymbol}${change.toFixed(2)}%)`);
      } else {
        console.log(`${symbol.toUpperCase()}: Not found`);
      }
    });
  });
}).on('error', err => console.error('Error:', err.message));
EOF

Make it executable:

$ chmod +x scripts/get-price.js

Step 4: Test the Skill

Before telling your agent about it, test manually:

$ node scripts/get-price.js --symbol=bitcoin
BTC: USD 67,234 (+2.45%)

$ node scripts/get-price.js --symbols=bitcoin,ethereum,solana
BTC: USD 67,234 (+2.45%)
ETH: USD 3,456 (-1.23%)
SOL: USD 156 (+5.67%)

If it works, your skill is ready!

Step 5: Let Your Agent Use It

Now chat with your agent:

You: What's the current Bitcoin price?

The agent will:

  1. Detect this matches the crypto-tracker skill
  2. Read SKILL.md to learn how to use it
  3. Run node scripts/get-price.js --symbol=bitcoin
  4. Parse the output and respond: "Bitcoin is currently $67,234 USD, up 2.45% in the last 24 hours."

Publishing to ClawHub

Once your skill works locally, you can publish it to ClawHub so other OpenClaw users can install it.

Install the ClawHub CLI

$ npm install -g clawhub

Log in to ClawHub

$ clawhub login

This will open your browser to authenticate.

Publish Your Skill

$ cd ~/.openclaw/workspace/skills/crypto-tracker
$ clawhub publish

The CLI will guide you through:

  • Adding a version number
  • Writing a description
  • Choosing a category
  • Setting visibility (public/private)

Once published, others can install it with:

$ clawhub install crypto-tracker

Advanced Skill Patterns

Multi-File Skills

Complex skills can include multiple scripts and reference files:

skills/my-skill/
├── SKILL.md
├── scripts/
│   ├── create.js
│   ├── update.js
│   └── delete.js
├── reference/
│   ├── API-DOCS.md
│   └── examples.json
└── assets/
    └── template.yaml

Your SKILL.md can reference these files:

## API Reference

For detailed API documentation, see `reference/API-DOCS.md`.

## Templates

Use the template in `assets/template.yaml` as a starting point.

Conditional Logic

You can guide agents through decision trees:

## Workflow

1. Check if user exists:
   node scripts/check-user.js --email user@example.com

2. If user exists:
   - Update: node scripts/update-user.js --email user@example.com --name "New Name"
   
3. If user doesn't exist:
   - Create: node scripts/create-user.js --email user@example.com --name "Name"

Environment Variables

For skills that need API keys or secrets:

## Setup

Before using this skill, set your API key:

export STRIPE_API_KEY="sk_test_..."

Or add it to ~/.openclaw/workspace/.env:
STRIPE_API_KEY=sk_test_...

Best Practices

  • Be specific in descriptions — Clear triggers help agents know when to use your skill
  • Include examples — Show concrete usage patterns, not just syntax
  • Handle errors gracefully — Scripts should print helpful error messages
  • Document dependencies — List required packages or system tools
  • Version your skills — Use semantic versioning for updates
  • Test thoroughly — Try edge cases before publishing

Discovering Existing Skills

Before building a skill, check if it already exists on ClawHub:

$ clawhub search crypto
$ clawhub search "google sheets"

You can also browse at clawhub.com.

Real-World Skill Examples

Here are some skills others have built:

  • gog — Google Workspace automation (Gmail, Calendar, Sheets, Docs)
  • tmux — Remote control tmux sessions for interactive CLIs
  • weather — Get weather forecasts without API keys
  • clawhub — Search and install skills from the marketplace
  • skill-creator — Meta-skill that helps agents create new skills

Each of these packages complex functionality into simple commands that agents can use.

Frequently Asked Questions

Do I need to know programming to create skills?

Not necessarily. Simple skills can just wrap existing CLI tools. If you can write a bash script, you can create a skill. For more complex integrations, Node.js or Python knowledge helps.

Can skills call other skills?

Yes! Your SKILL.md can reference other skills. For example, a "blog publishing" skill might call the "wordpress" skill internally.

How do I update a published skill?

Make your changes locally, then run:

$ clawhub publish --version 1.1.0

Users can update with:

$ clawhub update crypto-tracker

Can I monetize skills?

Currently, ClawHub supports free and private skills. Paid skills are planned for a future release.

What languages can I use for scripts?

Any language that works on the command line: bash, Node.js, Python, Ruby, Go, etc. Just make sure scripts are executable and include proper shebangs (#!/usr/bin/env node).

How do agents know which skill to use?

OpenClaw scans all installed skills' descriptions and "when to use" sections. When a user's request matches, the agent reads the relevant SKILL.md file and follows the instructions.

Can skills modify files outside the workspace?

Technically yes, but it's discouraged. Skills should operate within the workspace for safety and portability. If system-wide changes are needed, document them clearly in SKILL.md.

Conclusion

Custom skills transform OpenClaw from a general-purpose assistant into a specialized expert for your domain. Start with simple wrappers around existing tools, then graduate to complex multi-step workflows.

The skills you build today become the foundation for more powerful automation tomorrow. And by sharing them on ClawHub, you help the entire OpenClaw community work smarter.

Ready to build your first skill? Start small, test thoroughly, and publish when you're confident. The best skills solve real problems you encounter daily.

Posted in:

Want to learn more about OpenClaw? 🦞

Join our community to get access to free support and special programs!

🎉

Welcome to the OpenClaw Community!

Check your email for next steps.