@zosmaai/pi-llm-wiki 0.11.2 → 0.11.4

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.de.md +2 -1
  3. package/README.es.md +2 -1
  4. package/README.fr.md +2 -1
  5. package/README.hi.md +2 -1
  6. package/README.ja.md +2 -1
  7. package/README.ko.md +2 -1
  8. package/README.md +89 -10
  9. package/README.pt.md +2 -1
  10. package/README.ru.md +2 -1
  11. package/README.zh.md +2 -1
  12. package/commands/wiki-digest.md +28 -0
  13. package/commands/wiki-discover.md +30 -0
  14. package/commands/wiki-ingest.md +36 -0
  15. package/commands/wiki-init.md +30 -0
  16. package/commands/wiki-lint.md +25 -0
  17. package/commands/wiki-query.md +37 -0
  18. package/commands/wiki-record.md +36 -0
  19. package/commands/wiki-req.md +55 -0
  20. package/commands/wiki-retro.md +34 -0
  21. package/commands/wiki-run.md +31 -0
  22. package/commands/wiki-skills.md +26 -0
  23. package/commands/wiki-status.md +16 -0
  24. package/dist/extensions/llm-wiki/lib/host.js +97 -0
  25. package/dist/extensions/llm-wiki/lib/observation.js +9 -0
  26. package/dist/extensions/llm-wiki/lib/runtime.js +13 -1
  27. package/dist/extensions/llm-wiki/lib/task-config.js +74 -49
  28. package/dist/extensions/llm-wiki/lib/tools.js +10 -7
  29. package/dist/extensions/llm-wiki/lib/utils.js +59 -16
  30. package/dist/mcp/index.js +55 -3
  31. package/dist/mcp/operations.js +39 -3
  32. package/docs/api.md +9 -1
  33. package/docs/configuration.md +49 -8
  34. package/extensions/llm-wiki/index.ts +44 -6
  35. package/extensions/llm-wiki/lib/host.ts +125 -0
  36. package/extensions/llm-wiki/lib/observation.ts +14 -1
  37. package/extensions/llm-wiki/lib/runtime.ts +13 -1
  38. package/extensions/llm-wiki/lib/task-config.ts +115 -55
  39. package/extensions/llm-wiki/lib/tools.ts +10 -7
  40. package/extensions/llm-wiki/lib/utils.ts +55 -14
  41. package/mcp/index.ts +65 -2
  42. package/mcp/operations.ts +47 -4
  43. package/package.json +12 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ### Added
6
+ - **oh-my-pi (`omp`) host support** alongside pi, from one codebase and with no hard fork. `@oh-my-pi/pi-coding-agent` rewrites `@mariozechner/pi-*` and bare `typebox` specifiers onto its own bundled packages, so the extension module graph is unchanged; what differed was the on-disk config layout and slash-command discovery.
7
+ - **`extensions/llm-wiki/lib/host.ts`**: detects the host (`LLM_WIKI_HOST` override → agent-directory marker → `OMP_PROFILE` → `pi`) and enumerates every settings file both layouts use.
8
+ - **Dual-layout settings**: `loadTaskConfig` now merges `<agentDir>/{settings.json,config.yml,config.yaml}` and `<cwd>/{.pi,.omp}/{settings.json,config.yml,config.yaml}`, host-native project directory last. YAML is parsed for the `config.yml` files oh-my-pi migrates to. `/wiki-model` and `/wiki-trajectories` write JSON into whichever project config directory already exists, so a `.pi`-only repository never sprouts a second settings file and a hand-authored `config.yml` is never rewritten.
9
+ - **`commands/`**: a generated, committed mirror of `prompts/` (`npm run build:commands`, also run by `prepack`). pi finds slash-command templates through `pi.prompts`; oh-my-pi only turns `<package>/commands/*.md` into real `/wiki-*` commands.
10
+ - **Manifest**: added `package.json#omp.extensions`, naming the entry module rather than the `./extensions` directory — oh-my-pi reads `omp` before falling back to `pi`, and `omp -e <package-root>` imports a manifest entry verbatim, so a directory entry fails there. No new dependency: the host resolves its own bundled packages for the extension, so an `@oh-my-pi/pi-coding-agent` peer would be inert while dragging the whole host tree into `pnpm-lock.yaml`.
11
+ - **17 tests** (`test/host-compat.test.ts`, plus manifest/mirror assertions in `test/package-structure.test.ts`): host detection and its precedence, settings-file enumeration and ordering, write-target selection, cross-host config round-trips, YAML reads, corrupt-file tolerance, and `commands/`↔`prompts/` parity.
12
+ - **Ambient surfaces are gated on "does a wiki apply here"**: the session notice, the periodic observe/retro reminder, and the `before_agent_start` recall injection (with its `<wiki_status>` system-prompt footer) fire unprompted, and vault resolution falls back to the personal vault — so once `~/.llm-wiki/` existed they spoke up in EVERY directory, injecting reminders and unrelated cross-project recall hits into repositories that never ran `/wiki-init`. Harmless under pi, where extensions are opted into per project; under oh-my-pi the plugin is installed once and loads everywhere. New `resolveProjectVaultRoot()` answers the question the old `resolveVaultRoot()` could not — "does THIS project have a vault", with no personal fallback and no false positive from the personal vault sitting on the ancestor path of every project under `$HOME`. The new `llm-wiki.ambientPersonalVault` setting overrides the host-dependent default (`true` under pi, preserving historical behaviour; `false` under omp). Tools and slash commands are registered either way, so `/wiki-init` and `wiki_bootstrap` still work in any directory.
13
+ - **17 more tests** (`test/ambient-gate.test.ts`): project-vault resolution (own vault, ancestor walk, `WIKI_HOME`, personal-vault exclusion), the host-dependent default and its explicit override, the composed gate across four project states, and the reminder gate — including that a closed gate does not bank turns, so opening it later is not an instant nag, and that `display: false` is not a substitute because it still injects into model context.
14
+
5
15
  ### Fixed
