aboutsummaryrefslogtreecommitdiff
path: root/course/chapters/04-ai.json
blob: 3552c531c8697d733c862c361cffc7f40ded1903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{
  "id": "04-ai",
  "title": "The AI assistant",
  "icon": "🤖",
  "level": "intermediate",
  "lessons": [
    {
      "id": "4.1",
      "title": "Ask, and let it use tools",
      "objective": "Use the AI assistant and understand the confirmation boundary.",
      "minutes": 9,
      "commands": [
        "ai",
        "ask",
        "ai-config",
        "ai-model"
      ],
      "blocks": [
        {
          "type": "text",
          "text": "`ai` and `ask` open the tool-calling assistant. It can read files, run safe commands and search the web."
        },
        {
          "type": "cmd",
          "text": "ai what can you do?"
        },
        {
          "type": "text",
          "text": "Destructive actions (writes, `sed -i`, deletes) require confirmation. AI-initiated commands run with a loop guard so they cannot recurse."
        },
        {
          "type": "cmd",
          "text": "ai-model"
        },
        {
          "type": "cmd",
          "text": "ai-config"
        }
      ],
      "exercise": {
        "instruction": "Ask the AI a short question.",
        "accept": [
          "ai *",
          "ask *"
        ],
        "check": {
          "type": "command"
        },
        "hint": "Type: ai \"hello\""
      },
      "quiz": {
        "q": "What happens when the AI wants a destructive command?",
        "options": [
          "runs silently",
          "asks for confirmation",
          "restarts the terminal"
        ],
        "answer": 1
      },
      "sources": [
        "modules/core/module-aiassist.js",
        "modules/core/ollama-manager.js"
      ]
    },
    {
      "id": "4.2",
      "title": "Context, memory and skills",
      "objective": "Inspect and clear context, then browse the skill library the AI retrieves from.",
      "minutes": 8,
      "commands": [
        "ai-context",
        "ai-clear",
        "skill-list",
        "skill-validate",
        "learn-skill"
      ],
      "blocks": [
        {
          "type": "text",
          "text": "The assistant keeps recent context. `ai-context` shows it; `ai-clear` resets it without touching your files."
        },
        {
          "type": "cmd",
          "text": "ai-context"
        },
        {
          "type": "cmd",
          "text": "skill-list"
        },
        {
          "type": "text",
          "text": "Skills are markdown entries in `/skills/` indexed by `/skills/index.json`; `load_skills` retrieves them by query."
        },
        {
          "type": "cmd",
          "text": "skill-validate course-01-orientation"
        },
        {
          "type": "tip",
          "text": "This course installs its chapters as `course-*` skills, so the AI can teach what you are reading."
        }
      ],
      "exercise": {
        "instruction": "List the installed skills.",
        "accept": [
          "skill-list"
        ],
        "check": {
          "type": "command"
        },
        "hint": "Type: skill-list"
      },
      "quiz": {
        "q": "Where does the skill index live?",
        "options": [
          "/skills/index.json",
          "/etc/skills",
          "localStorage only"
        ],
        "answer": 0
      },
      "sources": [
        "modules/ext/skill-pack-core.js",
        "modules/core/module-aiassist.js"
      ]
    }
  ]
}