> 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.2-skill-structure.md). Agents can also search and read this documentation through its [MCP server](https://www.openclawbook.xyz/~gitbook/mcp).

# 29.2 Skill Structure

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

***

The previous section introduced the overall architecture of the skill system. This section dives deeper into the concrete specification of skill files—what each Front Matter field means, how built-in skills are organized, and the design philosophy behind several representative skills.

***

## 29.2.1 SKILL.md File Specification

### File Structure

Each skill is a directory containing a `SKILL.md` file (or a skill can also be a standalone `.md` file). Typical structure:

```
skills/
├── weather/
│   └── SKILL.md
├── github/
│   └── SKILL.md
├── discord/
│   ├── SKILL.md
│   └── (possible auxiliary files)
```

### Front Matter Fields

The YAML Front Matter of `SKILL.md` defines the skill's metadata. Using the `github` skill as an example:

```yaml
---
name: github
description: "Interact with GitHub using the `gh` CLI."
metadata:
  {
    "openclaw":
      {
        "emoji": "🐙",
        "requires": { "bins": ["gh"] },
        "install":
          [
            { "id": "brew", "kind": "brew", "formula": "gh", "bins": ["gh"] },
            { "id": "apt", "kind": "apt", "package": "gh", "bins": ["gh"] },
          ],
      },
  }
---
```

Complete field reference:

| Field                      | Type    | Required | Description                                                       |
| -------------------------- | ------- | -------- | ----------------------------------------------------------------- |
| `name`                     | string  | Yes      | Unique skill identifier                                           |
| `description`              | string  | Yes      | Skill description (≤100 chars, for command hints)                 |
| `homepage`                 | string  | No       | Skill homepage URL                                                |
| `user-invocable`           | boolean | No       | Whether users can invoke via slash command (default `true`)       |
| `disable-model-invocation` | boolean | No       | Whether to prevent injection into system prompt (default `false`) |
| `command-dispatch`         | string  | No       | Command dispatch method (`tool` for deterministic dispatch)       |
| `command-tool`             | string  | No       | Tool to invoke for deterministic dispatch                         |
| `metadata`                 | JSON5   | No       | OpenClaw-specific metadata (see below)                            |

### OpenClaw Metadata (metadata.openclaw)

The `metadata` field contains a JSON5 object with an `openclaw` key for OpenClaw-specific skill configuration:

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

export type OpenClawSkillMetadata = {
  always?: boolean;         // Unconditional activation (skip all eligibility checks)
  skillKey?: string;        // Skill config key (defaults to name)
  primaryEnv?: string;      // Primary environment variable name (e.g., DISCORD_TOKEN)
  emoji?: string;           // Display emoji
  homepage?: string;        // Homepage URL
  os?: string[];            // Supported operating systems ["darwin", "linux"]
  requires?: {
    bins?: string[];        // Required binaries (all needed)
    anyBins?: string[];     // At least one of these binaries needed
    env?: string[];         // Required environment variables
    config?: string[];      // Required config paths (e.g., "browser.enabled")
  };
  install?: SkillInstallSpec[];  // Installation specs (multiple methods)
};
```

`requires` is the core of skill eligibility filtering—it declares external dependencies needed for the skill to run. The system checks these dependencies at startup and automatically hides skills that don't meet them.

### Installation Specs (SkillInstallSpec)

The `install` array defines how to install the skill's external dependencies, supporting five installer types:

```typescript
export type SkillInstallSpec = {
  id?: string;              // Installation option identifier
  kind: "brew" | "node" | "go" | "uv" | "download";
  label?: string;           // User-visible installation description
  bins?: string[];          // Binaries that should exist after installation
  os?: string[];            // Operating systems this installer applies to
  formula?: string;         // brew: Homebrew formula name
  package?: string;         // node/uv: package name
  module?: string;          // go: module path
  url?: string;             // download: download URL
  archive?: string;         // download: archive format
  extract?: boolean;        // download: whether to extract
  targetDir?: string;       // download: target directory
};
```

A single skill can provide multiple installation methods. For example, the `github` skill supports both `brew install gh` and `apt install gh`—the system chooses the most appropriate method based on user preference and available package managers.

### Front Matter Parsing

`parseFrontmatter` extracts the YAML header from a Markdown file, and `resolveOpenClawMetadata` extracts OpenClaw metadata from it:

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

export function resolveOpenClawMetadata(
  frontmatter: ParsedSkillFrontmatter,
): OpenClawSkillMetadata | undefined {
  const raw = frontmatter["metadata"];
  if (!raw) return undefined;

  const parsed = JSON5.parse(raw);
  // Try to extract metadata from "openclaw" key (and compatible keys)
  const metadataRaw = parsed["openclaw"] ?? parsed["clawdbot"] ?? parsed["claude-code"];

  return {
    always: metadataRaw.always,
    emoji: metadataRaw.emoji,
    primaryEnv: metadataRaw.primaryEnv,
    requires: metadataRaw.requires ? {
      bins: normalizeStringList(metadataRaw.requires.bins),
      anyBins: normalizeStringList(metadataRaw.requires.anyBins),
      env: normalizeStringList(metadataRaw.requires.env),
      config: normalizeStringList(metadataRaw.requires.config),
    } : undefined,
    install: metadataRaw.install?.map(parseInstallSpec).filter(Boolean),
  };
}
```

Note the compatibility handling—the code attempts to read metadata from multiple possible key names (`openclaw`, `clawdbot`, `claude-code`), a compatibility layer preserved from OpenClaw's evolution from other projects.

***

## 29.2.2 Built-in Skills Directory Analysis

### 52 Built-in Skills

OpenClaw's `skills/` directory contains 52 built-in skills. Categorized by functional domain:

**Development and Code**

* `github` — GitHub CLI operations (PRs, Issues, CI)
* `coding-agent` — Sub-Agent orchestration (Codex, Claude Code, Pi)
* `tmux` — Terminal multiplexer operations
* `session-logs` — Session log viewing

**Communication and Social**

* `discord` — Discord message read/write
* `slack` — Slack channel operations
* `imsg` / `bluebubbles` — iMessage integration
* `himalaya` — Email client

**Notes and Knowledge Management**

* `obsidian` — Obsidian vault operations
* `notion` — Notion page management
* `bear-notes` — Bear notes
* `apple-notes` / `apple-reminders` — macOS native apps

**Smart Home**

* `openhue` — Philips Hue lighting control
* `sonoscli` — Sonos speaker system

**AI and Models**

* `gemini` — Google Gemini API
* `oracle` — High-quality reasoning model consultation
* `openai-image-gen` — DALL-E image generation
* `openai-whisper` / `openai-whisper-api` — Speech-to-text

**Media and Creation**

* `spotify-player` — Spotify playback control
* `video-frames` — Video frame extraction
* `camsnap` — Camera snapshots
* `canvas` — Canvas drawing

**Utility Tools**

* `weather` — Weather queries
* `summarize` — Text summarization
* `healthcheck` — Service health checks
* `model-usage` — Model usage statistics
* `blogwatcher` — Blog monitoring

**Ecosystem**

* `clawhub` — Skill registry CLI
* `skill-creator` — Skill creation wizard

### Skill Complexity Spectrum

Built-in skills span the complete spectrum from minimal to complex:

| Level   | Skill          | SKILL.md Lines | Characteristics                                        |
| ------- | -------------- | -------------- | ------------------------------------------------------ |
| Minimal | `weather`      | \~55 lines     | Single `curl` command, no API key                      |
| Simple  | `github`       | \~100 lines    | Single CLI tool with multiple commands                 |
| Medium  | `discord`      | \~200 lines    | Requires API Token + multiple endpoints                |
| Complex | `coding-agent` | \~300 lines    | Orchestrates external Agent processes, PTY interaction |

***

## 29.2.3 Representative Skill Analysis

### weather: A Minimal, Clean Example

`weather` is one of the simplest skills—it demonstrates the pure form of "skill as documentation":

```yaml
metadata: { "openclaw": { "emoji": "🌤️", "requires": { "bins": ["curl"] } } }
```

The only dependency is `curl` (present on nearly all Unix-like systems). The body provides usage for two weather services (wttr.in and Open-Meteo), including specific `curl` commands and formatting parameters. After reading this content, when a user asks "What's the weather in Beijing today?", the Agent knows to execute `curl -s "wttr.in/Beijing?format=3"`.

### github: Standard CLI Integration Pattern

The `github` skill demonstrates how to integrate a mature CLI tool:

```yaml
metadata:
  openclaw:
    emoji: "🐙"
    requires: { bins: ["gh"] }
    install:
      - { id: "brew", kind: "brew", formula: "gh", bins: ["gh"] }
      - { id: "apt", kind: "apt", package: "gh", bins: ["gh"] }
```

Key design decisions:

1. **Multiple installation methods**: macOS users can `brew install gh`, Linux users can use `apt`
2. **Structured body**: Organized by functionality (PRs, Issues, CI), with most common commands for each
3. **Caveats**: Reminds the Agent to use `--repo owner/repo` when outside a Git directory

### coding-agent: Complex Interaction Scenarios

`coding-agent` is one of the most complex built-in skills—it guides the Agent on how to launch and manage other coding Agents (like Codex, Claude Code):

```yaml
metadata:
  openclaw:
    emoji: "🧩"
    requires: { anyBins: ["claude", "codex", "opencode", "pi"] }
```

Note `anyBins` instead of `bins`—only one of these coding Agent CLIs needs to be installed. The body details:

* Why PTY mode is necessary (coding Agents are interactive terminal applications)
* Background execution and session management
* Tool parameters (`command`, `pty`, `workdir`, `background`)
* Process Tool operations (`poll`, `log`, `write`, `kill`)

### clawhub: Ecosystem Self-Bootstrapping

The `clawhub` skill embodies an interesting "self-bootstrapping" design—it's a skill whose function is to manage other skills:

```yaml
metadata:
  openclaw:
    requires: { bins: ["clawhub"] }
    install:
      - { id: "node", kind: "node", package: "clawhub", bins: ["clawhub"] }
```

Through the `clawhub` skill, the Agent learns how to search, install, and update skills. When a user says "I need a skill to manage Trello", the Agent executes `clawhub search "trello"`, finds and installs the appropriate skill.

***

## 29.2.4 Skill Invocation Policy

Each skill has two invocation control switches, set via Front Matter:

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

export type SkillInvocationPolicy = {
  userInvocable: boolean;          // Whether invocable via /command
  disableModelInvocation: boolean; // Whether to prevent system prompt injection
};
```

Four combinations:

| userInvocable | disableModelInvocation | Effect                                                         |
| :-----------: | :--------------------: | -------------------------------------------------------------- |
|     `true`    |         `false`        | **Default**: Agent auto-discovers + user can manually invoke   |
|     `true`    |         `true`         | **User-only**: No prompt injection, only slash command trigger |
|    `false`    |         `false`        | **Auto-only**: Agent auto-discovers, but no slash command      |
|    `false`    |         `true`         | **Fully disabled**: Neither prompt injection nor command       |

`disableModelInvocation` is useful for operations requiring explicit user intent (like sending messages to Slack), preventing the Agent from acting on its own initiative.

***

## Section Summary

1. **SKILL.md specification** includes YAML Front Matter (metadata) and Markdown body (domain knowledge), declaring dependencies, installation methods, and special behaviors via `metadata.openclaw`.
2. **Five installer types** (brew/node/go/uv/download) cover mainstream package managers and direct download scenarios, with a single skill able to offer multiple installation options.
3. **52 built-in skills** span from minimal (weather, 55 lines) to complex (coding-agent, 300+ lines), covering development, communication, smart home, media, and other domains.
4. **Invocation policy** uses two booleans (`userInvocable` and `disableModelInvocation`) to control skill triggering, balancing automation with user control.
5. **Self-bootstrapping design**: `clawhub` is a skill for managing skills, `skill-creator` is a skill for creating skills—the skill system extends itself using its own mechanisms.
