How afazhriel/booktoskill works
book-to-skill converts books, folders, globs, and other structured prose into clean text and metadata, then relies on an agent to create an Agent Skills-compatible skill. The main runtime is a CLI that orchestrates input discovery and format-specific extraction; parsers cover PDF, EPUB, DOCX, RTF, HTML, plain text, and Calibre formats. The README also documents analysis-only, generate-from-analysis, and fold-in workflows. Parser and orchestration links reflect the provided excerpts and SOURCE INDEX; the agent-generation stage is documented rather than implemented in the sampled Python runtime.
Main entry points: utils.py Extraction workflow · html.py HTML extraction · text.py Text decoding · cli.py Command interface
Components 20
CLI and workflow
- Command interface
book_to_skill/cli.py - Extraction workflow
book_to_skill/utils.py - Formats and paths
book_to_skill/config.py - Dependency checks
book_to_skill/dependencies.py
Document extraction
- PDF extraction
book_to_skill/parsers/pdf.py - EPUB extraction
book_to_skill/parsers/epub.py - DOCX extraction
book_to_skill/parsers/docx.py - RTF extraction
book_to_skill/parsers/rtf.py - HTML extraction
book_to_skill/parsers/html.py - Text decoding
book_to_skill/parsers/text.py - Calibre formats
book_to_skill/parsers/calibre.py
Text processing
- Text sanitization
book_to_skill/sanitize.py - Extracted text and metadata
book_to_skill/config.py
Skill generation
- Agent generator
- Generated skill
- Agent host
Analysis utilities
- Discovery tax analysis
tools/discovery_tax.py - Generated skill scanner
tools/scan_generated_skill.py - Skill validator
tools/validate_skill.py
Other components
- User
Connections 21
- User → Command interface: provides sources
README.md - Command interface → Extraction workflow: invokes
book_to_skill/cli.py - Extraction workflow → Formats and paths: uses settings
book_to_skill/utils.py - Extraction workflow → Dependency checks: checks dependencies
book_to_skill/utils.py - Extraction workflow → PDF extraction: dispatches extraction
book_to_skill/utils.py - Extraction workflow → EPUB extraction: dispatches extraction
book_to_skill/utils.py - Extraction workflow → DOCX extraction: dispatches extraction
book_to_skill/utils.py - Extraction workflow → RTF extraction: dispatches extraction
book_to_skill/utils.py - Extraction workflow → HTML extraction: dispatches extraction
book_to_skill/utils.py - Extraction workflow → Text decoding: dispatches extraction
book_to_skill/utils.py - Extraction workflow → Calibre formats: dispatches extraction
book_to_skill/utils.py - EPUB extraction → HTML extraction: parses content
book_to_skill/parsers/epub.py - HTML extraction → Text decoding: reads files
book_to_skill/parsers/html.py - RTF extraction → Text decoding: reads files
book_to_skill/parsers/rtf.py - Extraction workflow → Text sanitization: sanitizes text
book_to_skill/utils.py - Extraction workflow → Extracted text and metadata: writes results
book_to_skill/utils.py - Extracted text and metadata → Agent generator: provides extracted content
README.md - Agent generator → Generated skill: generates
README.md - Generated skill → Agent host: loads on demand
README.md - Discovery tax analysis → Extraction workflow: measures extraction
tools/discovery_tax.py - Generated skill scanner → Text sanitization: checks characters
tools/scan_generated_skill.py