Building AI Skills
Updated: 3/2/2026Official
Building AI Skills
OpenClaw Skills are reusable, modular units of functionality that can be combined to create powerful AI agents.
What Are Skills?
Skills can:
- Execute system commands
- Make HTTP requests
- Process and analyze data
- Integrate with external APIs
- Interact with databases
Skill Structure
A basic skill consists of:
export const skill = {
name: 'my-skill',
description: 'A helpful skill',
execute: async (context) => {
// Your skill logic here
return { result: 'success' };
}
};
Creating Your First Skill
Let's create a simple skill that fetches weather information:
export const weatherSkill = {
name: 'weather',
description: 'Get current weather for a location',
parameters: {
location: {
type: 'string',
description: 'The city name',
required: true
}
},
execute: async (context) => {
const { location } = context.parameters;
const response = await fetch(
`https://api.openweathermap.org/data/2.5/weather?q=${location}&appid=YOUR_API_KEY`
);
const data = await response.json();
return {
location: data.name,
temperature: data.main.temp,
description: data.weather[0].description
};
}
};
Registering Your Skill
To use your skill, register it in your OpenClaw configuration:
{
"skills": {
"mySkills": {
"enabled": true,
"skills": [
"./skills/weather.ts"
]
}
}
}