agentleFS
tejask0tejask0/agent-skills/mobi-to-markdown/SKILL.md

mobi-to-markdown

Skill0 starsChanged 4 months agoMITView on GitHub

Use when converting a MOBI, AZW3, or EPUB ebook into a clean Markdown note (e.g. for Obsidian) — covers Calibre ebook-convert, why pandoc produces HTML soup, adding YAML frontmatter, and promoting chapters to headings.

  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep Notes and Index sections at the end.

    line 48

≈ “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

MOBI → Markdown

Overview

Convert an ebook to clean, readable Markdown suitable for an Obsidian vault. Use Calibre's ebook-convert, not pandoc — pandoc on an ebook with no semantic headings emits raw <span>/<svg> HTML soup; Calibre's Markdown writer produces clean output directly.

Prerequisites

  • ebook-convert (Calibre). Check: ebook-convert --version. Install: sudo apt install calibre.

Steps

1. Convert

Calibre has no md output plugin — Markdown is produced by the TXT writer with --txt-output-formatting markdown. Output to .txt, then rename:

ebook-convert "input.mobi" "output.txt" \
  --txt-output-formatting markdown \
  --keep-links --keep-image-references
mv "output.txt" "output.md"

Italics, blockquotes, and numbered entries carry over intact. (--keep-links/--keep-image-references only take effect with a non-none formatting option.)

2. Add YAML frontmatter + H1

Prepend metadata so the note is searchable and shows a title:

---
title: <Title>
author: <Author>
translator: <if any>
publisher: <if any>
source: <input>.mobi (converted)
tags: [book, <topic>]
---

# <Title>
*<subtitle / edition line>*

3. Promote chapters to ## headings

Ebooks navigate by an internal TOC, so chapter titles often land as plain bold/paragraph text. Promote each (Introduction, every Book/Chapter, Notes, Index) to ## so Obsidian's outline panel works. Add subtitles where the edition has them.

4. Clean up

  • Drop the duplicate title/TOC block at the top — heading-based navigation replaces the publisher's TOC page.
  • Collapse runs of blank lines.
  • Keep Notes and Index sections at the end.

Common Mistakes

MistakeFix
Using pandoc on the MOBIRaw HTML soup; ebook has no semantic headings. Use ebook-convert.
Output file named .md directlyNo md output plugin — ValueError: No plugin to handle output format: md. Output .txt, then rename.
Leaving chapters as bold textObsidian outline is empty; promote to ##.
Keeping the original TOC pageRedundant with headings; delete it.
Case-only filenames in vaultFoo.md+foo.md collide on Mac/Android via Syncthing; name uniquely.

Reference output

Running this on a full-length public-domain classic (e.g. a well-known philosophy or literature text with a modern translation) typically produces: YAML frontmatter, every Book/Chapter plus Introduction/Notes/Index promoted to ##, original front-matter TOC removed, and a few thousand lines of clean Markdown.

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.