exam-cram-coach
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
Its scripts were only partly scanned.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/ZeKaiNie/universal-examprep-skill with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/ZeKaiNie/universal-examprep-skill'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/zekainie--universal-examprep-skill)HTML
<a href="/listings/zekainie--universal-examprep-skill"><img src="/api/listings/zekainie--universal-examprep-skill/badge.svg" alt="findsafeskills safety rating" /></a>Install
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 43 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- {
- "name": "exam-cram-coach",
- "owner": {
- "name": "ZeKaiNie",
- "url": "https://github.com/ZeKaiNie"
- },
- "metadata": {
- "description": "Exam Cram Coach: an offline exam-prep tutor skill that teaches from your own lecture files with page citations, shows the figures cropped from them, and quizzes you with your own homework and past papers.",
- "version": "5.3.0"
- },
- "plugins": [
- {
- "name": "universal-exam-cram-coach",
- "source": "./skills",
- "strict": false,
- "description": "Exam prep from your own course files: chapter-by-chapter teaching with page citations, figures cropped from the PDFs, quizzes from your homework and past papers, mistakes and progress kept across chats. 期末复习·考前突击·刷题·错题本·小抄.",
- "version": "5.3.0",
- "author": {
- "name": "ZeKaiNie",
- "url": "https://github.com/ZeKaiNie"
- },
- "homepage": "https://github.com/ZeKaiNie/universal-examprep-skill",
- "repository": "https://github.com/ZeKaiNie/universal-examprep-skill",
- "license": "MIT",
- "category": "education",
- "keywords": [
- "exam-prep",
- "study",
- "tutor",
- "quiz",
- "cheat-sheet",
- "education",
- "students",
- "pdf",
- "期末复习",
- "刷题"
- ],
- "skills": [
- "./universal-exam-cram-coach"
- ]
- }
- ]
- }
README.md · README · 368 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- <div align="center">
- <img src="assets/exam-panic.png" width="180" alt="Exam Cram Coach" />
- # Exam Cram Coach · Flash
- *An AI exam-prep tutor for Claude Code, Codex, Cursor, Windsurf, Antigravity and Gemini CLI: drop in your lecture slides, notes, homework and past papers, and it teaches chapter by chapter with page citations, shows the figures, quizzes you with your own questions, tracks mistakes, and builds your cheat sheet.*
- English · [中文](README.zh.md)
- [](https://github.com/ZeKaiNie/universal-examprep-skill/stargazers)
- [](https://skills.sh/zekainie/universal-examprep-skill/universal-exam-cram-coach)
- [](https://github.com/ZeKaiNie/universal-examprep-skill/releases/latest)
- [](LICENSE)
- [](https://github.com/ZeKaiNie/universal-examprep-skill/actions)
- [](https://github.com/hesreallyhim/awesome-claude-code)
- [](https://github.com/VoltAgent/awesome-agent-skills)
- [](https://github.com/Piebald-AI/awesome-gemini-cli)
- ```bash
- # One command for Claude Code, Codex, Cursor, Windsurf, Antigravity, Gemini CLI and 40+ agents
- npx skills add ZeKaiNie/universal-examprep-skill
- ```
- **One command to set up · Teaches from your files · Shows the figures · Quizzes from your homework · Never hides what it made up**
- </div>
- Exam Cram Coach is an [Agent Skill](skills/universal-exam-cram-coach/SKILL.md) plus one small Python tool. You give a coding agent (Claude Code, Codex, Cursor, Windsurf, Antigravity, Gemini CLI, …) the folder with your lecture slides, notes, homework and past papers. It is engineered with three core technical differentiators:
- 1. **🎯 100% Grounded & Anti-Hallucination**: Every taught concept cites exact `file p.N` references; out-of-scope queries exit with non-zero status to strictly prevent fabrication (100% out-of-scope abstention); transparent 🟢/🟡/⚠️ provenance tags distinguish materials from AI commentary.
- 2. **🧠 Cross-Session Persistent Memory**: Maintains state locally in `study_state.json` and a mistake log without external vector databases or token bloat. Close your chat and resume anytime with `coach.py status`; mistakes are prioritized in spaced re-quizzing.
- 3. **⚡ High-End Performance on Cheap / Weak Models**: Deterministic CLI output with `📍 next command` hints and automated vector-figure cropping (`pypdfium2`). Benchmarked on 1,000+ pages of real college probability notes: **Gemini Flash-Lite** and **Claude Haiku** achieve zero command fabrication, zero phantom citations, and publication-grade figure presentations (see [Weak Model Benchmark](docs/weak-model-test.en.md)).
- Core workflow:
- - reads PDF / PPTX / DOCX / Markdown / TXT / HTML and splits the course into chapters;
- - **cuts the figures out of the lecture notes and the printed questions and solutions**, so it can put the right picture in front of you while it explains;
- - pulls the real questions and reference answers out of homework and exams (matches `hw2.pdf` with `hw2solutions.pdf`, and “Problem 1.3.10” with its solution);
- - teaches chapter by chapter in plain words, quizzes only with those questions, tracks mistakes, and compiles a concise cheat sheet;
- - labels every sentence so you always know where it came from:
- | Label | Meaning |
- |---|---|
- | 🟢 **From your materials** | traceable to a file and page |
- | 🟡 **AI supplement** | background the agent added; may differ from what your teacher taught |
- | ⚠️ **AI-generated answer** | the materials contain no answer; this one is the agent's own |
- ## 🌟 Featured & Curated By
- Universal Exam Cram Coach is officially indexed and recommended across major AI agent ecosystems:
- - **[Awesome Claude Code](https://github.com/hesreallyhim/awesome-claude-code)** (56k+ ⭐) — The premier curated directory for Claude Code; featured in *Documentation, Knowledge & Learning* (manually approved by maintainer).
- - **[Awesome Agent Skills](https://github.com/VoltAgent/awesome-agent-skills)** (36k+ ⭐) — The cross-ecosystem directory for AI agent skills; featured in *Community Skills · Specialized Domains*.
- - **[Awesome Gemini CLI](https://github.com/Piebald-AI/awesome-gemini-cli)** — Curated tools and skills for Google Gemini CLI.
- ## Two editions, pick one
- | | **Flash** (this folder, recommended) | **Full** (v4.3, in [`full/`](full/)) |
- |---|---|---|
- | For | anyone with an exam coming up; small or local models | readers who want the complete knowledge-base build, printable HTML/PDF study guides and the verification pipeline |
- | Setup | one command, seconds | several confirmation steps, the agent renders pages itself |
- | README | this page · [中文](README.zh.md) | [full/README.md](full/README.md) · [full/README.zh.md](full/README.zh.md) |
- | Install | `npx skills add ZeKaiNie/universal-examprep-skill`, or `universal-exam-cram-coach-flash.zip` from the [latest release](https://github.com/ZeKaiNie/universal-examprep-skill/releases/latest) | `npx skills add ZeKaiNie/universal-examprep-skill --skill universal-exam-cram-coach-full`; updating and the v4.3 zip are covered in [full/README.md](full/README.md) |
- The rest of this page is about **Flash**: setup takes seconds even for a whole course, the whole skill is about 1,600 words, the study loop is seven commands, and it works with small models (tested with Gemini flash-lite and Claude Haiku). A feature-by-feature comparison is in [Flash vs. the full edition](#flash-vs-the-full-edition).
- ## Contents
- 1. [Start studying in five minutes](#start-studying-in-five-minutes)
- 2. [What a study session looks like](#what-a-study-session-looks-like)
- 3. [Preparing your materials](#preparing-your-materials)
- 4. [Flash vs. the full edition](#flash-vs-the-full-edition)
- 5. [What ends up in the `exam-cram/` folder](#what-ends-up-in-the-exam-cram-folder)
- 6. [Command reference](#command-reference)
- 7. [Measured results](#measured-results)
- 8. [FAQ](#faq)
- 9. [For developers](#for-developers)
- ## Start studying in five minutes
- ### Step 0 · What you need
- - **A coding agent with a terminal**: Claude Code, Codex, Cursor, Windsurf, Antigravity, Gemini CLI, or any other agent that can run shell commands and read files. For PDF-heavy courses prefer the desktop app or IDE version of your agent: terminals often cannot display the figures.
- - **Python 3.8 or newer.** Check with `python --version`. On Windows, install it from [python.org](https://www.python.org/downloads/) and tick *Add python.exe to PATH*.
- - Optional but recommended: `pip install pypdfium2`. It gives PDF text extraction and figure cropping. Without it, PDFs are listed as “needs pypdfium2” and everything else (PPTX, DOCX, Markdown, TXT) still works.
- ### Step 1 · Install the skill
- **Recommended: one command.** It needs Node.js 18 or newer for `npx` (check with `node --version`):
- ```bash
- npx skills add ZeKaiNie/universal-examprep-skill
- pip install pypdfium2
- ```
- The first command asks which agents to set up (Claude Code, Codex, Cursor, Windsurf, Antigravity, Gemini CLI, GitHub Copilot and 40+ others) and whether to install for this project or for your user account (`-g`). It copies one folder, `universal-exam-cram-coach/`: 13 files, about 150 KB, and the tool inside runs offline. Update later with `npx skills update`.
- **Claude Code plugin** (alternative; no Node.js needed). Type these in Claude Code:
- ```text
- /plugin marketplace add ZeKaiNie/universal-examprep-skill
- /plugin install universal-exam-cram-coach@exam-cram-coach
- ```
- **Or ask your agent to do it.** Paste this; it may ask you to approve running the commands:
- ```text
- Install the Exam Cram Coach skill for this agent: run `npx skills add ZeKaiNie/universal-examprep-skill --skill universal-exam-cram-coach` (the CLI detects you and installs for you), then run `pip install pypdfium2`, then run `python <installed folder>/coach.py doctor` and show me its output.
- ```
- <details><summary>Offline install from the release zip, and the skills folder of each agent</summary>
- Download `universal-exam-cram-coach-flash.zip` and `SHA256SUMS.txt` from the [latest release](https://github.com/ZeKaiNie/universal-examprep-skill/releases/latest), check the checksum, and unzip into your agent's skills folder:
- ```bash
- sha256sum -c SHA256SUMS.txt # macOS: shasum -a 256 -c SHA256SUMS.txt
- ```
- On Windows, `certutil -hashfile universal-exam-cram-coach-flash.zip SHA256` prints the hash to compare with `SHA256SUMS.txt`.
- | Agent | User-level skills folder |
- |---|---|
- | Claude Code | `~/.claude/skills/` |
- | Codex | `~/.codex/skills/` |
- | Cursor | `~/.cursor/skills/` |
- | Windsurf | `~/.codeium/windsurf/skills/` |
- | Antigravity | `~/.gemini/antigravity/skills/` |
- | Gemini CLI | `~/.gemini/skills/` |
- | GitHub Copilot | `~/.copilot/skills/` |
- You should end up with `…/skills/universal-exam-cram-coach/SKILL.md` and `…/skills/universal-exam-cram-coach/coach.py`.
- </details>
- To check the install from any terminal (use your agent's folder from the table):
- ```bash
- python ~/.claude/skills/universal-exam-cram-coach/coach.py doctor
- ```
- It prints the version, whether PDF support is available, and the last workspace used.
- **Installed an earlier Flash version?** Versions 5.0 and 5.1 installed as `exam-cram-coach` and copied the whole repository (about 12 MB). Run `npx skills remove exam-cram-coach` (add `-g` if you installed it for your user account, or delete that folder), then install again as above. Your study workspaces are separate and stay as they are. The name `universal-exam-cram-coach` used to install the v4.3 full edition; `npx skills update` now brings Flash, and `npx skills add ZeKaiNie/universal-examprep-skill --skill universal-exam-cram-coach-full` keeps v4.3 ([how to update it](full/README.md)).
- ### Step 2 · Put your materials in one folder
- Anything goes in one folder (sub-folders are fine): slides, lecture notes, textbook chapters, homework, solutions, quizzes, past exams. See [Preparing your materials](#preparing-your-materials) for naming tips that make chapters and answers line up automatically. Your own scanned homework can stay in the folder: it is detected and never shown as an answer.
- ### Step 3 · Send the first message
- ```text
- Use the Exam Cram Coach skill. My materials are in D:\Courses\Probability. The exam is in 3 days, I am starting from zero, teach me in English from chapter 1.
- ```
- The agent will run one command (`coach.py setup`), which takes a few seconds even for a thousand pages, and reply with the chapter list, the number of questions it found, and any warning such as *“3 PDFs need `pip install pypdfium2`”* or *“file X has no text, I will open it directly”*. Then it starts teaching chapter 1.
- ### Step 4 · Keep talking normally
- | You say | What happens |
- |---|---|
- | “next” / “continue” | the next slice of the chapter, explained in plain words, with `[lec2.pdf p.3]` sources and the figures from those pages |
- | “what is …?” / “why …?” | it searches your materials and answers only from the matching passages; if nothing matches it says so |
- | “quiz me” | a homework or exam question (with its printed figure), past-exam questions first; multiple-choice, true/false, number and short fill-in answers are graded by the script itself, the rest by the agent against the reference answer; wrong ones go to your mistake list |
- | “I'm done with this chapter” | the chapter is marked *verified* (you answered a material question right) or *covered*, and it moves on |
- | “show me my mistakes” / “make a cheat sheet” | re-teaches open mistakes; writes `cheatsheet.md` from your chapter summaries, confusions and mistakes |
- | “what should I do today?” | `coach.py plan` splits the remaining chapters over the days left until the exam date (the last day is kept for mistakes and the cheat sheet); when there is not enough time, it names the chapters past exams ask most |
- | new chat, days later | say “continue my exam prep” and it resumes exactly where you stopped |
- Every reply ends with a 📍 progress line (chapter and part, quiz score, mistakes, days left, next step) copied from the tool, so a long session never loses its place.
- ## What a study session looks like
- This is what a student saw in a real session on a probability course (Gemini flash-lite, translated from Chinese). Where the transcript shows `` the chat displayed a figure that `setup` had cut out of the lecture PDF:
- > **Chapter 1: Set Theory**
- >
- > 🟢 A *set* is a collection of things. Capital letters name sets (A), small letters name elements (x). x ∈ A means x is an element of A, x ∉ A means it is not. (ch01.pdf p.3)
- >
- > 🟢 **Union A ∪ B**: everything that is in A or in B or in both — on a Venn diagram, the whole area both circles cover. (ch01.pdf p.4)
- >
- > *[figure cropped from ch01.pdf p.4 shown here]*
- >
- > 🟢 **Partition**: a family of sets that is both mutually exclusive and collectively exhaustive. (ch01.pdf p.9)
- >
- > These are the foundation for everything that follows. Say “next” when you are ready for the examples.
- Later, on a homework question whose statement is only a textbook number:
- > **Quiz · Problem 1.1.2** (hw1.pdf p.1)
- >
- > 🟡 Givens, restated from the reference answer: a pizza is either Tuscan (T) or Neapolitan (N), so {N, T} is a partition; M = mushrooms, O = onions. Are N and M mutually exclusive? Are N and T collectively exhaustive? …
- >
- > *(student: “I can't do it, show me the answer”)*
- >
- > 🟢 **Reference solution** (hw1solution.pdf p.1): since N = Tᶜ, N ∩ M ≠ ∅, so N and M are **not** mutually exclusive. N ∪ T = S, so they **are** collectively exhaustive. From the diagram T and O do not overlap …
- >
- > *[the solution's Venn diagram, cropped from hw1solution.pdf p.1, shown here]*
- >
- > Record it with `python coach.py answer q001 right` or `… wrong`, or say “next”.
- Every fact carries a page; every picture is a crop of the original file; the answer figure appears only after you asked for the answer. The crops look like this (from the MIT 6.006 lecture notes and Quiz 1, CC BY-NC-SA, produced by `setup` with no manual work):
- <div align="center">
- <img src="docs/img/mit_lecture_figure.png" width="420" alt="a figure cropped from a lecture page" />
-
- <img src="docs/img/mit_question_figure.png" width="380" alt="a printed quiz problem cropped with its diagram" />
- </div>
- ## Preparing your materials
- The tool works on any layout, but a few habits make the automatic chapter split and answer matching perfect:
- | Goal | Tip |
- |---|---|
- | Chapters in the right order | Put a number in the lecture file name: `lec3.pdf`, `Lecture 03 - Sorting.pptx`, `ch05_hashing.docx`, `第3章_栈.pptx`. A slide deck whose first page says “Chapter 3 / Title” is also recognised. A single big file with “Chapter N” headings inside is split on those headings. |
- | Homework matched with solutions | Keep the same base name: `hw2.pdf` + `hw2solutions.pdf`, `作业2.txt` + `作业2答案.txt`, `q1.pdf` + `q1_sol.pdf`. Download suffixes like `hw2 (4)(1).pdf` are ignored. |
- | Questions detected | Number them: `Problem 3`, `3.`, `(3)`, `第3题`, or textbook labels `Problem 1.3.10`. Sections such as “二、填空题” restart the numbering. |
- | Textbook problems (“Problem 1.3.10”) with no statement in the folder | Still fine: the question is paired with its solution, and the quiz shows the givens from the start of the solution, labelled 🟡. |
- | Figures | Nothing to do for PDF (vector drawings and embedded images are cropped automatically), PPTX and DOCX (embedded pictures are extracted). Loose image files named `fig3.png` are attached to chapter 3. |
- | Scanned or handwritten pages | Detected automatically and skipped; they are never used as question text or answers. |
- | Language | Detected from the materials; force it with `--lang zh|en`. The agent replies in the language you write. |
- Supported input: `.pdf` (needs `pypdfium2` or `pypdf`), `.pptx`, `.docx`, `.md`, `.txt`, `.html`, and image files. Excel files and audio are not read.
- ## Flash vs. the full edition
- | | **Flash (root of this repository, v5.x)** | Full (v4.3, `full/`) |
- |---|---|---|
- | Setup | one command, seconds | several confirmation commands, the agent renders PDF pages itself and writes “receipts” |
- | Skill text the agent must read | ≈6 KB | ≈140 KB |
- | Figures | cropped from PDF/PPTX/DOCX by the tool, listed with each slice, question and answer | agent-rendered pages, contact sheets, per-crop review calls |
- | Works with small models | yes (Gemini flash-lite, Claude Haiku tested) | no |
- | Web study guide (HTML/PDF), page-by-page visual QA | no | yes |
- | Knowledge windows, 3×4 learning-mode matrix, generation ledgers, remote parser adapters | no | yes |
- | Provenance labels, materials-only quizzes, mistakes, notes, cheat sheet, progress across chats | yes | yes |
- Use Flash unless you specifically want the printable HTML/PDF study guides of v4.3. Both editions stay in this repository (`full/` is the v4.3 tree, unchanged, with its own README and tests). They do not share workspaces: after switching, re-run `setup` on the materials folder.
- ## What ends up in the `exam-cram/` folder
- `setup` creates one folder next to your materials (or where `--workspace` points). Everything is plain text or PNG; nothing is uploaded anywhere.
- | Path | What it is |
- |---|---|
- | `study_state.json` | the only state: course, current chapter, progress per chapter, quiz results, mistakes, notes |
- | `progress.md`, `notebook.md` | readable views of the state (regenerated on every change) |
- | `chapters/chNN_title.md` | the chapter text with `[file p.N]` anchors — open it to read along |
- | `quiz_bank.json` | every question with its answer, source file/page, chapter and figure paths |
- | `figures/` + `figures.json` | cropped figures: `ch03_p12_1.png` (lecture page 12), `hw1solution_q001_ans_1.png` (answer figure of q001) |
- | `index.json` | retrieval chunks used by `ask` |
- | `cheatsheet.md` | written by `cheatsheet` |
- Delete the folder to start over, or run `setup … --fresh`.
- ## Command reference
- You normally never type these; the agent does. They are useful for checking on things or for automation.
- ```text
- python coach.py setup <folder> [--days N | --date YYYY-MM-DD] [--profile small|standard|large] [--lang zh|en] [--name COURSE] [--start N] [--slice CHARS] [--fresh]
- python coach.py status progress panel
- python coach.py next [--repeat|--back] next slice of the current chapter + its figures
- python coach.py chapter N [--part K] inspect chapter N (list parts or print one)
- python coach.py goto N [--restart] switch chapter
- python coach.py ask "keywords" [-k 5] [--chapter N] search the materials (exit code 4 = nothing found)
- python coach.py quiz [-n N] [--chapter N] [--all] pick questions (open mistakes first, then past-exam questions)
- python coach.py grade <id> "student's answer" grade and record choice / true-false / number / short fill-in; otherwise print the reference
- python coach.py check <id> reference answer, its source and answer figure
- python coach.py answer <id> right|wrong|skip [--note …] record a result
- python coach.py done [--chapter N] finish the chapter, move on
- python coach.py note "…" [--type summary|confusion|note] [--chapter N]
- python coach.py mistakes [--answers] open mistakes
- python coach.py cheatsheet [--out FILE] build the cheat sheet
- python coach.py plan [--days N|--date D] day-by-day plan to the exam date, with questions per chapter
- python coach.py export [--to DIR] [--qid …] [--chapter N] [paths…] copy figures where the chat UI can render them
- python coach.py figures [--chapter N] [--file F] [--page P] list cropped figures
- python coach.py figure <file> <page> [--crop x0,y0,x1,y1] [--scale 2] render a page or a region
- python coach.py doctor environment check
- python coach.py help
- ```
- `--workspace PATH` (or the environment variable `EXAM_CRAM_WORKSPACE`) selects a workspace; otherwise the last one used is remembered. `--profile` matches the output to the model: `small` (short slices, one question per quiz) for small or fast models, `large` (slices about three times longer, five questions per quiz) for frontier models; the agent picks it for itself. `--slice CHARS` sets the slice length directly.
- ## Measured results
- All numbers were measured on a Windows 11 laptop with Python 3.12; the commands are in [docs/v5-refactor.en.md](docs/v5-refactor.en.md).
- **Setup speed and extraction quality**
- | Course | Files | `setup` time | Chapters found | Questions paired with answers | Figures cropped |
- |---|---|---|---|---|---|
- | MIT 6.006 (OCW): 6 lecture PDFs + Quiz 1 + official solutions | 8 PDFs, 1.9 MB | 1.4 s | 6/6, titles correct | 9/9 | 34 lecture figures |
- | Open Yale PSYC 110: 4 lecture transcripts | 4 Markdown | 0.1 s | 4/4 | (no homework) | — |
- | EEC 160 Applied Probability (private): 9 slide decks, 9 homework sheets with scanned handwriting, 9 solution sets | 27 PDFs, 1000 pages, 30 MB | 9 s | 9/9, multi-line titles joined | 89/89 by textbook label | 235 lecture figures + 16 answer figures; 140 scanned pages skipped |
- **Weak models actually follow it.** Four-turn Chinese session on EEC 160 with only `SKILL.md` as guidance ([docs/weak-model-test.en.md](docs/weak-model-test.en.md)):
- | Model | Ran setup → next → quiz → check | Page citations | 🟢/🟡 labels | Figures embedded in replies | Invented commands |
- |---|---|---|---|---|---|
- | Gemini flash-lite (Antigravity) | ✅ | 17 | 8/1 | 10 | none |
- | Gemini flash (Antigravity) | ✅ | 21 | 14/15 | 6 | none |
- | Claude Haiku 4.5 | ✅ | 13 | 14/14 | 5 | none |
- **Compared with v4.3** on the same MIT course: skill text read by the agent 140 KB → 10 KB; script calls before the first explanation 5 → 1; unit-test suite 12 minutes → under one second; repository 144k lines → 2.5k.
- **What `npx skills add` puts on your disk** (measured with skills CLI 1.7.0): 545 files / 12 MB in v5.1, when the skill sat at the repository root and the CLI copied everything; 13 files / 150 KB since v5.2, which installs only `skills/universal-exam-cram-coach/`.
- ## FAQ
- **The agent says PDFs need pypdfium2.** Run `pip install pypdfium2` (on Windows, `py -m pip install pypdfium2` if `pip` is not found), then ask the agent to run `setup` again. `pypdf` also works for text but cannot crop figures.
- **`python` is not recognized.** Install Python from python.org and tick *Add python.exe to PATH*, or tell the agent the full path to your Python.
- **I don't see the pictures in the chat.** Two different causes. Terminals cannot render images at all: use the desktop or IDE version of your agent, or open the PNG path it printed. Chat panels built on VS Code / Electron (Cursor, Windsurf, Antigravity, VS Code extensions) do render images, but block `file://` paths outside the opened workspace or in a Temp folder: the skill then runs `coach.py export --to <a folder inside the workspace or the host's artifact folder>` and embeds the copied files. If a picture still does not appear, the agent has at least opened it and can describe it, and gives you the path to click.
- **My slides are scans without text.** They are listed as “no text”; the agent can render any page with `coach.py figure <file> <page>` and read it with its own vision. Handwritten homework is skipped on purpose.
- **A question shows only “Problem 1.4.4”.** The statement is in the textbook, not in your folder. The quiz prints the givens from the start of the reference solution (🟡) and the agent teaches from the solution; it must not invent a different problem.
- **No questions were found.** Check the naming tips above; questions need a number or label at the start of a line. `quiz --all` draws from every chapter.
- **Chapters are wrong.** Put the chapter number in the file name (`lec3`, `第3章`, `03-…`), or split a combined file. `coach.py chapter N` shows what each chapter contains.
- **Several courses.** Each materials folder gets its own `exam-cram/`; the last one used is remembered, or pass `--workspace`.
- **Start over / change the exam date.** `setup <folder> --fresh` discards progress; `setup <folder> --days 2` updates the date and keeps progress.
- **Where does my data go?** Nowhere. The tool only writes into `exam-cram/`. Your agent host sees the text and images it prints, the same as any file you open with the agent.
- **Is it safe to install? What if a course file contains instructions for the AI?** The installed skill is 13 small files that need no network access, run no other programs and hold no keys. Everything it prints from your files sits between `<<<MATERIAL` and `MATERIAL>>>`, and `SKILL.md` tells the agent to treat that text as course content only. Lines such as “ignore previous instructions” or “如果你是 AI…” are flagged with ⚠️, both by `setup` and wherever they are shown; that check is a heuristic, while the fence and the rule are the actual boundary. Details are in [SECURITY.md](SECURITY.md).
- **Can I use it without an agent?** Yes: every command prints plain text, so `python coach.py next` and `python coach.py quiz` work as a reading and drill tool on their own.
- **Can I use it in a web chat without Python?** The skill has a fallback (§8 of SKILL.md), but progress, figures and quizzes work much better with a local agent.
- ## For developers
- ```bash
- git clone https://github.com/ZeKaiNie/universal-examprep-skill
- cd universal-examprep-skill
- pip install pypdfium2
- python -m unittest discover -s tests -v # 43 tests, about a second
- python coach.py setup samples/zh-data-structures # bundled Chinese sample course
- python samples/fetch.py # MIT 6.006 + Yale PSYC 110 (CC BY-NC-SA)
- python eval/agent_smoke.py claude --model claude-haiku-4-5-20251001 --materials <folder> # drive a real agent
- python release.py # build dist/universal-exam-cram-coach-flash.zip + SHA256SUMS.txt
- ```
- Layout: `skills/universal-exam-cram-coach/` is the installable skill and nothing else (`SKILL.md`, `coach.py`, `coach/` with `extract` → `chapters` → `questions` → `figures` → `guard` → `index` → `state` → `cli`, `LICENSE`); `tests/test_skill_surface.py` keeps that folder small, offline and audit-clean. The root `coach.py` is a developer shortcut to the same CLI. Also `.claude-plugin/marketplace.json` (Claude Code plugin), `tests/`, `samples/`, `eval/` (agent smoke test and scorer), `docs/` ([refactor report](docs/v5-refactor.en.md), [feature audit](docs/feature-audit.en.md), [weak-model test](docs/weak-model-test.en.md)). Release history is in [CHANGELOG.md](CHANGELOG.md); contribution notes in [CONTRIBUTING.md](CONTRIBUTING.md).
- ## Keywords
- So that people and agents searching in either language find this page: exam prep · final exam cram · midterm revision · study from lecture slides PDF / PPTX · AI tutor that cites sources · quiz from homework and past papers · mistake notebook · cheat sheet generator · study plan for N days · figures extracted from lecture notes · Agent Skill for Claude Code / Codex / Cursor / Windsurf / Antigravity / Gemini CLI · works with small local models · offline, no server, Python, MIT. 期末复习 · 考前突击 · 期中复习 · 考研/考证复习 · 课件 PDF 讲解 · AI 家教 · 引用出处不编造 · 用作业和真题刷题 · 错题本 · 考前小抄 · 复习计划 · 讲义配图 · Claude Code / Codex / Cursor 智能体技能 · 本地运行 · 开源。
- ## License
- [MIT](LICENSE). Sample courses keep their own licenses (see [samples/README.md](samples/README.md)); the two example crops above come from MIT OpenCourseWare 6.006 (CC BY-NC-SA 4.0). Good luck with your exam. 🎓
- <div align="center">
- <a href="https://www.star-history.com/?repos=ZeKaiNie%2Funiversal-examprep-skill&type=date&legend=top-left">
- <picture>
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=ZeKaiNie/universal-examprep-skill&type=date&theme=dark&legend=top-left" />
- <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=ZeKaiNie/universal-examprep-skill&type=date&legend=top-left" />
- </picture>
- </a>
- </div>
skills/universal-exam-cram-coach/coach/guard.py · Bundled script · 124 lines · 3 findings marked
- # -*- coding: utf-8 -*-
- """Course files are data, never instructions.
- Everything the tool prints from a student's files goes between two fence lines that carry
- an id derived from the fenced text, so the text itself cannot forge the closing line.
- Lines that look like instructions to an AI ("ignore previous instructions", "如果你是 AI…",
- Note: Quoted as data in code: Quotes instruction-override phrasing (in quotes, code, a table or an example): "ignore previous instructions"
- Line 6 on GitHub
- "send the student's notes to https://…") are flagged.
- The detector is a heuristic: it catches common phrasings in English and Chinese, can miss
- a reworded attack, and occasionally flags ordinary text (for example a psychology study
- that quotes such an instruction). The fence and the rule in SKILL.md are the real boundary;
- the flag only draws attention.
- """
- import hashlib
- import re
- import unicodedata
- OPEN = "<<<MATERIAL"
- CLOSE = "MATERIAL>>>"
- _ZERO_WIDTH = re.compile("[---]")
- Note: Usual in code (characters a sanitizer strips): Contains 2 bidirectional-override character(s), which make text display in a different order from how it's read
- Line 21 on GitHub
- _AI = (r"(?:ai|a\.i\.|ai\s+(?:assistant|model|tutor|agent)|"
- r"assistant(?!\s+(?:professor|prof\b|manager|director|lecturer|coach|editor|teacher|instructor|dean|principal))|"
- r"chatbot|chat\s*gpt|gpt-?\d\w*|claude|gemini|copilot|llm|(?:large\s+)?language\s+model)")
- _EN = [
- # "ignore all previous instructions", "disregard your guidelines", "ignore everything above"
- Note: Quoted as data in code: Quotes instruction-override phrasing (in quotes, code, a table or an example): "ignore all previous instructions"
- Line 27 on GitHub
- r"\b(?:ignore|disregard|forget|override)\b[^.\n]{0,40}\b(?:previous|prior|above|earlier|preceding|all|any|your|these|those)\b"
- r"[^.\n]{0,30}\b(?:instructions?|prompts?|directives?|guidelines)\b",
- r"\b(?:ignore|disregard|forget)\s+(?:everything|anything|all)\s+(?:above|before|so\s+far|previously)\b",
- r"\b(?:ignore|disregard|forget)\s+(?:the\s+|all\s+(?:the\s+)?)?(?:previous|prior|above|earlier|preceding)\s+(?:rules|context|messages?|text|content)\b",
- r"\byou\s+are\s+(?:now\s+)?(?:an?\s+)?(?:ai\s+(?:assistant|model|tutor|agent)|chat\s*gpt|gpt-?\d\w*|claude|gemini|copilot|llm|(?:large\s+)?language\s+model)\b",
- r"\bif\s+you\s+are\s+(?:an?\s+)?" + _AI + r"\b",
- r"\bas\s+an?\s+(?:ai|ai\s+(?:assistant|model)|language\s+model|llm)\s*,\s*you\b",
- r"\b(?:note|message|instructions?|reminder|attention)\s*(?:to|for)?\s*(?:the\s+|any\s+)?" + _AI + r"s?\s*[::]",
- r"\b(?:hey|hi|dear|attention|note\s+to)\s*,?\s*" + _AI + r"\b",
- r"^\s*(?:dear\s+)?" + _AI + r"\s*[,,::]\s*(?:please|you|do|don't|ignore|tell|mark|skip|say|give|output)\b",
- r"^\s*(?:new|updated|real|actual|hidden|secret)\s+instructions?\s*[::]",
- r"\b(?:reveal|print|show|output|repeat)\s+(?:your|the)\s+(?:system|developer)\s+prompt\b",
- r"\b(?:do\s+not|don't|never)\s+(?:reveal|disclose|mention)\s+(?:this|these|that|it)\b[^.\n]{0,20}\b(?:user|student)s?\b",
- r"\b(?:do\s+not|don't|never)\s+(?:tell|let|inform)\s+(?:the\s+)?(?:user|student)s?\s+(?:know|about\s+(?:this|these|that|it))\b",
- r"\b(?:send|upload|post|forward|exfiltrate|email)\b[^.\n]{0,40}\b(?:(?:the\s+)?(?:student|user)'?s?|their)\s+(?:notes?|files?|data|answers?|messages?|conversation|history|keys?|passwords?|work)\b[^.\n]{0,30}\bto\s+https?://",
- r"<\|im_start\|>\s*system",
- ]
- _ZH = [
- r"(?:忽略|无视|忘记|忘掉|不要理会)(?:你)?(?:之前|以上|前面|上面|上述|先前|原有|原来)的?(?:所有|全部)?的?(?:指令|指示|提示词?|规则|设定|要求|内容)",
- r"(?:忽略|无视|忘记|忘掉)(?:你的)?(?:所有|全部)(?:的)?(?:指令|指示|提示词?|规则|设定)",
- r"你(?:现在)?(?:是|扮演|作为)(?:一个|一名)?[^,。,.\n]{0,10}?(?:AI|人工智能|ChatGPT|GPT|Claude|Gemini|智能助手|大模型|语言模型)",
- r"(?:如果|假如|若)你是(?:一个|一名)?\s*(?:AI|人工智能|大模型|语言模型|助手|智能体)",
- r"作为(?:一个|一名)?\s*(?:AI|人工智能|大模型|语言模型|AI\s*助手)\s*[,,]?\s*你",
- r"(?:给|对|致)\s*(?:AI|人工智能|大模型|助手|模型|智能体)的?\s*(?:指令|说明|提示|话)",
- r"^\s*(?:致|给)\s*(?:AI|人工智能|大模型|智能体|AI\s*助手)\s*[::]",
- r"(?:AI|人工智能|大模型|语言模型|智能体|AI\s*助手)\s*(?:请注意|请你|请直接|请跳过|请忽略|请务必|注意)",
- r"(?:输出|泄露|透露|显示|打印|复述)(?:你的)?系统提示词",
- r"不要(?:向|跟|对)(?:学生|用户)(?:透露|说|提起|提到|讲)(?:这|此|本)",
- r"不要(?:告诉|让|提醒)(?:学生|用户)(?:这|此|本|知道)",
- r"(?:学生|用户)的?[^。\n]{0,15}(?:发送|上传|转发)(?:到|给)\s*https?://",
- r"(?:发送|上传|转发)(?:学生|用户)的?[^。\n]{0,15}(?:到|给)\s*https?://",
- ]
- _PATTERNS = [re.compile(p, re.I | re.M) for p in _EN + _ZH]
- _MARKER = re.compile(r"<\s*<\s*<\s*m\W{0,3}a\W{0,3}t\W{0,3}e\W{0,3}r\W{0,3}i\W{0,3}a\W{0,3}l"
- r"|m\W{0,3}a\W{0,3}t\W{0,3}e\W{0,3}r\W{0,3}i\W{0,3}a\W{0,3}l\s*>\s*>\s*>", re.I)
- def _norm(text):
- """Detection copy: NFKC (fullwidth → ASCII), no zero-width or bidi controls."""
- return _ZERO_WIDTH.sub("", unicodedata.normalize("NFKC", text))
- def is_suspicious(line):
- s = _norm(line)
- return any(p.search(s) for p in _PATTERNS)
- def flagged_lines(text, limit=5):
- """Indexes of lines that address an AI; a sentence split over two lines is caught too."""
- lines = text.split("\n")
- out = []
- for i, line in enumerate(lines):
- s = line.strip()
- if not s:
- continue
- hit = is_suspicious(s)
- if not hit and i + 1 < len(lines):
- nxt = lines[i + 1].strip()
- # PDF extraction breaks sentences: Latin text rejoins with a space, CJK text without
- hit = not is_suspicious(nxt) and (is_suspicious(s + " " + nxt) or is_suspicious(s + nxt))
- if hit:
- out.append(i)
- if len(out) >= limit:
- break
- return out
- def neutralize(text):
- """Break anything that looks like a fence marker, whatever its case, spacing or width."""
- chars, index = [], []
- for pos, ch in enumerate(text):
- if _ZERO_WIDTH.match(ch):
- continue
- for c in unicodedata.normalize("NFKC", ch):
- chars.append(c)
- index.append(pos)
- norm = "".join(chars)
- spans = [(index[m.start()], index[m.end() - 1] + 1) for m in _MARKER.finditer(norm)]
- if not spans:
- return _ZERO_WIDTH.sub("", text) if _ZERO_WIDTH.search(text) else text
- out, last = [], 0
- for a, b in spans:
- out.append(text[last:a])
- out.append("[fence-like text removed]")
- last = b
- out.append(text[last:])
- return _ZERO_WIDTH.sub("", "".join(out))
- def fence_id(text):
- return hashlib.sha256(text.encode("utf-8", "replace")).hexdigest()[:6]
- def fence(text):
- body = neutralize(text).rstrip()
- fid = fence_id(body)
- return "%s %s\n%s\n%s %s" % (OPEN, fid, body, CLOSE, fid)
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.