Documents

flashcard-forge

Try it

Convert any text — PDF excerpts, lecture notes, articles, textbook chapters — into spaced-repetition flashcards. Generates Anki-importable CSV with Q&A and cloze-deletion modes using regex-based extraction and sentence analysis.

What it does

Turn walls of text into decks you'll actually review.

The skill document

Flashcard Forge

Turn walls of text into decks you'll actually review.

Flashcard Forge is a skill that transforms study material (PDFs, lecture notes, articles, textbook chapters) into spaced-repetition flashcards. It extracts key facts, definitions, and Q&A pairs using regex patterns and sentence-structure analysis, then exports Anki-importable CSV files.

When to Use

Activate this skill when you need to:

  • Convert a textbook chapter or lecture transcript into flashcards
  • Extract definitions, key facts, or Q&A from a body of text
  • Generate cloze (fill-in-the-blank) cards for memorization
  • Produce Anki-importable CSV from raw notes
  • Study for an exam by turning reading material into active recall cards

Modes

Q&A Mode (--mode qa)

Extracts question-answer pairs and definition pairs:

  • Definition patterns: "X is defined as Y", "X refers to Y", "X means Y"
  • Explicit questions: sentences containing "What/Why/How/When/Where" markers
  • List patterns: "There are N types of X: A, B, C"
  • Cause/effect: "X causes Y", "X results in Y"
  • Comparison: "Unlike X, Y does Z"

Cloze Mode (--mode cloze)

Generates fill-in-the-blank cards by identifying key terms in each sentence and masking them:

  • Nouns and proper nouns are candidates for clozing
  • Numbers, dates, and named entities are high-priority cloze targets
  • Each card uses Anki's {{c1::...}} cloze syntax

Auto Mode (--mode auto, default)

Runs both modes and merges results, deduplicating by question text.

Quick Reference

NeedCommand
Q&A cards from a text filepython3 scripts/flashcard_forge.py notes.txt
Cloze cardspython3 scripts/flashcard_forge.py notes.txt --mode cloze
Anki CSV outputpython3 scripts/flashcard_forge.py notes.txt -o deck.csv
Custom cloze countpython3 scripts/flashcard_forge.py notes.txt --max-cloze 3
Min sentence length filterpython3 scripts/flashcard_forge.py notes.txt --min-length 20
JSON outputpython3 scripts/flashcard_forge.py notes.txt --format json

How It Works

  1. Read & clean — load the text, normalize whitespace, strip markdown artifacts.
  2. Segment — split into sentences using punctuation-aware tokenization.
  3. Extract — apply regex patterns (see references/extraction-patterns.md) to find definitions, Q&A, lists, cause/effect, and comparisons.
  4. Rank — score each candidate by information density (presence of key terms, numbers, definitions).
  5. Deduplicate — remove near-identical cards using Jaccard similarity.
  6. Export — write Anki-importable CSV (semicolon-separated, quoted) or JSON.

See references/anki-import.md for how to import the CSV into Anki.

Files

  • references/extraction-patterns.md — catalog of regex extraction patterns
  • references/anki-import.md — step-by-step Anki import guide
  • references/study-strategies.md — best practices for flashcard-based learning
  • scripts/flashcard_forge.py — the main extraction and export script
  • scripts/sample_text.txt — example input demonstrating all pattern types

Common Pitfalls

  1. Over-generation. A long text can produce hundreds of mediocre cards. Use --max-cards to cap output and --min-length to filter trivial sentences.

  2. CSV delimiter conflicts. Anki expects semicolon-separated values for basic cards. The script handles quoting automatically; don't open the CSV in Excel and re-save (it may change the delimiter).

  3. Cloze mode needs cloze note type. Cloze cards only work with Anki's "Cloze" note type, not "Basic." See references/anki-import.md.

  4. Poor input quality. Garbled OCR or deeply nested markdown confuses the sentence segmenter. Pre-clean the text for best results.

  5. Duplicates across runs. The dedup step is within-file only. If you merge multiple outputs, dedup manually or use --format json and post-process.

Verification Checklist

  • Input text is reasonably clean (no raw HTML, minimal OCR artifacts)
  • Chosen mode matches your Anki deck type (qa → Basic, cloze → Cloze)
  • --max-cards set if the input is large
  • CSV opens correctly in a text editor (fields quoted, semicolon-separated)
  • Test-imported into Anki and reviewed 5-10 cards for quality

License

MIT © Denis Voronin

Related skills

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván556 installs18 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván855 installs69 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai21 installs8 stars

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants4.3k installs296 stars

More from voronindenis5

Browse all skills

Prepare salary negotiations with a structured toolkit: market-rate anchoring math, walk-away floor calculation, total-compensation evaluation (equity, bonuses, benefits), negotiation scripts for offers, raises, and counter-offers, and BATNA analysis. Use when the user has a job offer, is preparing a raise conversation, wants to know if their pay is competitive, or needs scripts and a strategy for negotiating compensation.

by voronindenis51 installs

Use when your calendar is eating your week and you want to know exactly where the time goes, when planning recurring meetings for a team, before proposing a new recurring meeting, when someone says 'we should sync weekly' and you want data, or when auditing which meetings to kill — imports ICS calendar files, measures meeting hours per week/person/meeting-series (including double-bookings and fragmentation), computes focus-time destruction from meeting placement, scores the true cost of each series (hours × attendees × frequency), flags specific meetings to kill/shorten/make-async using explicit rules, and simulates the recovered hours before anyone has to argue about it.

by voronindenis52 installs

Agent self-awareness of cognitive states — context fatigue, attention drift, memory debt, confidence erosion, and skill staleness. Detect, report, and mitigate degrading conditions before they cause failures.

by voronindenis5

Plan what happens to your digital life if you die or become incapacitated. Inventory accounts, subscriptions, crypto wallets, important files, social media legacy contacts, and generate a sealed instruction document for trusted family. Includes encrypted digital will template and printable emergency access guide.

by voronindenis5

Use when an agent task fails or produces unexpected results. Performs structured post-mortem root cause analysis: categorizes the failure, traces the exact failure point through tool-call logs, reconstructs the decision chain, generates a post-mortem report, and saves lessons to prevent recurrence.

by voronindenis5