Convert building-code PDFs and regulations into auditable, searchable AI skills with indexed clauses, preserved legal wording, structured tables, and cross-standard references.
The fastest way to install a skill directly from the registry.
npx clawhub@latest install code-to-skill
Copy the skill folder to one of these locations
~/.openclaw/skills/ <project>/skills/ Priority: Workspace > Local > Bundled
Copy this prompt to OpenClaw to install it automatically.
Help me install code-to-skill using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).
Get the raw skill files in a ZIP archive.
Code-to-Skill transforms architectural standards, Chinese GB specifications, industry procedures, and legal regulations into structured, queryable AI skills. Instead of summarizing regulatory text, it indexes every numbered clause by trigger conditions, requirement type, keywords, and related provisions.
The workflow preserves the original force of regulatory language, including mandatory, recommended, permitted, and prohibited wording such as 应, 宜, 可, 不应, and 不得. It also extracts decision-making tables into JSON, generates Markdown for agent-readable documentation, and builds cross-reference maps for connected standards. Openclaw Skills users can use the generated skill for design review, compliance research, and targeted clause lookup without loading an entire regulation into context.
Install the required PDF extraction dependency before using the converter:
openclaw skills install book-to-skill
Locate the shared extraction script in the workspace or supported agent skill directories, then run it against the regulation PDF:
python3 <path-to-extract.py> <path-to-regulation.pdf> --mode text --install-missing ask
The extractor produces a working directory containing book_skill_work/full_text.txt and metadata.json. Confirm the extracted metadata before generating the skill. The expected invocation is:
code-to-skill <path-to-regulation.pdf> [regulation-slug]
For OpenClaw, generated skills are placed under <workspace>/skills/<REGULATION_SLUG>/. Create the output directories when needed:
mkdir -p "$SKILLS_HOME/<REGULATION_SLUG>/clauses"
mkdir -p "$SKILLS_HOME/<REGULATION_SLUG>/tables"
After generation, run the shared scanner from the book-to-skill installation:
python3 <book-to-skill-directory>/tools/scan_generated_skill.py <generated-regulation-skill-directory>
Clean temporary extraction artifacts after validation:
rm -rf /tmp/book_skill_work
The skill is also designed to work with compatible roots used by GitHub Copilot CLI and Claude Code, including ~/.agents/skills and ~/.claude/skills. A valid source PDF is required; a regulation number alone is not sufficient.
The generated regulation skill follows a predictable, retrieval-oriented file taxonomy:
| Path | Purpose |
|---|---|
SKILL.md |
Master metadata, usage instructions, clause index, chapter overview, force distribution, table index, references, and limitations. |
clause-index.md |
Complete index of numbered clauses, topics, force levels, and trigger keywords. |
clauses/chNN-*.md |
Chapter-grouped clause files containing verbatim regulatory text and metadata. |
tables/<table-id>.md |
Human-readable table with source, applicability, references, notes, and usage guidance. |
tables/<table-id>.json |
Programmatic table representation for structured queries and downstream automation. |
cross-refs.md |
Internal clause links, external standard references, and optional inbound references. |
mandatory-map.md |
Matrix of mandatory, prohibited, recommended, and permitted requirements. |
terminology.md |
Definitions and terminology extracted from the regulation. |
supplements/ |
Optional local-standard additions and documented differences. |
version-history.md |
Optional record of revisions and edition changes. |
Each clause records its source number, original text, force level, trigger conditions, related clauses, linked tables, and searchable keywords. Force labels distinguish 应 or 必须 as Shall, 不应 as Shall Not, 不得 or 严禁 as Must Not, 宜 as Should, 不宜 as Should Not, and 可 as May. Explanatory notes are stored separately and explicitly marked as non-mandatory guidance.
Table JSON uses fields such as table_id, description, source, columns, rows, referenced_by, notes, and units. Regulation metadata includes the regulation identifier, edition, issuing authority, explanatory-note availability, intended use case, scope, estimated size, clause count, table count, and external standards cited.
Loading
Toolbelt gives AI agents a shared, queryable workspace for documents, structured data, entities, relationships, and persistent findings.

Turn historical battles and military conflicts into rigorously researched, single-screen mobile PNG briefings with tactical analysis and source citations.

An evidence-first Openclaw Skills workflow that transforms arXiv literature into validated field intelligence, technical options, maturity assessments, and actionable decisions.

AI Tech Insight Compass turns daily AI trend research into source-backed, publication-ready technical articles.

A source-grounded consulting delivery workflow that transforms scattered client inputs into validated storylines, executive presentations, strategy documents, and speaker scripts.

An implementation workflow that isolates code changes, validates them, commits and pushes the result, and opens a draft GitHub pull request.








































