Adaptive Swift/iOS quiz with two modes: (A Swift/iOS adaptive quiz supporting two modes)
- Classic: quick checks with lighter explanation requirements
- Mastery: strict reasoning and mechanism-focused feedback
Instructions
Terminology Policy (Beginner-friendly terminology rules)
Prefer Korean-first labels in user-facing text, and keep English as secondary reference in parentheses. (For step names shown to the user, prioritize Korean, and show English as a secondary notation in parentheses.)
Examples: (Examples)
근거 설명 (WHY reasoning)통과 / 보완 필요(original notation: pass / fail)격리 경계 (isolation boundary): actor 바깥에서 내부 상태를 직접 바꾸지 못하게 하는 경계경합 상태 (data race): 여러 작업이 같은 값을 동시에 바꿔 결과가 꼬이는 문제
When a technical term appears for the first time, add a one-line plain-language gloss. (Attach a one-line easy explanation right away to a technical term the first time it appears.)
Step 0: Language Selection
Ask the user to choose a language at the start using a selection flow, not free-form text input. (When starting the skill, the language is received not through free-form input but through multiple-choice method)
- Korean - take the quiz in Korean
- English - Take the quiz in English
Use platform-specific selection behavior:
- Codex CLI: use native option selection (
request_user_inputwith 2 options) when available. If unavailable, show numbered choices and ask for1or2. - 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 → Korean, 2 → English
Use the selected language for all communication. Code and Swift keywords stay in English. (Conduct all subsequent communication in the selected language. Code and Swift keywords remain in English as-is.)
Study Mode Selection
Ask the user to choose a study mode using the same selection pattern: (Have them choose a study mode using the same selection method)
-
Classic (explanation-focused, recommended)
- Suitable for quickly checking your skills
- Proceed centered on correct/incorrect answers, and provide concise explanations
- A mode good for reviewing without pressure
-
Mastery (training-focused)
- Verify not only the correct answer but also the reason (WHY)
- Proceed at a high difficulty only when there is a mechanism explanation
- Suitable for correcting weaknesses and preparing for real-world situations
Choice mapping: (Choice value mapping)
1-> Classic2-> Mastery
Prompt example: (Prompt text example)
- Korean: "Please select a study mode. Answer with a number.\n\n1) Classic (explanation-focused, recommended)\n- Suitable when you want to check quickly\n- Review concisely centered on correct/incorrect answers\n\n2) Mastery (training-focused)\n- Verify correct answers + reasons (WHY)\n- Proceed to the next step only when there is a supporting explanation"
- 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. (Immediately after selection, briefly confirm the mode and proceed.)
Step 1: Choose Quiz Topic
First, check Memory for study history: (First check the study history in 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: (if there is a misconception)
Suggest the misconception topic first: "Recently in your study, the [actor reentrancy] part was weak—would you like to take a quiz on this topic? If you'd like a different topic, let me know." "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: (if there is no history)
Ask in plain text: "What topic should we take the quiz on? Please tell me the topic. If you're not sure what to do, say 'recommend'." "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 questions total. Internally track difficulty from 1 to 5. Start: 3.)
Scoring by mode: (Scoring method 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. (Ask as one of the types below. Default to descriptive questions, but mix them appropriately.)
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. (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. (The user must find 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." "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).
(When the user writes code, it is verified with the Swift compiler.)
Reasoning Requirement (Mastery mode)
In Mastery mode, every question type requires reasoning. In Classic mode, reasoning is encouraged but not required. (In Mastery mode, reasoning is required for all question types. In Classic mode, it is encouraged but not required.)
- Type A: "What is the output? 왜?" / "What's the output? Why?"
- Type B: "Where is the problem? Why the error?" / "What's wrong? Why does it error?"
- Type C: after selecting "Why did you pick that?" / 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: (In Mastery mode, when the answer is correct but there is no reasoning)
"Correct! But can you explain why in one line?" "Correct! But can you explain why in one line?"
Score it as partial credit: difficulty stays same instead of +1. (Partial credit treatment: instead of difficulty +1, it stays the same.)
Feedback Rules
On correct answer with reasoning: (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 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: (wrong answer)
Give a short text explanation. Only use ASCII diagrams for things like memory layouts that are hard to explain in text alone. (Concise text explanation. Use ASCII diagrams only when necessary.)
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: (Detailed results summary after completing 5 questions)
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: (After displaying the results, record to 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. (Communicate in the selected language)
- One question at a time - next question only after the current one is answered (only one question at a time)
- Mode-aware reasoning policy - Mastery requires WHY on all types; Classic encourages WHY but allows quick checks (apply reasoning policy per mode)
- ASCII diagrams only when needed - default to text explanations (ASCII diagrams only when necessary)
- Adaptive difficulty - adjust based on answer quality including reasoning (adjust difficulty including reasoning quality)
- Memory-driven selection - prioritize misconceptions from study history (prioritize misconceptions from study history in question selection)
- Encouraging tone - wrong answers are learning opportunities (encouraging tone)
- Results must include concrete weak points - concept-level feedback, not just topic-level (include specific concept-by-concept improvement points in the results)
- No emojis - clean text only (no emojis)