Creating Your First Skill

Complete step-by-step tutorial to build a custom OpenClaw skill from scratch

This tutorial will guide you through creating your first OpenClaw skill. We'll build a simple but practical skill that demonstrates the core concepts. By the end, you'll understand how to create, test, and share skills. Estimated time: 20-30 minutes.

๐Ÿ“š Reference: For complete skill structure, advanced features, and all available tools, see the Skills Reference Guide.

What We'll Build

We'll create a Random Quote Skill that:

  • Provides inspirational quotes when asked
  • Demonstrates basic skill structure
  • Shows how to use built-in tools
  • Can be easily extended later

This is a simple example, but it covers all the fundamentals you need to build more complex skills.

Prerequisites

Before starting, ensure you have:

  • OpenClaw installed and running - Complete the Getting Started Tutorial first
  • A channel connected - Follow the Channel Setup Tutorial
  • Basic text editor - Any editor works (nano, VS Code, etc.)
  • Access to your workspace - Default location is ~/.openclaw/workspace
  • To install an existing skill with a generated script, use the Setup Wizard (Add a skill)

Step 1: Plan Your Skill

Before writing code, let's plan what our skill will do:

Skill Purpose

Random Quote Skill will:

  • Respond when users ask for quotes, inspiration, or motivation
  • Provide a random quote from a predefined list
  • Be simple enough to understand, but extensible

What Tools Do We Need?

For this skill, we'll use OpenClaw's built-in capabilities. We don't need external APIs - we'll store quotes in the skill file itself. This keeps it simple for learning.

๐Ÿ’ก Advanced Skills: More complex skills can use external APIs, file operations, or custom tools. See the Skills Reference for advanced patterns.

Step 2: Create Skill Directory

Skills are stored in your workspace. Let's create the directory structure:

Create Skill Directory
mkdir -p ~/.openclaw/workspace/skills/random-quote

Directory structure: Skills are organized as ~/.openclaw/workspace/skills/<skill-name>/. The skill name should be lowercase with hyphens (kebab-case).

โœ… Workspace Location: Your workspace is typically at ~/.openclaw/workspace, but you can check or change it in your configuration. See the Configuration Reference for details.

Step 3: Create the Skill File

Every skill needs a SKILL.md file. This is a Markdown file that defines your skill.

Step 3.1: Create SKILL.md

Create the skill file in your skill directory:

Create Skill File
touch ~/.openclaw/workspace/skills/random-quote/SKILL.md
# or open in your editor:
code ~/.openclaw/workspace/skills/random-quote/SKILL.md

Step 3.2: Write the Skill Content

Open SKILL.md and add the following content:

SKILL.md Content
# Random Quote Skill

## Description
Provides inspirational and motivational quotes when users ask for quotes, inspiration, or motivation. 
This skill demonstrates basic skill structure and can be extended with more quotes or API integration.

## Tools
This skill uses OpenClaw's built-in capabilities to select and return quotes. No external tools required.

## Instructions
When the user asks for:
- A quote
- Inspiration
- Motivation
- A random quote
- Something uplifting

Respond with a random quote from the following list, formatted nicely:

1. "The only way to do great work is to love what you do." - Steve Jobs
2. "Innovation distinguishes between a leader and a follower." - Steve Jobs
3. "Life is what happens to you while you're busy making other plans." - John Lennon
4. "The future belongs to those who believe in the beauty of their dreams." - Eleanor Roosevelt
5. "It is during our darkest moments that we must focus to see the light." - Aristotle
6. "The only impossible journey is the one you never begin." - Tony Robbins
7. "In the middle of difficulty lies opportunity." - Albert Einstein
8. "Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill

Vary your responses and make them feel natural. You can add context or commentary to the quote if appropriate.

## Examples
- User: "Give me a quote"
  Response: "Here's an inspiring quote for you: 'The only way to do great work is to love what you do.' - Steve Jobs"

- User: "I need some motivation"
  Response: "Here's something to inspire you: 'The future belongs to those who believe in the beauty of their dreams.' - Eleanor Roosevelt"

