quiz
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQuiz
测验
Generate interactive quizzes about the current codebase to test understanding.
生成关于当前代码库的交互式测验,以测试理解程度。
Reference Files
参考文件
| File | Read When |
|---|---|
| Default: question types by difficulty with concrete examples |
| Applying difficulty and quantity settings, exploration depth, question stems |
| Step 5: scoring rubric, result formatting, final output template |
| 文件 | 读取时机 |
|---|---|
| 默认:按难度划分的问题类型及具体示例 |
| 应用难度与数量设置、探索深度、问题题干 |
| 步骤5:评分标准、结果格式、最终输出模板 |
Configuration
配置
Collect from the user (ask only what was not provided):
收集用户提供的信息(仅询问未提供的内容):
Number of Cards
卡片数量
| Option | Cards | Best for |
|---|---|---|
| Fewer | 5 | Quick check, focused review |
| Standard | 10 | Balanced coverage |
| More | 15 | Deep dive, comprehensive review |
Default: Standard (10)
| 选项 | 卡片数 | 适用场景 |
|---|---|---|
| 较少 | 5 | 快速检查、重点回顾 |
| 标准 | 10 | 均衡覆盖 |
| 较多 | 15 | 深度探究、全面回顾 |
默认:标准(10张)
Difficulty
难度
| Level | Format | Question style |
|---|---|---|
| Easy | Multiple choice | What does X do? Where is Y defined? |
| Medium | Multiple choice + explanation | How does X interact with Y? What pattern is used for Z? |
| Hard | Open-ended + explanation | What 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 for exploration depth and question strategy per level.
references/difficulty-calibration.md系统地扫描项目以构建问题库:
- 读取项目结构(目录、关键文件、入口点)
- 识别主要语言、框架及工具
- 读取关键文件:配置文件、入口点、核心模块、测试文件
- 梳理依赖关系与模块边界
- 记录模式:命名规范、架构风格、错误处理
- 发现非显而易见的细节:边缘情况、临时解决方案、易犯错误
加载以获取对应难度级别的探索深度和问题策略。
references/difficulty-calibration.mdStep 3: Generate questions
步骤3:生成问题
Using , generate the configured number of questions at the selected difficulty. Apply calibration from .
references/question-templates.mdreferences/difficulty-calibration.mdEach 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.mdreferences/difficulty-calibration.md每个问题必须:
- 引用当前代码库中的真实代码(文件路径、函数名、模式)
- 有一个明确的正确答案
- 仅通过代码库即可解答(无需外部知识)
- 覆盖代码库的不同部分(避免集中在某一区域)
对于选择题,提供4个选项(A、B、C、D),干扰项需来自项目中的真实名称。
对于中等和困难难度的问题,准备一个简短的解析,在用户作答后展示。
对照下方的质量检查清单检查每个问题。移除或重写未通过的问题。
Step 4: Present quiz interactively
步骤4:交互式呈现测验
Present one question at a time. For each question:
- Show the question number and total as a header (e.g., "Question 3/10")
- For multiple choice (easy/medium): use with the question text and 4 options so the user can select an answer interactively
AskUserQuestion - For open-ended (hard): show the question text and wait for a free-text response
- After the user responds, show whether the answer was correct
- Show the explanation with file:line references (medium and hard only)
- Proceed to the next question
一次呈现一个问题。每个问题的处理流程:
- 显示问题序号和总数作为标题(例如:"问题3/10")
- 选择题(简单/中等难度):使用工具,展示问题文本和4个选项,让用户可交互式选择答案
AskUserQuestion - 开放式问题(困难难度):展示问题文本,等待用户输入自由文本答案
- 用户作答后,显示答案是否正确
- 展示解析并附带文件:行号引用(仅中等和困难难度)
- 进入下一个问题
Step 5: Score and summarize
步骤5:评分与总结
Load for the result template.
references/scoring-and-output.mdAfter 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
相关技能
- for understanding codebase architecture before quizzing
plan-feature - for code review exercises on recent changes
review-pr
- :用于在测验前理解代码库架构
plan-feature - :用于针对近期变更的代码审查练习
review-pr