zam-core 0.3.6 → 0.3.11
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/.agent/skills/zam/SKILL.md +177 -9
- package/.agents/skills/zam/SKILL.md +178 -9
- package/.claude/skills/zam/SKILL.md +177 -9
- package/README.de.md +3 -3
- package/README.md +3 -3
- package/dist/cli/index.js +3371 -1616
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +532 -146
- package/dist/index.js +2033 -898
- package/dist/index.js.map +1 -1
- package/package.json +21 -3
- package/templates/personal/README.md +31 -0
- package/templates/personal/beliefs/README.md +19 -0
- package/templates/personal/goals/README.md +19 -0
- package/templates/personal/package.json +9 -0
|
@@ -21,7 +21,7 @@ All knowledge management is done through the `zam` CLI:
|
|
|
21
21
|
zam init
|
|
22
22
|
|
|
23
23
|
# Token management
|
|
24
|
-
zam token register --slug <slug> --concept "<one sentence>" --domain <d> --bloom <1-5> [--source-link <link>]
|
|
24
|
+
zam token register --slug <slug> --concept "<one sentence>" --domain <d> --bloom <1-5> [--question "<concept-free recall question>"] [--source-link <link>]
|
|
25
25
|
zam token find --query "<keywords>"
|
|
26
26
|
zam token list [--domain <d>]
|
|
27
27
|
zam token prereq --token <child> --requires <parent>
|
|
@@ -30,12 +30,13 @@ zam token deprecate --slug <slug> # mark outdated knowledge
|
|
|
30
30
|
# Card & review management
|
|
31
31
|
zam card due --user <username>
|
|
32
32
|
zam card update --user <username> --token <slug> --rating <1-4>
|
|
33
|
+
zam card block --user <username> --token <slug>
|
|
33
34
|
zam card unblock --user <username>
|
|
34
35
|
|
|
35
36
|
# Sessions
|
|
36
37
|
zam session start --user <username> --task "<description>" [--context shell|ui|reallife]
|
|
37
38
|
zam session log --session <id> --token <slug> --done-by <user|agent> [--rating <n>]
|
|
38
|
-
zam session end --session <id>
|
|
39
|
+
zam session end --session <id> [--synthesize] [--patterns <json-file>]
|
|
39
40
|
|
|
40
41
|
# Stats
|
|
41
42
|
zam stats --user <username>
|
|
@@ -143,8 +144,13 @@ zam token find --query "<keywords>"
|
|
|
143
144
|
Only register genuinely new concepts. Reuse existing slugs where the concept matches.
|
|
144
145
|
|
|
145
146
|
**Register tokens and prerequisites:**
|
|
147
|
+
|
|
148
|
+
As the frontier model, YOU author both the concept and the recall question. The
|
|
149
|
+
local LLM is reserved for review time, where it rephrases the question live so
|
|
150
|
+
the learner never memorizes a fixed input->output pair. Pass a clear,
|
|
151
|
+
concept-free `--question` so the offline fallback stays high quality:
|
|
146
152
|
```bash
|
|
147
|
-
zam token register --slug <slug> --concept "<one sentence>" --domain <d> --bloom <1-5>
|
|
153
|
+
zam token register --slug <slug> --concept "<one sentence>" --domain <d> --bloom <1-5> --question "<concept-free recall question>" [--source-link <link>]
|
|
148
154
|
zam token prereq --token <child> --requires <parent>
|
|
149
155
|
```
|
|
150
156
|
|
|
@@ -211,12 +217,11 @@ This spawns a new terminal window (Terminal.app or iTerm2 on macOS), already `cd
|
|
|
211
217
|
Shell hooks silently capture every command with timestamps, exit codes, and working directory to a JSONL log. When the user returns:
|
|
212
218
|
|
|
213
219
|
```bash
|
|
214
|
-
#
|
|
215
|
-
zam
|
|
220
|
+
# Preview evidence, confirm each rating, and end the session
|
|
221
|
+
zam session end --session <session-id> --synthesize
|
|
216
222
|
|
|
217
|
-
#
|
|
218
|
-
|
|
219
|
-
| zam bridge analyze-monitor --session <session-id>
|
|
223
|
+
# Supply task-specific mappings when skill-to-token links are ambiguous
|
|
224
|
+
zam session end --session <session-id> --synthesize --patterns <json-file>
|
|
220
225
|
```
|
|
221
226
|
|
|
222
227
|
The analyzer infers ratings from:
|
|
@@ -225,7 +230,15 @@ The analyzer infers ratings from:
|
|
|
225
230
|
- **Speed**: inter-command gaps, thinking pauses → lower if slow
|
|
226
231
|
- **Self-corrections**: same command prefix run repeatedly with different args → lower rating
|
|
227
232
|
|
|
228
|
-
|
|
233
|
+
Single-token agent skills supply command patterns automatically. A pattern file
|
|
234
|
+
contains an array (or `{ "patterns": [...] }`) of
|
|
235
|
+
`{ "slug": "<token>", "patterns": ["<command>"] }` entries. Only medium- and
|
|
236
|
+
high-confidence candidates are proposed. Accept, override, or skip every
|
|
237
|
+
rating; accepted ratings are applied atomically and repeated synthesis is
|
|
238
|
+
idempotent.
|
|
239
|
+
|
|
240
|
+
Use `zam bridge get-monitor` and `zam bridge analyze-monitor` only when raw
|
|
241
|
+
diagnostic output is needed.
|
|
229
242
|
|
|
230
243
|
When done, the user can simply close the monitored terminal window — hooks only live in that shell process. No cleanup command needed.
|
|
231
244
|
|
|
@@ -279,6 +292,10 @@ Use it to:
|
|
|
279
292
|
|
|
280
293
|
### STEP 5 — End session
|
|
281
294
|
```bash
|
|
295
|
+
# Monitored executable session
|
|
296
|
+
zam session end --session <id> --synthesize
|
|
297
|
+
|
|
298
|
+
# Conceptual or unmonitored session
|
|
282
299
|
zam session end --session <id>
|
|
283
300
|
zam stats --user <username>
|
|
284
301
|
```
|
|
@@ -323,6 +340,157 @@ Never present a blocked token to the user.
|
|
|
323
340
|
|
|
324
341
|
---
|
|
325
342
|
|
|
343
|
+
## Dynamic Token Decomposition
|
|
344
|
+
|
|
345
|
+
**Principle:** Do not pre-create hundreds of tokens. Let the dependency graph grow
|
|
346
|
+
from real gaps discovered during review. Every rating of 1 is an opportunity to
|
|
347
|
+
diagnose *why* the user couldn't answer — and to create the missing foundations.
|
|
348
|
+
|
|
349
|
+
This applies primarily to tokens at Bloom 3-5 (apply, analyze, synthesize) that
|
|
350
|
+
cover broad learning areas. School curricula — where a single "Lernbereich" spans
|
|
351
|
+
many underlying concepts — are the canonical use case.
|
|
352
|
+
|
|
353
|
+
### When to split
|
|
354
|
+
|
|
355
|
+
A token should be decomposed when ALL of the following hold:
|
|
356
|
+
|
|
357
|
+
1. The user rated it **1** (drew a blank / couldn't answer)
|
|
358
|
+
2. The token is at **Bloom ≥ 3** (application or above)
|
|
359
|
+
3. The token covers **multiple distinct concepts** (not atomic)
|
|
360
|
+
4. No prerequisite tokens already exist for the specific gap you diagnose
|
|
361
|
+
|
|
362
|
+
### How to diagnose
|
|
363
|
+
|
|
364
|
+
After a rating of 1, pause. Do not just re-ask the same question or move on.
|
|
365
|
+
Ask yourself: **"What would the user have needed to know to answer this?"**
|
|
366
|
+
|
|
367
|
+
| Symptom | Missing foundation | Create Bloom 1-2 token for |
|
|
368
|
+
|---------|-------------------|---------------------------|
|
|
369
|
+
| Couldn't name key terms | Factual recall | Definitions, terminology |
|
|
370
|
+
| Used terms incorrectly | Conceptual understanding | Explain the concept in own words |
|
|
371
|
+
| Knew facts but couldn't connect them | Structural understanding | How A relates to B |
|
|
372
|
+
| Understood but couldn't apply | Procedural knowledge | Apply concept to a simple case first |
|
|
373
|
+
|
|
374
|
+
### Source-grounded splitting
|
|
375
|
+
|
|
376
|
+
When the high-level token has a `source_link` pointing to a curriculum (LehrplanPLUS,
|
|
377
|
+
school syllabus, certification exam outline), **consult it before creating any
|
|
378
|
+
foundation tokens**. The source defines the official scope — your foundations must
|
|
379
|
+
stay inside it.
|
|
380
|
+
|
|
381
|
+
**Protocol:**
|
|
382
|
+
|
|
383
|
+
1. Fetch or follow the `source_link` (WebFetch for URLs, Read for local files)
|
|
384
|
+
2. Locate the relevant Lernbereich / topic section in the source
|
|
385
|
+
3. Extract the **explicitly listed** basic terms, dates, concepts, and
|
|
386
|
+
"grundlegende Daten und Begriffe" (for LehrplanPLUS) or equivalent
|
|
387
|
+
4. Create foundation tokens ONLY for items that appear in the source
|
|
388
|
+
|
|
389
|
+
**Example of a BAD split (terms not in curriculum):**
|
|
390
|
+
|
|
391
|
+
> `ge-aufklaerung-begriffe`: "Define: Aufklärung, Emanzipation, Toleranz,
|
|
392
|
+
> Vernunft, Fortschritt, Naturrecht."
|
|
393
|
+
>
|
|
394
|
+
> Problem: The LehrplanPLUS Geschichte 8 LB2 lists "Aufklärung, Menschenrechte,
|
|
395
|
+
> Volkssouveränität, Gewaltenteilung, Parlament, konstitutionelle Monarchie,
|
|
396
|
+
> Bürgertum" as required terms. Emanzipation, Toleranz, and Fortschrittsglaube
|
|
397
|
+
> are NOT part of the 8th-grade Realschule curriculum for this Lernbereich.
|
|
398
|
+
|
|
399
|
+
**Example of a CORRECT split (terms from the source):**
|
|
400
|
+
|
|
401
|
+
> `ge-aufklaerung-begriffe`: "Define: Aufklärung, Volkssouveränität,
|
|
402
|
+
> Gewaltenteilung, konstitutionelle Monarchie, Menschenrechte."
|
|
403
|
+
>
|
|
404
|
+
> Every term appears in the LehrplanPLUS. The student won't be tested on
|
|
405
|
+
> anything outside this list.
|
|
406
|
+
|
|
407
|
+
**Rule of thumb:** For curriculum-based tokens, the source is the contract.
|
|
408
|
+
If the source says "grundlegende Daten und Begriffe: X, Y, Z", only X, Y,
|
|
409
|
+
and Z are fair game for Bloom 1-2 foundations. Adding extra terms is scope
|
|
410
|
+
creep and undermines the learner's trust.
|
|
411
|
+
|
|
412
|
+
### Registration protocol
|
|
413
|
+
|
|
414
|
+
For each gap you diagnose, register a new token and wire it immediately:
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
# 1. Register the foundation token (Bloom 1-2, atomic, single concept)
|
|
418
|
+
zam token register \
|
|
419
|
+
--slug <parent-slug>-<gap-keyword> \
|
|
420
|
+
--concept "<one atomic concept the user was missing>" \
|
|
421
|
+
--domain <same-domain> \
|
|
422
|
+
--bloom <1-or-2> \
|
|
423
|
+
--question "<direct recall or explain question>"
|
|
424
|
+
|
|
425
|
+
# 2. Wire it as a prerequisite of the high-level token
|
|
426
|
+
zam token prereq --token <high-level-slug> --requires <parent-slug>-<gap-keyword>
|
|
427
|
+
|
|
428
|
+
# 3. Block the high-level card after all new prerequisites are wired
|
|
429
|
+
zam card block --user <username> --token <high-level-slug>
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### What happens next
|
|
433
|
+
|
|
434
|
+
After wiring prerequisites and blocking the card:
|
|
435
|
+
- The high-level token is removed from the review queue
|
|
436
|
+
- The next `/zam` session will surface the *foundation tokens first*
|
|
437
|
+
- Once all prerequisites reach `reps >= 1`, `zam card unblock` promotes the
|
|
438
|
+
high-level token back into the review queue
|
|
439
|
+
|
|
440
|
+
If prerequisites already existed when the token was rated 1, the rating command
|
|
441
|
+
blocks it automatically. Use `zam card block` when the missing prerequisites were
|
|
442
|
+
discovered and registered only after the rating.
|
|
443
|
+
|
|
444
|
+
### Example: High-school history
|
|
445
|
+
|
|
446
|
+
> User rates `ge-aufklaerung` (Bloom 4: "How did Enlightenment ideas shape the
|
|
447
|
+
> French Revolution and transform Europe's political order?") as **1**.
|
|
448
|
+
|
|
449
|
+
Agent diagnoses:
|
|
450
|
+
- *"You couldn't name the three estates. You weren't sure what 'popular sovereignty'
|
|
451
|
+
means. You mixed up 1789 and 1793."*
|
|
452
|
+
|
|
453
|
+
Agent creates three foundations:
|
|
454
|
+
|
|
455
|
+
| Token | Bloom | Question |
|
|
456
|
+
|-------|-------|----------|
|
|
457
|
+
| `ge-aufklaerung-staende` | 1 | Who belonged to each of the three estates in 18th-century France? |
|
|
458
|
+
| `ge-aufklaerung-begriffe` | 1 | Define: Enlightenment, popular sovereignty, separation of powers, natural rights. |
|
|
459
|
+
| `ge-aufklaerung-daten` | 1 | Name the five key events of the French Revolution (1789–1799) with dates. |
|
|
460
|
+
|
|
461
|
+
Agent wires them:
|
|
462
|
+
```bash
|
|
463
|
+
zam token prereq --token ge-aufklaerung --requires ge-aufklaerung-staende
|
|
464
|
+
zam token prereq --token ge-aufklaerung --requires ge-aufklaerung-begriffe
|
|
465
|
+
zam token prereq --token ge-aufklaerung --requires ge-aufklaerung-daten
|
|
466
|
+
zam card block --user <username> --token ge-aufklaerung
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
`ge-aufklaerung` is now blocked. Next session: foundations first. When they
|
|
470
|
+
stick → `ge-aufklaerung` reappears — this time with a fighting chance.
|
|
471
|
+
|
|
472
|
+
### Sizing rule
|
|
473
|
+
|
|
474
|
+
- Create **2–4 foundations per failed high-level token**, not 10
|
|
475
|
+
- Each foundation must be **genuinely atomic** — one fact or concept
|
|
476
|
+
- If the user still fails a foundation, split it further (e.g. "too many dates
|
|
477
|
+
at once" → one token per date)
|
|
478
|
+
- Over time this builds a **Bloom ladder**: Level 1 facts → Level 2 understanding
|
|
479
|
+
→ Level 3 application → Level 4+ analysis
|
|
480
|
+
|
|
481
|
+
### Safety
|
|
482
|
+
|
|
483
|
+
- **Never create more than 10 new tokens in a single session** — if a rating of 1
|
|
484
|
+
reveals massive gaps, prioritize the 3 most urgent foundations and let the rest
|
|
485
|
+
emerge in subsequent sessions
|
|
486
|
+
- **Always dedup before registering** — `zam token find --query "<keywords>"`
|
|
487
|
+
- **Do not split Bloom 1-2 tokens** — they are already atomic; if the user fails
|
|
488
|
+
them, the fix is re-exposure and practice, not further decomposition
|
|
489
|
+
- A rating of 1 on a Bloom 1 token means the user needs simpler wording or a
|
|
490
|
+
mnemonic, not more tokens
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
326
494
|
## Token Deprecation
|
|
327
495
|
|
|
328
496
|
Knowledge goes stale. If a token comes up for review and the user indicates it's outdated ("that's not how it works anymore"):
|
package/README.de.md
CHANGED
|
@@ -77,7 +77,7 @@ ZAM ist das Werkzeug für den Übergang in eine Welt, in der Fürsorge und gemei
|
|
|
77
77
|
|
|
78
78
|
ZAM enthält nun eine plattformübergreifende Desktop-Anwendung im Verzeichnis [`desktop/`](desktop/). Entwickelt mit **Tauri v2**, **Vite**, **TypeScript** und **Vanilla CSS**, bietet sie ein hochmodernes Dark-Mode-Lernstudio, das dieselbe SQLite-Datenbank wie das CLI nutzt.
|
|
79
79
|
|
|
80
|
-
### Starten unter Windows oder
|
|
80
|
+
### Starten unter Windows, macOS oder Linux:
|
|
81
81
|
|
|
82
82
|
1. **CLI Bridge kompilieren**:
|
|
83
83
|
Stelle sicher, dass der neueste CLI-Code im Hauptverzeichnis kompiliert ist:
|
|
@@ -98,7 +98,7 @@ Dies kompiliert das Rust-Backend im Hintergrund, startet den Vite-Entwicklungsse
|
|
|
98
98
|
|
|
99
99
|
### 📦 Automatische GitHub Releases & Native Installer
|
|
100
100
|
|
|
101
|
-
Wir haben eine **GitHub Actions CI/CD-Pipeline** integriert, die
|
|
101
|
+
Wir haben eine **GitHub Actions CI/CD-Pipeline** integriert, die derzeit native Installationsdateien für Windows (`.msi`/`.exe`) und Linux (`.deb`/`.rpm`) kompiliert und verpackt, sobald ein neuer Git-Tag gepusht wird. AppImage-Pakete sind vorläufig ausgesetzt, weil `linuxdeploy` das mitgelieferte native `libsql`-Modul noch nicht zuverlässig verarbeiten kann. macOS kann weiterhin aus dem Quellcode gebaut werden; signierte und notarisierte macOS-Release-Artefakte folgen, sobald der Apple-Signing-Account verfügbar ist.
|
|
102
102
|
|
|
103
103
|
Um eine neue Version zu veröffentlichen (z.B. `v0.1.0`):
|
|
104
104
|
|
|
@@ -110,7 +110,7 @@ git tag v0.1.0
|
|
|
110
110
|
git push origin v0.1.0
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
Dies startet automatisch die
|
|
113
|
+
Dies startet automatisch die Windows- und Linux-Builds auf GitHub-Runnern und erstellt einen Entwurf (Draft) mit den kompilierten Installationsdateien.
|
|
114
114
|
|
|
115
115
|
---
|
|
116
116
|
|
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ ZAM is a tool for the transition to a world where care and shared growth are the
|
|
|
97
97
|
|
|
98
98
|
ZAM now includes a cross-platform desktop application inside the [`desktop/`](desktop/) directory. Built with **Tauri v2**, **Vite**, **TypeScript**, and **Vanilla CSS**, it provides a premium dark-mode dashboard and active-recall learning studio that securely shares the same SQLite database as the CLI.
|
|
99
99
|
|
|
100
|
-
### How to Run on Windows or
|
|
100
|
+
### How to Run on Windows, macOS, or Linux:
|
|
101
101
|
|
|
102
102
|
1. **Build the CLI Bridge**:
|
|
103
103
|
Ensure you have compiled the latest CLI code in the repository root:
|
|
@@ -118,7 +118,7 @@ This will compile the secure Rust backend, spin up the Vite development server,
|
|
|
118
118
|
|
|
119
119
|
### 📦 Automated GitHub Releases & Native Installers
|
|
120
120
|
|
|
121
|
-
We have integrated a **GitHub Actions CI/CD workflow** that
|
|
121
|
+
We have integrated a **GitHub Actions CI/CD workflow** that currently compiles and packages native installers for Windows (`.msi`/`.exe`) and Linux (`.deb`/`.rpm`) when a new git tag is pushed. AppImage packaging is temporarily deferred because `linuxdeploy` cannot process the bundled native `libsql` module reliably. macOS builds remain supported from source, but signed/notarized macOS release artifacts are deferred until the Apple signing account is available.
|
|
122
122
|
|
|
123
123
|
To release a new version (e.g., `v0.1.0`):
|
|
124
124
|
|
|
@@ -130,7 +130,7 @@ git tag v0.1.0
|
|
|
130
130
|
git push origin v0.1.0
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
This automatically spins up the
|
|
133
|
+
This automatically spins up the Windows and Linux compiler environments on GitHub and creates a drafted GitHub Release containing their native redistributables.
|
|
134
134
|
|
|
135
135
|
---
|
|
136
136
|
|