Install
openclaw skills install @jarvisyaoht/web-to-skill将企业可公开访问的在线文档(网页)一键转化为可复用的技能包(.zip)。技能包内包含统一规范的 Markdown 正文、提取的图片资源,以及基于 JSONL 格式的结构化知识索引,可直接挂载给 AI Agent 作为专属知识源使用。
openclaw skills install @jarvisyaoht/web-to-skillUse three deterministic stages. Keep every agent-created intermediate file and the final zip under the writable task directory provided by the system prompt. Run all scripts with Python 3. Do not install or upgrade packages or browser binaries at runtime.
Let <skill-dir> be the skill base directory supplied by the skill loader immediately above these instructions. Use
that directory exactly as supplied. Execute bundled scripts in place with python3 <skill-dir>/scripts/...; never copy
them into the task directory or a temporary directory.
Let <task-dir> be the writable task directory supplied by the system prompt. Use it exactly as supplied for every
intermediate artifact, model-authored JSON file, and final zip.
Always run <skill-dir>/scripts/prepare_urls.py first.
python3 <skill-dir>/scripts/prepare_urls.py \
--out <task-dir>/crawl/url-list.txt \
"https://example.com/docs"
python3 <skill-dir>/scripts/prepare_urls.py \
--out <task-dir>/crawl/url-list.txt \
"https://example.com/page-a" \
"https://example.com/page-b"
Do not manually create the URL-list file and do not run directory discovery for a batch supplied by the user.
Directory navigation uses a fixed 60-second timeout except for Yuque, which uses 120 seconds. A failed navigation is
retried once. Directory scroll passes, convergence, and any truncation reason are appended to
<task-dir>/crawl/crawl.log; they are not added to the URL-list file or the retrieval index.
For ChatWiki Docs (help.chatwiki.com), use the Docusaurus sitemap rather than the currently visible sidebar. Rebuild
sitemap paths on the supplied origin because the sitemap publishes a placeholder host, and preserve the language
selected by the supplied start URL.
For KanCloud books, read the complete summary tree from application/payload+json before using rendered catalog links.
Treat a result containing only the supplied page as a preparation failure; do not continue to build a one-page skill.
Run <skill-dir>/scripts/crawl_urls.py with the URL-list file from Stage 1.
python3 <skill-dir>/scripts/crawl_urls.py \
--url-list <task-dir>/crawl/url-list.txt \
--out-dir <task-dir>/crawl
The crawler has intentionally fixed behavior:
<task-dir>/crawl/html/.<task-dir>/crawl/index.jsonl.<task-dir>/crawl/crawl.log
created during Stage 1.Use debug mode only when validating the workflow. It processes at most the first five URLs:
python3 <skill-dir>/scripts/crawl_urls.py \
--url-list <task-dir>/crawl/url-list.txt \
--out-dir <task-dir>/crawl-debug \
--debug
Do not pass browser, concurrency, wait, retry, depth, link-scope, or timeout options. Those controls are not part of this workflow.
Never edit or delete the generated URL list, JSONL index, crawl log, or rendered HTML snapshots by hand. After crawl validation succeeds, never rerun URL preparation or crawling because a downstream stage fails. If crawl validation fails, rerun the crawler at most once without deleting artifacts; if the same error repeats, return that error instead of restarting the workflow.
Validate the completed crawl with the bundled helper:
python3 <skill-dir>/scripts/validate_crawl.py \
--index <task-dir>/crawl/index.jsonl
The helper resolves every crawl-index html_path relative to the directory containing index.jsonl, never relative to
the process working directory. It returns a bounded completion result containing the latest crawl_urls run.done
counts, a bounded failure summary, and a bounded redirect-duplicate summary. Do not open, list, print, cat, or
otherwise load crawl.log through model file tools or ad hoc commands. Use only the helper output when evaluating crawl
completion, failures, or redirect duplicates.
Run the deterministic metadata-outline helper. Do not open, list, or read index.jsonl through model file tools.
python3 <skill-dir>/scripts/metadata_outline.py \
--index <task-dir>/crawl/index.jsonl
The helper returns at most 60 compact page records. It allocates slots in proportion to each source site's successful
page count, preserves source-site coverage when the limit permits, and samples evenly within each site instead of taking
only its first pages. Use only the returned outline and exact URLs to create one UTF-8 JSON metadata file at
<task-dir>/skill-metadata.json.
Read references/metadata.md for the schema and limits. The model must provide the skill
identity and source profile; the build script does not infer them. If outline_truncated is true, describe represented
themes without claiming exhaustive index coverage. Do not infer negative coverage from topics missing in the outline.
If build validation rejects the metadata file, correct only <task-dir>/skill-metadata.json and rerun the build stage.
Do not repeat URL preparation or crawling when their validated outputs are already present.
The build stage also reads the last crawl_urls run.done event from <task-dir>/crawl/crawl.log, validates its counts
against index.jsonl, and writes a deterministic succeeded, failed, redirect-duplicate, and timeout-skipped coverage
note into the generated Skill. Model-authored coverage_notes supplement this deterministic crawl boundary and cannot
replace or hide it.
Use the metadata name value as <skill-name> and build the zip:
python3 <skill-dir>/scripts/build_skill.py \
--index <task-dir>/crawl/index.jsonl \
--metadata <task-dir>/skill-metadata.json \
--zip-out <task-dir>/generate_skill/<skill-name>.zip
The generated skill contains:
<skill-name>/
|-- SKILL.md
|-- agents/
| `-- openai.yaml
|-- references/
| |-- web-index.jsonl
| `-- html/
| `-- *.html
`-- scripts/
|-- search_index.py
`-- fetch_rendered_html.py
search_index.py is the bounded local retrieval helper. fetch_rendered_html.py fetches one current rendered page only
when the saved snapshots are insufficient or the user explicitly requests current content.
Before returning success:
status: complete with nonzero url_count and index_rows. Require
run_done.requested == url_count, run_done.succeeded == index_rows, html_paths_checked == index_rows,
failure_summary.count == run_done.failed, and duplicate_summary.count == run_done.duplicate_final_urls.status: complete, at least one outline item, and no more than 60.<task-dir>/generate_skill/<skill-name>.zip.ls or reopen the zip, index,
HTML snapshots, or crawl.log after a successful build. Inspect them only to diagnose a reported script error.