Skip to content

Turn any technical book PDF into a Claude Code skill — ready to study, reference, and use while you work.

feat(hosts): add OpenClaw skill discovery and validation (#209)

Hossein Rahimi526f36255256
diff --git a/README.md b/README.md
index d25326e..a39fa72 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
</p>
<p align="center">
- <strong>Turn any technical book, document folder, or collection of sources into a unified agent skill — ready to study, reference, and use while you work in GitHub Copilot CLI, Amp, Claude Code, or Hermes Agent.</strong>
+ <strong>Turn any technical book, document folder, or collection of sources into a unified agent skill — ready to study, reference, and use while you work in GitHub Copilot CLI, Amp, Claude Code, Hermes Agent, or OpenClaw.</strong>
</p>
<p align="center">
@@ -67,13 +67,13 @@ The usual workarounds don't help:
Once installed, you just type `/your-book-slug replication` and the agent reads the right chapter and answers from the actual content. No hallucination. No digging through PDFs. The book becomes part of your workflow.
-Works with any host that supports the open [Agent Skills](https://github.com/agentskills/agentskills) standard — GitHub Copilot CLI, Amp, Claude Code, and Hermes Agent all read the same `SKILL.md` format.
+Works with any host that supports the open [Agent Skills](https://github.com/agentskills/agentskills) standard — GitHub Copilot CLI, Amp, Claude Code, Hermes Agent, and OpenClaw all read the same `SKILL.md` format.
---
## 📦 What it generates
-Running `/book-to-skill your-book.pdf` (or a folder, glob, or list of files) creates a full skill in the user-level cross-agent skills directory `~/.agents/skills/<slug>/` — one copy that Copilot CLI, Amp, and Codex discover natively; when run under Claude Code, the converter also attempts a verified symlink at `~/.claude/skills/<slug>/` — Claude Code sees the skill when the link read-back confirms it; otherwise the run report says so. Hermes Agent partitions its personal skills by category and does not scan the cross-agent root, so a Hermes install lands in `$HERMES_HOME/skills/<category>/<slug>/` instead (host-private and project-local destinations remain available on request):
+Running `/book-to-skill your-book.pdf` (or a folder, glob, or list of files) creates a full skill in the user-level cross-agent skills directory `~/.agents/skills/<slug>/` — one copy that Copilot CLI, Amp, and Codex discover natively; OpenClaw also discovers it when using its default state directory. With a non-default `OPENCLAW_STATE_DIR`, use the active state's `skills/` root or a workspace/extra directory instead. When run under Claude Code, the converter also attempts a verified symlink at `~/.claude/skills/<slug>/` — Claude Code sees the skill when the link read-back confirms it; otherwise the run report says so. Hermes Agent partitions its personal skills by category and does not scan the cross-agent root, so a Hermes install lands in `$HERMES_HOME/skills/<category>/<slug>/` instead. OpenClaw-managed and project-local destinations remain available when explicitly requested:
| File | Purpose | Size |
|------|---------|------|
@@ -137,6 +137,7 @@ npx skills add virgiliojr94/book-to-skill
git clone https://github.com/virgiliojr94/book-to-skill.git ~/.claude/skills/book-to-skill
# (Copilot CLI: ~/.copilot/skills/ · Amp/cross-agent: ~/.agents/skills/)
# (Hermes Agent: ${HERMES_HOME:-$HOME/.hermes}/skills/<category>/)
+# (OpenClaw: ${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/; ~/.agents/skills/ only with default state)
```
📥 **All hosts, optional extractors, and the standalone CLI → [docs/install.md](docs/install.md)**
diff --git a/README.ru.md b/README.ru.md
index 35adbbe..7df037e 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -16,7 +16,7 @@
> Чтобы увидеть drift: `git log 903d102..master -- README.md`
<p align="center">
- <strong>Превратите любую техническую книгу, папку документов или набор источников в единый agent skill — чтобы изучать, ссылаться и использовать в GitHub Copilot CLI, Amp, Claude Code или Hermes Agent.</strong>
+ <strong>Превратите любую техническую книгу, папку документов или набор источников в единый agent skill — чтобы изучать, ссылаться и использовать в GitHub Copilot CLI, Amp, Claude Code, Hermes Agent или OpenClaw.</strong>
</p>
<p align="center">
@@ -71,13 +71,13 @@
После установки: `/your-book-slug replication` — агент читает нужную главу и отвечает из текста. Без галлюцинаций и копания в PDF.
-Работает с хостами open [Agent Skills](https://github.com/agentskills/agentskills) — GitHub Copilot CLI, Amp, Claude Code и Hermes Agent (общий формат `SKILL.md`).
+Работает с хостами open [Agent Skills](https://github.com/agentskills/agentskills) — GitHub Copilot CLI, Amp, Claude Code, Hermes Agent и OpenClaw (общий формат `SKILL.md`).
---
## 📦 Что получается
-`/book-to-skill your-book.pdf` (или folder/glob) создаёт skill в директории skills агента (`~/.copilot/skills/<slug>/`, `~/.agents/skills/<slug>/`, `~/.claude/skills/<slug>/` или `$HERMES_HOME/skills/<category>/<slug>/` для Hermes Agent):
+`/book-to-skill your-book.pdf` (или folder/glob) создаёт skill в директории skills агента (`~/.copilot/skills/<slug>/`, `~/.agents/skills/<slug>/`, `~/.claude/skills/<slug>/`, `$HERMES_HOME/skills/<category>/<slug>/` для Hermes Agent, или `${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/<slug>/` для OpenClaw):
| File | Purpose | Size |
|------|---------|------|
@@ -141,6 +141,7 @@ npx skills add virgiliojr94/book-to-skill
git clone https://github.com/virgiliojr94/book-to-skill.git ~/.claude/skills/book-to-skill
# (Copilot: ~/.copilot/skills/ · Amp: ~/.agents/skills/)
# (Hermes Agent: ${HERMES_HOME:-$HOME/.hermes}/skills/<category>/)
+# (OpenClaw: ${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/; ~/.agents/skills/ только в состоянии по умолчанию)
```
📥 **Все хосты → [docs/install.md](docs/install.md)**
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 8d8e67b..22de269 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -15,7 +15,7 @@
> 查看差异:`git log 907be50..master -- README.md`
<p align="center">
- <strong>将任意技术书籍、文档文件夹或资料集合,转换为统一的 Agent Skill——可在 GitHub Copilot CLI、Amp、Claude Code 或 Hermes Agent 中随时学习、查阅并在工作中使用。</strong>
+ <strong>将任意技术书籍、文档文件夹或资料集合,转换为统一的 Agent Skill——可在 GitHub Copilot CLI、Amp、Claude Code、Hermes Agent 或 OpenClaw 中随时学习、查阅并在工作中使用。</strong>
</p>
<p align="center">
@@ -71,13 +71,13 @@
安装后,输入 `/your-book-slug replication`,Agent 会读取对应章节,基于实际内容回答。没有幻觉,不用翻 PDF。书成为你工作流的一部分。
-兼容任何支持开放 [Agent Skills](https://github.com/agentskills/agentskills) 标准的宿主 —— GitHub Copilot CLI、Amp、Claude Code 和 Hermes Agent 都读取相同的 `SKILL.md` 格式。
+兼容任何支持开放 [Agent Skills](https://github.com/agentskills/agentskills) 标准的宿主 —— GitHub Copilot CLI、Amp、Claude Code、Hermes Agent 和 OpenClaw 都读取相同的 `SKILL.md` 格式。
---
## 📦 生成内容
-运行 `/book-to-skill your-book.pdf`(或文件夹、glob、文件列表)后,会在 Agent 的 skills 目录下生成完整 skill(Copilot CLI:`~/.copilot/skills/<slug>/`;Amp 或跨 Agent:`~/.agents/skills/<slug>/`;Claude Code:`~/.claude/skills/<slug>/`;Hermes Agent:`$HERMES_HOME/skills/<category>/<slug>/`):
+运行 `/book-to-skill your-book.pdf`(或文件夹、glob、文件列表)后,会在 Agent 的 skills 目录下生成完整 skill(Copilot CLI:`~/.copilot/skills/<slug>/`;Amp 或跨 Agent:`~/.agents/skills/<slug>/`;Claude Code:`~/.claude/skills/<slug>/`;Hermes Agent:`$HERMES_HOME/skills/<category>/<slug>/`;OpenClaw:`${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/<slug>/`):
| 文件 | 用途 | 大小 |
|------|------|------|
@@ -140,6 +140,7 @@ npx skills add virgiliojr94/book-to-skill
git clone https://github.com/virgiliojr94/book-to-skill.git ~/.claude/skills/book-to-skill
# (Copilot CLI:~/.copilot/skills/ · Amp/跨 Agent:~/.agents/skills/)
# (Hermes Agent:${HERMES_HOME:-$HOME/.hermes}/skills/<category>/)
+# (OpenClaw:${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/;~/.agents/skills/ 仅限默认状态)
```
📥 **所有宿主、可选提取器与独立 CLI → [docs/install.md](docs/install.md)**
diff --git a/SKILL.md b/SKILL.md
index a2aa4d3..6cc3955 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -1,6 +1,6 @@
---
name: book-to-skill
-description: "Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, plain text, RTF, MOBI/AZW with Calibre) into structured agent skills, extracting frameworks, mental models, principles, techniques, and anti-patterns. Use when the user wants to study a document through GitHub Copilot CLI, Amp, Claude Code, or Hermes Agent, apply an author's frameworks while working, or build a reusable knowledge base from a file."
+description: "Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, plain text, RTF, MOBI/AZW with Calibre) into structured agent skills, extracting frameworks, mental models, principles, techniques, and anti-patterns. Use when the user wants to study a document through GitHub Copilot CLI, Amp, Claude Code, Hermes Agent, or OpenClaw, apply an author's frameworks while working, or build a reusable knowledge base from a file."
---
<!--
@@ -8,7 +8,9 @@ Cross-agent notes (informational; ignored by host agents):
- Compatible skill roots: GitHub Copilot CLI (~/.copilot/skills, ~/.agents/skills,
.github/skills, .claude/skills, .agents/skills), Amp (.agents/skills,
~/.config/agents/skills, ~/.config/amp/skills), Claude Code (~/.claude/skills),
- Hermes Agent ($HERMES_HOME/skills, .hermes/skills, .agents/skills).
+ Hermes Agent ($HERMES_HOME/skills, .hermes/skills, .agents/skills),
+ OpenClaw (${OPENCLAW_STATE_DIR:-~/.openclaw}/skills, .agents/skills, skills/;
+ ~/.agents/skills only with the default state).
- `allowed-tools` is intentionally omitted to stay agent-neutral: Copilot CLI uses
`shell`/MCP-server names, Claude uses `Bash`/`Read`/`Write`/`Glob`/`Grep`, Amp
adds `shell_command`. The skill needs shell (to run extract.py) and file
@@ -22,7 +24,7 @@ Transform written knowledge into actionable agent skills by extracting structure
## Philosophy
-Books contain crystallized expertise: frameworks, principles, and techniques that took years to develop. This skill extracts that knowledge into a format GitHub Copilot CLI, Amp, Claude Code, Hermes Agent, or another compatible agent can leverage repeatedly.
+Books contain crystallized expertise: frameworks, principles, and techniques that took years to develop. This skill extracts that knowledge into a format GitHub Copilot CLI, Amp, Claude Code, Hermes Agent, OpenClaw, or another compatible agent can leverage repeatedly.
**Extract structure, not summaries.** A skill isn't a book report. It's a toolkit of:
- Named frameworks (mental models with clear application)
@@ -68,17 +70,19 @@ Four paths available. Route based on what the user asks:
This converter can run from multiple skill systems. When looking for this converter's helper script or writing the generated book skill, prefer these locations in order:
1. GitHub Copilot CLI personal skills: `~/.copilot/skills/`
-2. Cross-agent personal skills (Copilot, Amp, Codex): `~/.agents/skills/`
+2. Cross-agent personal skills (Copilot, Amp, Codex; OpenClaw with its default state): `~/.agents/skills/`
3. Claude Code personal skills: `~/.claude/skills/`
4. Project-local Copilot skills: `.github/skills/`
5. Project-local Claude skills: `.claude/skills/`
-6. Project-local Amp / Copilot skills: `.agents/skills/`
+6. Project-local Amp / Copilot / OpenClaw skills: `.agents/skills/`
7. Amp global skills: `~/.config/agents/skills/`
8. Amp legacy global skills: `~/.config/amp/skills/`
9. Hermes Agent personal skills: `$HERMES_HOME/skills/` (defaults to `~/.hermes/skills/`)
10. Hermes Agent project skills: `.hermes/skills/` or `.agents/skills/`
+11. OpenClaw personal skills: `${OPENCLAW_STATE_DIR:-~/.openclaw}/skills/` (active state; `~/.agents/skills/` is shared only with the default state)
+12. OpenClaw project skills: `.agents/skills/` or `skills/`
-For **generated** book skills, prefer the user-level cross-agent root `~/.agents/skills/` — one physical copy serves every supported host. Copilot CLI and Amp discover it natively; Claude Code needs a symlink from `~/.claude/skills/<skill_name>` (created in Step 10, see Step 5 for the rules). Pick a host-private or project-local root only when the user explicitly asks for one. `BOOK_TO_SKILL_SCOPE=project` or `personal` can make that choice explicit for automation; do not ask a mandatory scope question merely because both scopes are available.
+For **generated** book skills, prefer the user-level cross-agent root `~/.agents/skills/` — one physical copy serves the cross-agent hosts and OpenClaw when it uses its default state. Copilot CLI and Amp discover it natively; Claude Code needs a symlink from `~/.claude/skills/<skill_name>` (created in Step 10, see Step 5 for the rules). Pick a host-private or project-local root only when the user explicitly asks for one. `BOOK_TO_SKILL_SCOPE=project` or `personal` can make that choice explicit for automation; do not ask a mandatory scope question merely because both scopes are available.
---
@@ -134,6 +138,7 @@ Run the extraction script, passing the input paths:
```bash
SCRIPT_PATH=""
HERMES_HOME_RESOLVED="${HERMES_HOME:-$HOME/.hermes}"
+OPENCLAW_STATE_DIR_RESOLVED="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)"
HERMES_PROJECT_TRUSTED=false
if [ -n "$PROJECT_ROOT" ] && [ "${HERMES_AGENT:-}" = true ] && \
@@ -148,6 +153,13 @@ CANDIDATES=(
"$HOME/.copilot/skills/book-to-skill/scripts/extract.py"
"$HOME/.agents/skills/book-to-skill/scripts/extract.py"
"$HOME/.claude/skills/book-to-skill/scripts/extract.py"
+ "${OPENCLAW_STATE_DIR_RESOLVED}/skills/book-to-skill/scripts/extract.py"
+ "${OPENCLAW_STATE_DIR_RESOLVED}/skills"/*/book-to-skill/scripts/extract.py
+ "${OPENCLAW_STATE_DIR_RESOLVED}/skills"/*/*/book-to-skill/scripts/extract.py
+ "${OPENCLAW_STATE_DIR_RESOLVED}/skills"/*/*/*/book-to-skill/scripts/extract.py
+ "${OPENCLAW_STATE_DIR_RESOLVED}/skills"/*/*/*/*/book-to-skill/scripts/extract.py
+ "${OPENCLAW_STATE_DIR_RESOLVED}/skills"/*/*/*/*/*/book-to-skill/scripts/extract.py
+ "${OPENCLAW_STATE_DIR_RESOLVED}/skills"/*/*/*/*/*/*/book-to-skill/scripts/extract.py
"$HERMES_HOME_RESOLVED/skills/book-to-skill/scripts/extract.py"
"$HERMES_HOME_RESOLVED"/skills/*/book-to-skill/scripts/extract.py
)
@@ -156,7 +168,25 @@ if [ "${HERMES_AGENT:-}" != true ]; then
".github/skills/book-to-skill/scripts/extract.py"
".claude/skills/book-to-skill/scripts/extract.py"
".agents/skills/book-to-skill/scripts/extract.py"
+ "skills/book-to-skill/scripts/extract.py"
+ "skills"/*/book-to-skill/scripts/extract.py
+ "skills"/*/*/book-to-skill/scripts/extract.py
+ "skills"/*/*/*/book-to-skill/scripts/extract.py
+ "skills"/*/*/*/*/book-to-skill/scripts/extract.py
+ "skills"/*/*/*/*/*/book-to-skill/scripts/extract.py
+ "skills"/*/*/*/*/*/*/book-to-skill/scripts/extract.py
)
+ if [ -n "$PROJECT_ROOT" ]; then
+ CANDIDATES+=(
+ "$PROJECT_ROOT/skills/book-to-skill/scripts/extract.py"
+ "$PROJECT_ROOT/skills"/*/book-to-skill/scripts/extract.py
+ "$PROJECT_ROOT/skills"/*/*/book-to-skill/scripts/extract.py
+ "$PROJECT_ROOT/skills"/*/*/*/book-to-skill/scripts/extract.py
+ "$PROJECT_ROOT/skills"/*/*/*/*/book-to-skill/scripts/extract.py
+ "$PROJECT_ROOT/skills"/*/*/*/*/*/book-to-skill/scripts/extract.py
+ "$PROJECT_ROOT/skills"/*/*/*/*/*/*/book-to-skill/scripts/extract.py
+ )
+ fi
fi
CANDIDATES+=(
"$HOME/.config/agents/skills/book-to-skill/scripts/extract.py"
@@ -347,16 +377,21 @@ Choose the destination skill root (`SKILLS_HOME`). First resolve **scope** from
| **OpenAI Codex** | `~/.agents/skills` (discovered natively; follows symlinks) | `.agents/skills` |
| **Hermes Agent** | `$HERMES_HOME/skills/<category>` (defaults to `~/.hermes/skills/<category>`) | `.hermes/skills/<category>` → `.agents/skills` |
| **Claude Code** | `~/.agents/skills` + symlink from `~/.claude/skills/<skill_name>` | `.claude/skills` |
+| **OpenClaw** | `${OPENCLAW_STATE_DIR:-~/.openclaw}/skills` (active state; `~/.agents/skills` only with default state) | `.agents/skills` → `skills/` |
Hermes Agent is the one host that keeps its own personal root: it partitions personal skills by category and does not scan the cross-agent root. Use the active profile's `HERMES_HOME` and choose a category that matches the generated skill's subject. Do not construct profile paths manually. If the user selects a project-local Hermes root, run `hermes skills trust <project-root>` after generation and verify discovery with `hermes skills list`; project skills remain unavailable until the project is trusted.
+For OpenClaw, use the active state directory's `skills/` root: `${OPENCLAW_STATE_DIR:-~/.openclaw}/skills/`. The shared `~/.agents/skills` compatibility root is discoverable only when `OPENCLAW_STATE_DIR` is unset or the default `~/.openclaw`; with a non-default state, do not claim that OpenClaw will see a shared-root install. Verify discovery with `openclaw skills list` after generation.
+
Selection rules:
1. Personal install: set `SKILLS_HOME` to `~/.agents/skills` (create the directory if missing). One exception, so the default does not invent a convention in someone else's house: if `~/.agents/skills` does not exist **and** the host's private root already contains skills, use the private root instead and say why in the report.
2. **Claude Code does not scan `~/.agents/skills`** — after generation completes, Step 10 links the skill in with `ln -sfn "$HOME/.agents/skills/<skill_name>" "$HOME/.claude/skills/<skill_name>"`.
3. **Hermes Agent personal installs use the Hermes row above**, not the cross-agent root, and take no symlink.
4. If the user explicitly asks for a host-private root (`~/.copilot/skills`, `~/.claude/skills`, `~/.config/agents/skills`, `~/.config/amp/skills`), honor it and skip the symlink.
5. If the user explicitly asked for project-local output, use the project-local row for their host.
-6. If the choice requires knowing the host (project-local output, the Hermes personal root, or the Claude Code symlink) and you cannot identify it, ask: "Which agent are you running this in — Hermes Agent, GitHub Copilot CLI, Amp, Codex, or Claude Code?"
+6. If the choice requires knowing the host (project-local output, the Hermes personal root, the OpenClaw state root, or the Claude Code symlink) and you cannot identify it, ask: "Which agent are you running in — OpenClaw, Hermes Agent, GitHub Copilot CLI, Amp, Codex, or Claude Code?"
+7. For OpenClaw personal output, use `${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills`. The shared `~/.agents/skills` root is a valid OpenClaw destination only when `OPENCLAW_STATE_DIR` is unset or equals the default `$HOME/.openclaw`; otherwise use the active state root or a project/extra directory.
+8. If the user explicitly asks for an OpenClaw-managed personal root, use the active state root and verify discovery with `openclaw skills list`.
Set `SKILLS_HOME` to the selected root and check if `$SKILLS_HOME/<skill_name>/` already exists. On Claude Code, also check whether `~/.claude/skills/<skill_name>` exists as a **real directory** (not a symlink) — a previous install may live there; if so, offer to migrate it (move the directory into `~/.agents/skills/` and replace the original path with the symlink) before continuing.
If the skill already exists, prompt the user to choose:
@@ -682,6 +717,7 @@ Reload (if your agent doesn't auto-detect new skills):
Claude Code: restart the session
Amp: restart the session
Hermes Agent: start a new session
+ OpenClaw: openclaw skills list (new session if watcher disabled)
Share this skill (optional):
GitHub repo, installable on any host (Step 11): say "publish"
diff --git a/docs/architecture.md b/docs/architecture.md
index 98b4aef..94bc416 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -41,9 +41,11 @@ document into clean text + metadata; the agent turns that into a structured skil
~/.copilot/skills/ GitHub Copilot CLI (personal)
~/.agents/skills/ Copilot CLI or Amp (cross-agent, personal)
~/.claude/skills/ Claude Code (personal)
+ ~/.openclaw/skills/ OpenClaw (personal, default state only)
$HERMES_HOME/skills/<category>/ Hermes Agent (personal)
.github/skills/ | .claude/skills/ | .agents/skills/ project-local (any host)
.hermes/skills/<category>/ Hermes project-local
+ skills/ OpenClaw workspace
scope: personal vs project-local (Step 5, BOOK_TO_SKILL_SCOPE)
SKILL.md core frameworks + chapter & topic index (~4K)
chapters/*.md on-demand, loaded only when asked
@@ -52,6 +54,11 @@ document into clean text + metadata; the agent turns that into a structured skil
cheatsheet.md decision rules / trees / trade-offs / tells
```
+OpenClaw's shared `~/.agents/skills` compatibility root is discoverable only
+when `OPENCLAW_STATE_DIR` is unset or uses the default `~/.openclaw`. A
+non-default state uses its active `<state-dir>/skills` root instead; the
+converter does not infer arbitrary `skills.load.extraDirs`.
+
## Design principles
1. **Extract structure, not summaries** — named frameworks, decision rules,
@@ -76,7 +83,7 @@ document into clean text + metadata; the agent turns that into a structured skil
| `book_to_skill/dependencies.py` | optional-dependency probing + `--check` |
| `book_to_skill/sanitize.py` | strips zero-width / Unicode-tag-block characters from extracted text (see Security) |
| `tools/discovery_tax.py` | measures token cost vs context-dump / discovery loop |
-| `tools/validate_skill.py` | checks a generated SKILL.md against host rules (`--lens claude\|copilot\|amp\|hermes`) |
+| `tools/validate_skill.py` | checks a generated SKILL.md against host rules (`--lens claude\|copilot\|amp\|hermes\|openclaw`) |
| `tools/scan_generated_skill.py` | advisory prompt-injection scan of a generated skill (see Security) |
| `SKILL.md` | the generator spec (Steps 0–10 + fold-in workflow) |
diff --git a/docs/how-it-works.md b/docs/how-it-works.md
index 52997d5..ee75db5 100644
--- a/docs/how-it-works.md
+++ b/docs/how-it-works.md
@@ -41,6 +41,9 @@ scripts/extract.py <paths…> --mode <technical|text>
~/.claude/skills/<slug>/ (symlink → above, attempted under
Claude Code and verified by
read-back; report states the result)
+ ${OPENCLAW_STATE_DIR:-~/.openclaw}/skills/<slug>/ (OpenClaw active
+ state; shared ~/.agents/skills works
+ only with the default state)
$HERMES_HOME/skills/<category>/<slug>/
(Hermes Agent: its own personal root,
not the cross-agent one, no symlink)
diff --git a/docs/index.md b/docs/index.md
index 294dae3..683a35b 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -1,5 +1,5 @@
---
-description: "Turn any book, PDF or EPUB into a structured agent skill for Claude Code, GitHub Copilot CLI, Amp and Hermes Agent. Named frameworks and decision rules, loaded on demand."
+description: "Turn any book, PDF or EPUB into a structured agent skill for Claude Code, GitHub Copilot CLI, Amp, Hermes Agent and OpenClaw. Named frameworks and decision rules, loaded on demand."
seo_title: "book-to-skill - Turn Any Book Into an AI Agent Skill"
hide:
- navigation
@@ -13,7 +13,7 @@ hide:
"name": "book-to-skill",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Linux, macOS, Windows",
- "description": "Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, RTF, MOBI/AZW) into structured, on-demand agent skills for Claude Code, GitHub Copilot CLI, Amp and Hermes Agent.",
+ "description": "Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, RTF, MOBI/AZW) into structured, on-demand agent skills for Claude Code, GitHub Copilot CLI, Amp, Hermes Agent and OpenClaw.",
"url": "https://booktoskill.is-a.dev/",
"codeRepository": "https://github.com/virgiliojr94/book-to-skill",
"license": "https://opensource.org/licenses/MIT",
@@ -63,14 +63,14 @@ Turn any book or document into a structured, on-demand agent skill — named fra
---
- One `SKILL.md` runs on Claude Code, GitHub Copilot CLI, Amp, and Hermes Agent
+ One `SKILL.md` runs on Claude Code, GitHub Copilot CLI, Amp, Hermes Agent, and OpenClaw
through the open Agent Skills standard.
</div>
## Install
-**As an agent skill** (gives you the `/book-to-skill` command in Claude Code, Copilot CLI, Amp, or Hermes Agent):
+**As an agent skill** (gives you the `/book-to-skill` command in Claude Code, Copilot CLI, Amp, Hermes Agent, or OpenClaw):
```bash
npx skills add virgiliojr94/book-to-skill
diff --git a/docs/install.md b/docs/install.md
index 7c1f49c..1f7b201 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -1,12 +1,12 @@
---
-description: "Install book-to-skill as an agent skill for Claude Code, GitHub Copilot CLI, Amp, Codex and Hermes Agent, or as a standalone pip CLI. Every host path and optional extractor covered."
-seo_title: "Install book-to-skill - Claude Code, Copilot CLI, Amp, Hermes, or pip"
+description: "Install book-to-skill as an agent skill for Claude Code, GitHub Copilot CLI, Amp, Codex, Hermes Agent and OpenClaw, or as a standalone pip CLI. Every host path and optional extractor covered."
+seo_title: "Install book-to-skill - Claude Code, Copilot CLI, Amp, Hermes, OpenClaw, or pip"
---
## 📥 Install
> **Two ways to use it, do not confuse them:**
-> - **As an agent skill** (the `/book-to-skill` command in Claude Code, Copilot CLI, Amp, Codex, or Hermes Agent) → **`git clone` into your skills folder** (below). This is what gives you the slash command and the full convert-a-book flow.
+> - **As an agent skill** (the `/book-to-skill` command in Claude Code, Copilot CLI, Amp, Codex, Hermes Agent, or OpenClaw) → **`git clone` into your skills folder** (below). This is what gives you the slash command and the full convert-a-book flow.
> - **As a standalone CLI** (just the text extractor) → `pip install` it from the repository, then `book-to-skill --help`. This does **not** register the agent skill; it only installs the extraction engine. See [the CLI section](#standalone-cli-pip).
The skill follows the open [Agent Skills](https://github.com/agentskills/agentskills) standard, so a single install works for any compatible host.
@@ -40,6 +40,22 @@ git clone https://github.com/virgiliojr94/book-to-skill.git ~/.agents/skills/boo
ln -s /path/to/book-to-skill ~/.agents/skills/book-to-skill
```
+**OpenClaw**:
+
+```bash
+git clone https://github.com/virgiliojr94/book-to-skill.git "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/book-to-skill"
+# Shared cross-agent path; OpenClaw discovers this only with the default state:
+# git clone https://github.com/virgiliojr94/book-to-skill.git ~/.agents/skills/book-to-skill
+```
+
+OpenClaw discovers skills under the active state directory's `skills/` root, `<workspace>/skills/book-to-skill`, and explicitly configured `skills.load.extraDirs` (up to 6 grouping levels). The shared `~/.agents/skills` compatibility root is discovered only when `OPENCLAW_STATE_DIR` is unset or uses the default `~/.openclaw`; a non-default state does not index that home-scoped root. Verify with `openclaw skills list` — it watches `SKILL.md` by default. Grouped layouts like `${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/skills/group/subgroup/book-to-skill` also work.
+
+The converter probes the active OpenClaw state root and workspace `skills/` layouts, including flat and grouped paths up to six grouping levels. It does not infer arbitrary `skills.load.extraDirs`; if you configure extra directories, verify the resulting path explicitly with `openclaw skills list`.
+
+```bash
+openclaw skills list
+```
+
**Hermes Agent**:
```bash
diff --git a/tests/test_openclaw_host_support.py b/tests/test_openclaw_host_support.py
new file mode 100644
index 0000000..ee1407e
--- /dev/null
+++ b/tests/test_openclaw_host_support.py
@@ -0,0 +1,107 @@
+"""OpenClaw host-discovery contract in the converter spec."""
+
+import os
+from pathlib import Path
+import subprocess
+
+import pytest
+
+
+ROOT = Path(__file__).resolve().parent.parent
+SKILL = (ROOT / "SKILL.md").read_text(encoding="utf-8")
+
+
+def _extract_probe_script():
+ start = SKILL.index('SCRIPT_PATH=""')
+ end = SKILL.index('\nif [ -z "$SCRIPT_PATH" ]', start)
+ return SKILL[start:end] + '\nprintf "%s" "$SCRIPT_PATH"\n'
+
+
+def _probe_env(home, state_dir=None):
+ env = os.environ.copy()
+ home_text = home.resolve().as_posix()
+ if os.name == "nt":
+ home_text = "/" + home_text[0].lower() + home_text[2:]
+ env.update({"HOME": home_text})
+ if state_dir is None:
+ env.pop("OPENCLAW_STATE_DIR", None)
+ else:
+ state_text = state_dir.resolve().as_posix()
+ if os.name == "nt":
+ state_text = "/" + state_text[0].lower() + state_text[2:]
+ env["OPENCLAW_STATE_DIR"] = state_text
+ env.pop("HERMES_AGENT", None)
+ env.pop("HERMES_HOME", None)
+ return env
+
+
+def _host_path(path_text):
+ path_text = path_text.strip()
+ if (
+ os.name == "nt"
+ and len(path_text) >= 3
+ and path_text[0] == "/"
+ and path_text[2] == "/"
+ ):
+ path_text = path_text[1].upper() + ":" + path_text[2:]
+ return Path(path_text)
+
+
+ "layout",
+ [
+ "personal-flat",
+ "personal-grouped",
+ "personal-deep",
+ "personal-custom-state",
+ "workspace-flat",
+ "workspace-grouped",
+ "workspace-deep",
+ ],
+)
+ os.name == "nt",
+ reason="the probe uses POSIX Bash path semantics; the same cases run in Ubuntu CI",
+)
+def test_openclaw_extractor_probe_discovers_supported_layouts(tmp_path, layout):
+ home = tmp_path / "home"
+ project = tmp_path / "project"
+ project.mkdir()
+ nested = project / "src" / "nested"
+ nested.mkdir(parents=True)
+ subprocess.run(["git", "init", "-q"], cwd=project, check=True)
+
+ roots = {
+ "personal-flat": home / ".openclaw" / "skills" / "book-to-skill",
+ "personal-grouped": home / ".openclaw" / "skills" / "group" / "subgroup" / "book-to-skill",
+ "personal-deep": home / ".openclaw" / "skills" / "one" / "two" / "three" / "four" / "five" / "six" / "book-to-skill",
+ "personal-custom-state": tmp_path / "custom-openclaw-state" / "skills" / "book-to-skill",
+ "workspace-flat": project / "skills" / "book-to-skill",
+ "workspace-grouped": project / "skills" / "group" / "subgroup" / "book-to-skill",
+ "workspace-deep": project / "skills" / "one" / "two" / "three" / "four" / "five" / "six" / "book-to-skill",
+ }
+ extractor = roots[layout] / "scripts" / "extract.py"
+ extractor.parent.mkdir(parents=True)
+ extractor.touch()
+
+ state_dir = roots[layout].parents[1] if layout == "personal-custom-state" else None
+ result = subprocess.run(
+ ["bash", "-c", _extract_probe_script()],
+ cwd=nested,
+ env=_probe_env(home, state_dir=state_dir),
+ check=True,
+ capture_output=True,
+ text=True,
+ )
+ selected = _host_path(result.stdout)
+ if not selected.is_absolute():
+ selected = nested / selected
+ assert selected.resolve() == extractor.resolve()
+
+
+def test_openclaw_host_layouts_are_documented():
+ assert "${OPENCLAW_STATE_DIR:-~/.openclaw}/skills" in SKILL
+ assert "skills/book-to-skill/scripts/extract.py" in SKILL
+ assert "openclaw skills list" in SKILL
+ assert "OPENCLAW_STATE_DIR" in SKILL
+ assert "~/.agents/skills` only with default state" in SKILL
diff --git a/tests/test_validate_skill.py b/tests/test_validate_skill.py
index 84d2571..4a6e60d 100644
--- a/tests/test_validate_skill.py
+++ b/tests/test_validate_skill.py
@@ -35,6 +35,39 @@ def test_hermes_lens_accepts_standard_skill(tmp_path):
assert errors == []
+def test_openclaw_lens_accepts_openclaw_metadata(tmp_path):
+ p = tmp_path / "SKILL.md"
+ p.write_text(
+ "---\n"
+ "name: openclaw-skill\n"
+ "description: A test skill.\n"
+ "homepage: https://example.com/skill\n"
+ "user-invocable: true\n"
+ "disable-model-invocation: false\n"
+ "command-dispatch: tool\n"
+ "command-tool: example\n"
+ "command-arg-mode: raw\n"
+ "metadata:\n"
+ " openclaw:\n"
+ " emoji: book\n"
+ "---\n\n# Body\n",
+ encoding="utf-8",
+ )
+ errors, warns = validate_skill.audit(str(p), lens="openclaw")
+ assert errors == []
+ assert not [warning for warning in warns if "frontmatter" in warning]
+
+
+def test_openclaw_lens_rejects_underscore_identifiers(tmp_path):
+ p = tmp_path / "SKILL.md"
+ p.write_text(
+ "---\nname: invalid_skill\ndescription: A test skill.\n---\n\n# Body\n",
+ encoding="utf-8",
+ )
+ errors, _ = validate_skill.audit(str(p), lens="openclaw")
+ assert any("name:" in error for error in errors)
+
+
def test_hermes_lens_recognizes_hermes_metadata(tmp_path):
p = tmp_path / "SKILL.md"
p.write_text(
diff --git a/tools/validate_skill.py b/tools/validate_skill.py
index e17759b..303b779 100644
--- a/tools/validate_skill.py
+++ b/tools/validate_skill.py
@@ -10,6 +10,7 @@ Lenses:
copilot — GitHub Copilot CLI rules
amp — Sourcegraph Amp rules
hermes — Hermes Agent rules
+ openclaw — OpenClaw rules
The SKILL.md format itself is an open standard
(https://github.com/agentskills/agentskills) — `name` + `description` are the
@@ -22,10 +23,11 @@ Refs:
https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices
Copilot https://docs.github.com/en/copilot/concepts/agents/about-agent-skills
https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-skills
- Amp https://ampcode.com/manual#skills
- Hermes https://hermes-agent.nousresearch.com/docs/user-guide/features/skills
+ Amp https://ampcode.com/manual#skills
+ Hermes https://hermes-agent.nousresearch.com/docs/user-guide/features/skills
+ OpenClaw https://docs.openclaw.ai/tools/skills
-Usage: python3 tools/validate_skill.py [--lens claude|copilot|amp|hermes] [path/to/SKILL.md]
+Usage: python3 tools/validate_skill.py [--lens claude|copilot|amp|hermes|openclaw] [path/to/SKILL.md]
"""
import argparse
import re
@@ -103,6 +105,21 @@ LENSES = {
"lowercase letters/digits/hyphens/dots/underscores and start with a letter or digit"
),
},
+ "openclaw": {
+ "label": "OpenClaw",
+ "tools": set(),
+ "recognized_keys": {
+ "name", "description", "allowed-tools", "license", "metadata",
+ "homepage", "user-invocable", "disable-model-invocation",
+ "command-dispatch", "command-tool", "command-arg-mode",
+ },
+ "reserved_name_words": set(),
+ "bash_tool_names": set(),
+ "unknown_tool_severity": "warn",
+ "enforces_allowed_tools": False,
+ "name_pattern": r"[a-z0-9][a-z0-9-]*",
+ "name_charset": "lowercase letters/digits/hyphens and start with a letter or digit",
+ },
}