> For the complete documentation index, see [llms.txt](https://www.openclawbook.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.openclawbook.xyz/en/ch29-skill-system/29.1-skill-platform-design.md). Agents can also search and read this documentation through its [MCP server](https://www.openclawbook.xyz/~gitbook/mcp).

# 29.1 Skill Platform Design

> **Generated by**: Claude Opus 4.6 (initial draft) / Claude Opus 5 (`v2026.3.9` revision) **Token usage**: Input \~400k tokens, Output \~7k tokens (this section) **Source baseline**: `v2026.3.9` (`v2026.3.8-170-g665f67726`)

***

LLMs are generalists—they can chat about anything, but master nothing. To make an Agent excel in specific domains (weather queries, GitHub operations, smart home control), you need to inject **domain knowledge and operational guidelines**. OpenClaw's Skill System is designed precisely for this: a set of hot-pluggable, self-describing, auto-discoverable Agent capability extension mechanisms.

***

## 29.1.1 What is a Skill: Hot-Pluggable Agent Capability Modules

### Design Philosophy

The core idea of skills is simple: **a Markdown file is a skill**. A skill file (typically named `SKILL.md`) contains two parts:

1. **Front Matter** (YAML header)—structured metadata: name, description, dependencies, installation methods
2. **Body**—domain knowledge for the Agent to learn: API usage, command examples, best practices

````markdown
---
name: weather
description: Get current weather and forecasts (no API key required).
metadata: { "openclaw": { "emoji": "🌤️", "requires": { "bins": ["curl"] } } }
---

# Weather

Two free services, no API keys needed.

## wttr.in (primary)

Quick one-liner:
```bash
curl -s "wttr.in/London?format=3"
````

````

When the Agent receives a user request, the system injects the content of matching skills into the system prompt. The Agent doesn't need to "call" a skill—it only needs to **read** the guidance in the skill file and then use existing tools (like `bash`) to execute operations.

> **Sidebar**: This design is fundamentally different from traditional "plugin APIs." Traditional plugins define API endpoints for programs to call; skills are "documentation" for LLMs, guiding Agent behavior through natural language. This leverages the LLM's core strength—understanding and following natural language instructions.

### Skills vs Tools

"Skills" and "Tools" in OpenClaw are different concepts:

| Dimension | Skill | Tool |
|-----------|-------|------|
| Essence | Markdown document | Executable function |
| Consumer | LLM (reads via system prompt) | LLM (invokes via function calling) |
| Extension method | Write a `.md` file | Write TypeScript code and register |
| Examples | weather, github, discord | bash, file_read, memory_search |

Skills tell the Agent **how to do** something; tools give the Agent **the ability to do** it. A weather skill tells the Agent "call wttr.in with `curl`"; the `bash` tool gives the Agent the ability to execute `curl` commands.

---

## 29.1.2 Skill Types: Bundled / Managed / Workspace / Extra

OpenClaw supports four sources of skills, ranked by priority from lowest to highest:

| Type | Directory | Source ID | Description |
|------|-----------|-----------|-------------|
| **Extra** | Configured extra directory | `openclaw-extra` | Skills provided by plugins or custom directories |
| **Bundled** | `<package>/skills/` | `openclaw-bundled` | Built-in skills distributed with OpenClaw |
| **Managed** | `~/.openclaw/skills/` | `openclaw-managed` | Skills installed via ClawHub |
| **Workspace** | `<workspace>/skills/` | `openclaw-workspace` | Project-level custom skills |

Priority is reflected as: **same-named skills, higher priority overrides lower priority**. If your project directory has a custom `weather` skill, it overrides the built-in `weather` skill.

```typescript
// src/agents/skills/workspace.ts (simplified)

const merged = new Map<string, Skill>();
// Priority: extra < bundled < managed < workspace
for (const skill of extraSkills)    merged.set(skill.name, skill);
for (const skill of bundledSkills)  merged.set(skill.name, skill);
for (const skill of managedSkills)  merged.set(skill.name, skill);
for (const skill of workspaceSkills) merged.set(skill.name, skill);
````

### Built-in Skills (Bundled)

OpenClaw ships with 52 built-in skills covering development tools, communication platforms, smart home, media processing, and more:

| Category                    | Representative Skills                     | Description                                                |
| --------------------------- | ----------------------------------------- | ---------------------------------------------------------- |
| **Development Tools**       | github, coding-agent, tmux                | Git operations, sub-Agent orchestration, terminal sessions |
| **Communication Platforms** | discord, slack, imsg, bluebubbles         | Chat platform integrations                                 |
| **Notes/Knowledge**         | obsidian, notion, bear-notes, apple-notes | Various note-taking apps                                   |
| **Smart Home**              | openhue, sonoscli                         | Hue lighting, Sonos speakers                               |
| **AI/Models**               | gemini, oracle, openai-image-gen          | Model invocation, image generation                         |
| **Media**                   | spotify-player, video-frames, camsnap     | Music, video, camera                                       |
| **Tools**                   | weather, summarize, healthcheck           | Weather, summarization, health checks                      |
| **Ecosystem**               | clawhub, skill-creator                    | Skill registry, skill creation                             |

### Built-in Skills Directory Resolution

`resolveBundledSkillsDir` locates the physical directory of built-in skills, supporting multiple installation scenarios:

```typescript
// src/agents/skills/bundled-dir.ts (simplified)

export function resolveBundledSkillsDir(): string | undefined {
  // 1. Environment variable override
  const override = process.env.OPENCLAW_BUNDLED_SKILLS_DIR;
  if (override) return override;

  // 2. Compiled binary: look for skills/ directory next to executable
  const sibling = path.join(path.dirname(process.execPath), "skills");
  if (fs.existsSync(sibling)) return sibling;

  // 3. npm/dev mode: find skills/ from package root
  const packageRoot = resolveOpenClawPackageRootSync();
  if (packageRoot) {
    const candidate = path.join(packageRoot, "skills");
    if (looksLikeSkillsDir(candidate)) return candidate;
  }

  // 4. Traverse up to 6 directory levels
  // ...
  return undefined;
}
```

`looksLikeSkillsDir` determines if a directory is a skills directory by checking for `.md` files or subdirectories containing `SKILL.md`.

***

## 29.1.3 Skill Loading and Snapshots

### Loading Process

`loadSkillEntries` is the core function for skill loading. It loads skills from four sources, parses Front Matter, and extracts metadata:

```typescript
// src/agents/skills/workspace.ts (simplified)

function loadSkillEntries(workspaceDir, opts?): SkillEntry[] {
  // 1. Load raw Skill objects from various sources
  const bundledSkills  = loadSkillsFromDir({ dir: bundledSkillsDir, source: "openclaw-bundled" });
  const managedSkills  = loadSkillsFromDir({ dir: managedSkillsDir, source: "openclaw-managed" });
  const workspaceSkills = loadSkillsFromDir({ dir: workspaceSkillsDir, source: "openclaw-workspace" });
  const extraSkills    = extraDirs.flatMap(dir => loadSkillsFromDir({ dir, source: "openclaw-extra" }));

  // 2. Merge by priority (same-named overrides)
  const merged = new Map<string, Skill>();
  // ... extra < bundled < managed < workspace

  // 3. Parse Front Matter and metadata for each skill
  return Array.from(merged.values()).map(skill => {
    const raw = fs.readFileSync(skill.filePath, "utf-8");
    const frontmatter = parseFrontmatter(raw);
    return {
      skill,
      frontmatter,
      metadata: resolveOpenClawMetadata(frontmatter),
      invocation: resolveSkillInvocationPolicy(frontmatter),
    };
  });
}
```

Each `SkillEntry` contains four layers of information:

```typescript
type SkillEntry = {
  skill: Skill;                        // Basic info: name, description, filePath, baseDir
  frontmatter: ParsedSkillFrontmatter; // Raw Front Matter key-value pairs
  metadata?: OpenClawSkillMetadata;    // Parsed OpenClaw-specific metadata
  invocation?: SkillInvocationPolicy;  // Invocation policy
};
```

### Eligibility Filtering

Not all loaded skills are activated. `shouldIncludeSkill` implements multi-dimensional eligibility checks:

```typescript
// src/agents/skills/config.ts (simplified)

export function shouldIncludeSkill(params: { entry, config, eligibility }): boolean {
  // 1. Configuration disable check
  if (skillConfig?.enabled === false) return false;

  // 2. Built-in skill allowlist check
  if (!isBundledSkillAllowed(entry, allowBundled)) return false;

  // 3. Operating system compatibility check
  if (osList.length > 0 && !osList.includes(process.platform)) return false;

  // 4. always flag: unconditional activation
  if (entry.metadata?.always === true) return true;

  // 5. Required binary check (exists in PATH)
  for (const bin of requiredBins) {
    if (!hasBinary(bin)) return false;
  }

  // 6. Any binary check (at least one required)
  if (requiredAnyBins.length > 0 && !requiredAnyBins.some(bin => hasBinary(bin))) return false;

  // 7. Environment variable check
  for (const envName of requiredEnv) {
    if (!process.env[envName] && !skillConfig?.env?.[envName]) return false;
  }

  // 8. Configuration path check
  for (const configPath of requiredConfig) {
    if (!isConfigPathTruthy(config, configPath)) return false;
  }

  return true;
}
```

This is why users who install OpenClaw only see skills matching their environment—users without the `gh` CLI won't see the `github` skill, and users without a Discord Token won't see the `discord` skill.

### Skill Snapshots

A skill snapshot (`SkillSnapshot`) is a static representation of all active skills at a given moment, used for injection into the Agent's system prompt:

```typescript
// src/agents/skills/types.ts

export type SkillSnapshot = {
  prompt: string;                                    // Formatted skill prompt
  skills: Array<{ name: string; primaryEnv?: string }>; // List of active skills
  resolvedSkills?: Skill[];                          // Complete Skill objects
  version?: number;                                  // Snapshot version (for caching)
};
```

`buildWorkspaceSkillSnapshot` builds the snapshot through: loading → filtering → excluding skills with `disableModelInvocation` → calling `formatSkillsForPrompt` to generate prompt text.

### Skill Command Specs

Each skill can also be registered as a slash command (`/weather`, `/github`), allowing users to invoke it directly. `buildWorkspaceSkillCommandSpecs` generates command specs for each invocable skill:

```typescript
// src/agents/skills/workspace.ts (simplified)

function buildWorkspaceSkillCommandSpecs(workspaceDir, opts?): SkillCommandSpec[] {
  const eligible = filterSkillEntries(entries, config);
  const userInvocable = eligible.filter(e => e.invocation?.userInvocable !== false);

  return userInvocable.map(entry => ({
    name: sanitizeSkillCommandName(entry.skill.name), // lowercase+underscore, ≤32 chars
    skillName: entry.skill.name,
    description: entry.skill.description,
    dispatch: resolveCommandDispatch(entry),           // Optional deterministic dispatch
  }));
}
```

Command names are processed by `sanitizeSkillCommandName` (keeping only `[a-z0-9_]`) and uniqueness is ensured by `resolveUniqueSkillCommandName`. A skill's Front Matter can specify deterministic dispatch via `command-dispatch: tool` + `command-tool: <toolName>`—meaning the command bypasses LLM reasoning and directly invokes the specified tool.

***

## Section Summary

1. **Skills are essentially Markdown documents**, declaring metadata via Front Matter and providing domain knowledge in the body, which guides Agent behavior when injected into the system prompt.
2. **Four sources** ranked by priority: Extra < Bundled < Managed < Workspace, with higher-priority same-named skills overriding lower-priority ones.
3. **Eligibility filtering** checks eight dimensions: configuration disable, allowlist, OS compatibility, `always` flag, required binaries, environment variables, configuration paths—ensuring only skills matching the current environment are activated.
4. **Skill snapshots** are static representations of active skills, with `formatSkillsForPrompt` formatting them as part of the system prompt.
5. **52 built-in skills** cover development, communication, smart home, media, and other domains, with each skill file being self-contained for easy understanding and extension.
