@leon135/opencode-learn 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -40
- package/package.json +1 -1
- package/skills/teach/SKILL.md +2 -2
- package/assets/thumbnail.png +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# opencode-learn
|
|
2
2
|
|
|
3
|
-
[](https://www.youtube.com/watch?v=kzcI5F4tGiU)
|
|
4
|
-
|
|
5
3
|
An AI teaching system packaged as an [OpenCode v2](https://opencode.ai/v2/docs/) plugin. The `teach` skill probes what you already know, plans a dependency map, then teaches node by node — checking each node lands with a graded quiz before building on top of it.
|
|
6
4
|
|
|
7
5
|
## Where it comes from
|
|
@@ -15,47 +13,16 @@ Three generations of the same system:
|
|
|
15
13
|
> [!WARNING]
|
|
16
14
|
> Experimental — some things may not work or may break.
|
|
17
15
|
|
|
18
|
-
## What's in it
|
|
19
|
-
|
|
20
|
-
One plugin package, `opencode-learn` (the repo root). Its `package.json` maps two exports to the plugin parts:
|
|
21
|
-
|
|
22
|
-
- `.` → `plugins/index.ts` — the **server** part, plugin id `opencode-learn`. It registers the bundled agents and skills at setup, adds the quiz and viz tools, and runs the md-link mirror.
|
|
23
|
-
- `./tui` → `plugins/tui.ts` — the **TUI** part, plugin id `opencode-learn.tui`. It registers the slash commands and the `ctrl+alt:m` binding.
|
|
24
|
-
|
|
25
|
-
Inside:
|
|
26
|
-
|
|
27
|
-
- `skills/teach/SKILL.md` — the philosophy and the process
|
|
28
|
-
- `skills/visualize/SKILL.md` — adds a correct, minimal diagram to a lesson when an idea is clearer as a picture
|
|
29
|
-
- `plugins/agents.ts` — `researcher`, `svg-maker`, `mermaid-maker`: the subagents the plugin registers
|
|
30
|
-
- `plugins/quiz.ts` — the graded `quiz_ask` / `quiz_grade` question pair (chat-UI mode via `openchamber_render` with auto-detection; TUI session forms in form mode)
|
|
31
|
-
- `plugins/viz/` (`index.ts`, `tui.ts`, `common.ts`) — the `write_*`/`edit_*`/`render_*` authoring loops the visual makers use (SVG via `rsvg-convert`, fallback ImageMagick; Mermaid via `mmdc`) and the `/viz-dir` TUI command
|
|
32
|
-
- `plugins/md-link/` (`index.ts`, `tui.ts`, `core.ts`) — live-mirrors the session to a markdown file for comfortable reading in Obsidian (assistant replies, your prompts, and quiz Q&A as callouts) plus its TUI commands
|
|
33
|
-
|
|
34
16
|
## Install
|
|
35
17
|
|
|
36
|
-
Requires OpenCode v2.
|
|
37
|
-
|
|
38
|
-
**Explicit config entry** — works from any path. Add the package directory to `plugins` in your project `opencode.json(c)` or `~/.config/opencode/opencode.json(c)`:
|
|
18
|
+
Requires OpenCode v2.
|
|
39
19
|
|
|
40
20
|
```jsonc
|
|
41
21
|
{
|
|
42
|
-
"plugins": ["/
|
|
22
|
+
"plugins": ["@leon135/opencode-learn"],
|
|
43
23
|
}
|
|
44
24
|
```
|
|
45
25
|
|
|
46
|
-
Relative paths resolve from the config file that contains the entry, and `file://` URLs work too. A single-file path is skipped — point the entry at a directory.
|
|
47
|
-
|
|
48
|
-
**Auto-discovery** — place the package directory directly inside a discovered plugins directory:
|
|
49
|
-
|
|
50
|
-
```text
|
|
51
|
-
<project>/.opencode/plugins/opencode-learn/
|
|
52
|
-
~/.config/opencode/plugins/opencode-learn/
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Immediate package directories under those locations load automatically. A `plugins/` directory beside a project-root `opencode.json(c)` is **not** discovered automatically — use `.opencode/plugins/` or an explicit entry.
|
|
56
|
-
|
|
57
|
-
One entry loads both parts. The package's `package.json` `name` + `exports` decide which file is the server part and which is the TUI part, and the TUI part loads from the server plugin's entry — no `cli.json` entry and no per-plugin TUI flag. There is no install step: the plugin is TypeScript source loaded by OpenCode, and its only dependencies are `@opencode/plugin` and `@opencode/client`. Use versions of those packages compatible with the OpenCode release you target, and test the installed package rather than only a linked copy.
|
|
58
|
-
|
|
59
26
|
Visuals publish into the session project's `viz/` by default — the project dir is captured once when the plugin sets up (`ctx.location.directory`), so publishes resolve against it even if the process cwd differs. To always publish somewhere else (an Obsidian vault, say), run `/viz-dir` in the TUI — or point `~/.config/opencode/viz-state.json` at it directly; the override still wins, and empty or missing means the project dir:
|
|
60
27
|
|
|
61
28
|
```json
|
|
@@ -66,7 +33,7 @@ md-link keeps its own state next to it in `~/.config/opencode/md-link-state.json
|
|
|
66
33
|
|
|
67
34
|
## Memory
|
|
68
35
|
|
|
69
|
-
Teaching spans sessions; session context does not. The `teach` skill keeps a **project-scoped learner profile** at
|
|
36
|
+
Teaching spans sessions; session context does not. The `teach` skill keeps a **project-scoped learner profile** at `.memory/profile.md` — one short file, read in full at session start and updated as the session goes rather than in one dump at the end:
|
|
70
37
|
|
|
71
38
|
- **Known foundations** — per subject: what you reliably hold, and where your edge is
|
|
72
39
|
- **Struggles** — concepts and moves that cost visible effort
|
|
@@ -75,11 +42,9 @@ Teaching spans sessions; session context does not. The `teach` skill keeps a **p
|
|
|
75
42
|
- **How to explain to you** — which analogies and cadence work, and which don't
|
|
76
43
|
- **Active plan / where we left off** — the current plan, stuck point, next-session hook
|
|
77
44
|
|
|
78
|
-
The file is yours: you can read and edit it, and the skill treats your edits as authoritative. It stays local — `.memory/` is gitignored.
|
|
79
|
-
|
|
80
45
|
## Quiz modes
|
|
81
46
|
|
|
82
|
-
|
|
47
|
+
**Chat-UI mode** returns the question plus a ready `openui-lang` program for `openchamber_render`; [OpenChamber](https://github.com/openchamber/openchamber) renders it, returns the chosen letter(s) and any note, and the model relays them to `quiz_grade(selected, note)`. The question, its details and the lettered option texts all render inside the callout (markdown, so LaTeX works there), while the Choice buttons stay plain letters (A, B, C…); a letter resolves to the shuffled option value through the same letter/value logic as before. Without that tool the result includes a plain-text lettered fallback.
|
|
83
48
|
|
|
84
49
|
**Form mode** (TUI, and `auto` when chat detection fails) is a hybrid: the session form carries only lettered options (A, B, C…, plus "...?") and a note field, with the fixed title "Quiz — answer the question shown in chat". The full question, its details and the lettered option texts come back in the `quiz_ask` result, which tells the model to post that block as a chat message (markdown; math renders per the TUI's own pipeline). The form opens before that message can appear, so you may see the lettered form first — an accepted ordering wrinkle of the design. Form grading uses the same letter/value resolution as chat.
|
|
85
50
|
|
|
@@ -88,7 +53,10 @@ The plugin option `mode` is `"auto"` (default), `"chat"`, or `"form"`:
|
|
|
88
53
|
```jsonc
|
|
89
54
|
{
|
|
90
55
|
"plugins": [
|
|
91
|
-
{
|
|
56
|
+
{
|
|
57
|
+
"package": "@leon135/opencode-learn",
|
|
58
|
+
"options": { "mode": "auto" },
|
|
59
|
+
},
|
|
92
60
|
],
|
|
93
61
|
}
|
|
94
62
|
```
|
package/package.json
CHANGED
package/skills/teach/SKILL.md
CHANGED
|
@@ -93,7 +93,7 @@ If, reading the finished set cold, you can still tell which is right without kno
|
|
|
93
93
|
|
|
94
94
|
### Phase 1 — Probe (never skip this)
|
|
95
95
|
|
|
96
|
-
First read the learner profile (
|
|
96
|
+
First read the learner profile (`.memory/profile.md` — see "The learner profile" below) and spend this probe wisely: foundations the profile already brackets don't get a full re-map, just a quick spot-check that the recorded edge still holds; aim the quiz work at the strands the profile doesn't cover.
|
|
97
97
|
|
|
98
98
|
You can't teach into his zone of proximal development without knowing where its edges are, and you can't aim the teaching without knowing what he's actually reaching for. Two separate unknowns, two separate tools — keep the boundary clean:
|
|
99
99
|
|
|
@@ -150,7 +150,7 @@ If you catch yourself asserting a fact he'd have to take on faith — foundation
|
|
|
150
150
|
|
|
151
151
|
## The learner profile — persistence across sessions
|
|
152
152
|
|
|
153
|
-
He learns across sessions; your session memory doesn't. Keep a **project-scoped learner profile** in the file
|
|
153
|
+
He learns across sessions; your session memory doesn't. Keep a **project-scoped learner profile** in the file `.memory/profile.md` (find the session's project directory; create the file — and the directory — when missing; if nothing resolvable exists, teach cold and skip silently). It's one short file, read in full at every session start, and maintained in the moment. Sections:
|
|
154
154
|
|
|
155
155
|
- **Known foundations** — per subject: what he reliably holds, and the phase-0 edge mapping (what he gets right, where it ends).
|
|
156
156
|
- **Struggles** — concepts and moves that cost him visible effort.
|
package/assets/thumbnail.png
DELETED
|
Binary file
|