games:
  - type: command-sprint
    title: "Socrates Command Sprint"
    challenges:
      - prompt: "List all files in the current directory (including hidden)."
        answer: "ls -la"
        alternates: ["ls -al", "ls -a -l"]
        timeLimit: 15
      - prompt: "Create a directory called 'test-dir'."
        answer: "mkdir test-dir"
        alternates: ["mkdir -p test-dir"]
        timeLimit: 12
      - prompt: "Write 'hello' to a file called output.txt."
        answer: "echo hello > output.txt"
        alternates: ["echo 'hello' > output.txt", "printf 'hello' > output.txt"]
        timeLimit: 18

  - type: speed-round
    title: "Socrates Speed Round"
    rounds:
      - question: "Which tier always works, even without a browser?"
        options:
          - "Full tier"
          - "Canvas tier"
          - "Terminal tier"
        answer: 2
        timeLimit: 12
      - question: "What method does Socrates use for teaching?"
        options:
          - "Lecture-based"
          - "Socratic (question-based)"
          - "Video-only"
        answer: 1
        timeLimit: 12
      - question: "What color is the first belt in Socrates?"
        options:
          - "Yellow"
          - "Green"
          - "White"
        answer: 2
        timeLimit: 10

  - type: bug-hunt
    title: "Spot the Bug"
    snippets:
      - code: |
          function add(a, b) {
            return a - b;
          }
          console.log(add(2, 3)); // Expected: 5
        bugLine: 2
        explanation: "The function is named 'add' but uses subtraction (-) instead of addition (+)."
        hint: "Look at the operator on line 2."
      - code: |
          const items = [1, 2, 3];
          for (let i = 0; i <= items.length; i++) {
            console.log(items[i]);
          }
        bugLine: 2
        explanation: "Off-by-one error: <= should be <. When i equals items.length, items[i] is undefined."
        hint: "Array indices go from 0 to length - 1."
      - code: |
          async function fetchUser(id) {
            const res = fetch(`/api/users/${id}`);
            return res.json();
          }
        bugLine: 2
        explanation: "Missing 'await' before fetch(). Without it, res is a Promise, not a Response, so res.json() will fail."
        hint: "This is an async function — are all async calls awaited?"

  - type: classify
    title: "Element Sorter"
    categories:
      - name: Interactive
        color: "#58a6ff"
      - name: Visual
        color: "#3fb950"
      - name: Content
        color: "#f0883e"
    items:
      - text: "Quiz"
        category: "Interactive"
      - text: "Terminal practice"
        category: "Interactive"
      - text: "Game"
        category: "Interactive"
      - text: "Mermaid diagram"
        category: "Visual"
      - text: "Celebration animation"
        category: "Visual"
      - text: "Progress bar"
        category: "Visual"
      - text: "Markdown text"
        category: "Content"
      - text: "Quick reference"
        category: "Content"
      - text: "Resource links"
        category: "Content"

  - type: scenario
    title: "The Module Author"
    startHealth: 3
    steps:
      - id: start
        situation: "You're creating a new learning module for Socrates. You have a topic in mind. What do you create first?"
        choices:
          - text: "Start with module.yaml to define metadata, XP, and triggers."
            consequence: "Good instinct. The metadata file is the entry point that defines everything about the module."
            health: 1
            next: content
          - text: "Jump straight into writing quiz questions."
            consequence: "Quizzes are important, but without content there's nothing to quiz on."
            health: -1
            next: content
          - text: "Write the content.md reference material first."
            consequence: "Content is foundational, but you'll need module.yaml to register the module."
            health: 0
            next: yaml_later
      - id: yaml_later
        situation: "You've written great content but realize the module isn't recognized by the system. What's missing?"
        choices:
          - text: "Create module.yaml with slug, title, description, and XP config."
            consequence: "Now the system can find and load your module."
            health: 1
            next: content
          - text: "Add the module to registry.yaml directly."
            consequence: "The registry references modules, but each module needs its own module.yaml first."
            health: 0
            next: content
      - id: content
        situation: "Your module.yaml and content.md are ready. What do you add next to make the module interactive?"
        choices:
          - text: "Add a walkthrough.md with Socratic questions and hint directives."
            consequence: "The walkthrough is the heart of the teaching experience."
            health: 1
            next: finish
          - text: "Add all six game types to game.yaml."
            consequence: "Games are fun but a walkthrough should come first — it's the core teaching flow."
            health: 0
            next: finish
          - text: "Skip interactivity — content is enough."
            consequence: "Content alone is passive. Socrates is built around active learning."
            health: -1
            next: finish
      - id: finish
        situation: "Your module is taking shape. Time to finalize. What's your last step?"
        choices:
          - text: "Add quiz, exercises, games, quick-ref, and resources. Then test everything."
            consequence: "Comprehensive and thorough. A well-rounded module with all element types."
            health: 1
            next: end
          - text: "Ship it as-is and iterate later."
            consequence: "Iterating is fine, but at least add a quiz to validate learning."
            health: 0
            next: end

  - type: memory-match
    title: "Element Pairs"
    pairs:
      - term: "canvas:quiz"
        definition: "Interactive quiz with timed-choice, drag-order, matching"
      - term: "canvas:terminal"
        definition: "Practice terminal with task validation"
      - term: "canvas:diagram"
        definition: "Mermaid diagram visualization"
      - term: "canvas:game"
        definition: "Interactive game (sprint, scenario, etc.)"
      - term: "canvas:celebrate"
        definition: "XP award and level-up animation"
      - term: "canvas:html"
        definition: "Rich HTML content (images, videos, links)"
