Tutorial
Skills extend OpenClaw's functionality. They can automate tasks, integrate with external APIs, and add custom commands to your AI assistant.
Understanding Skills
A skill is a package that:
- Responds to specific triggers (keywords, commands, patterns)
- Performs actions (API calls, file operations, computations)
- Returns formatted responses to the user
Skill Structure
// skill.ts
import { Skill, SkillContext, SkillResult } from '@openclaw/sdk';
export const mySkill: Skill = {
id: 'my-skill',
name: 'My Custom Skill',
description: 'Does something cool',
version: '1.0.0',
trigger: {
type: 'keyword',
keyword: '/myskill'
},
async execute(context: SkillContext): Promise {
const { input, userId } = context;
// Your skill logic here
const result = await doSomething(input);
return {
message: `Result: ${result}`,
mentions: [userId]
};
}
};
Trigger Types
- keyword: Exact match (e.g., "/weather")
- prefix: Starts with (e.g., "!")
- regex: Pattern matching
- intent: AI-detected intent
Skill Example: Weather
// weather-skill.ts
import { Skill, SkillContext, SkillResult } from '@openclaw/sdk';
export const weatherSkill: Skill = {
id: 'weather',
name: 'Weather',
description: 'Get current weather for a location',
version: '1.0.0',
trigger: {
type: 'keyword',
keyword: '/weather'
},
parameters: [
{
name: 'location',
description: 'City name',
required: true
}
],
async execute(context: SkillContext): Promise {
const location = context.params.location;
const response = await fetch(
`https://api.weather.com/v1/current?q=${location}`
).then(r => r.json());
const temp = response.main.temp;
const desc = response.weather[0].description;
return {
message: `🌤️ ${location}: ${temp}°C, ${desc}`,
mentions: [context.userId]
};
}
};
Installing Your Skill
# From npm
openclaw skills install @yourname/your-skill
# From local file
openclaw skills install ./path/to/skill
# Install via config
# config.yaml
skills:
- id: "my-skill"
path: "./skills/my-skill"
Skill Best Practices
- Keep skills focused on one responsibility
- Handle errors gracefully and return helpful messages
- Use environment variables for API keys
- Include clear descriptions for parameters
- Document usage examples in README
Publish your skill: Share useful skills with the community by publishing to npm with the
openclaw-skill keyword.
Related Articles
References
- OpenClaw Official Documentation - https://docs.openclaw.ai/ - Accessed February 2026
- OpenClaw GitHub Repository - https://github.com/openclaw/openclaw - Accessed February 2026
- OpenClaw Skills SDK - Creating Custom Skills - Accessed February 2026
- OpenClaw Skill Format Reference - SKILL.md Format - Accessed February 2026
Reference Trail
External sources surfaced from the underlying article content
- https://docs.openclaw.ai/docs.openclaw.ai
- https://github.com/openclaw/openclawgithub.com
- Creating Custom Skillsdocs.openclaw.ai
- SKILL.md Formatdocs.openclaw.ai
- Read SDK Docsdocs.openclaw.ai