Agent-assisted Anki deck maintenance: leech triage, minimum-information card splitting, AnkiConnect deck building — for certifications and compliance memorization.
Find a file
justinaquino 75cf29e038 fix: unsuspend in the AnkiConnect smoke test (was calling suspend twice)
The test called invoke("suspend") twice and printed "Unsuspended" for the second,
so it never exercised the unsuspend path and left every test card suspended.
AnkiConnect has a separate `unsuspend` action.

Synced from the internal project (tools/260329-anki backlog A9, found in the
2026-07-21 review, closed 2026-08-02).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-02 00:38:13 +08:00
examples Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
tests fix: unsuspend in the AnkiConnect smoke test (was calling suspend twice) 2026-08-02 00:38:13 +08:00
.gitignore Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
AGENTS.md Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
anki_daily_report.py Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
apply_cissp_leech_rewrites.py Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
build_deck_ankiconnect.py Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
CARD-CHANGES.md Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
check_leeches.py Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
generate_leech_report.py Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
KNOWLEDGE.md Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
process_card_changes.py Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
PROGRESS.md PROGRESS: gitbfj repo retained as mirror, not deleted 2026-07-21 22:57:30 +08:00
README.md Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00
TUTORIAL-ankiconnect-deck-building.md Initial public release: Anki deck-maintenance toolkit 2026-07-21 18:00:31 +08:00

comfac-anki — Agent-Assisted Anki Deck Maintenance

A practical toolkit and knowledge base for getting real value out of Anki — especially if you're studying for certifications (CISSP, CompTIA Network+, pfSense/Netgate, …) or need to memorize large compliance corpora (accounting standards, charts of accounts, tax rules, ISO frameworks).

The featured technique: using an AI agent to maintain your decks — diagnosing cards you keep forgetting (leeches), splitting overloaded cards, and applying fixes safely through the AnkiConnect API with backups and verification.

Maintained by Comfac Global Group's IT practice. This is the public, scrubbed copy of an internal deck-maintenance project: techniques, scripts, and sample data — no private decks, no personal configuration.

Who this is for

  • Students / professionals preparing for high-stakes exams who want their Anki decks to stop leaking.
  • Anyone drowning in leeches — cards Anki marks as repeatedly failed.
  • Tinkerers who want an AI agent (Claude, Kimi, OpenCode, any CLI agent) to safely read and improve their decks.

Start here

  1. KNOWLEDGE.md — the core document: why spaced repetition works, why cards actually fail (interference — the prime cause of forgetting), the minimum-information principle, leech triage, agent operating instructions, and the certification/compliance memorization pipeline.
  2. TUTORIAL-ankiconnect-deck-building.md — build a whole deck from a JSON file via the AnkiConnect HTTP API, plus the "pull" system for deciding what is worth memorizing.
  3. AGENTS.md — if you use an AI coding agent: drop-in operating instructions for safe deck manipulation.

Quickstart

# 1. Install Anki, then the AnkiConnect add-on (code 2055492159), restart Anki.
# 2. Verify connectivity (Anki must be running):
curl localhost:8765 -X POST -d '{"action":"deckNames","version":6}'

# 3. Smoke-test read/write against a throwaway deck:
python3 tests/test_ankiconnect.py

# 4. See which cards are failing in a deck:
python3 check_leeches.py "My Deck Name"

# 5. Full-collection leech report (read-only; adjust the profile path at the
#    top of the script or pass --collection):
python3 generate_leech_report.py

# 6. Build the sample catechism deck (149 cards) into a test deck:
python3 build_deck_ankiconnect.py examples/catechism-cards-260715.json --dry-run
python3 build_deck_ankiconnect.py examples/catechism-cards-260715.json

What's inside

Path What it is
KNOWLEDGE.md Consolidated theory + techniques + agent instructions + cert/compliance use case
TUTORIAL-ankiconnect-deck-building.md Deck building over the HTTP API; the pull system
AGENTS.md AI-agent operating instructions for deck maintenance
CARD-CHANGES.md Template card-change queue (the human→agent inbox)
build_deck_ankiconnect.py Generic JSON → Anki deck builder (test-deck first, mapping file per batch)
process_card_changes.py Batch card editor: backup → apply → verify; escalation tags (fixme/mic)
check_leeches.py List leech cards in one deck
generate_leech_report.py Full-collection leech report, grouped by deck (read-only)
anki_daily_report.py Daily review stats + leech diagnosis + confusable-cluster detection (read-only; optional AI diagnosis via your own API key)
apply_cissp_leech_rewrites.py Worked example: minimum-information rewrites applied to a test deck
examples/ Sample card JSON (149-card Critical Thought Catechism deck) + a leech-rewrite mapping file
tests/ AnkiConnect connectivity/write smoke test

Safety model (short version)

  • AnkiConnect only — scripts never touch collection.anki2 directly and never re-import .apkg files into a live profile.
  • Backup before every write batch (deck-scoped exportPackage, scheduling included).
  • Test decks first (Anki-Test-<Topic>-<date>); promote only after studying a sample.
  • Never delete — suspend. Edits are made in place so review history survives.
  • Full rules in KNOWLEDGE.md §3 and AGENTS.md.

Sample data note

examples/catechism-cards-260715.json is sourced from the public Critical Thought Catechism. Build your own Q&A cards from understanding — do not bulk-scrape copyrighted exam question banks.