- User: "Random quote please"
  Response: "Here's a quote: 'In the middle of difficulty lies opportunity.' - Albert Einstein"

Save the file after adding this content.

Understanding the Skill Structure

Let's break down what each section does:

  • Description - What your skill does (used by OpenClaw to understand when to use it)
  • Tools - What capabilities your skill uses (can be built-in or external APIs)
  • Instructions - How OpenClaw should use this skill (triggers, behavior, examples)
  • Examples - Concrete examples of how the skill should work

Step 4: Enable Your Skill

Now we need to tell OpenClaw about your new skill. There are two ways to do this:

Method A: Ask OpenClaw (Easiest)

Simply ask OpenClaw to enable your skill via your connected channel:

  • "Enable the random-quote skill"
  • "Use the random-quote skill"
  • "Activate random-quote"

OpenClaw will automatically detect and enable the skill!

Method B: Manual Configuration

Alternatively, add it to your configuration file:

Enable Skill in Config
{
  "agent": {
    "model": "anthropic/claude-opus-4-6"
  },
  "skills": {
    "enabled": ["random-quote"]
  }
}

After adding to config, restart your Gateway for changes to take effect.

Step 5: Test Your Skill

Now let's test that your skill works!

Step 5.1: Send Test Messages

Via your connected channel (Telegram, WhatsApp, etc.), try asking:

  • "Give me a quote"
  • "I need inspiration"
  • "Random quote please"
  • "Motivate me"

Step 5.2: Verify Response

OpenClaw should respond with a quote from your skill. If it does, congratulations - your skill is working! ๐ŸŽ‰

โœ… Success Indicators:
  • OpenClaw responds with quotes from your list
  • Quotes vary between requests
  • Responses feel natural and contextual

Step 6: Improve Your Skill (Optional)

Now that your basic skill works, here are ways to enhance it:

Add More Quotes

Expand your quote list in the Instructions section. Add quotes from your favorite authors, speakers, or sources.

Add Categories

You could extend the skill to support categories:

  • "Give me a motivational quote"
  • "Quote about success"
  • "Inspirational quote"

Update the Instructions section to handle these variations.

Integrate External API

For a more advanced version, you could:

  • Use a quotes API (like quotable.io or similar)
  • Add a tool that fetches quotes from the web
  • Store quotes in a database

See the Skills Reference for examples of skills using external APIs and tools.

Troubleshooting

Skill Not Working

If OpenClaw doesn't use your skill:

  1. Check file location: Ensure SKILL.md is in ~/.openclaw/workspace/skills/random-quote/SKILL.md
  2. Verify skill is enabled: Check your configuration or ask OpenClaw to list enabled skills
  3. Check file format: Ensure it's valid Markdown and the structure is correct
  4. Restart Gateway: Sometimes a restart is needed to load new skills

Skill Not Triggering

If the skill doesn't activate when you ask for quotes:

  • Review your Instructions section - are the triggers clear?
  • Try more explicit requests like "use the random-quote skill"
  • Check that the Description mentions quotes/inspiration

Wrong Responses

If OpenClaw responds but not with quotes:

  • Make your Instructions more specific
  • Add more examples to clarify expected behavior
  • Ensure the skill description clearly states its purpose

Next Steps

Congratulations on creating your first skill! Here's what to explore next:

๐Ÿ”ง Build More Skills

Create skills for your specific needs and workflows.

Skills Reference โ†’

๐Ÿ“ค Share Your Skill

Publish your skill to ClawHub for the community.

ClawHub.ai โ†’

โšก Learn Automation

Combine skills with automation for powerful workflows.

Automation Tutorial โ†’

Advanced Skill Patterns

Once you're comfortable with basic skills, explore these advanced patterns:

  • API Integration - Connect to external services and APIs
  • File Operations - Read and write files on the system
  • Database Access - Store and retrieve data
  • Complex Tools - Create custom tools with multiple parameters
  • Conditional Logic - Skills that adapt based on context

Browse the ClawHub skills registry to see examples of advanced skills created by the community.

Continue Learning