| name | bagu-exam-generator |
| description | Use when the user wants to create interview-prep exam papers, 八股文试卷, question banks, mock interview tests, or answer/explanation HTML files from Obsidian notes, Markdown notes, study folders, or technical interview notes. |
Bagu Exam Generator
Overview
Create printable interview-prep exam papers and separate answer/explanation files from a user's study notes. The skill is optimized for Chinese 八股文 notes, Obsidian vaults, Markdown folders, and computer-science interview topics such as networking, operating systems, databases, Java, Redis, and frontend fundamentals.
The output should feel like a real interview-prep paper: scoped to the user's notes, expanded only when permitted, with clear scoring, credible difficulty, and detailed explanations.
Trigger Signals
Use this skill when the user asks for:
- 根据 Obsidian 笔记制作试卷
- 八股文试卷、面试题、刷题卷、模拟卷
- 选择题、简答题、综合题、面试场景题
- 答案解析、详细解析、评分点
- 试卷和答案分开输出
- HTML/PDF/打印版试卷
Core Workflow
1. Inspect the note source first
Before asking detailed questions, locate candidate notes and identify topic coverage.
Use fast file discovery:
rg --files
find . -maxdepth 3 -type d
git status --short
For Obsidian vaults, look for:
扫盲点/
Fastlearn/<topic>/
03-面试题库.md
02-核心笔记.md
05-错题与漏洞.md
- topic-specific Markdown files
Read representative files before proposing the exam design. Prefer targeted sed -n reads over loading every note.
2. Preserve the user's worktree
Assume the vault may contain user edits. Do not modify original notes. Only add new output files unless explicitly asked to edit notes.
Check git status --short and mention unrelated dirty files briefly when relevant.
3. Ask clarifying questions before generation
Ask enough questions to remove ambiguity, but keep them practical. Good defaults are allowed if the user answers tersely.
Ask about:
- Source scope: which folders/files to use.
- Whether expansion beyond notes is allowed.
- Difficulty: 基础、校招八股、校招偏难、一面/二面、中高级.
- Question types and counts.
- Whether to include 综合题/面试场景题.
- Output format and destination path.
- Print style vs web practice style.
Example:
我先确认几个点:
1. 范围是否以这些笔记为主:...
2. 题量希望是 20 选 + 8 简答,还是 25 选 + 10 简答?
3. 难度按校招基础、校招偏难,还是中高级?
4. HTML 是否继续用打印试卷风格?
5. 是否允许我补充常见面试考点?
4. Propose a concrete exam design
Before writing files, present a concise design and ask for approval.
Include:
- Total score and duration.
- Question type counts and per-question score.
- Topic distribution.
- Output file paths.
- Style decision.
- What is excluded.
Recommended presets:
| Purpose | Structure | Difficulty |
|---|
| Standard 校招八股 | 20 选择 + 8 简答 + 2 综合场景 | 校招一面 |
| Harder OS/DB/Java paper | 25 选择 + 10 简答 | 校招偏难/一面二面交界 |
| Quick review | 15 选择 + 5 简答 | 基础巩固 |
| Interview simulation | 10 选择 + 8 简答 + 4 场景追问 | 面试表达训练 |
If the user says “题型不变”, infer from the most recent confirmed design. If ambiguous, state the inference explicitly.
5. Generate two separate artifacts
Default output structure:
obsidian_ubuntu/试卷/<主题>校招面试试卷.html
obsidian_ubuntu/试卷/<主题>校招面试答案解析.html
The exam file should contain:
- Title, total score, suggested duration.
- Name/date/score fields.
- Scope notice.
- Question sections with scores.
- Blank answer lines for choices.
- Lined answer areas for short answers and scenario questions.
- No answers.
The answer file should contain:
- Matching title.
- Choice answers with explanations.
- Short-answer reference answers.
- Scoring points.
- Detailed analysis.
- Common mistakes or interview reminders.
- Follow-up prompts when useful.
6. Use print-friendly HTML
Prefer plain static HTML/CSS with no external dependencies.
Baseline style:
- A4 width:
210mm.
- White page on gray screen background.
- Black/gray print palette.
- Serif Chinese font stack:
"Songti SC", "SimSun", "Noto Serif CJK SC", serif.
@media print removes shadow and screen margin.
break-inside: avoid for questions.
break-before: page for major sections.
- Answer areas use repeating linear gradients for writing lines.
Do not create a landing page. The first screen is the document itself.
7. Question writing rules
Ground the exam in the notes, then expand only if allowed.
For choices:
- Use single-choice unless user requests otherwise.
- Make distractors plausible and diagnostic.
- Test mechanism boundaries, not vocabulary only.
- Include common misconceptions from notes as distractors.
- Keep options similar in length where practical.
For short answers:
- Ask for causal chains and mechanism flow.
- Include “why”, “how”, “compare”, and “edge case” prompts.
- Make scoring possible with clear key points.
For scenario questions:
- Make them realistic interview prompts.
- Require layered analysis and trade-offs.
- Include follow-up reminders in the answer file.
8. Difficulty calibration
Use these signals:
基础:
- Definitions, simple comparisons, direct recall.
校招八股:
- Core mechanisms, standard why/how questions, common traps.
校招偏难:
- Boundary cases, failure modes, performance implications, implementation details.
中高级:
- Production diagnosis, metrics/tools, trade-offs, internals, distributed interactions.
If the user asks to “提高难度”, increase mechanism depth and edge-case reasoning before increasing obscure trivia.
9. Answer explanation pattern
Use this structure for short-answer explanations:
<h3>N. 题目主题</h3>
<div class="box">
<p><span class="score">评分点:</span>...</p>
<p><strong>参考答案:</strong>...</p>
<p><strong>解析:</strong>...</p>
<p><strong>易错提醒:</strong>...</p>
</div>
For choice explanations:
<li><span class="answer">答案:B。</span><span class="why">解释为什么 B 对,以及其他选项错在哪里。</span></li>
10. Verification before final response
After creating files, verify counts and paths.
Run checks like:
ls -l 'obsidian_ubuntu/试卷'
rg -c '<div class="answer-line">答案' '<试卷文件>'
rg -c 'write-area\"></div>' '<试卷文件>'
rg -c '<li><span class="answer">答案:' '<答案文件>'
rg -n '<h2|<h3|总分|选择题|简答题' '<试卷文件>' '<答案文件>'
git status --short
Report the verification evidence succinctly:
已校验:试卷里有 25 个选择题作答位、10 个简答题答题区;答案解析里有 25 条选择题答案,并包含 10 道简答题解析。
Common Mistakes
- Do not generate questions before reading the user's notes.
- Do not silently include topics the user explicitly excluded.
- Do not put answers in the exam file.
- Do not make the HTML depend on remote fonts or assets.
- Do not overwrite existing generated papers unless the user asks.
- Do not claim completion without verifying file existence and counts.
- Do not confuse “based on notes” with “only exact note wording”; use the user's permission to decide expansion.
Good Final Response
Keep it short and file-focused:
已生成两份 HTML:
- [主题校招面试试卷.html](/abs/path/...)
- [主题校招面试答案解析.html](/abs/path/...)
内容:25 道选择题、10 道简答题,总分 100 分。已校验选择题作答位、简答题答题区和答案条目数量。