Anki Flashcards Skill
A Claude skill that makes it negligibly easy to create high-quality Anki flashcards. The goal is expert-level cards with minimal user effort.
Why This Exists
Spaced repetition is one of the most effective learning techniques we have. The research is clear: active recall with expanding intervals beats passive review for long-term retention. Anki is the gold standard tool for this.
But Anki has an adoption problem. The card-creation process is slow and requires expertise most people don't have. What makes a good flashcard? How do you break down complex topics? When should you use cloze deletions vs. basic cards? These questions stop people before they start.
This skill removes that bottleneck. A user can say "make me a vocab card for ephemeral" and get an expert-quality card in seconds, packaged and ready for Anki. The vision is that card quality and creation speed should never be the reason someone doesn't use spaced repetition.
Design Philosophy
Expert quality by default
Every card should be as good as what a spaced repetition expert would create. This means:
- Atomic β One concept per card. No compound questions.
- Precise β Questions have one unambiguous answer.
- Self-contained β The answer makes sense without external context.
- Right type β The card format matches the knowledge type (vocab β bidirectional, lists β cloze, etc.).
Minimal friction
The simplest path should be the default. A vocab card shouldn't require a preview cycle. Complex document extraction might, but simple requests should complete in one turn.
Token efficiency
The skill uses a router pattern: SKILL.md is ~100 lines that routes to specific workflows. Claude only reads what it needs. Artifacts are generated from templates, not written from scratch. Commands copy and combine pre-built components rather than regenerating them.
Preview as optional safety net
The preview system exists because cards often look wrong once you see them. But it's optionalβquick flows skip it entirely, and users can always download without reviewing.
Card Types
The skill supports six card types, each designed for a specific kind of knowledge:
| Type | Use For | Cards Generated |
|---|---|---|
| Front-Back | Questions, procedures, cause-effect | 1 card |
| Bidirectional Concept | Vocabulary, terminology | 2 cards (termβdefinition) |
| Cloze Deletion | Lists of 3+ items, sequences | 1 card per cloze |
| Image Recognition | Visual ID: landmarks, species, art | 1 card |
| Image Occlusion | Labeling diagrams, anatomy, maps | 1 card per region |
| Person | Names, faces, contact details | 1 card per field |
Core Flows
Quick Cards (Primary)
The most common flow. User requests a simple card, Claude generates it immediately.
User: "Make a vocab card for ephemeral"
Claude: Looks up definition β Generates JSON β Creates .apkg β Done
No preview, no feedback loop. One turn. The preview can be shown alongside the download for users who want to verify, but it's not required.
Preview Cycle (For Complex Cards)
For batches of 4+ cards or complex extractions, the preview cycle helps catch issues:
Draft cards β Show preview β User reviews β Apply edits β Export
The preview artifact lets users flip cards, mark issues, and export feedback JSON. This is optional but valuable for larger batches where mistakes compound.
Document Extraction (Future)
Not yet implemented. The vision: upload a document, get a proposed card breakdown, review and refine, export. This requires intermediate analysis steps that aren't built yet.
Technical Architecture
See the Architecture section for the full breakdown.
Getting Started
To work on this skill:
- Read this README to understand the goals
- Check the Roadmap for current priorities
- Review Procedures for how to make common changes
- Use Commands for token-efficient operations
Architecture
How the pieces fit together.
Flow Overview
The skill follows a router β workflow β output pattern:
User Request
β
SKILL.md (Router)
β Intent detection
Workflow File
β Card generation logic
JSON Card Data
β
βββββββββββββββββββ¬ββββββββββββββββββ
β Preview β Export β
β (optional) β (always) β
βββββββββββββββββββ΄ββββββββββββββββββ
β β
preview.jsx .apkg file
Key Design Decisions
Slim Router Pattern
SKILL.md is intentionally minimal (~100 lines). It detects user intent and routes to the appropriate workflow file. This keeps token costs lowβClaude only reads the files it needs for the specific task.
JSON as Intermediate Format
Cards are generated as JSON, which serves as the single source of truth. The same JSON feeds both the preview artifact and the .apkg export script. This means:
- Claude can generate JSON once and reuse it
- Edits happen to the JSON, not to multiple outputs
- Preview and export are always in sync
Template-Based Artifacts
The preview artifact uses a template (preview-template.jsx) with a placeholder for card data. Claude injects JSON via sed rather than generating the entire artifact. This saves significant tokens.
Theme CSS Duplication
Theme CSS is duplicated in two places: themes.py (for .apkg generation) and preview-template.jsx (for preview rendering). This is intentionalβit avoids runtime CSS injection complexity and keeps the preview self-contained.
File Structure
Card Expansion Rules
Different card types generate different numbers of Anki cards from a single note:
| Card Type | Expansion |
|---|---|
| Front-Back | 1 card |
| Concept | 2 cards (termβdef, defβterm) |
| Cloze | 1 card per {{cN::...}} marker |
| Image | 1 card |
| Person | 1 card per populated field (up to 12) |
| Image Occlusion | 1 card per occlusion region |
The preview uses _displayId for sequential UI numbering and _originalIndex for mapping feedback back to source cards.
Defaults & Configuration
Default values used when generating cards.
Package Defaults
| Field | Default Value | Notes |
|---|---|---|
| deck_name | "Cards from Claude" | User can override per request |
| theme | "minimal" | Options: minimal, rich, bold, ios |
| author | "Claude" | Override for book/article cards |
| source | "General Knowledge" | Override for specific sources |
| verify_facts | false | Enable for factual cards |
Tagging Conventions
Cards use two levels of tags:
Batch Tags
Applied to all cards in a batch. Format: topic-YYYY-MM-DD
"batch_tags": ["python-decorators-2024-12-30"]
Card-Level Tags
Optional tags for individual cards:
"tags": ["vocabulary", "advanced"]
Visual Themes
Four themes are available. Each creates separate Anki note types with unique model IDs, so cards with different themes can coexist.
| Theme | Description |
|---|---|
minimal |
Clean whitespace, system fonts, subtle colors (default) |
rich |
Elegant serif typography, refined details |
bold |
Strong visual hierarchy, vibrant accents |
ios |
Native iOS/AnkiMobile appearance |
Model IDs
Each card type has a fixed model ID for consistency across exports:
| Card Type | Model ID |
|---|---|
| Front-Back | 1732590444335 |
| Concept | 1734130500288 |
| Cloze | 1761346594645 |
| Image | 1735412847293 |
| Person | 1767049421568 |
| Image Occlusion | 1735412847294 |
Roadmap
Current priorities and future plans.
The full roadmap is maintained in a separate file for token efficiency. The roadmap contains detailed phase breakdowns, status tracking, and planned features.
View the Roadmap
Ask Claude to present the roadmap file:
present /mnt/skills/user/anki-flashcards/developer/roadmap.html
Or view the raw file:
view /mnt/skills/user/anki-flashcards/developer/roadmap.html
Quick Summary
| Phase | Status | Focus |
|---|---|---|
| Phase 1: Ready for Users | Current | Core flows, polish, onboarding |
| Phase 2: Feedback & Iteration | Planned | User feedback integration |
| Phase 3: Advanced Features | Planned | Document extraction, batch import |
Procedures
Voice-optimized prompts for common skill modifications. Speak your specific request into the highlighted area, then copy the complete prompt.
Updating CSS Themes
Theme CSS lives in two places that must stay in sync:
scripts/themes.pyβ Source of truth for .apkg generationartifacts/preview-template.jsxβ Hardcoded for preview rendering
Adding a New Card Type
Adding a card type requires changes in multiple places:
- Define the note model in
create_anki_package.py - Add rendering logic in
preview-template.jsx - Update
references/choosing-card-type.md - Add to SKILL.md routing table
- Add test data to
assets/test-data/test-cards.json
Updating Test Data
Test data lives in assets/test-data/test-cards.json. It should cover all card types.
Packaging for Distribution
To create a .skill package for sharing:
# Copy skill to working directory first (read-only source)
cp -r /mnt/skills/user/anki-flashcards /home/claude/anki-flashcards
# Make any modifications...
# Package it
bash /home/claude/anki-flashcards/developer/tools/package-skill.sh /home/claude/anki-flashcards
The packaged skill will be at /mnt/user-data/outputs/anki-flashcards.skill
Testing the Preview
To test the preview artifact with sample data:
bash /mnt/skills/user/anki-flashcards/developer/tools/test-preview.sh
Then present /home/claude/preview.jsx to see the rendered cards.
Modifying Workflow Logic
Workflows are in workflows/*.md. To modify one:
General Skill Modification
Commands
Token-efficient commands for common operations.
Developer Commands
Say these to Claude when working on the skill:
| Command | What It Does |
|---|---|
"dev" or "developer" |
Opens this portal |
"debug" or "test preview" |
Renders test cards in preview artifact |
"package the skill" |
Creates .skill file for distribution |
"theme designer" |
Launches Theme Designer for CSS iteration |
User Commands
Commands for end users:
| Command | What It Does |
|---|---|
"/anki-help" |
Shows onboarding/help artifact |
Bash Commands
Token-efficient bash operations:
Generate Preview from JSON
# Save card data to file
cat > /home/claude/cards.json << 'EOF'
{"deck_name": "My Deck", "cards": [...]}
EOF
# Inject into template
cp /mnt/skills/user/anki-flashcards/artifacts/preview-template.jsx /home/claude/preview.jsx
sed -i "s|__CARD_DATA_PLACEHOLDER__|$(cat /home/claude/cards.json | tr '\n' ' ')|" /home/claude/preview.jsx
# Present the preview
# (use present_files tool)
Export to .apkg
echo '{"deck_name": "My Deck", "cards": [...]}' | \
python3 /mnt/skills/user/anki-flashcards/scripts/create_anki_package.py \
/mnt/user-data/outputs/flashcards.apkg
Test Preview
bash /mnt/skills/user/anki-flashcards/developer/tools/test-preview.sh
# Then present /home/claude/preview.jsx
Package Skill
cp -r /mnt/skills/user/anki-flashcards /home/claude/anki-flashcards
bash /home/claude/anki-flashcards/developer/tools/package-skill.sh /home/claude/anki-flashcards
Theme Designer
# Launch with production themes only
bash /home/claude/anki-flashcards/developer/tools/theme-designer-launch.sh
# Then: present_files(['/home/claude/theme-designer.jsx'])
# Launch with working themes for comparison
bash /home/claude/anki-flashcards/developer/tools/theme-designer-launch.sh /home/claude/working-themes.json
Skill Files
Reference view of key skill files.
Core Files
The main entry point. ~100 lines of intent detection and routing.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/SKILL.md
Python script that generates .apkg files from JSON. Handles all card types, themes, and media bundling.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/scripts/create_anki_package.py
React component for card preview. 2299 lines including theme CSS and all card type renderers.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/artifacts/preview-template.jsx
Workflow Files
Simple path for vocab/single cards. Minimal token usage.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/workflows/quick-cards.md
Preview β feedback β revise β export loop.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/workflows/review-cycle.md
PDF/doc β cards workflow. Not fully implemented yet.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/workflows/document-extraction.md
CSV/JSON conversion workflow.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/workflows/batch-import.md
Reference Files
Complete documentation for .apkg generation including JSON schema, all card types, themes.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/references/apkg-export.md
Common card quality issues and how to fix them.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/references/quality-fixes.md
Guidance on selecting the right card type for different knowledge.
To view: Ask Claude to view /mnt/skills/user/anki-flashcards/references/choosing-card-type.md
Test Data
Sample cards for testing the preview and export.
Test Cards
The test data at assets/test-data/test-cards.json includes examples of most card types:
What landmark is this?
Raj Patel
San Francisco
Photography, hiking
Running Test Preview
bash /mnt/skills/user/anki-flashcards/developer/tools/test-preview.sh
# Then present /home/claude/preview.jsx
Raw JSON
To view the full test data:
view /mnt/skills/user/anki-flashcards/assets/test-data/test-cards.json
Changelog
Version history and changes.
The full changelog is maintained in a separate file for token efficiency. It contains detailed version history with all changes, dates, and migration notes.
View the Changelog
Ask Claude to present the changelog file:
present /mnt/skills/user/anki-flashcards/developer/changelog.html
Or view the raw file:
view /mnt/skills/user/anki-flashcards/developer/changelog.html
Recent Versions
| Version | Date | Summary |
|---|---|---|
| v2.0 | Dec 30, 2024 | Developer Portal overhaul, architecture restructure |
| v1.x | Dec 2024 | Initial development: preview, 6 card types, .apkg export |
Contact
Feedback and questions welcome.
Developer
Ben Bateman
ben.bateman.email@gmail.com
If you're using this skill and have feedbackβwhat works, what doesn't, what you wish it didβplease reach out. Early feedback is invaluable.
Required Claude Settings
To use this skill, users need these Claude settings enabled:
- Settings β Capabilities β Skills β Must be on to install the skill
- Settings β Capabilities β Code Execution & File Creation β Required for generating files
- Settings β Capabilities β Network Egress for Package Managers β Required for installing the genanki Python package