What Structured Output Does Book-to-Skill Produce? Glossary, Patterns, and Cheatsheet Explained

Book-to-Skill generates a structured knowledge base consisting of a master SKILL.md manifest, a glossary, a patterns catalog, a cheatsheet, and per-chapter summaries that together create an immediately usable agent skill for Copilot CLI, Amp, or Claude Code.

Book-to-Skill transforms books and documents (PDF, EPUB, DOCX, HTML, or plain text) into machine-readable structured output designed for AI agent consumption. According to the virgiliojr94/book-to-skill repository, the conversion process produces a predictable directory layout with specific markdown artifacts rather than free-form summaries. These files provide agents with definitions, reusable techniques, and decision logic they can invoke on demand.

The Five Core Structured Output Files

The converter creates five distinct artifact types, each serving a specific purpose in the agent knowledge base. These are generated according to the workflow defined in SKILL.md and implemented in scripts/extract.py and book_to_skill/utils.py.

glossary.md (Alphabetical Term Reference)

The glossary provides an alphabetical list of every significant term the source book introduces. Each entry follows a strict format: **Term** — definition (Ch N) and includes the chapter reference where the term first appears. The file is intentionally limited to approximately 1,500 tokens to ensure rapid lookup. This artifact is generated during Step 8 of the conversion process, "Generate supporting files."

patterns.md (Reusable Techniques Catalog)

This file catalogs concrete techniques, design patterns, or algorithms described in the book. Each pattern follows a consistent template with ## Pattern Name, followed by When to use, How, and Trade-offs sections. The file is capped at roughly 2,000 tokens. Like the glossary, this is produced in Step 8 of the workflow defined in SKILL.md.

cheatsheet.md (Decision Logic and Heuristics)

The cheatsheet functions as a highly compressed decision-aid capturing the author’s judgment in terse rules formatted as "When X, do Y because Z." It includes decision trees, trade-off matrices, thresholds, and heuristic "tells & smells." With a strict limit of ≤1,200 tokens, this file is optimized for quick lookup during agent reasoning. This artifact is also generated in Step 8.

chapters/ Directory (Per-Chapter Summaries)

This directory contains one markdown file per book chapter (for example, ch01-intro.md). Each chapter file contains a structured summary including Core Idea, Frameworks, Key Concepts, Mental Models, Anti-patterns, optional Code Examples, and Worked Examples. The token budget for each chapter respects the book type and depth parameters specified during conversion. These files are generated during Step 7, "Generate chapter summaries."

SKILL.md (Master Skill Manifest)

The SKILL.md file serves as the entry-point for the entire skill. It includes metadata, a short description, a "Core Frameworks & Mental Models" section (limited to ~2,000 tokens), a chapter index, a topic index, and links to the supporting files. The entire manifest is kept under approximately 4,000 tokens. This master file is produced in Step 9, "Generate the master SKILL.md."

The Generation Pipeline

The conversion process follows a strict three-phase pipeline as implemented in the source code:

  1. Step 7 – Chapter Extraction: The system processes the source document through scripts/extract.py to create full_text.txt and metadata.json, then generates individual chapter summaries in the chapters/ directory.

  2. Step 8 – Supporting Files: The generator creates the three reference files (glossary.md, patterns.md, cheatsheet.md) using utility functions from book_to_skill/utils.py, applying strict token limits to each.

  3. Step 9 – Master Manifest: Finally, the system compiles the master SKILL.md that indexes all previous outputs and provides the structured entry point for agent hosts.

Working with the Generated Structured Output

After running the conversion command, you can inspect and use the artifacts immediately. The following examples demonstrate how to generate a skill and access its structured components.

Run the conversion against your source documents:


# Convert a book to a skill (replace <path> with your files)

book-to-skill <path-to-documents> my-skill-slug

This creates a skill directory at ~/.copilot/skills/my-skill-slug/. Inspect the generated structured output files:


# View the glossary of terms

cat ~/.copilot/skills/my-skill-slug/glossary.md

# Review the patterns catalog

cat ~/.copilot/skills/my-skill-slug/patterns.md

# Check the decision rules

cat ~/.copilot/skills/my-skill-slug/cheatsheet.md

Use the skill from a Copilot-compatible Python session:

from copilot import Agent

agent = Agent()
response = agent.ask(
    "my-skill-slug",
    "Explain the 'Five Whys' framework and give the decision rule from the cheatsheet."
)
print(response)

Summary

  • Book-to-Skill produces five distinct file types: glossary.md, patterns.md, cheatsheet.md, the chapters/ directory, and SKILL.md.
  • Each output file adheres to strict token budgets (ranging from ~1,200 to ~4,000 tokens) to optimize for agent context windows.
  • The generation follows a three-step pipeline: chapter summaries (Step 7), supporting files (Step 8), and the master manifest (Step 9).
  • The structured output creates a reusable knowledge base where agents can look up definitions, apply patterns, and reference decision heuristics on demand.

Frequently Asked Questions

What file formats can Book-to-Skill convert?

Book-to-Skill accepts PDF, EPUB, DOCX, HTML, and plain-text files as input. The scripts/extract.py module handles the parsing of these diverse formats to produce the initial full_text.txt and metadata.json files before the structured markdown generation begins.

Why are the output files limited to specific token counts?

The token limits (1,500 for glossary, 2,000 for patterns, 1,200 for cheatsheet, and 4,000 for SKILL.md) ensure that the generated content fits efficiently within the context windows of modern AI agents. This optimization allows Copilot CLI, Amp, or Claude Code to ingest the entire skill without truncation while maintaining fast retrieval speeds during agent reasoning tasks.

Can I customize the output templates or structure?

The current implementation in book_to_skill/utils.py and the workflow defined in SKILL.md use fixed templates for consistency across different book conversions. While the core structure is standardized to ensure compatibility with agent hosts, you can manually edit the generated markdown files after conversion to add additional context or reformat specific sections to better suit your workflow.

You may only publish the generated SKILL.md, glossary.md, patterns.md, and other artifacts if the source book's copyright permits redistribution or derivative works. The repository provides an example workflow using gh repo create for publishing, but you must verify that you have the legal right to share the extracted content before making the skill public.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →