# virgiliojr94/book-to-skill — AlpLab Radar Static Code Audit

- Ring: `trial`
- Category: `skills`
- Overall score: `4.1/5`
- Implementation check: `verified`
- Maturity: `early`
- Audited commit: `b4af10bce50f` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-02T05:51:29Z
- Repository: https://github.com/virgiliojr94/book-to-skill
- Radar entry: https://radar.alplab.co/#repo/virgiliojr94/book-to-skill
- License: `MIT`
- CI workflows: `.github/workflows`
- Tags: `agent-skills`, `document-extraction`, `pdf-parsing`, `prompt-injection-defense`, `mcp`, `cli-tool`

## Summary

A spec-driven Agent Skill that converts local books/documents (PDF, EPUB, DOCX, HTML, RTF, TXT/MD, MOBI/AZW) or MCP-mediated remote reads into structured cross-host agent skills, backed by a zero-network Python extraction package.

## Implementation Check

README's advertised capabilities match working code — extraction chain, chapter detection, zero-network MCP Search & Read, Unicode sanitization, and private-by-default publishing are implemented in book_to_skill/utils.py (main/detect_structure), remote/policy.py (resolve_publish_visibility), and sanitize.py (sanitize_extracted_text) — though the skill-generation half is agent-driven per the documented design (SKILL.md Steps 4-9), not deterministic code.

## When to Use

Use when you own technical books or documentation and want them distilled into an on-demand, token-efficient skill for any Agent Skills host (Copilot CLI, Claude Code, Amp, Codex, Hermes, OpenCode, OpenClaw); not for scanned/image-only PDFs without OCR, image-dependent content (images are dropped by design), or anyone expecting a deterministic converter that works without an LLM host.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.5/5 |
| usability | 4.0/5 |
| reliability | 3.0/5 |
| security | 4.5/5 |
| integration | 4.5/5 |

## Code Evidence

SKILL.md defines the full 0-11 step spec with per-host skill-root resolution (7 hosts) and a private-by-default GitHub publish gate; scripts/extract.py + book_to_skill/cli.py main() is the real entrypoint; book_to_skill/utils.py detect_structure() implements chapter-heading regexes for ~20 scripts (_CN_CHAPTER, _RU_CHAPTER, _KO_CHAPTER, _fa_chapter_number for Persian/Arabic) with fenced-code and prose guards (_closed_fence_line_numbers, _is_prose_period_tail), reuse_is_safe() enforces sha256 source fingerprints before resuming a workdir, and prepare_output_dir() rejects symlinks and foreign-uid dirs with 0700; book_to_skill/sanitize.py sanitize_extracted_text() strips zero-width/bidi (CVE-2021-42574 class)/tag-block/variation-selector codepoints and folds Kangxi radicals; book_to_skill/parsers/docx.py validate_docx_xml_safety() rejects DOCTYPE/ENTITY (XXE/Billion Laughs); book_to_skill/parsers/pdf.py has a pdftotext->pypdf->pdfminer fallback chain, looks_image_only() scanned-PDF preflight, and pdf_outline_titles(); book_to_skill/remote/ implements the MCP Search & Read contracts offline — reader.py read_section_from_pages() caps cursors and detects loops, policy.py resolve_publish_visibility() hard-locks to private unless policy+explicit consent, checkpoint.py FORBIDDEN_PROSE_KEYS blocks raw prose persistence with 0600 atomic writes; tools/scan_generated_skill.py scans generated skills for injection patterns and tools/validate_skill.py validates SKILL.md against 6 host lenses; .github/workflows/ci.yml runs pytest across Python 3.9-3.13, a dependency-free smoke extraction leg, bandit+zizmor security scans, and dependency review; tests/remote/test_security_boundaries.py test_zero_network_imports_across_book_to_skill_package() AST-enforces the no-network claim.

## Issues Found

README/SECURITY.md doc drift: README says tests run 'Linux/Windows' but .github/workflows/ci.yml has ubuntu-only runners, and SECURITY.md still says 'latest released 1.x' while pyproject.toml is 2.0.1; SKILL.md Step 2 invokes "$PYTHON_BIN" "$SCRIPT_PATH" $INPUT_PATHS unquoted, which breaks paths containing spaces; dependencies.py install_python_packages will fail on PEP 668 externally-managed interpreters (falls back gracefully but the hint doesn't mention venv/uv).

## Key Risks

Nothing was executed — 90+ test files exist but pass/fail is unverified here ('1,100+ tests' is a README claim); the generation half runs in the host LLM per SKILL.md so output quality varies by model and cannot be CI-verified; the 24x-51x token-savings claim rests on tools/discovery_tax.py methodology not re-measured statically; best extraction quality needs optional deps (docling, pdf-inspector, trafilatura, ebooklib) and MOBI/AZW requires external Calibre; --install-missing yes runs pip install into the current interpreter (explicit opt-in supply-chain surface); Mode 2 depends on a third-party MCP server (libgen-mcp) and puts copyright compliance on the user; no dependency lockfile.

## Reviewed Files

- `README.md`
- `pyproject.toml`
- `SKILL.md`
- `scripts/extract.py`
- `book_to_skill/cli.py`
- `book_to_skill/config.py`
- `book_to_skill/dependencies.py`
- `book_to_skill/utils.py`
- `book_to_skill/sanitize.py`
- `book_to_skill/pdf_inspector_integration.py`
- `book_to_skill/parsers/calibre.py`
- `book_to_skill/parsers/pdf.py`
- `book_to_skill/parsers/docx.py`
- `book_to_skill/parsers/html.py`
- `book_to_skill/parsers/epub.py`
- `book_to_skill/remote/discovery.py`
- `book_to_skill/remote/policy.py`
- `book_to_skill/remote/reader.py`
- `book_to_skill/remote/checkpoint.py`
- `book_to_skill/remote/coverage.py`
- `.github/workflows/ci.yml`
- `SECURITY.md`
- `SECURITY-NOTICE.md`
- `LICENSE.md`
- `references/search-and-read.md`
- `tools/validate_skill.py`
- `tools/scan_generated_skill.py`
- `tests/test_output_dir_security.py`
- `tests/test_repo_hygiene.py`
- `tests/remote/test_security_boundaries.py`
