ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 DannyMac180

quiz-after

Claude 完成有變更的工作後,提示列上方會出現一個小測驗:針對剛完成的內容提出兩或三個問題,每題都有按鈕可顯示答案與原因。它檢查你是否理解變更,而不是否記得檔名。按下 **Save to deck**,問題就會成為 explain-this 牌組中的間隔重複卡片。

DannyMac180@DannyMac180

DannyMac180/skills/tree/main/modsmith/templates/quiz-after

已翻譯

關於這個 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 ]

判斷方式

  1. 回合執行期間,它會計算主要對話中不是唯讀的工具呼叫(編輯、寫入、會改變內容的 Bash 指令、啟動 subagent)。讀取、搜尋、一般聊天和記帳工具(TodoWrite、task 工具、plan mode、AskUserQuestion、ToolSearch)都不計入。
  2. 主要回合正常結束,且計數大於零時,它會呼叫一次 $.model.fork。fork 看到的是主執行緒最後送出的對話,並先回答:工作真的完成了嗎?
  3. 尚未完成:不繪製任何內容。已完成:回傳 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

  1. 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.
  2. When the main turn ends normally and that count is above zero, it makes one $.model.fork call. The fork sees the conversation as the main thread last sent it and first answers: is the task actually finished?
  3. 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

  • /quiz toggles it on or off. The setting is kept in the plugin's $.store, so it survives restarts. /quiz on and /quiz off set it explicitly.
  • /quiz now asks 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, 3 reveal answers, s saves to the deck, x dismisses. The declarations also say a bare digit typed into an empty prompt presses a band Button, so while a quiz is up, 1 in 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 review brings 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 cached column before adding a third.
  • A mode selector: quiz-after has no mode of its own yet. /quiz off is 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.

更多類似作品