quiz

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Quiz

测验

Generate interactive quizzes about the current codebase to test understanding.
生成关于当前代码库的交互式测验,以测试理解程度。

Reference Files

参考文件

FileRead When
references/question-templates.md
Default: question types by difficulty with concrete examples
references/difficulty-calibration.md
Applying difficulty and quantity settings, exploration depth, question stems
references/scoring-and-output.md
Step 5: scoring rubric, result formatting, final output template
文件读取时机
references/question-templates.md
默认:按难度划分的问题类型及具体示例
references/difficulty-calibration.md
应用难度与数量设置、探索深度、问题题干
references/scoring-and-output.md
步骤5:评分标准、结果格式、最终输出模板

Configuration

配置

Collect from the user (ask only what was not provided):
收集用户提供的信息(仅询问未提供的内容):

Number of Cards

卡片数量

OptionCardsBest for
Fewer5Quick check, focused review
Standard10Balanced coverage
More15Deep dive, comprehensive review
Default: Standard (10)
选项卡片数适用场景
较少5快速检查、重点回顾
标准10均衡覆盖
较多15深度探究、全面回顾
默认:标准(10张)

Difficulty

难度

LevelFormatQuestion style
EasyMultiple choiceWhat does X do? Where is Y defined?
MediumMultiple choice + explanationHow does X interact with Y? What pattern is used for Z?
HardOpen-ended + explanationWhat would break if X changed? How would you refactor Y?
Default: Medium
等级题型问题风格
简单选择题X的作用是什么?Y定义在何处?
中等选择题+解析X与Y如何交互?Z使用了什么模式?
困难开放式问题+解析如果X发生变化,哪些功能会受影响?你会如何重构Y?
默认:中等

Workflow

工作流

Copy this checklist to track progress:
text
Quiz progress:
- [ ] Step 1: Gather configuration
- [ ] Step 2: Explore the codebase
- [ ] Step 3: Generate questions
- [ ] Step 4: Present quiz interactively
- [ ] Step 5: Score and summarize
复制此清单以跟踪进度:
text
测验进度:
- [ ] 步骤1:收集配置信息
- [ ] 步骤2:探索代码库
- [ ] 步骤3:生成问题
- [ ] 步骤4:交互式呈现测验
- [ ] 步骤5:评分与总结

Step 1: Gather configuration

步骤1:收集配置信息

Ask the user for card count and difficulty. Use defaults if not specified. Accept informal phrasing ("give me a hard quiz", "just 5 questions").
If the user provides both values upfront, skip straight to Step 2.
询问用户卡片数量和难度。若未指定则使用默认值。接受非正式表述(如"给我一个困难的测验"、"只要5个问题")。
如果用户预先提供了两个值,直接跳至步骤2。

Step 2: Explore the codebase

步骤2:探索代码库

Systematically scan the project to build a question pool:
  • Read the project structure (directories, key files, entry points)
  • Identify the primary language(s), framework(s), and tooling
  • Read key files: configuration, entry points, core modules, tests
  • Map dependencies and module boundaries
  • Note patterns: naming conventions, architecture style, error handling
  • Find non-obvious details: edge cases, workarounds, gotchas
Load
references/difficulty-calibration.md
for exploration depth and question strategy per level.
系统地扫描项目以构建问题库:
  • 读取项目结构(目录、关键文件、入口点)
  • 识别主要语言、框架及工具
  • 读取关键文件:配置文件、入口点、核心模块、测试文件
  • 梳理依赖关系与模块边界
  • 记录模式:命名规范、架构风格、错误处理
  • 发现非显而易见的细节:边缘情况、临时解决方案、易犯错误
加载
references/difficulty-calibration.md
以获取对应难度级别的探索深度和问题策略。

Step 3: Generate questions

步骤3:生成问题

Using
references/question-templates.md
, generate the configured number of questions at the selected difficulty. Apply calibration from
references/difficulty-calibration.md
.
Each question must:
  • Reference real code from the current codebase (file paths, function names, patterns)
  • Have one clear correct answer
  • Be answerable from the codebase alone (no external knowledge required)
  • Cover different parts of the codebase (avoid clustering)
For multiple-choice questions, provide 4 options (A, B, C, D) with plausible distractors drawn from real names in the project.
For medium and hard questions, prepare a brief explanation to show after the user answers.
Check every question against the quality checklist below. Remove or rewrite any that fail.
使用
references/question-templates.md
,生成符合配置数量和选定难度的问题。应用
references/difficulty-calibration.md
中的校准规则。
每个问题必须:
  • 引用当前代码库中的真实代码(文件路径、函数名、模式)
  • 有一个明确的正确答案
  • 仅通过代码库即可解答(无需外部知识)
  • 覆盖代码库的不同部分(避免集中在某一区域)