6
16
  - **MCP server failed to start on `@modelcontextprotocol/server` 2.0.0** (Issue #128): `mcp/index.ts` imported `StdioServerTransport` from the package root, but SDK 2.0.0 (published 2026-07-27) moved that export to the `./stdio` subpath, so `node dist/mcp/index.js` died with `SyntaxError: The requested module '@modelcontextprotocol/server' does not provide an export named 'StdioServerTransport'` before the transport ever connected. The declared range `^2.0.0-alpha.2` is a caret range over a prerelease, so it permits `2.0.0`: every fresh consumer install resolved the stable SDK against the pre-stable import, while `pnpm-lock.yaml` pinned the `2.0.0-alpha.2` floor — so `test/mcp-package.test.ts`, which does spawn the published command and complete the stdio handshake, only ever exercised the alpha where the root export still existed. Fixed by importing `StdioServerTransport` from `@modelcontextprotocol/server/stdio` (the `./stdio` subpath does not exist in `2.0.0-alpha.2`, so the range, the lockfile and the import move together), raising the range to `^2.0.0`, and refreshing the lockfile so the existing smoke test now runs against the SDK consumers actually get.
7
17
  - **Packaged MCP server was never exercised with consumer-resolved dependencies**: a new `packaged-mcp-consumer` CI job packs the tarball, installs it into a directory with **no lockfile**, prints the resolved SDK version, and runs `scripts/mcp-smoke.mjs` — the stdio handshake (`initialize` → `tools/list`) — against that install. This closes the whole class of failure behind Issue #128: a dependency range that resolves differently for consumers than for this repo's lockfile can no longer break the published server undetected.
@@ -18,6 +28,7 @@
18
28
  - **Personal wiki created at doubled path `~/.llm-wiki/.llm-wiki/…`**: `getPersonalWikiRoot()` returned the dot-dir itself (`~/.llm-wiki`) while `getVaultPaths()` then appended another `.llm-wiki/` segment, so the personal vault was written to `~/.llm-wiki/.llm-wiki/wiki/…`. Fixed by aligning `getPersonalWikiRoot()` with the same "root = parent of `.llm-wiki/`" contract used by project vaults. `WIKI_HOME` continues to override the parent.
19
29
 
20
30
  ### Added
31
+ - **`wiki_bootstrap` over MCP, so MCP-only clients can create a vault** (Issue #130): the README aims the standalone MCP server at Claude Code, Cursor and Windsurf — clients with no access to the Pi extension — yet all five MCP tools failed closed with `No wiki vault found. Set WIKI_ROOT or run wiki_bootstrap first.`, naming a tool those clients did not have. Short of installing pi or hand-building the `.llm-wiki/` tree, there was no path to a working vault. `bootstrapVault()` is pure Node (`node:fs`, `node:path`, sibling lib modules) with no model and no credentials in play, so it is now exposed as a sixth MCP tool through a thin `bootstrapOperation` adapter, keeping Pi and MCP over one implementation. Bootstrap resolves its target with `getVaultPaths(WIKI_ROOT)` rather than the usual `resolveVaultPaths()`: resolution deliberately walks up to a parent vault and then falls back to the personal vault, which is right for reading and writing pages but would create the vault somewhere other than where the client pointed the server. There is no `root` parameter, so the server stays confined to its configured root, and `mode` accepts the same free-form `personal`/`company` string the Pi tool takes. Re-running is safe: an existing vault has its config updated and metadata rebuilt, and pages are untouched. The two guards on the MCP surface (`test/mcp-parity.test.ts` and `test/mcp-package.test.ts`) were deliberately widened from five tools to six, `scripts/mcp-smoke.mjs` now requires the tool on the packed artifact, and every README's MCP table lists it.
21
32
  - **Visible wiki activity + background/reported mutations** (Issue #77): the wiki was effectively invisible — recall was appended only to the **system prompt**, the observe/retro reminder was sent with `display: false`, and the lone user-facing cue was a static status line. The wiki now surfaces what it does, and mutating work is pushed off the agent's critical path.
22
33
  - **Visible surfaces**: a one-time **session notice** (`buildSessionNotice`) announces the full loop — retrieval (recall → `wiki_search` → `read`, all synchronous because the LLM consumes their output) and capture (`wiki_observe` → `wiki_retro`, background + reported); the periodic reminder is now `display: true` and names **both** capture tools (`buildReminderText`); and the status line becomes **recall-aware** (`🧠 LLM Wiki — recalled N page(s) for this task`) when auto-recall matches.
23
34
  - **Background + reported principle**: only `wiki_search` / `read` / `wiki_recall` stay synchronous. Heavy mutations — `wiki_rebuild_meta`, `wiki_reindex_embeddings`, `wiki_lint` — now dispatch to the background runtime and **report a visible completion message** instead of blocking the turn; `wiki_ingest` gained a persistent completion report alongside its toast. New `Runtime.report()` / `Runtime.launchReported()` primitives and a `dispatchReported()` tool helper (with a synchronous fallback when no runtime is available, preserving prior behavior and unit tests).
package/README.de.md CHANGED
@@ -346,10 +346,11 @@ This preserves both the **original artifact** and a **normalized extracted view*
346
346
 
347
347
  Use the wiki from **any MCP-compatible tool** — Claude Code, Cursor, Windsurf, and others.
348
348
 
349
- The package ships a standalone MCP server exposing 5 wiki tools over stdio:
349
+ The package ships a standalone MCP server exposing 6 wiki tools over stdio:
350
350
 
351
351
  | Tool | Description |
352
352
  |------|-------------|
353
+ | `wiki_bootstrap` | Initialize a new wiki vault with config, templates, schema, and metadata |
353
354
  | `wiki_recall` | Search wiki for task-relevant pages |
354
355
  | `wiki_search` | Full registry search |
355
356
  | `wiki_status` | Wiki stats (page counts, type breakdown) |
package/README.es.md CHANGED
@@ -330,10 +330,11 @@ Esto preserva tanto el **artefacto original** como una **vista extraída normali
330
330
 
331
331
  Usa el wiki desde **cualquier herramienta compatible con MCP** — Claude Code, Cursor, Windsurf y otras.
332
332
 
333
- El paquete incluye un servidor MCP independiente que expone 5 herramientas de wiki por stdio:
333
+ El paquete incluye un servidor MCP independiente que expone 6 herramientas de wiki por stdio:
334
334
 
335
335
  | Herramienta | Descripción |
336
336
  |-------------|-------------|
337
+ | `wiki_bootstrap` | Inicializa un nuevo vault de wiki con configuración, plantillas, esquema y metadatos |
337
338
  | `wiki_recall` | Busca en el wiki páginas relevantes para la tarea |
338
339
  | `wiki_search` | Búsqueda completa del registro |
339
340
  | `wiki_status` | Estadísticas del wiki (conteos de páginas, desglose por tipo) |
package/README.fr.md CHANGED
@@ -346,10 +346,11 @@ This preserves both the **original artifact** and a **normalized extracted view*
346
346
 
347
347
  Use the wiki from **any MCP-compatible tool** — Claude Code, Cursor, Windsurf, and others.
348
348
 
349
- The package ships a standalone MCP server exposing 5 wiki tools over stdio:
349
+ The package ships a standalone MCP server exposing 6 wiki tools over stdio:
350
350
 
351
351
  | Tool | Description |
352
352
  |------|-------------|
353
+ | `wiki_bootstrap` | Initialize a new wiki vault with config, templates, schema, and metadata |
353
354
  | `wiki_recall` | Search wiki for task-relevant pages |
354
355
  | `wiki_search` | Full registry search |
355
356
  | `wiki_status` | Wiki stats (page counts, type breakdown) |
package/README.hi.md CHANGED
@@ -346,10 +346,11 @@ This preserves both the **original artifact** and a **normalized extracted view*
346
346
 
347
347
  Use the wiki from **any MCP-compatible tool** — Claude Code, Cursor, Windsurf, and others.
348
348
 
349
- The package ships a standalone MCP server exposing 5 wiki tools over stdio:
349
+ The package ships a standalone MCP server exposing 6 wiki tools over stdio:
350
350
 
351
351
  | Tool | Description |
352
352
  |------|-------------|
353
+ | `wiki_bootstrap` | Initialize a new wiki vault with config, templates, schema, and metadata |
353
354
  | `wiki_recall` | Search wiki for task-relevant pages |
354
355
  | `wiki_search` | Full registry search |
355
356
  | `wiki_status` | Wiki stats (page counts, type breakdown) |
package/README.ja.md CHANGED
@@ -346,10 +346,11 @@ This preserves both the **original artifact** and a **normalized extracted view*
346
346
 
347
347
  Use the wiki from **any MCP-compatible tool** — Claude Code, Cursor, Windsurf, and others.
348
348
 
349
- The package ships a standalone MCP server exposing 5 wiki tools over stdio:
349
+ The package ships a standalone MCP server exposing 6 wiki tools over stdio:
350
350
 
351
351
  | Tool | Description |
352
352
  |------|-------------|
353
+ | `wiki_bootstrap` | Initialize a new wiki vault with config, templates, schema, and metadata |
353
354
  | `wiki_recall` | Search wiki for task-relevant pages |
354
355
  | `wiki_search` | Full registry search |
355
356
  | `wiki_status` | Wiki stats (page counts, type breakdown) |
package/README.ko.md CHANGED
@@ -346,10 +346,11 @@ This preserves both the **original artifact** and a **normalized extracted view*
346
346
 
347
347
  Use the wiki from **any MCP-compatible tool** — Claude Code, Cursor, Windsurf, and others.
348
348
 
349
- The package ships a standalone MCP server exposing 5 wiki tools over stdio:
349
+ The package ships a standalone MCP server exposing 6 wiki tools over stdio:
350
350
 
351
351
  | Tool | Description |
352
352
  |------|-------------|
353
+ | `wiki_bootstrap` | Initialize a new wiki vault with config, templates, schema, and metadata |
353
354
  | `wiki_recall` | Search wiki for task-relevant pages |
354
355
  | `wiki_search` | Full registry search |
355
356
  | `wiki_status` | Wiki stats (page counts, type breakdown) |
package/README.md CHANGED
@@ -47,10 +47,21 @@ Start with a new OKF vault, or point pi-llm-wiki at an existing vault and adopt
47
47
 
48
48
  ## Quick Start
49
49
 
50
+ **pi** ([`@mariozechner/pi-coding-agent`](https://github.com/badlogic/pi-mono)):
51
+
50
52
  ```bash
51
53
  pi install npm:@zosmaai/pi-llm-wiki
52
54
  ```
53
55
 
56
+ **oh-my-pi** ([`omp`](https://github.com/can1357/oh-my-pi)):
57
+
58
+ ```bash
59
+ omp install @zosmaai/pi-llm-wiki
60
+ ```
61
+
62
+ Both hosts load the same extension, skill, and `/wiki-*` slash commands — see
63
+ [Dual-host support](#dual-host-support-pi--oh-my-pi) for what differs.
64
+
54
65
  The extension will proactively suggest creating a wiki on your first session. Alternatively:
55
66
 
56
67
  ```
@@ -342,10 +353,11 @@ This preserves both the **original artifact** and a **normalized extracted view*
342
353
 
343
354
  Use the wiki from **any MCP-compatible tool** — Claude Code, Cursor, Windsurf, and others.
344
355
 
345
- The package ships a standalone MCP server exposing 5 wiki tools over stdio:
356
+ The package ships a standalone MCP server exposing 6 wiki tools over stdio:
346
357
 
347
358
  | Tool | Description |
348
359
  |------|-------------|
360
+ | `wiki_bootstrap` | Initialize a new wiki vault with config, templates, schema, and metadata |
349
361
  | `wiki_recall` | Search wiki for task-relevant pages |
350
362
  | `wiki_search` | Full registry search |
351
363
  | `wiki_status` | Wiki stats (page counts, type breakdown) |
@@ -384,6 +396,66 @@ The same server as an entry in `.mcp.json` (Claude Code) or `claude_desktop_conf
384
396
 
385
397
  ---
386
398
 
399
+ ## Dual-host support (pi + oh-my-pi)
400
+
401
+ The package targets two hosts from a single codebase:
402
+
403
+ | | **pi** (`@mariozechner/pi-coding-agent`) | **oh-my-pi** (`omp`) |
404
+ |---|---|---|
405
+ | Extension entry | `package.json#pi.extensions` | `package.json#omp.extensions` (falls back to `#pi`) |
406
+ | Skill | `skills/llm-wiki/SKILL.md` via `pi.skills` | same file, found by directory convention |
407
+ | Slash commands | `prompts/*.md` via `pi.prompts` | `commands/*.md` (generated mirror of `prompts/`) |
408
+ | Project config | `<cwd>/.pi/settings.json` | `<cwd>/.omp/settings.json`, then `.omp/config.yml` |
409
+ | User config | `~/.pi/agent/settings.json` | `~/.omp/agent/settings.json`, then `config.yml` |
410
+ | MCP server | auto-registered via `pi.mcpservers` | register manually (see below) |
411
+ | Ambient surfaces without a project wiki | on (personal vault) | off — see below |
412
+
413
+ No source changes are needed for the imports: oh-my-pi rewrites
414
+ `@mariozechner/pi-*` and bare `typebox` specifiers onto its own bundled
415
+ packages when it loads a legacy extension.
416
+
417
+ **Settings are read from both layouts.** `llm-wiki` config is merged from every
418
+ file above, host-native directory last. A vault configured under pi keeps
419
+ working after `omp` takes over the same repository, and writes land in whichever
420
+ config directory already exists (so a `.pi`-only repo does not sprout a second
421
+ settings file). Writes are always JSON — a hand-authored `config.yml` is read
422
+ but never rewritten.
423
+
424
+ Set `LLM_WIKI_HOST=pi|omp` to override host detection; by default it is derived
425
+ from the resolved agent directory.
426
+
427
+ **Ambient surfaces are gated under oh-my-pi.** The session notice, the periodic
428
+ observe/retro reminder, and `before_agent_start` recall all fire unprompted, and
429
+ vault resolution falls back to the personal vault — so once `~/.llm-wiki/`
430
+ exists they would speak up in *every* directory. Under pi that is the historical
431
+ behaviour and it is kept; under omp the plugin is installed once and loads in
432
+ every project, so a repository that never ran `/wiki-init` stays quiet. Override
433
+ either default with `llm-wiki.ambientPersonalVault`. The wiki tools and slash
434
+ commands are registered regardless, so `/wiki-init` always works — and a project
435
+ with its own `.llm-wiki/` gets every surface back.
436
+
437
+ **MCP under oh-my-pi.** `pi.mcpservers` is a pi-only manifest key, and the
438
+ server's vault auto-detection depends on the client's working directory, so it
439
+ cannot be declared with a relative path. Register it explicitly instead:
440
+
441
+ ```jsonc
442
+ // <cwd>/.omp/.mcp.json
443
+ {
444
+ "mcpServers": {
445
+ "llm-wiki": {
446
+ "command": "node",
447
+ "args": ["/abs/path/to/node_modules/@zosmaai/pi-llm-wiki/dist/mcp/index.js"],
448
+ "env": { "WIKI_ROOT": "/abs/path/to/your/wiki" }
449
+ }
450
+ }
451
+ }
452
+ ```
453
+
454
+ You rarely need it: under either host the extension already registers the same
455
+ capabilities as native tools.
456
+
457
+ ---
458
+
387
459
  ## Skill Behavior
388
460
 
389
461
  The bundled `llm-wiki` skill teaches the model to:
@@ -480,6 +552,13 @@ Thanks to everyone who has contributed! This list is regenerated automatically b
480
552
  <sub><b>James Fraser</b></sub>
481
553
  </a>
482
554
  </td>
555
+ <td align="center">
556
+ <a href="https://github.com/mkuhl">
557
+ <img src="https://avatars.githubusercontent.com/u/61073?v=4" width="64;" alt="mkuhl"/>
558
+ <br />
559
+ <sub><b>Mike P. Kuhl</b></sub>
560
+ </a>
561
+ </td>
483
562
  <td align="center">
484
563
  <a href="https://github.com/CelestialCreator">
485
564
  <img src="https://avatars.githubusercontent.com/u/177931942?v=4" width="64;" alt="CelestialCreator"/>
@@ -487,6 +566,13 @@ Thanks to everyone who has contributed! This list is regenerated automatically b
487
566
  <sub><b>Akshay</b></sub>
488
567
  </a>
489
568
  </td>
569
+ <td align="center">
570
+ <a href="https://github.com/prestalab">
571
+ <img src="https://avatars.githubusercontent.com/u/2825421?v=4" width="64;" alt="prestalab"/>
572
+ <br />
573
+ <sub><b>PrestaLab</b></sub>
574
+ </a>
575
+ </td>
490
576
  <td align="center">
491
577
  <a href="https://github.com/xcsf">
492
578
  <img src="https://avatars.githubusercontent.com/u/43439835?v=4" width="64;" alt="xcsf"/>
@@ -501,13 +587,8 @@ Thanks to everyone who has contributed! This list is regenerated automatically b
501
587
  <sub><b>Daniel Naab</b></sub>
502
588
  </a>
503
589
  </td>
504
- <td align="center">
505
- <a href="https://github.com/mkuhl">
506
- <img src="https://avatars.githubusercontent.com/u/61073?v=4" width="64;" alt="mkuhl"/>
507
- <br />
508
- <sub><b>Mike P. Kuhl</b></sub>
509
- </a>
510
- </td>
590
+ </tr>
591
+ <tr>
511
592
  <td align="center">
512
593
  <a href="https://github.com/deestax">
513
594
  <img src="https://avatars.githubusercontent.com/u/152369481?v=4" width="64;" alt="deestax"/>
@@ -515,8 +596,6 @@ Thanks to everyone who has contributed! This list is regenerated automatically b
515
596
  <sub><b>Superdao</b></sub>
516
597
  </a>
517
598
  </td>
518
- </tr>
519
- <tr>
520
599
  <td align="center">
521
600
  <a href="https://github.com/mystery4f">
522
601
  <img src="https://avatars.githubusercontent.com/u/40482524?v=4" width="64;" alt="mystery4f"/>
package/README.pt.md CHANGED
@@ -346,10 +346,11 @@ This preserves both the **original artifact** and a **normalized extracted view*
346
346
 
347
347
  Use the wiki from **any MCP-compatible tool** — Claude Code, Cursor, Windsurf, and others.
348
348
 
349
- The package ships a standalone MCP server exposing 5 wiki tools over stdio:
349
+ The package ships a standalone MCP server exposing 6 wiki tools over stdio:
350
350
 
351
351
  | Tool | Description |
352
352
  |------|-------------|
353
+ | `wiki_bootstrap` | Initialize a new wiki vault with config, templates, schema, and metadata |
353
354
  | `wiki_recall` | Search wiki for task-relevant pages |
354
355
  | `wiki_search` | Full registry search |
355
356
  | `wiki_status` | Wiki stats (page counts, type breakdown) |
package/README.ru.md CHANGED
@@ -346,10 +346,11 @@ This preserves both the **original artifact** and a **normalized extracted view*
346
346
 
347
347
  Use the wiki from **any MCP-compatible tool** — Claude Code, Cursor, Windsurf, and others.
348
348
 
349
- The package ships a standalone MCP server exposing 5 wiki tools over stdio:
349
+ The package ships a standalone MCP server exposing 6 wiki tools over stdio:
350
350
 
351
351
  | Tool | Description |
352
352
  |------|-------------|
353
+ | `wiki_bootstrap` | Initialize a new wiki vault with config, templates, schema, and metadata |
353
354
  | `wiki_recall` | Search wiki for task-relevant pages |
354
355
  | `wiki_search` | Full registry search |
355
356
  | `wiki_status` | Wiki stats (page counts, type breakdown) |
package/README.zh.md CHANGED
@@ -330,10 +330,11 @@ my-wiki/
330
330
 
331
331
  从 **任何 MCP 兼容工具** 使用 wiki——Claude Code、Cursor、Windsurf 等。
332
332
 
333
- 包附带独立 MCP 服务器,通过 stdio 暴露 5 个 wiki 工具:
333
+ 包附带独立 MCP 服务器,通过 stdio 暴露 6 个 wiki 工具:
334
334
 
335
335
  | 工具 | 描述 |
336
336
  |------|------|
337
+ | `wiki_bootstrap` | 用配置、模板、模式和元数据初始化新的 wiki vault |
337
338
  | `wiki_recall` | 搜索 wiki 中与任务相关的页面 |
338
339
  | `wiki_search` | 完整注册表搜索 |
339
340
  | `wiki_status` | Wiki 统计(页面计数、类型分解) |
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Generate a daily or weekly digest of wiki changes — new sources, pages, insights, and gaps.
3
+ argument-hint: "[--period daily|weekly]"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-digest
9
+
10
+ Generate a digest of recent wiki activity.
11
+
12
+ ## User Arguments
13
+
14
+ $ARGUMENTS
15
+
16
+ ## Steps
17
+
18
+ 1. Call `wiki_status()` to get current stats (page count, orphans, gaps, health).
19
+ 2. Read `.llm-wiki/meta/log.md` for recent events since the last digest period.
20
+ 3. Summarize:
21
+ - New sources captured
22
+ - New pages created or updated
23
+ - Key insights or connections made
24
+ - Knowledge gaps identified
25
+ - Health trends (improving, stable, declining)
26
+ 4. Save the digest to `.llm-wiki/outputs/digest-YYYY-MM-DD.md` using the `write` tool.
27
+ 5. Call `wiki_log_event(kind=digest)` to record this digest was generated.
28
+ 6. Report a concise digest to the user.
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Auto-discover new sources from the web. Searches based on config topics and known knowledge gaps.
3
+ argument-hint: "[--topic <topic>]"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-discover
9
+
10
+ Find new source material for the wiki by searching the web and capturing them as source packets.
11
+
12
+ ## User Arguments
13
+
14
+ $ARGUMENTS
15
+
16
+ ## Steps
17
+
18
+ 1. Call `wiki_status()` to get the current topic and mode from the wiki config.
19
+ 2. Use `wiki_search(query=<topic>)` to find existing pages and identify what's already covered.
20
+ 3. Search the web for new sources:
21
+ - If `--topic` is specified in `$ARGUMENTS`, focus on that topic
22
+ - Otherwise, search for the wiki's main topic + "latest", "news", "update"
23
+ 4. For each promising result (max 5-10):
24
+ a. Call `wiki_capture_source(url=<url>)` to capture it as an immutable source packet
25
+ b. Skip ads, listicles, and duplicates — prefer in-depth analysis
26
+ 5. Report: "Discovered [N] new sources captured as packets. Run `/wiki-ingest` to synthesize them into knowledge pages."
27
+
28
+ **Rules:**
29
+ - Do NOT manually save files to `raw/` — always use `wiki_capture_source`.
30
+ - The extension handles manifest, extraction, and skeleton page creation automatically.
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Process new source packets and synthesize them into wiki knowledge pages.
3
+ argument-hint: "[source_id]"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-ingest
9
+
10
+ Process uningested source packets and synthesize them into wiki knowledge pages.
11
+
12
+ ## User Arguments
13
+
14
+ $ARGUMENTS
15
+
16
+ ## Steps
17
+
18
+ 1. Call `wiki_ingest(source_id=<id if provided>, batch_size=3)`.
19
+ 2. If the tool reports "All sources ingested", inform the user and stop.
20
+ 3. **If the tool reports it is ingesting in the background**, the synthesis sub-agent is handling those sources on the configured task model. Do NOT synthesize them yourself — just report which sources were dispatched and stop. (You'll be notified as each completes.)
21
+ 4. **Otherwise** (the tool returned extracted content — background unavailable or `background=false`), for each source in the returned batch:
22
+ a. Read the extracted text from `.llm-wiki/raw/sources/<SOURCE_ID>/extracted.md`
23
+ b. Update the skeleton source page in `wiki/sources/` with a proper summary, key entities, and concepts
24
+ c. Use `wiki_ensure_page(type=entity, title=<name>)` for each new entity (people, orgs, tools, products)
25
+ d. Use `wiki_ensure_page(type=concept, title=<name>)` for each new concept (ideas, patterns, frameworks)
26
+ e. Add `[[wikilinks]]` cross-references between related pages
27
+ f. Flag any contradictions with existing wiki content using `⚠️ **Contradiction**` markers
28
+ 5. After processing a synchronous batch, call `wiki_rebuild_meta` to update metadata.
29
+ 6. Report: "Ingested [N] sources → [M] pages created/updated. [X] contradictions flagged."
30
+
31
+ > **Background vs synchronous:** ingestion runs in the background by default (non-blocking) when a task model is available, so the main agent is never stalled. It falls back to the synchronous main-agent flow above when no model/API key is configured, or when called with `background=false`.
32
+
33
+ **Rules:**
34
+ - Never modify files in `raw/` — source packets are immutable after capture.
35
+ - Never fabricate information — always cite sources with `[[sources/SRC-...]]`.
36
+ - The extension auto-updates metadata — you do NOT need to manually edit `meta/` files.
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Initialize a new LLM Wiki in the current directory. Creates the full directory structure, config, and template files.
3
+ argument-hint: "<topic> [--mode personal|company]"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-init
9
+
10
+ Initialize a new LLM Wiki vault using the `wiki_bootstrap` tool.
11
+
12
+ ## User Arguments
13
+
14
+ $ARGUMENTS
15
+
16
+ ## Steps
17
+
18
+ 1. If the user provided a topic in `$ARGUMENTS`, use it. Otherwise, ask the user for the wiki **topic**.
19
+ 2. Determine mode: default to `personal`; use `company` if the user specifies `--mode company` or requests it.
20
+ 3. Call `wiki_bootstrap(topic=<topic>, mode=<mode>)` to create the vault.
21
+ 4. Report the result and suggest next steps:
22
+ - "Use `wiki_capture_source` to add your first source (URL, file, or text)."
23
+ - "Run `/wiki-ingest` after capturing sources to synthesize them into knowledge pages."
24
+
25
+ **Do NOT manually create directories or files.** The `wiki_bootstrap` tool handles all scaffolding including:
26
+ - `.llm-wiki/raw/sources/` — immutable source packets
27
+ - `.llm-wiki/wiki/` — editable knowledge pages
28
+ - `.llm-wiki/meta/` — auto-generated metadata
29
+ - `.llm-wiki/config.json` — vault configuration
30
+ - `.llm-wiki/WIKI_SCHEMA.md` — operating rules
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Health check the wiki. Detects contradictions, orphans, missing pages, stale claims, and knowledge gaps.
3
+ argument-hint: "[--fix]"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-lint
9
+
10
+ Run a comprehensive health check on the wiki.
11
+
12
+ ## User Arguments
13
+
14
+ $ARGUMENTS
15
+
16
+ ## Steps
17
+
18
+ 1. Determine if auto-fix is requested: set `auto_fix=true` if `$ARGUMENTS` contains `--fix`, otherwise `false`.
19
+ 2. Call `wiki_lint(auto_fix=<true/false>)` to run the health check.
20
+ 3. Present the lint report to the user, including:
21
+ - Page count, orphans, missing pages, contradictions
22
+ - Knowledge gaps found
23
+ - Any auto-fixes applied
24
+ 4. If contradictions are found, flag them for human review — do NOT auto-resolve contradictions.
25
+ 5. If knowledge gaps are identified, suggest creating pages for frequently-mentioned topics.
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Ask questions against the wiki. Synthesizes answers from wiki pages with cross-reference citations.
3
+ argument-hint: "<question>"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-query
9
+
10
+ Ask a question and get an answer synthesized from wiki content.
11
+
12
+ ## User Question
13
+
14
+ $ARGUMENTS
15
+
16
+ ## Steps
17
+
18
+ 1. Call `wiki_recall(query=<question>)` to find relevant wiki pages.
19
+ 2. Read the full content of each matching page using the `read` tool.
20
+ 3. Synthesize an answer with `[[wikilink]]` citations to specific wiki pages.
21
+ 4. If the answer reveals a new connection or analysis worth preserving:
22
+ - Call `wiki_ensure_page(type=synthesis, title=<title>, content=<content>)` to save it
23
+ 5. Call `wiki_log_event(kind=query, details={question: <question>})` to log the query.
24
+
25
+ **Rules:**
26
+ - Answer ONLY from wiki content, not from general knowledge.
27
+ - If the wiki lacks information, say so clearly and suggest what sources would help fill the gap.
28
+
29
+ **Example:**
30
+
31
+ ```
32
+ /wiki-query What are the key differences between RAG and LLM Wiki?
33
+ → Calls wiki_recall(query="RAG LLM Wiki differences")
34
+ → Reads matching pages
35
+ → Synthesizes a comparison with [[wikilink]] citations
36
+ → Saves as synthesis page via wiki_ensure_page(type=synthesis, ...)
37
+ ```
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Capture the just-completed task's tool-call trajectory into the wiki as agent working-memory, then optionally distill it into a reusable skill.
3
+ argument-hint: "<title> [--outcome success|failure|partial]"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-record
9
+
10
+ Capture the trajectory of the task you just completed — the sequence of tool calls that solved it — into the wiki's working-memory layer.
11
+
12
+ This is the counterpart to source capture: instead of recording what you *read*, it records what you *did*, so the wiki compounds over your own work.
13
+
14
+ ## User Arguments
15
+
16
+ $ARGUMENTS
17
+
18
+ Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` first to understand the wiki conventions.
19
+
20
+ ## Steps
21
+
22
+ 1. Call `wiki_capture_trajectory` with:
23
+ - `title`: short descriptive phrase for the task (≤60 chars, noun phrase)
24
+ - `outcome`: optional — `success` (default), `failure`, or `partial`
25
+ - The extension auto-extracts the tool-call trajectory from the live session, so you usually do **not** pass `steps` manually.
26
+ 2. Open the generated skeleton case page in `wiki/cases/` and flesh out:
27
+ - **Task** — what was requested
28
+ - **Approach** — the key steps and decisions (not every tool call, just the meaningful ones)
29
+ - **Outcome** — the result, and anything worth reusing or avoiding next time
30
+ 3. If the task taught a reusable pattern, run `wiki_distill_skills` and create a `skill` page via `wiki_ensure_page(type="skill")` that cites `[[trajectories/TRJ-...]]`.
31
+ 4. Confirm the case (and any skill) will be surfaced by `wiki_recall` / `wiki_recall_skill` in future sessions.
32
+
33
+ **Rules:**
34
+ - Only record tasks worth learning from — non-trivial debugging, refactors, integrations, multi-step workflows. Skip trivial one-shot answers.
35
+ - The raw trajectory packet under `raw/trajectories/` is immutable. Edit the `case`/`skill` pages, never the packet.
36
+ - One trajectory per `wiki_capture_trajectory` call.
@@ -0,0 +1,55 @@
1
+ ---
2
+ description: Capture and decompose a concept into atomic, traceable wiki requirements. Clarifies ambiguous requirements, splits them into atomic pieces, and persists them as wiki/requirements/ pages with status tracking.
3
+ argument-hint: "<concept description>"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-req
9
+
10
+ Capture a concept and decompose it into atomic, traceable requirements in the wiki.
11
+
12
+ Transforms natural language descriptions into structured `wiki/requirements/` pages, preserving the original clarified concept as an immutable source packet in `raw/sources/`.
13
+
14
+ ## User Arguments
15
+
16
+ $ARGUMENTS
17
+
18
+ Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` first to understand the wiki conventions, architecture, and page type rules.
19
+
20
+ ## Steps
21
+
22
+ 1. **Clarify the concept**
23
+ - Discuss with the user: unpack ambiguous terms, surfaces implicit assumptions, identify scope boundaries
24
+ - Ask targeted questions to resolve unknowns (e.g., "Which providers?", "What's the fallback behavior?", "Who are the actors?")
25
+ - Reach mutual clarity before proceeding
26
+
27
+ 2. **Capture the clarified concept**
28
+ - Call `wiki_capture_source(text=...)` with the clarified conversation as markdown
29
+ - This creates an immutable record in `raw/sources/SRC-YYYY-MM-DD-NNN/`
30
+ - The source captures the original intent verbatim — no interpretation, no decomposition
31
+
32
+ 3. **Decompose into atomic requirements**
33
+ - Break the clarified concept into the smallest meaningful units of functionality
34
+ - Each requirement should represent one independently verifiable behavior
35
+ - For each atomic requirement, call `wiki_ensure_page(type="requirement", title="...", content="...")` where content includes:
36
+ - `type: requirement` and `status: draft` in frontmatter
37
+ - A clear `## Description` section
38
+ - `## Acceptance Criteria` as a checkbox list (the threshold for "done")
39
+ - `source_id` linking back to the source capture
40
+ - `depends_on` linking to any prerequisite requirements
41
+ - `[[wikilinks]]` to relevant entities, concepts, and other wiki pages
42
+ - Set priority based on user input: `p0` (blocking), `p1` (critical), `p2` (important), `p3` (nice-to-have)
43
+
44
+ 4. **Cross-link and finalize**
45
+ - Ensure each requirement page has bidirectional wikilinks to related pages
46
+ - Update any existing entity or concept pages that these requirements reference
47
+ - Report the results: how many requirements created, their priorities, and the source capture ID
48
+
49
+ **Rules:**
50
+ - One atomic requirement per `wiki_ensure_page` call — each must be independently testable
51
+ - Always capture the clarified concept first via `wiki_capture_source` before decomposing
52
+ - Requirements live in `wiki/requirements/` — they are editable wiki pages, not immutable sources
53
+ - Use status values: `draft` → `clarified` → `active` → `implemented` → `deferred` → `rejected`
54
+ - Use priority values: `p0` (blocking), `p1` (critical), `p2` (important), `p3` (nice-to-have)
55
+ - Do not create requirements in `raw/` — that layer is for external source artifacts only
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: Save an atomic insight from the current task into the wiki. Creates a single markdown file that layered recall surfaces in future sessions.
3
+ argument-hint: "<title> [--category <category>]"
4
+ section: LLM Wiki
5
+ topLevelCli: true
6
+ ---
7
+
8
+ # /wiki-retro
9
+
10
+ Save an atomic insight from a completed task into the wiki.
11
+
12
+ Captures what you learned as a single markdown file so that layered recall surfaces it in future sessions.
13
+
14
+ ## User Arguments
15
+
16
+ $ARGUMENTS
17
+
18
+ Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` first to understand the wiki conventions.
19
+
20
+ ## Steps
21
+
22
+ 1. Identify the key insight(s) from the current task — non-obvious learnings, patterns, or decisions worth preserving
23
+ 2. For each insight, call `wiki_retro` with:
24
+ - `slug`: unique kebab-case identifier (e.g., `jwt-revocation-pattern`)
25
+ - `title`: short descriptive phrase, ≤60 chars, noun phrase not a sentence
26
+ - `body`: markdown explanation with `[[wikilinks]]` to related wiki pages
27
+ - `category`: optional (frontend, architecture, devops, bugfix, design, etc.)
28
+ 3. Confirm the insight was saved and will be surfaced by layered recall in future sessions
29
+ 4. If the insight relates to existing wiki pages, update those pages with cross-references
30
+
31
+ **Rules:**
32
+ - One atomic insight per `wiki_retro` call. Use multiple calls for multiple insights.
33
+ - Don't save obvious things. Save non-obvious patterns, tradeoffs, and design decisions.
34
+ - Always add `[[wikilinks]]` to connect the new insight with existing wiki knowledge.