shimo4228

Pdf2anki — AI skill for Claude Code

AI community

Command-line tool that turns PDF, text, and Markdown files into Anki cards with Claude, scoring every card and, with --quality full, sending low-scoring ones through an LLM critique.

How to install Pdf2anki

This entry records only its repository, not the path inside it, so there is no exact command to give. Open shimo4228/pdf2anki and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Pdf2anki does

Command-line tool that turns PDF, text, and Markdown files into Anki cards with Claude, scoring every card and, with --quality full, sending low-scoring ones through an LLM critique.

Alternatives in AI

  • Guizang Ppt Skill — AI-agent Skill for generating polished HTML slide decks: editorial magazine and Swiss layouts, image prompts 24.9k ★
  • Geo SEO Claude — GEO-first SEO skill for Claude Code 3.6k ★
  • Launch An AI Feature — Workflow recipe — take an AI/LLM feature from a probabilistic-aware PRD to a launch-ready model card by chaini 1.3k ★

README

Language: English | [日本語](README.ja.md)

pdf2anki

[![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue)](https://www.python.org/) [![License: AGPL-3.0](https://img.shields.io/badge/license-AGPL--3.0-green)](LICENSE)

pdf2anki is a command-line tool that turns PDF, text, and Markdown files into Anki cards with Anthropic's Claude, for people who study from documents with Anki. By default it scores every card before export, and with `--quality full` it sends low-scoring cards through an LLM critique that improves, splits, or removes them.

Built as a hands-on project to test defenses against what LLM card generation produces (broken JSON, uneven card quality, and invisible cost) by combining LLM structured extraction, cognitive science (Wozniak's 20 Rules, the card-writing rules from the creator of SuperMemo), and a keyword-matching evaluation of prompt changes.

[!NOTE] `convert` and the web UI send your document text (and, with `--vision`, the images embedded in image-heavy pages) to the Anthropic API, `eval` sends the texts of its labeled dataset, and all three need your own paid `ANTHROPIC_API_KEY`. Each run stops at a budget limit, 1.00 USD by default. `preview` makes no API calls.

The story behind the tool and a later audit of its code are in [More from the author](#more-from-the-author).

Installation

Requirements: Python 3.12+, [uv](https://docs.astral.sh/uv/), and an Anthropic API key (paid). OCR (`--ocr`) also needs Tesseract and its language packs on the system ([Runbook](docs/RUNBOOK.md)).

git clone https://github.com/shimo4228/pdf2anki.git
cd pdf2anki
uv sync --all-extras

`uv sync` installs the `pdf2anki` command into `.venv`. Run it as `uv run pdf2anki ...`, or activate the environment once with `source .venv/bin/activate`; the examples below assume it is active.

Environment Setup

pdf2anki reads the API key and the two `PDF2ANKI_` variables below from the environment; it does not load a `.env` file. Export the