Skip to content

Book2Skills Pipeline v2

Book2Skills Banner

Autonomous, Intelligent Book-to-Skill Conversion Pipeline for Production AI Systems (OpenClaw, Claude, Codex, Hermes, etc.).

An end-to-end processing pipeline that converts unstructured books and complex domain documents (PDF, DOCX, MD, TXT) into production-ready AI Agent Skills (SKILL.md) compatible with AI frameworks such as OpenClaw, Claude, Codex, Hermes, and others. Features multi-provider LLM knowledge extraction, structured skill generation, semantic vector embeddings, persistent ChromaDB vector storage, autonomous LLM quality review, and knowledge graph relationship mapping.


๐Ÿš€ Quick Start

# 1. Installation
pip install -e ".[all]"

# 2. Configuration Setup
cp .env.example .env
# Edit .env: e.g., set B2S_LLM__PROVIDER=ollama & B2S_LLM__BASE_URL=http://localhost:11434/v1 for local mode

# 3. ๐ŸŽฎ Launch Interactive Studio (Recommended โ€” Zero Command Memory Required)
book2skills studio

# Or run via CLI directly:
book2skills run all --incremental   # Process all books in data directory
book2skills export md               # Export formatted SKILL.md bundles
book2skills search "marketing"      # Search vector & keyword database

๐ŸŽฎ Interactive Studio (TUI)

The simplest way for anyone to operate the systemโ€”an interactive arrow-key terminal menu:

book2skills studio
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘   ๐Ÿ“š  BOOK-TO-SKILLS STUDIO                                             โ•‘
โ•‘   Turn books into ready-to-use AI Agent Skills (OpenClaw, Claude...)    โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

โฏ Choose an action:
   ๐Ÿ‘‰ ๐Ÿš€  Run pipeline โ€” all books
      ๐Ÿ“„  Run pipeline โ€” single book
      โš™๏ธ  Configure LLM Provider
      ๐Ÿ“‹  List available books
      ๐Ÿ“ฆ  List generated skills
      ๐Ÿ”  Search skills database
      ๐Ÿ“ค  Export SKILL.md files
      ๐Ÿ“Š  View system statistics
      ๐Ÿ—‘๏ธ  Clear pipeline cache
      ๐Ÿšช  Exit Studio
  • Interactive LLM Provider Wizard: Easily switch between OpenAI, Anthropic, Gemini, DeepSeek, OpenRouter, and Ollama directly from the terminal without manual .env editing.
  • Live Progress Tracking: Visual progress indicators displaying active stages (extract โ†’ clean โ†’ chunk โ†’ knowledge โ†’ skill_gen...).
  • Colorized Output: Rich summaries for books, skills, and extraction statistics.
  • Zero Syntax Friction: Completely navigable using keyboard arrow keys and Enter.

โœจ Version 2 Architectural Upgrade Highlights

Feature Area v1 Implementation v2 Enterprise Pipeline
Knowledge Extraction Heuristic Regex parsing Multi-LLM + JSON Schema Strict Enforcer (with fallback)
Semantic Tags โŒ Empty / Missing โœ… LLM generates 3โ€“5 targeted semantic tags per skill
Category Classification Defaulted to "general" โœ… Intelligent multi-category classifier (10+ categories)
Skill Naming Standard Inconsistent camelCase โœ… Strict kebab-case naming specification
Data Provenance Unlinked book_id โœ… Explicit source_book & source_chapters mapping
Skill Sections Empty workflow fields โœ… LLM synthesizes full Workflows, Checklists, & Examples
SKILL.md Export โŒ Unavailable โœ… Automated AI Agent SKILL.md bundle exporter
Vector Embeddings Non-semantic hash codes โœ… Semantic vector embeddings (sentence-transformers)
Vector Database Transient in-memory store โœ… Persistent ChromaDB database storage
Quality Control Superficial rules โœ… Autonomous LLM Review Agents (1-10 scoring & audit)
Deduplication Exact title matching โœ… Semantic cosine vector similarity clustering (0.85+ threshold)
Knowledge Graph โŒ None โœ… Inter-skill relationship mapping & graph storage

๐Ÿ—๏ธ The 10-Stage Pipeline Architecture

Extract โ”€โ”€โ–บ Clean โ”€โ”€โ–บ Semantic Chunking โ”€โ”€โ–บ Knowledge Extraction (LLM)
   โ”‚
   โ–ผ
Skill Gen (LLM) โ”€โ”€โ–บ Quality Review (LLM) โ”€โ”€โ–บ Deduplication (Cosine Similarity)
   โ”‚
   โ–ผ
Knowledge Graph โ”€โ”€โ–บ Vector Embeddings โ”€โ”€โ–บ Persistent Vector DB (ChromaDB)

