swift-quiz
npx skills add https://github.com/itlearning/study-ios --skill swift-quiz
Agent 安装分布
Skill 文档
swift-quiz – Swift/iOS Quiz
Adaptive quiz and coding exercises for Swift/iOS. (ì ìí í´ì¦ì ì½ë© ì°ìµì ìí ì¤í¬.)
Instructions
Give a Swift/iOS quiz. Difficulty adjusts automatically based on the learner’s level. (Swift/iOS í´ì¦ë¥¼ ì¶ì íë¤. ëì´ëë íìµì ìì¤ì ë§ê² ìë ì¡°ì íë¤.)
Step 0: Language Selection
Ask the user to choose a language at the start using AskUserQuestion: (ì¤í¬ ìì ì AskUserQuestionì¼ë¡ ì¸ì´ë¥¼ ì ííë¤)
questions:
- question: "Which language do you prefer? / ì´ë¤ ì¸ì´ë¡ ì§íí ê¹ì?"
header: "Language"
options:
- label: "íêµì´"
description: "íêµì´ë¡ í´ì¦ë¥¼ íëë¤"
- label: "English"
description: "Take the quiz in English"
multiSelect: false
Use the selected language for all communication. Code and Swift keywords stay in English. (ì íí ì¸ì´ë¡ ì´í 모ë ìíµì ì§ííë¤. ì½ëì Swift í¤ìëë ìì´ ê·¸ëë¡ ì ì§íë¤.)
Step 1: Choose Quiz Topic
Ask in plain text: (í ì¤í¸ë¡ 물ì´ë³¸ë¤)
Korean: “ì´ë¤ 주ì ë¡ í´ì¦ë¥¼ íê¹ì? 주ì 를 ìë ¤ì£¼ì¸ì. ë í ì§ ëª¨ë¥´ê² ì¼ë©´ ‘ì¶ì²í´ì¤’ë¼ê³ í´ì£¼ì¸ì.”
English: “What topic should the quiz cover? Tell me a topic, or say ‘recommend’ if you’re not sure.”
- If the user enters a topic: start the quiz on that topic. (ì ì ê° ì£¼ì 를 ì ë ¥í ê²½ì°: í´ë¹ 주ì ë¡ ë°ë¡ í´ì¦ ìì)
- If the user says “recommend” / “ì¶ì²í´ì¤”: check learning history (SwiftLearningProgress in memory) and suggest 3-4 recently studied topics. Present choices via AskUserQuestion. (íìµ ì´ë ¥ì ì°¸ê³ íì¬ ìµê·¼ íìµí 주ì ì¤ì¬ì¼ë¡ 3-4ê° ì¶ì². AskUserQuestionì¼ë¡ ì íì§ ì ì.)
Step 2: Run the Quiz (5 questions)
5 questions total. Track difficulty internally from 1-5 (start at 3). (ì´ 5문ì . ë´ë¶ì ì¼ë¡ ëì´ë를 1~5ë¡ ì¶ì íë¤. ìì: 3.)
- Correct answer -> difficulty +1 (ì ëµ -> ëì´ë +1)
- 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 your answer.
(ë¤ì ì½ëì ì¶ë ¥ ê²°ê³¼ë? ëµê³¼ ì´ì 를 í¨ê» ì ì´ì£¼ì¸ì.)
var nums = [1, 2, 3]
var copy = nums
copy.append(4)
print(nums.count)
The user types their own answer. (ì ì ê° ì§ì ëµì íì´ííë¤.)
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 types their own answer. (ì ì ê° ì§ì ëµì íì´ííë¤.)
Type C: Concept Question (multiple-choice allowed / ê°ê´ì íì©)
What keyword do you need to modify a struct's property inside a method?
(Swiftìì struct ì¸ì¤í´ì¤ì íë¡í¼í°ë¥¼ ë©ìë ììì ë³ê²½íë ¤ë©´ ì´ë¤ í¤ìëê° íìí ê¹ì?)
Present 4 choices via AskUserQuestion. Multiple-choice is fine for concept checks. (AskUserQuestionì¼ë¡ 4ì§ì ë¤ ì ì. ê°ë íì¸ì©ì ê°ê´ìë ê´ì°®ë¤.)
Type D: Write Code (difficulty 4+ only / ëì´ë 4 ì´ì)
Write a function that meets these requirements:
(ë¤ì ì¡°ê±´ì ë§ì¡±íë í¨ì를 ìì±íì¸ì:)
- Name: isEven (í¨ìëª
: isEven)
- Takes an Int, returns Bool (Int를 ë°ìì Boolì ë°í)
- Returns true for even, false for odd (ì§ìë©´ true, íìë©´ false)
When the user writes code, use the Task tool with subagent_type: "Bash" to verify it with the Swift compiler (swift command).
(ì¬ì©ìê° ì½ë를 ìì±íë©´ Task ëêµ¬ë¡ ìë¸ìì´ì í¸ë¥¼ íì©íì¬ Swift ì»´íì¼ë¬ë¡ ê²ì¦íë¤.)
Feedback Rules
On correct answer / ì ëµì¼ ë:
Correct!
Key point: Array is a value type, so `copy` is an independent copy.
That means nums.count is still 3.
(ì ëµì
ëë¤! íµì¬ í¬ì¸í¸: Arrayë ê° íì
ì´ë¼ì copyë ë
립ì ì¸ ë³µì¬ë³¸ì
ëë¤.)
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.
(ìì½ì§ë§ íë ¸ìµëë¤. ì ëµì "3"ì
ëë¤.
Arrayë struct(ê° íì
)ì´ë¯ë¡ ë
립ì ì¸ ë³µì¬ë³¸ì ë§ëëë¤.)
Step 3: Results Summary
After all 5 questions, show a summary: (5문ì ìë£ í ê²°ê³¼ ìì½)
Quiz Results / í´ì¦ ê²°ê³¼
- Topic / 주ì : Basic syntax
- Score / ì ëµ: 3/5
- Final difficulty / ìµì¢
ëì´ë: 4/5
- Strengths / ê°ì : Optional handling, type system
- Needs work / ë³´ì íì: Value types vs reference types
- Suggestion / ì¶ì²: Review "value vs reference types" with /swift-study
Rules
- Use the selected language – from Step 0. Only code and keywords in English. (ì íí ì¸ì´ë¡ ìíµ)
- One question at a time – next question only after the current one is answered (í ë²ì í 문ì ë§)
- Open-ended by default – the user must think and write answers. Multiple-choice OK for concept checks. (ìì í ì¤ì¬)
- ASCII diagrams only when needed – default to text explanations (ASCII ë¤ì´ì´ê·¸ë¨ì íìí ëë§)
- Adaptive difficulty – adjust to the learner’s level automatically (ëì´ë ì ì)
- Encouraging tone – wrong answers are learning opportunities (ê²©ë ¤íë í¤)
- No emojis – clean text only (ì´ëª¨ì§ ì¬ì© ê¸ì§)