DannyMac180/skills/tree/main/modsmith/templates/quiz-after
quiz-after
Claude 完成有变更的任务后,提示栏上方会出现一个小测验:针对刚完成的内容提出两个或三个问题,每题都有按钮可显示答案和原因。它检查你是否理解变更,而不是否记得文件名。按下 **Save to deck**,问题就会成为 explain-this 卡组中的间隔重复卡片。
关于这个 mod
quiz-after
Claude 完成有变更的任务后,提示栏上方会出现一个小测验:针对刚完成的内容提出两个或三个问题,每题都有按钮可显示答案和原因。它检查你是否理解变更,而不是有没有记得文件名。按下 Save to deck,问题就会成为 explain-this 卡组中的间隔重复卡片。
测验 · 带退避的重试队列 · fork: 48.2k 已缓存,350 个新增,520 个输出
1. 为什么队列要退避,而不是以固定速率重试?
[ 显示答案 1 ]
2. 工作在最后一次重试后仍然失败,会发生什么?
a) 丢弃工作
b) 放入死信列表
c) 永远重试
→ 放入死信列表。worker 不会静默丢弃工作。
[ Save to deck ] [ Dismiss ]
判断方式
- 回合运行期间,它会计算主对话中不是只读的工具调用(编辑、写入、会改变内容的 Bash 命令、启动 subagent)。读取、搜索、普通聊天和记账工具(TodoWrite、task 工具、plan mode、AskUserQuestion、ToolSearch)都不计入。
- 主回合正常结束,且计数大于零时,它会调用一次
$.model.fork。fork 看到的是主线程最后发送的对话,并先回答:任务真的完成了吗? - 未完成:不绘制任何内容。已完成:返回 JSON,其中的问题会先清理(删除不良字段、最多三题,只有答案是选项之一时才使用选择题),然后绘制。
fork 会在回合结束后由计时器运行,因此不会阻塞回合。如果在它回答前发送新的提示,该测验就会被丢弃。
费用
| 时机 | 模型调用 | Tokens |
| --- | --- | --- |
| 仅聊天或只读回合、已中止的回合、subagent 回合 | 无 | 0 |
| /quiz off | 无 | 0 |
| 有变更的回合、测验开启、任务完成 | 1 次 fork | 整份逐字稿作为输入,主要来自提示缓存,另外约 350 个问题输入 token,以及约 200 到 700 个输出 token |
| 相同情况,但 fork 判断任务尚未完成 | 1 次 fork | 相同的缓存逐字稿和约 350 个新增输入 token,约 10 个输出 token;不绘制任何内容 |
| /quiz now | 1 次 fork | 和已完成的任务相同 |
| 显示答案、Dismiss、Save to deck | 无 | 0 |
fork 会重用主线程的提示缓存,因此只要缓存条目仍然温热(它刚结束回合,通常如此),逐字稿会按缓存读取费率计费,而不是完整输入价格。测验标题会显示每次 fork 的实际拆分:cached / new / out,让你看到付了多少。cached 接近零,表示缓存已过期或模型发生变化,该 fork 会以完整价格读取逐字稿。
上面的 token 数字是根据提示长度估算的,不是测量值;标题中的数字才是真实数值。缓存读取是主要成本:在 100k token 的会话中,每个符合条件的回合都会读取 100k 个缓存 token,无论最后是否完成。
命令与按键
/quiz切换开启或关闭。设置会保存在插件的$.store中,因此重启后仍会保留。/quiz on和/quiz off可直接指定。/quiz now会要求针对目前为止的工作出题,跳过“是否完成”检查。即使 mod 已关闭也可以使用。- 频带获得焦点后(ctrl+x tab,或点击):
1、2、3显示答案,s保存到卡组,x关闭。声明也表示,在空白提示栏中输入单独数字会按下频带按钮,所以测验出现时,在空白提示栏输入1会显示答案 1,而不是输入文字(未实际测试)。
保存到卡组(explain-this)
按钮会把每个问题追加为一张卡片,写入
$EXPLAIN_THIS_HOME/memory/cards.jsonl(默认为 ~/.explain-this/memory/),格式就是 explain-this/scripts/sm2.ts add 写入的格式:新的 SM-2 状态(interval_days 0, ease 2.5, due today),transfer 类问题的 type 为 transfer,其他问题为 recall,并带上问题的 tag。答案和原因会一起保存,因为 explain-this 复习会根据它们给自由文本答案评分。
除非按下按钮,否则不会写入任何内容。如果 memory 文件夹不存在,mod 不会创建文件夹,而是显示提示。运行一次 explain-this 来设置卡组。
组合使用
- 提示栏上方的其他频带(例如 token-weather):quiz-after 会先绘制自己的测验,再绘制链中其余内容(
await next(e)),因此不会遮挡其他 mod。survey 占用频带时,它会让开位置。 - explain-this:共享卡片卡组,因此
explain-this review会按 SM-2 日程带回这些问题。 - 其他基于 fork 的 mod(next-steps supervisor、assumptions check):每个都是自己的 fork,也各自支付缓存读取费。如果运行多个,先查看
cached列,再加入第三个。 - 模式选择器:quiz-after 目前没有自己的模式。
/quiz off是“学习模式”可能切换的开关。
安装
claude plugin validate templates/quiz-after
claude --plugin-dir templates/quiz-after
claude plugin test templates/quiz-after # parsing, card shape, gating and the band on terminal and desktop
先复制文件夹并重命名,再进行修改。基于 Claude Code 2.1.286 的声明构建。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add DannyMac180/skills claude plugin install quiz-after
原文 / README
quiz-after
When Claude finishes a task that changed something, a small quiz appears above the prompt: two or three questions about what was just built, each with a button that reveals the answer and why. It checks that you understand the change, not that you remember file names. Press Save to deck and the questions become spaced-repetition cards in your explain-this deck.
Quiz · Retry queue with backoff · fork: 48.2k cached, 350 new, 520 out
1. Why does the queue back off instead of retrying at a fixed rate?
[ Reveal answer 1 ]
2. What happens to a job that fails after the last retry?
a) It is dropped
b) It goes to the dead-letter list
c) It retries forever
→ It goes to the dead-letter list The worker never drops work silently.
[ Save to deck ] [ Dismiss ]
How it decides
- While a turn runs, it counts the main conversation's tool calls that were not read-only (an edit, a write, a Bash command that changes things, a subagent launch). Reads, searches, plain chat and bookkeeping tools (TodoWrite, the task tools, plan mode, AskUserQuestion, ToolSearch) count for nothing.
- When the main turn ends normally and that count is above zero, it makes
one
$.model.forkcall. The fork sees the conversation as the main thread last sent it and first answers: is the task actually finished? - Not finished: nothing is drawn. Finished: it returns JSON with the questions, which are cleaned up (bad fields dropped, at most three, multiple choice only when the answer is one of the choices) and drawn.
The fork runs after the turn has ended, on a timer, so it never holds up the turn. If you send a new prompt before it answers, that quiz is thrown away.
What it costs
| When | Model calls | Tokens |
| --- | --- | --- |
| Chat-only or read-only turn, aborted turn, subagent turn | none | 0 |
| /quiz off | none | 0 |
| A turn that changed something, quiz on, task finished | 1 fork | the whole transcript as input, served mostly from the prompt cache, plus about 350 new input tokens for the question and roughly 200 to 700 output tokens |
| The same, but the fork judges the task unfinished | 1 fork | the same cached transcript and ~350 new input tokens, about 10 output tokens; nothing drawn |
| /quiz now | 1 fork | as a finished task |
| Reveal, Dismiss, Save to deck | none | 0 |
A fork reuses the main thread's prompt cache, so the transcript is billed at
the cache-read rate rather than full input price, as long as the cache entry
is still warm (it is: the turn just ended). The quiz header shows each fork's
actual split, cached / new / out, so you can see what you paid. A cached
number near zero means the cache had lapsed or the model changed, and that
fork paid full price for the transcript.
The token figures above are estimates from the prompt's length, not measurements; the header's numbers are the real ones. The cached read is the big term: on a 100k-token session, every qualifying turn reads 100k cached tokens, finished or not.
Commands and keys
/quiztoggles it on or off. The setting is kept in the plugin's$.store, so it survives restarts./quiz onand/quiz offset it explicitly./quiz nowasks for a quiz about the work so far, skipping the "is it finished?" check. It works even while the mod is off.- With the band focused (ctrl+x tab, or a click):
1,2,3reveal answers,ssaves to the deck,xdismisses. The declarations also say a bare digit typed into an empty prompt presses a band Button, so while a quiz is up,1in an empty prompt reveals answer 1 instead of typing (not tried live).
Save to deck (explain-this)
The button appends one card per question to
$EXPLAIN_THIS_HOME/memory/cards.jsonl (default ~/.explain-this/memory/),
in the shape explain-this/scripts/sm2.ts add writes: a fresh SM-2 state
(interval_days 0, ease 2.5, due today), type transfer for transfer
questions and recall otherwise, and the question's tag. The answer and its
reason are stored together because explain-this review grades free-text answers
against them. Questions already in the deck are skipped.
Nothing is written unless you press the button. If the memory folder does not
exist, the mod creates nothing and says so in a toast. Run explain-this once to
set the deck up.
Composes with
- Other bands above the prompt (for example token-weather): quiz-after draws
its quiz and then whatever the rest of the chain draws (
await next(e)) beneath it, so it never hides another mod. It steps aside while a survey holds the band. - explain-this: shares its card deck, so
explain-this reviewbrings the questions back on the SM-2 schedule. - Other fork-based mods (a next-steps supervisor, an assumptions check):
each one is its own fork and pays its own cache read. If you run several,
check the
cachedcolumn before adding a third. - A mode selector: quiz-after has no mode of its own yet.
/quiz offis the switch a "learning mode" would flip.
Install
claude plugin validate templates/quiz-after
claude --plugin-dir templates/quiz-after
claude plugin test templates/quiz-after # parsing, card shape, gating and the band on terminal and desktop
Copy the folder and rename it before changing it. Built against Claude Code 2.1.286's declarations.