Each stage is completely modular, independently executable via CLI (book2skills run stage <name> <file>), and backed by persistent checkpointing for seamless resume capabilities.


๐Ÿ“‹ Complete CLI Command Summary

book2skills run all --incremental   # Process all books incrementally
book2skills run pipeline <file>     # Process a single book file
book2skills run stage <name> <file> # Run a single isolated pipeline stage
book2skills list books              # List discovered book files
book2skills list skills             # List all generated skills
book2skills search "query"          # Search skills by keyword / semantic content
book2skills export md               # Export skills to SKILL.md format
book2skills show                    # Inspect current system configuration
book2skills clear -y                # Clear pipeline cache silently

๐Ÿ”Œ REST API Endpoints

HTTP Method Endpoint Description
POST /api/v1/pipeline/run Trigger asynchronous pipeline execution
GET /api/v1/pipeline/status/{run_id} Retrieve real-time pipeline execution status
GET /api/v1/skills List all generated skills with pagination & filters
GET /api/v1/skills/{skill_id} Fetch full detailed payload for a specific skill
DELETE /api/v1/skills/{skill_id} Remove a skill from storage
GET /api/v1/books List available books in the data directory
POST /api/v1/books/upload Upload a new book file (.pdf, .docx)
GET /api/v1/search?q=... Perform high-speed search across all skills
GET /api/v1/stats Return global system metrics & quality score averages
GET /api/v1/health Health check endpoint

๐Ÿค– Supported LLM Providers & Models

Provider Needs API Key? Recommended Models Primary Strengths
Ollama (Local) โŒ No qwen2.5:14b, llama3.1:8b 100% Free, offline, private local execution
OpenAI โœ… Yes gpt-4o, gpt-4o-mini High throughput & strict JSON adherence
Anthropic โœ… Yes claude-3-5-sonnet, claude-3-5-haiku Superior procedural logic & synthesis
DeepSeek โœ… Yes deepseek-v3, deepseek-r1 Enterprise-grade reasoning at high efficiency
Google Gemini โœ… Yes gemini-1.5-pro, gemini-1.5-flash Large context window handling
OpenRouter โœ… Yes 200+ models accessible Flexible model routing and benchmark testing

Dual-Model Pairing Strategy: - Small Model (B2S_LLM__MODEL_SMALL): Handles extraction, semantic chunking, & tag generation. - Large Model (B2S_LLM__MODEL_LARGE): Handles skill synthesis, edge-case formulation, & quality review.


๐Ÿงช Testing Suite

# Run isolated unit tests
pytest tests/unit/

# Run integration tests (LLM & storage validation)
pytest tests/integration/

# Run end-to-end tests (full pipeline run)
pytest tests/e2e/

# Generate code coverage report
pytest --cov=src/book_to_skills

๐Ÿ“ Output Directory Layout

outputs/
โ”œโ”€โ”€ skills/            # Skill JSON payloads
โ”‚   โ””โ”€โ”€ markdown/      # Production-ready SKILL.md bundles
โ”œโ”€โ”€ knowledge_graph/   # Inter-skill relationship mappings
โ””โ”€โ”€ embeddings/        # Vector index snapshots
data/vector_store/     # Persistent ChromaDB vector database

๐Ÿณ Docker Deployment

# Build Docker image
docker build -f docker/Dockerfile -t book2skills .

# Run API & queue services via Docker Compose
docker-compose -f docker/docker-compose.yml up -d

๐Ÿ“„ Full Documentation Suite


๐Ÿ“ Tech Stack Summary

Python 3.11 ยท FastAPI ยท Pydantic ยท Typer ยท sentence-transformers ยท ChromaDB ยท structlog ยท pytest ยท Docker ยท GitHub Actions


๐Ÿ™ Acknowledgements

Book2Skills is built upon and inspired by exceptional open-source projects, research initiatives, and developer tools:

  • ๐Ÿง  AI Agent Ecosystem (OpenClaw, Claude, Codex, Hermes, etc.): For pioneering the standardized SKILL.md specification for AI agents.
  • โšก FastAPI & Pydantic v2: For high-speed web framework infrastructure and strict type enforcement.
  • ๐ŸŽจ Rich & Questionary: For enabling visually stunning terminal UIs and interactive menu controls.
  • ๐Ÿ” ChromaDB & Sentence-Transformers: For semantic vector embeddings, indexing, and similarity clustering.
  • ๐Ÿค– LLM Providers & Ecosystem: Ollama, OpenAI, Anthropic, Google Gemini, and DeepSeek for empowering autonomous knowledge extraction.
  • ๐Ÿ“š Material for MkDocs: For delivering beautiful, accessible documentation UI for GitHub Pages.