# Skills

A skill is domain knowledge the model loads on demand: one directory containing a `SKILL.md`.

```
---
name: my-skill
description: One line saying when to use it — the model matches on this sentence.
---

The body is free-form markdown: procedures, rule checklists, examples...
```

Front matter is a `key: value` YAML subset. A long value can continue on indented lines after `>-` or `|`. A directory missing `name` or `description` is skipped. The model matches on `description`.

## How it loads

1. At startup each skill directory is scanned for `<slug>/SKILL.md`.
2. Every name and description goes into a skills block in the system prompt; the agentic runtime's `<available_skills>` also carries each file's absolute path.
3. When a task matches, the model loads the full file with the `skill` tool. The text is never injected automatically.

A skill executes nothing itself. Scripts, references and data beside it run through `bash` or `execute_code`.

## Lookup paths

Later and more local wins on a name collision. The system prompt, CLI and slash commands use the same four.

| Source | Path |
| --- | --- |
| Remote cache | `~/.openprogram/cache/skills/` |
| Plugin | [Plugins](https://fzkuji.github.io/OpenProgram/docs/capabilities/plugins.html) |
| User | `~/.openprogram/skills/` |
| Project | `<cwd>/skills/` |

OpenProgram ships no default skills; product workflows are Programs.

## Use in chat

| Typed | Effect |
| --- | --- |
| `/<name>` | Inserts the skill's body |
| `/skill <name> [request]` | Runs one turn. The model reads the file before your request; the conversation shows what you typed. `allowed-tools` limits that turn. An unknown, ambiguous or blocked name gets a reply and no turn runs. |

## Routines

Tell the agent "save this as a routine", "do this every Monday at 9", or "from now on do it like this". Its `save_routine` tool writes `~/.openprogram/skills/routines/<name>/SKILL.md`:

- a one-line description, so it recognizes the next request;
- the steps actually taken, repeatable without the original conversation;
- your corrections, as rules that win over the steps.

| Aspect | Behaviour |
| --- | --- |
| Schedule | If asked, a repeating [reminder that wakes the agent](https://fzkuji.github.io/OpenProgram/docs/capabilities/reminders.html) in the same conversation. Each run starts "Run the saved routine `routines/<name>`". The save reply gives the next run. |
| Correct | "Leave out the bot accounts next time", during a run or after. Saving under the same name rewrites that skill with the correction and keeps the schedule; earlier corrections stay. |
| Manage | An ordinary skill: `openprogram skills list`, `/skill <name>`, or edit or delete the file. Pause or cancel the schedule on **Tasks** → **Scheduled**, or ask. |
| Who | Only the owner, or an agent working for the owner, can schedule one. |

## Commands

| Command | Effect |
| --- | --- |
| `openprogram skills list` | Discovered skills by source |
| `openprogram skills doctor` | Scan directories for problems |
| `openprogram skills search <q>` | Search discovery sources (ClawHub by default) |
| `openprogram skills install <spec>` | A slug (ClawHub), `clawhub:<slug>` or `github:owner/repo`. `--source`: `clawhub://`, a GitHub repo or a JSON index. |
| `openprogram skills update --all` | Compare `SKILL.md` hashes with upstream and re-pull stale ones, or pass one name |
| `openprogram skills remove <slug>` | Project, user or remote-cache only |

[Plugins](https://fzkuji.github.io/OpenProgram/docs/capabilities/plugins.html)
