agentleFS
hevangelhevangel/media-agent-skills/skills/ebook/SKILL.md

ebook

Skill4 starsChanged 20 days agoMITView on GitHub

Work with EPUB files - extract, update, and manage metadata, download and embed covers, update series info. Use when handling EPUB ebook libraries or metadata.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. aresbit/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository15 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use fetch-ebook-metadata from Calibre: https://manual.calibre-ebook.com/generated/en/fetch-ebook-metadata.html

    line 47
  2. Distinctive:

    Use openlibrary-client for additional metadata.

    line 48
  3. Very specific:

    Add Calibre-compatible series metadata (calibre:series and calibre:series_index).

    line 54
  4. Very specific:

    Series Not Detected: Use update_epub_series() to add Calibre series metadata.

    line 116
  5. Very specific:

    Use uv as the Python package manager.

    line 121
  6. Distinctive:

    Always test on a few files before batch processing.

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

EPUB Manager

Configuration

Library paths are loaded from the .env file in the workspace root.

EBOOK_LIBRARY_PATH=/path/to/ebook/library

You can configure multiple library paths as needed. The default structure follows Calibre conventions: $EBOOK_LIBRARY_PATH/Author Name/Book Title (ID)/book.epub

Reference

  • Code Snippets: scripts/
  • Code Snippet README: scripts/README.md
  • Kavita integration: See the kavita skill

Available Scripts

ScriptPurpose
extract_metadata.pyExtract metadata from EPUBs to JSON
update_metadata.pyUpdate Dublin Core metadata (title, author, publisher)
update_series_metadata.pyAdd Calibre-compatible series info
embed_cover.pyEmbed cover images into EPUBs
download_cover.pyDownload covers from OpenLibrary/Google Books (supports multiple ISBNs)
check_metadata.pyFind EPUBs with missing metadata

Common Tasks

Extract Metadata

Extract metadata from all EPUB files in a directory recursively and save to JSON.

Check for Missing Metadata

Analyze extracted metadata to find EPUBs missing title, author, or other key fields.

Fetch Missing Metadata

Update Metadata

Modify EPUB metadata (title, author, publisher) by editing the OPF file within the EPUB.

Update Series Info

Add Calibre-compatible series metadata (calibre:series and calibre:series_index).

EPUB Metadata Fields (Dublin Core)

  • title, creator, publisher, date, language, identifier (ISBN)
  • subject (genres/tags), description, rights, contributor

EPUB Structure

EPUB files are ZIP archives containing:

  • mimetype - Must be first file, uncompressed
  • META-INF/container.xml - Points to OPF file
  • content.opf - Package document with metadata
  • OEBPS/ - Content directory with XHTML, CSS, images

Code Examples

Extract Metadata

import os
from pathlib import Path

from skills.ebook.scripts.extract_metadata import extract_epub_metadata, scan_epub_files

metadata = extract_epub_metadata(Path("book.epub"))
all_metadata = scan_epub_files(Path(os.environ["EBOOK_LIBRARY_PATH"]))

Update Metadata

from skills.ebook.scripts.update_metadata import update_epub_metadata

update_epub_metadata("book.epub", {
    'creator': ['Author 1', 'Author 2'],
    'publisher': 'Publisher Name'
})

Download and Embed Cover

from skills.ebook.scripts.download_cover import download_cover_multi_isbn
from skills.ebook.scripts.embed_cover import embed_cover_image

isbns = ['9780545060394', '0545060397']
source = download_cover_multi_isbn(isbns, 'temp/cover.jpg')
if source:
    embed_cover_image('book.epub', 'temp/cover.jpg')

Update Series

from skills.ebook.scripts.update_series_metadata import update_epub_series
update_epub_series('book.epub', 'Series Name', 1)

Common Issues

  • Cover Not Showing: Multiple cover images in EPUB. Use embed_cover_image() with remove_existing_covers=True.
  • Series Not Detected: Use update_epub_series() to add Calibre series metadata.
  • Changes Not in Kavita: Trigger rescan with force mode via the Kavita skill.

Notes

  • Use uv as the Python package manager.
  • Temporary files go in $WORKSPACE_PATH/temp/.
  • Backups created automatically with .backup extension.
  • Always test on a few files before batch processing.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.