claude-skills/engineering/book-to-skill/commands
Claude b19c40cf95
feat(engineering): add book-to-skill — compile documents into knowledge-base skills
Derived from virgiliojr94/book-to-skill (MIT). Compiles a book, docs folder, or
spec collection (PDF, EPUB, DOCX, HTML, Markdown, RST, AsciiDoc, RTF, MOBI/AZW)
into an agent skill: a resident master SKILL.md (core frameworks + chapter index
+ topic index, capped at 4k tokens) plus on-demand chapter files, a glossary, a
patterns file, and a decision cheatsheet.

The extraction library (scripts/book_to_skill/, 12 modules incl. 7 per-format
parsers) is vendored close to verbatim and keeps upstream's format chains,
chapter detection across Latin/Roman/Chinese/Thai/Korean heading styles,
invisible-Unicode (Trojan Source) sanitization, and the DOCX entity guard.

12 numbered deviations recorded in the plugin README (authoritative list):

- No implicit installs: --install-missing defaults to `report`, printing the pip
  command and using the stdlib fallback, where upstream prompts on a TTY and
  installs into the caller's environment.
- Rights gate: emitting a shareable package refuses without --rights from
  public-domain|open-license|internal-docs|author-permission. `fair-use` is
  deliberately excluded — a defence, not a licence.
- Validator merged and extended: upstream's two validators become one four-family
  gate, adding budget (token caps) and index (dead chapter links, unindexed
  chapters, dangling topic refs) — the failure that silently breaks navigation
  while the skill still looks complete.
- Folded YAML scalars now parse, so a wrapped description no longer under-reports
  its length past the 1024-char cap.
- token_budget_estimator replaces discovery_tax: tiktoken path dropped for one
  deterministic estimator, post-flight budget audit added, plus an explicit
  worth-converting verdict that says "just read it" below ~3x the compiled size.
- Two PRIV-ESC criticals fixed: upstream install hints contained a literal
  `sudo apt install`; they now name the package manager without escalating.

Repo-native addition with no upstream counterpart — Step 11 / /cs:book-to-plugin:
upstream stops at a bare ~/.claude/skills folder this library cannot route to.
skill_plugin_emitter.py wraps a compiled skill as a full plugin package (manifest
+ cs-<slug> agent + /cs:<slug> command + README) and prints the marketplace entry
without editing marketplace.json. Its --force path is guarded against symlinks,
paths outside the destination root, and non-package directories.

Ships 4 stdlib-only tools (all --help/--sample/--output json), 5 references citing
7-8 sources each, 3 asset templates, cs-book-to-skill agent, 2 commands.
Cross-linked into write-a-skill ("author first, compile second").

Regenerated the engineering harness manifest: picked up book-to-skill plus three
skills that had drifted out (minimalist, skillopt-sleep, strict-api), 81 -> 85.

Counters: skills 362 -> 363, tools 644 -> 662, refs 741 -> 746, agents 102 -> 103,
commands 116 -> 118, plugins 88 -> 89 (derive_counters.py --check passes).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zu9Gmm9S78c2t3kDLnpPX
2026-08-05 07:01:23 +00:00
..
cs-book-to-plugin.md feat(engineering): add book-to-skill — compile documents into knowledge-base skills 2026-08-05 07:01:23 +00:00
cs-book-to-skill.md feat(engineering): add book-to-skill — compile documents into knowledge-base skills 2026-08-05 07:01:23 +00:00