对于选择题,提供4个选项(A、B、C、D),干扰项需来自项目中的真实名称。
对于中等和困难难度的问题,准备一个简短的解析,在用户作答后展示。
对照下方的质量检查清单检查每个问题。移除或重写未通过的问题。

Step 4: Present quiz interactively

步骤4:交互式呈现测验

Present one question at a time. For each question:
  1. Show the question number and total as a header (e.g., "Question 3/10")
  2. For multiple choice (easy/medium): use
    AskUserQuestion
    with the question text and 4 options so the user can select an answer interactively
  3. For open-ended (hard): show the question text and wait for a free-text response
  4. After the user responds, show whether the answer was correct
  5. Show the explanation with file:line references (medium and hard only)
  6. Proceed to the next question
一次呈现一个问题。每个问题的处理流程:
  1. 显示问题序号和总数作为标题(例如:"问题3/10")
  2. 选择题(简单/中等难度):使用
    AskUserQuestion
    工具,展示问题文本和4个选项,让用户可交互式选择答案
  3. 开放式问题(困难难度):展示问题文本,等待用户输入自由文本答案
  4. 用户作答后,显示答案是否正确
  5. 展示解析并附带文件:行号引用(仅中等和困难难度)
  6. 进入下一个问题

Step 5: Score and summarize

步骤5:评分与总结

Load
references/scoring-and-output.md
for the result template.
After all questions are answered, present the final scorecard with score, rating, breakdown by area, and recommended next steps.
加载
references/scoring-and-output.md
获取结果模板。
所有问题作答完成后,呈现最终评分卡,包含分数、评级、各领域得分明细及后续建议。

Quality Checklist

质量检查清单

Every question must pass all of these:
  • Codebase-grounded — References a real file path, function, or pattern from the current project
  • Single focus — Tests one concept. If you need "and" to describe it, split it.
  • Unambiguous — Has exactly one correct answer. No trick questions.
  • Self-contained — Answerable from the codebase alone, no external knowledge required
  • Plausible distractors — Multiple-choice options use real names from the project, not random strings
  • Spread coverage — Questions cover different files and areas, no clustering
  • Difficulty-matched — Matches the cognitive level of the selected difficulty
  • No generated files — Never asks about lock files, node_modules, or build output
  • Explanation ready — Medium and hard questions have a prepared explanation with file:line references
每个问题必须全部满足以下要求:
  • 基于代码库 — 引用当前项目中的真实文件路径、函数或模式
  • 单一焦点 — 测试一个概念。如果需要用"和"来描述,拆分问题。
  • 无歧义 — 仅有一个正确答案。无陷阱题。
  • 自给自足 — 仅通过代码库即可解答,无需外部知识
  • 合理干扰项 — 选择题选项使用项目中的真实名称,而非随机字符串
  • 覆盖广泛 — 问题覆盖不同文件和区域,避免集中
  • 难度匹配 — 符合选定难度的认知水平
  • 排除生成文件 — 绝不询问锁文件、node_modules或构建输出相关问题
  • 准备好解析 — 中等和困难难度的问题需附带包含文件:行号引用的解析

Anti-patterns

反模式

  • Do not ask questions about external libraries or frameworks (only the project's own code)
  • Do not ask questions that require running the code to answer
  • Do not reveal all questions at once (present one at a time, wait for response)
  • Do not skip the explanation on wrong answers (the quiz is for learning)
  • Do not ask trick questions or ambiguous questions with multiple valid answers
  • Do not repeat questions about the same file or function
  • Do not generate questions before exploring the codebase (Step 2 must complete first)
  • 不要询问外部库或框架相关问题(仅针对项目自身代码)
  • 不要询问需要运行代码才能解答的问题
  • 不要一次性展示所有问题(一次一个,等待用户作答)
  • 不要在用户答错时跳过解析(测验的目的是学习)
  • 不要设置陷阱题或存在多个有效答案的歧义问题
  • 不要重复询问同一文件或函数的问题
  • 不要在探索代码库前生成问题(必须先完成步骤2)

Related Skills

相关技能

  • plan-feature
    for understanding codebase architecture before quizzing
  • review-pr
    for code review exercises on recent changes
  • plan-feature
    :用于在测验前理解代码库架构
  • review-pr
    :用于针对近期变更的代码审查练习