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 デッキの間隔反復カードになります。
Quiz · バックオフ付きリトライキュー · fork: 48.2k cached, 350 new, 520 out
1. なぜキューは固定レートでリトライせず、バックオフするのですか?
[ Reveal answer 1 ]
2. 最後のリトライ後にジョブが失敗するとどうなりますか?
a) 破棄される
b) デッドレターリストに入る
c) 永遠にリトライする
→ デッドレターリストに入ります。worker が仕事を黙って捨てることはありません。
[ Save to deck ] [ Dismiss ]
判定方法
- ターンの実行中、メイン会話で読み取り専用ではなかったツール呼び出し(編集、書き込み、変更を行う Bash コマンド、subagent の起動)を数えます。読み取り、検索、通常のチャット、記録用ツール(TodoWrite、task ツール、plan mode、AskUserQuestion、ToolSearch)は数えません。
- メインターンが正常に終わり、その数がゼロを超えていると、
$.model.forkを 1 回呼び出します。fork が見るのは、メインスレッドが最後に送った時点の会話で、最初に「本当にタスクは完了したか」を判定します。 - 未完了なら何も描画しません。完了なら、質問を含む JSON を返します。質問は整形され(不正なフィールドを削除し、最大 3 問にし、答えが選択肢の 1 つである場合だけ選択式にする)、表示されます。
fork はターン終了後にタイマーで実行されるため、ターンを止めません。回答前に新しいプロンプトを送ると、そのクイズは破棄されます。
費用
| タイミング | モデル呼び出し | Tokens |
| --- | --- | --- |
| チャットのみ、読み取り専用ターン、中止したターン、subagent ターン | なし | 0 |
| /quiz off | なし | 0 |
| 変更を行ったターン、quiz がオン、タスク完了 | fork を 1 回 | トランスクリプト全体を入力に使います。大部分はプロンプトキャッシュから取得され、質問用に約 350 の新規入力 token、さらに約 200 から 700 の出力 token が加わります |
| 同じ条件だが、fork が未完了と判断 | fork を 1 回 | 同じキャッシュ済みトランスクリプトと約 350 の新規入力 token、約 10 の出力 token。何も表示しません |
| /quiz now | fork を 1 回 | 完了したタスクと同じ |
| Reveal、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)
ボタンを押すと、質問 1 つにつきカード 1 枚を
$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 で、キャッシュ読み取り料金も個別にかかります。複数を動かすなら、3 つ目を追加する前に
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.
