| name | swift-quiz |
| description | Adaptive Swift/iOS quiz with two modes. Classic is lighter, Mastery requires mechanism-level reasoning. |
swift-quiz - Swift/iOS Quiz
Adaptive Swift/iOS quiz with two modes:
(๋ ๊ฐ์ง ๋ชจ๋๋ฅผ ์ง์ํ๋ Swift/iOS ์ ์ํ ํด์ฆ)
- Classic: quick checks with lighter explanation requirements
- Mastery: strict reasoning and mechanism-focused feedback
Instructions
Terminology Policy (์ด์ฌ์ ์นํ ์ฉ์ด ๊ท์น)
Prefer Korean-first labels in user-facing text, and keep English as secondary reference in parentheses.
(์ฌ์ฉ์์๊ฒ ๋ณด์ฌ์ฃผ๋ ๋จ๊ณ๋ช
์ ํ๊ตญ์ด๋ฅผ ์ฐ์ ํ๊ณ , ์์ด๋ ๊ดํธ๋ก ๋ณด์กฐ ํ๊ธฐํ๋ค.)
Examples:
(์์)
๊ทผ๊ฑฐ ์ค๋ช
(WHY reasoning)
ํต๊ณผ / ๋ณด์ ํ์ (์๋ฌธ ํ๊ธฐ: pass / fail)
๊ฒฉ๋ฆฌ ๊ฒฝ๊ณ (isolation boundary): actor ๋ฐ๊นฅ์์ ๋ด๋ถ ์ํ๋ฅผ ์ง์ ๋ฐ๊พธ์ง ๋ชปํ๊ฒ ํ๋ ๊ฒฝ๊ณ
๊ฒฝํฉ ์ํ (data race): ์ฌ๋ฌ ์์
์ด ๊ฐ์ ๊ฐ์ ๋์์ ๋ฐ๊ฟ ๊ฒฐ๊ณผ๊ฐ ๊ผฌ์ด๋ ๋ฌธ์
When a technical term appears for the first time, add a one-line plain-language gloss.
(์ฒ์ ๋์ค๋ ๊ธฐ์ ์ฉ์ด๋ ํ ์ค ์ฌ์ด ์ค๋ช
์ ๋ฐ๋ก ๋ถ์ธ๋ค.)
Step 0: Language Selection
Ask the user to choose a language at the start using a selection flow, not free-form text input.
(์คํฌ ์์ ์ ์์ ์
๋ ฅ์ด ์๋๋ผ ์ ํํ ๋ฐฉ์์ผ๋ก ์ธ์ด๋ฅผ ๋ฐ๋๋ค)
- ํ๊ตญ์ด - ํ๊ตญ์ด๋ก ํด์ฆ๋ฅผ ํ๋๋ค
- English - Take the quiz in English
Use platform-specific selection behavior:
- Codex CLI: use native option selection (
request_user_input with 2 options) when available. If unavailable, show numbered choices and ask for 1 or 2.
- Claude Code: use native option selection UI when available. If unavailable, show numbered choices.
- Gemini CLI: use native option selection UI when available. If unavailable, show numbered choices.
Choice mapping: 1 โ ํ๊ตญ์ด, 2 โ English
Use the selected language for all communication. Code and Swift keywords stay in English.
(์ ํํ ์ธ์ด๋ก ์ดํ ๋ชจ๋ ์ํต์ ์งํํ๋ค. ์ฝ๋์ Swift ํค์๋๋ ์์ด ๊ทธ๋๋ก ์ ์งํ๋ค.)
Study Mode Selection
Ask the user to choose a study mode using the same selection pattern:
(๊ฐ์ ์ ํ ๋ฐฉ์์ผ๋ก ํ์ต ๋ชจ๋๋ฅผ ์ ํํ๊ฒ ํ๋ค)
Choice mapping:
(์ ํ๊ฐ ๋งคํ)
1 -> Classic
2 -> Mastery
Prompt example:
(์๋ด ๋ฌธ๊ตฌ ์์)
- Korean:
"ํ์ต ๋ชจ๋๋ฅผ ์ ํํด์ฃผ์ธ์. ๋ฒํธ๋ก ๋ตํด์ฃผ์ธ์.\n\n1) Classic (์ค๋ช
์ค์ฌ, ์ถ์ฒ)\n- ๋น ๋ฅด๊ฒ ์ ๊ฒํ๊ณ ์ถ์ ๋ ์ ํฉ\n- ์ ๋ต/์ค๋ต ์ค์ฌ์ผ๋ก ๊ฐ๊ฒฐํ๊ฒ ๋ณต์ต\n\n2) Mastery (ํ๋ จ ์ค์ฌ)\n- ์ ๋ต + ์ด์ (WHY)๊น์ง ๊ฒ์ฆ\n- ๊ทผ๊ฑฐ ์ค๋ช
์ด ์์ด์ผ ๋ค์ ๋จ๊ณ๋ก ์งํ"
- English:
"Choose a study mode (reply with a number):\n\n1) Classic (Explanation-first, Recommended)\n- Best for quick review\n- Lighter explanation requirements\n\n2) Mastery (Practice-first)\n- Verifies both answer and WHY\n- Requires mechanism-level reasoning to advance"
After selection, briefly confirm mode and continue.
(์ ํ ์งํ ๋ชจ๋๋ฅผ ์งง๊ฒ ํ์ธํ๊ณ ์งํํ๋ค.)
Step 1: Choose Quiz Topic
First, check Memory for study history:
(๋จผ์ Memory์์ ํ์ต ์ด๋ ฅ์ ํ์ธํ๋ค.)
Read SwiftLearningProgress from memory. Look for:
- Recent misconceptions (e.g., "misconception: reentrancy state preservation assumption")
- Recent gate failures (e.g., "gates: cycle3 fail-then-pass")
- Topics studied recently
If misconceptions found:
(misconception์ด ์์ผ๋ฉด)
Suggest the misconception topic first:
"์ต๊ทผ ํ์ต์์ [actor reentrancy] ๋ถ๋ถ์ด ์ฝํ๋๋ฐ, ์ด ์ฃผ์ ๋ก ํด์ฆ๋ฅผ ํ์ด๋ณผ๊น์? ๋ค๋ฅธ ์ฃผ์ ๋ฅผ ์ํ๋ฉด ์๋ ค์ฃผ์ธ์."
"Your recent study showed weakness in [actor reentrancy]. Want to quiz on that? Tell me if you'd prefer a different topic."
If no history found:
(์ด๋ ฅ์ด ์์ผ๋ฉด)
Ask in plain text:
"์ด๋ค ์ฃผ์ ๋ก ํด์ฆ๋ฅผ ํ๊น์? ์ฃผ์ ๋ฅผ ์๋ ค์ฃผ์ธ์. ๋ญ ํ ์ง ๋ชจ๋ฅด๊ฒ ์ผ๋ฉด '์ถ์ฒํด์ค'๋ผ๊ณ ํด์ฃผ์ธ์."
"What topic should the quiz cover? Tell me a topic, or say 'recommend' if you're not sure."
Step 2: Run the Quiz (5 questions)
5 questions total. Track difficulty internally from 1-5 (start at 3).
(์ด 5๋ฌธ์ . ๋ด๋ถ์ ์ผ๋ก ๋์ด๋๋ฅผ 1~5๋ก ์ถ์ ํ๋ค. ์์: 3.)
Scoring by mode:
(๋ชจ๋๋ณ ์ฑ์ ๋ฐฉ์)
-
Classic mode
- Correct answer โ difficulty +1 (์ ๋ต -> ๋์ด๋ +1)
- Wrong answer โ difficulty -1 (์ค๋ต -> ๋์ด๋ -1)
- Reasoning is encouraged but optional (๊ทผ๊ฑฐ ์ค๋ช
์ ๊ถ์ฅ, ํ์ ์๋)
-
Mastery mode
- Correct answer WITH reasoning โ difficulty +1 (๊ทผ๊ฑฐ ํฌํจ ์ ๋ต -> ๋์ด๋ +1)
- Correct answer WITHOUT reasoning โ difficulty stays same (๊ทผ๊ฑฐ ์๋ ์ ๋ต -> ๋์ด๋ ์ ์ง)
- Wrong answer โ difficulty -1 (์ค๋ต -> ๋์ด๋ -1)
Question Types
Each question uses one of the types below. Default to open-ended, mix in others as appropriate.
(์๋ ์ ํ ์ค ํ๋๋ก ์ถ์ . ์์ ํ์ ๊ธฐ๋ณธ์ผ๋ก ํ๋, ์ ์ ํ ์๋๋ค.)
Type A: Predict Output (open-ended)
What does this code print? Explain WHY.
(๋ค์ ์ฝ๋์ ์ถ๋ ฅ ๊ฒฐ๊ณผ๋? ์ ๊ทธ๋ฐ์ง ์ด์ ๋ ํจ๊ป ์ ์ด์ฃผ์ธ์.)
var nums = [1, 2, 3]
var copy = nums
copy.append(4)
print(nums.count)
The user must type both the answer AND reasoning.
(์ ์ ๊ฐ ๋ต๊ณผ ๊ทผ๊ฑฐ๋ฅผ ๋ชจ๋ ํ์ดํํด์ผ ํ๋ค.)
Type B: Find the Bug (open-ended)
What's wrong with this code? Explain WHY it errors.
(๋ค์ ์ฝ๋์์ ๋ฌธ์ ๊ฐ ๋๋ ๋ถ๋ถ์? ์ ์๋ฌ๊ฐ ๋๋์ง ์ค๋ช
ํด์ฃผ์ธ์.)
let name: String = "Swift"
name = "SwiftUI"
print(name)
The user must identify the problem AND explain the mechanism.
(์ ์ ๊ฐ ๋ฌธ์ ๋ฅผ ์ฐพ๊ณ ๋ฉ์ปค๋์ฆ์ ์ค๋ช
ํด์ผ ํ๋ค.)
Type C: Concept Question (multiple-choice + reasoning)
What keyword do you need to modify a struct's property inside a method?
(Swift์์ struct ์ธ์คํด์ค์ ํ๋กํผํฐ๋ฅผ ๋ฉ์๋ ์์์ ๋ณ๊ฒฝํ๋ ค๋ฉด ์ด๋ค ํค์๋๊ฐ ํ์ํ ๊น์?)
Present 4 choices via AskUserQuestion. After the user picks one, ask:
"์ ๊ทธ๊ฑธ ๊ณจ๋๋์? ํ ์ค๋ก ์ด์ ๋ฅผ ์ ์ด์ฃผ์ธ์."
"Why did you pick that? Give a one-line reason."
Type D: Write Code (difficulty 4+ only)
Write a function that meets these requirements:
(๋ค์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ํจ์๋ฅผ ์์ฑํ์ธ์:)
- Name: isEven
- Takes an Int, returns Bool
- Returns true for even, false for odd
When the user writes code, use the Task tool with subagent_type: "Bash" to verify it with the Swift compiler (swift command).
(์ฌ์ฉ์๊ฐ ์ฝ๋๋ฅผ ์์ฑํ๋ฉด Swift ์ปดํ์ผ๋ฌ๋ก ๊ฒ์ฆํ๋ค.)
Reasoning Requirement (Mastery mode)
In Mastery mode, every question type requires reasoning.
In Classic mode, reasoning is encouraged but not required.
(Mastery ๋ชจ๋์์๋ ๋ชจ๋ ๋ฌธ์ ์ ํ์์ ๊ทผ๊ฑฐ๋ฅผ ์๊ตฌํ๋ค. Classic ๋ชจ๋์์๋ ๊ถ์ฅ์ด๋ฉฐ ํ์๋ ์๋๋ค.)
- Type A: "์ถ๋ ฅ ๊ฒฐ๊ณผ๋? ์?" / "What's the output? Why?"
- Type B: "์ด๋๊ฐ ๋ฌธ์ ? ์ ์๋ฌ?" / "What's wrong? Why does it error?"
- Type C: ์ ํ ํ "์ ๊ทธ๊ฑธ ๊ณจ๋๋์?" / After picking, "Why that choice?"
- Type D: No additional reasoning needed (code itself is the demonstration)
If the user gives a correct answer but no reasoning in Mastery mode:
(Mastery ๋ชจ๋์์ ์ ๋ต์ด์ง๋ง ๊ทผ๊ฑฐ๊ฐ ์์ผ๋ฉด)
"์ ๋ต์ด์์! ๊ทผ๋ฐ ์ ๊ทธ๋ฐ์ง๋ ํ ์ค๋ก ์ค๋ช
ํด์ค ์ ์์๊น์?"
"Correct! But can you explain why in one line?"
Score it as partial credit: difficulty stays same instead of +1.
(๋ถ๋ถ ์ ๋ต ์ฒ๋ฆฌ: ๋์ด๋ +1 ๋์ ์ ์ง.)
Feedback Rules
On correct answer with reasoning:
(๊ทผ๊ฑฐ ํฌํจ ์ ๋ต)
Correct!
Key point: Array is a value type, so `copy` is an independent copy.
That means nums.count is still 3.
Difficulty: 3 โ 4
On correct answer without reasoning:
(๊ทผ๊ฑฐ ์๋ ์ ๋ต)
Correct! But WHY is it 3?
(Please add your reasoning.)
After they explain:
Good. Array is a value type (struct), so assignment creates an independent copy.
Difficulty stays at 3 (add reasoning next time for full credit).
On wrong answer:
(์ค๋ต)
Give a short text explanation. Only use ASCII diagrams for things like memory layouts that are hard to explain in text alone.
(๊ฐ๊ฒฐํ ํ
์คํธ ํด์ค. ASCII ๋ค์ด์ด๊ทธ๋จ์ ํ์ํ ๋๋ง.)
Not quite. The answer is "3".
Array is a struct (value type), so `var copy = nums` creates an independent copy.
Appending to copy doesn't affect the original nums.
Difficulty: 3 โ 2
Step 3: Results Summary
After all 5 questions, show a detailed summary:
(5๋ฌธ์ ์๋ฃ ํ ์์ธ ๊ฒฐ๊ณผ ์์ฝ)
Quiz Results / ํด์ฆ ๊ฒฐ๊ณผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Topic / ์ฃผ์ : Actor Isolation
Score / ์ ๋ต: 3/5
Final difficulty / ์ต์ข
๋์ด๋: 4/5
๋ณด์ ํฌ์ธํธ ๋ถ์ / Gap analysis:
- reentrancy: suspension point ์ดํ ์ํ ๋ณ๊ฒฝ ๊ฐ๋ฅ์ฑ ์ธ์ ๋ถ์กฑ
- nonisolated: ์ธ์ ์ฌ์ฉํ๋์ง ๋ถํ์ค
Strengths / ๊ฐ์ :
- actor ๊ฒฉ๋ฆฌ ๊ฒฝ๊ณ(isolation boundary) ์ดํด ์ ํ
- async context ํ์์ฑ ์ธ์ ํ์ค
Next Study / ๋ค์ ํ์ต ์ถ์ฒ:
โ /swift-study ์์ "actor reentrancy" ํ์ต ์ถ์ฒ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Step 4: Record to Memory
After showing results, record to SwiftLearningProgress in memory:
(๊ฒฐ๊ณผ๋ฅผ ํ์ํ ํ Memory์ ๊ธฐ๋กํ๋ค)
SwiftLearningProgress:
- "YYYY-MM-DD: quiz <topic> <score>/5 (<level>)"
- "YYYY-MM-DD: quiz gap: <specific concept>"
- "YYYY-MM-DD: quiz strength: <specific concept>"
Rules
- Use the selected language - from Step 0. Code and keywords in English. (์ ํํ ์ธ์ด๋ก ์ํต)
- One question at a time - next question only after the current one is answered (ํ ๋ฒ์ ํ ๋ฌธ์ ๋ง)
- Mode-aware reasoning policy - Mastery requires WHY on all types; Classic encourages WHY but allows quick checks (๋ชจ๋๋ณ ๊ทผ๊ฑฐ ์ ์ฑ
์ ์ฉ)
- ASCII diagrams only when needed - default to text explanations (ASCII ๋ค์ด์ด๊ทธ๋จ์ ํ์ํ ๋๋ง)
- Adaptive difficulty - adjust based on answer quality including reasoning (๊ทผ๊ฑฐ ํ์ง ํฌํจํ์ฌ ๋์ด๋ ์กฐ์ )
- Memory-driven selection - prioritize misconceptions from study history (ํ์ต ์ด๋ ฅ์ misconception ์ฐ์ ์ถ์ )
- Encouraging tone - wrong answers are learning opportunities (๊ฒฉ๋ คํ๋ ํค)
- Results must include concrete weak points - concept-level feedback, not just topic-level (๊ฒฐ๊ณผ์ ๊ตฌ์ฒด์ ๊ฐ๋
๋ณ ๋ณด์ ํฌ์ธํธ ํฌํจ)
- No emojis - clean text only (์ด๋ชจ์ง ์ฌ์ฉ ๊ธ์ง)