@zosmaai/pi-llm-wiki 0.1.2 โ†’ 0.2.0

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 CHANGED
@@ -1,372 +1,72 @@
1
- # ๐Ÿง  @zosmaai/pi-llm-wiki
1
+ # @zosmaai/pi-llm-wiki
2
2
 
3
- > **Self-maintaining, Obsidian-compatible knowledge base for your pi coding agent.**
4
- > Following Andrej Karpathy's LLM Wiki pattern โ€” drop in sources, let the LLM build and maintain the wiki.
3
+ [![CI](https://github.com/zosmaai/pi-llm-wiki/actions/workflows/ci.yml/badge.svg)](https://github.com/zosmaai/pi-llm-wiki/actions/workflows/ci.yml)
4
+ [![npm](https://img.shields.io/npm/v/@zosmaai/pi-llm-wiki)](https://www.npmjs.com/package/@zosmaai/pi-llm-wiki)
5
+ [![Coverage](https://codecov.io/gh/zosmaai/pi-llm-wiki/branch/main/graph/badge.svg)](https://codecov.io/gh/zosmaai/pi-llm-wiki)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
+ [![CodeQL](https://github.com/zosmaai/pi-llm-wiki/actions/workflows/codeql.yml/badge.svg)](https://github.com/zosmaai/pi-llm-wiki/actions/workflows/codeql.yml)
5
8
 
6
- [![Pi Package](https://img.shields.io/badge/pi-package-8B5CF6?style=flat&logo=pinboard)](https://pi.dev/packages)
7
- [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
8
- [![Follow Karpathy Pattern](https://img.shields.io/badge/pattern-Karpathy%20LLM%20Wiki-blue)](https://gist.github.com/karpathy/442a6bf555914893e9891c19de94f)
9
- [![Obsidian Ready](https://img.shields.io/badge/Obsidian-ready-7C3AED?logo=obsidian)](https://obsidian.md)
9
+ Self-maintaining, Obsidian-compatible knowledge base for [pi](https://pi.dev). Following Andrej Karpathy's LLM Wiki pattern.
10
10
 
11
- ---
12
-
13
- ## โœจ Features
14
-
15
- | Capability | Description |
16
- | ----------------- | ------------------------------------------------------------------------------------------------------------------ |
17
- | **๐Ÿ“ฅ Ingest** | Drop any source into `raw/` โ€” the LLM reads, summarizes, extracts entities & concepts, cross-references everything |
18
- | **๐Ÿ” Query** | Ask questions against a persistent, interlinked knowledge base โ€” not raw chunks |
19
- | **๐Ÿงน Lint** | Health-check the wiki: contradictions, orphans, missing pages, stale claims, knowledge gaps |
20
- | **๐ŸŒ Discover** | Auto-find new sources from the web based on your topics and known gaps |
21
- | **๐Ÿ”„ Full Cycle** | `run` = discover โ†’ ingest โ†’ lint. One command to refresh everything |
22
- | **โฐ Watch** | Schedule automatic updates (daily/weekly/hourly) via pi's cron system |
23
- | **๐Ÿ“Š Status** | Quick dashboard showing wiki size, health, and last activity |
24
- | **๐Ÿ““ Digest** | Daily/weekly summaries of what changed in the wiki |
25
-
26
- ### Two Modes
27
-
28
- - **๐Ÿ‘ค Personal Wiki** โ€” Learning, journaling, book notes, health, goals, reflections
29
- - **๐Ÿข Company Wiki** โ€” Competitor tracking, market research, customer calls, internal docs, change detection
30
-
31
- ### Obsidian Integration
32
-
33
- Every `[[wikilink]]` the LLM creates becomes a visible connection in Obsidian's graph view. Includes Dataview dashboard, frontmatter for structured queries, and Marp-ready slide decks.
34
-
35
- > "The wiki stays maintained because the cost of maintenance is near zero." โ€” Andrej Karpathy
36
-
37
- ---
38
-
39
- ## ๐Ÿ“ฆ What's Included
40
-
41
- ```
42
- @zosmaai/pi-llm-wiki/
43
- โ”œโ”€โ”€ ๐Ÿ“œ skills/llm-wiki/SKILL.md โ† Core schema: architecture, workflows, conventions
44
- โ”‚ โ”œโ”€โ”€ templates/INDEX.md โ† Master catalog template
45
- โ”‚ โ”œโ”€โ”€ templates/LOG.md โ† Activity log template
46
- โ”‚ โ”œโ”€โ”€ templates/DASHBOARD.md โ† Obsidian Dataview dashboard
47
- โ”‚ โ”œโ”€โ”€ templates/config.yaml โ† Default configuration
48
- โ”‚ โ””โ”€โ”€ templates/pages/ โ† Page templates (entity, concept, source, synthesis)
49
- โ”œโ”€โ”€ ๐Ÿ”ง extensions/llm-wiki-tools.ts โ† 5 custom tools for the LLM:
50
- โ”‚ โ”œโ”€โ”€ wiki_ingest Process new sources and update wiki pages
51
- โ”‚ โ”œโ”€โ”€ wiki_status_report Report wiki health and statistics
52
- โ”‚ โ”œโ”€โ”€ wiki_lint_report Scan for contradictions, orphans, gaps
53
- โ”‚ โ”œโ”€โ”€ wiki_discover_sources Find new source material from the web
54
- โ”‚ โ””โ”€โ”€ wiki_watch Schedule auto-updates
55
- โ””โ”€โ”€ ๐Ÿ’ฌ prompts/ โ† 8 slash commands:
56
- โ”œโ”€โ”€ /wiki:init Initialize a new wiki
57
- โ”œโ”€โ”€ /wiki:ingest Process new sources
58
- โ”œโ”€โ”€ /wiki:query Ask questions against the wiki
59
- โ”œโ”€โ”€ /wiki:lint Health check
60
- โ”œโ”€โ”€ /wiki:discover Auto-discover sources
61
- โ”œโ”€โ”€ /wiki:run Full cycle (discover โ†’ ingest โ†’ lint)
62
- โ”œโ”€โ”€ /wiki:status Wiki health overview
63
- โ””โ”€โ”€ /wiki:digest Daily/weekly summary
64
- ```
65
-
66
- ---
67
-
68
- ## ๐Ÿš€ Installation
69
-
70
- ### Prerequisites
71
-
72
- - [pi coding agent](https://pi.dev) installed
73
- - Node.js 20+
74
-
75
- ### Via npm (recommended)
76
-
77
- ```bash
78
- pi install npm:@zosmaai/pi-llm-wiki@latest
79
- ```
80
-
81
- ### Via git
82
-
83
- ```bash
84
- pi install git:github.com/zosmaai/pi-llm-wiki@v0.1.0
85
- ```
86
-
87
- ### Via local path (development)
88
-
89
- ```bash
90
- git clone https://github.com/zosmaai/pi-llm-wiki.git
91
- pi install ./pi-llm-wiki
92
- ```
93
-
94
- ### Verify Installation
95
-
96
- ```bash
97
- pi list
98
- # Should show: @zosmaai/pi-llm-wiki
99
-
100
- # Check loaded resources:
101
- pi --list-skills | grep llm-wiki
102
- pi --list-tools | grep wiki
103
- # Should show: wiki_ingest, wiki_status_report, wiki_lint_report, wiki_discover_sources, wiki_watch
104
- ```
105
-
106
- ---
107
-
108
- ## ๐ŸŽฏ Quick Start
109
-
110
- ### 1๏ธโƒฃ Initialize a new wiki
11
+ ## Install
111
12
 
112
13
  ```bash
113
- pi
14
+ pi install npm:@zosmaai/pi-llm-wiki
114
15
  ```
115
16
 
116
- Then inside pi:
17
+ ## Quick Start
117
18
 
118
19
  ```
119
- /wiki:init "AI Engineering"
20
+ /wiki-init "AI Engineering"
120
21
  ```
121
22
 
122
- This creates your wiki directory structure and template files.
123
-
124
- ### 2๏ธโƒฃ Add your first sources
125
-
126
- Drop content into `raw/`:
127
-
128
- - Use [Obsidian Web Clipper](https://obsidian.md/clipper) to save articles
129
- - Save meeting notes, transcripts, or research papers
130
- - Export Slack threads or email threads
131
-
132
- ### 3๏ธโƒฃ Ingest
23
+ Drop sources into `raw/`, then:
133
24
 
134
25
  ```
135
- /wiki:ingest
26
+ /wiki-ingest
27
+ /wiki-query What are the key patterns?
136
28
  ```
137
29
 
138
- The LLM reads every new source, creates wiki pages, cross-references everything, and builds the index. A single source typically generates 5-15 wiki pages (summary + entities + concepts + cross-refs).
30
+ ## What It Does
139
31
 
140
- ### 4๏ธโƒฃ Query
32
+ | Tool | Purpose |
33
+ | --------------------- | --------------------------------------------- |
34
+ | `wiki_bootstrap` | Initialize a new wiki vault |
35
+ | `wiki_capture_source` | Capture URL/file/text into immutable packet |
36
+ | `wiki_ingest` | Process sources into wiki pages |
37
+ | `wiki_ensure_page` | Create entity/concept/synthesis/analysis page |
38
+ | `wiki_search` | Search the wiki registry |
39
+ | `wiki_lint` | Health check (orphans, gaps, contradictions) |
40
+ | `wiki_status` | Stats dashboard |
41
+ | `wiki_rebuild_meta` | Force metadata rebuild |
42
+ | `wiki_log_event` | Record custom event |
43
+ | `wiki_watch` | Schedule auto-updates |
141
44
 
142
- ```
143
- /wiki:query What are the key patterns in modern AI engineering?
144
- ```
145
-
146
- The LLM answers from your wiki, not from general knowledge โ€” giving you answers grounded in your curated sources.
45
+ ## Architecture
147
46
 
148
- ### 5๏ธโƒฃ Keep it fresh
149
-
150
- ```bash
151
- # Auto-update daily at 8 AM
152
- /wiki:run --schedule daily
47
+ Four layers with clear ownership:
153
48
 
154
- # Or run manually anytime
155
- /wiki:run
156
49
  ```
157
-
158
- ---
159
-
160
- ## ๐Ÿ—๏ธ Architecture
161
-
162
- <p align="center">
163
- <img src="https://raw.githubusercontent.com/zosmaai/pi-llm-wiki/master/assets/screenshot.png" alt="LLM Wiki Architecture" width="90%">
164
- </p>
165
-
166
- <p align="center">
167
- <em>Three-layer architecture: raw sources โ†’ LLM-managed wiki โ†’ Obsidian frontend</em>
168
- </p>
169
-
170
- The LLM Wiki follows a three-layer architecture:
171
-
50
+ raw/sources/SRC-*/ # Immutable source packets (extension-owned)
51
+ wiki/ # Editable knowledge pages (you + LLM)
52
+ meta/ # Auto-generated registry, backlinks, index, log
53
+ .wiki/ # Config and templates
172
54
  ```
173
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
174
- โ”‚ YOU (curate & ask) โ”‚
175
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
176
- โ”‚ wiki/ โ”‚ outputs/ โ”‚ Obsidian vault โ”‚
177
- โ”‚ (read only) โ”‚ (reports, digests) โ”‚ (graph view, UI) โ”‚
178
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
179
- โ”‚ LLM (writes & maintains) โ”‚
180
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
181
- โ”‚ raw/ โ”‚ schema/SKILL.md โ”‚
182
- โ”‚ (immutable sources) โ”‚ (rules & conventions) โ”‚
183
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
184
- ```
185
-
186
- ### Directory Structure
187
55
 
188
- ```
189
- my-wiki/
190
- โ”œโ”€โ”€ raw/ โ† You add sources here (immutable)
191
- โ”‚ โ”œโ”€โ”€ articles/ Web articles (markdown)
192
- โ”‚ โ”œโ”€โ”€ papers/ Research papers
193
- โ”‚ โ”œโ”€โ”€ notes/ Personal notes
194
- โ”‚ โ”œโ”€โ”€ slack/ Slack thread exports
195
- โ”‚ โ””โ”€โ”€ assets/ Downloaded images
196
- โ”œโ”€โ”€ wiki/ โ† LLM manages this entirely
197
- โ”‚ โ”œโ”€โ”€ INDEX.md Master catalog
198
- โ”‚ โ”œโ”€โ”€ LOG.md Activity log
199
- โ”‚ โ”œโ”€โ”€ DASHBOARD.md Obsidian Dataview dashboard
200
- โ”‚ โ”œโ”€โ”€ entities/ People, orgs, tools, products
201
- โ”‚ โ”œโ”€โ”€ concepts/ Ideas, patterns, frameworks
202
- โ”‚ โ”œโ”€โ”€ sources/ One summary per source
203
- โ”‚ โ”œโ”€โ”€ syntheses/ Cross-cutting analyses
204
- โ”‚ โ””โ”€โ”€ changes/ Change detection records
205
- โ”œโ”€โ”€ outputs/ Reports and digests
206
- โ”œโ”€โ”€ config.yaml Wiki configuration
207
- โ””โ”€โ”€ .discoveries/ Auto-discovery metadata
208
- ```
209
-
210
- ---
211
-
212
- ## ๐Ÿ’ฌ All Commands
213
-
214
- | Command | Description | Example |
215
- | ---------------- | ------------------- | ----------------------------------------- |
216
- | `/wiki:init` | Create a new wiki | `/wiki:init "Rust Programming"` |
217
- | `/wiki:ingest` | Process new sources | `/wiki:ingest raw/articles/my-article.md` |
218
- | `/wiki:query` | Ask a question | `/wiki:query "Compare RAG vs LLM Wiki"` |
219
- | `/wiki:lint` | Health check | `/wiki:lint --fix` |
220
- | `/wiki:discover` | Find new sources | `/wiki:discover --topic "AI agents"` |
221
- | `/wiki:run` | Full cycle | `/wiki:run --schedule daily` |
222
- | `/wiki:status` | Show health | `/wiki:status` |
223
- | `/wiki:digest` | Daily summary | `/wiki:digest --period weekly` |
224
-
225
- ---
226
-
227
- ## ๐Ÿ”ง Custom Tools (Extension)
228
-
229
- The included TypeScript extension registers 5 tools the LLM can call directly:
230
-
231
- | Tool | Purpose |
232
- | ----------------------- | ----------------------------------------------- |
233
- | `wiki_ingest` | Prepare and track files for ingestion |
234
- | `wiki_status_report` | Gather wiki statistics and health metrics |
235
- | `wiki_lint_report` | Scan for issues (orphans, contradictions, gaps) |
236
- | `wiki_discover_sources` | Prepare discovery parameters from config |
237
- | `wiki_watch` | Generate schedule commands |
238
-
239
- These tools handle the scaffolding and bookkeeping so the LLM can focus on the actual knowledge work โ€” reading, synthesizing, and writing wiki pages.
240
-
241
- ---
242
-
243
- ## ๐Ÿ““ Using with Obsidian
244
-
245
- <p align="center">
246
- <img src="https://raw.githubusercontent.com/zosmaai/pi-llm-wiki/master/assets/knowledge-graph.png" alt="Knowledge Graph" width="90%">
247
- </p>
248
-
249
- <p align="center">
250
- <em>The LLM automatically connects entities, concepts, and sources with [[wikilinks]] โ€” viewable in Obsidian's graph view</em>
251
- </p>
252
-
253
- 1. Open the `wiki/` directory as an Obsidian vault
254
- 2. Install these plugins:
255
- - [Dataview](https://github.com/blacksmithgu/obsidian-dataview) โ€” Query pages by frontmatter
256
- - [Graph View](https://obsidian.md) (built-in) โ€” Visualize [[wikilink]] connections
257
- - [Spaced Repetition](https://github.com/st3v3nmw/obsidian-spaced-repetition) โ€” Flashcards
258
- - [Charts View](https://github.com/caronchen/obsidian-chartsview-plugin) โ€” Dashboard analytics
259
- - [Marp](https://marp.app/) โ€” Markdown slide decks
260
- 3. Browse the graph view to discover connections the LLM found
261
- 4. Use the `DASHBOARD.md` for live analytics
262
-
263
- ### Obsidian Web Clipper
264
-
265
- Use the [Obsidian Web Clipper](https://obsidian.md/clipper) browser extension to save articles directly into `raw/articles/`. Set attachment folder to `raw/assets/` in Obsidian settings.
266
-
267
- ---
268
-
269
- ## ๐Ÿข Personal vs. Company Wiki
270
-
271
- ### Personal Wiki (`config.yaml: mode: personal`)
272
-
273
- Best for: Learning, research, journaling, book notes, health tracking, goals.
274
-
275
- - Extra folders: `wiki/journal/`, `wiki/goals/`
276
- - Daily journal entries can be ingested as raw sources
277
- - Track people you meet, books you read, courses you take
278
-
279
- ### Company Wiki (`config.yaml: mode: company`)
280
-
281
- Best for: Competitive intelligence, market research, customer insights, internal documentation.
282
-
283
- - Extra folders: `wiki/decisions/`, `wiki/changes/`
284
- - **Change detection** โ€” Re-check competitor sources for pricing, feature, and positioning changes
285
- - Confidence levels in frontmatter: `high | medium | low`
286
- - Slack/email thread exports as sources
287
- - Generate battlecards with `/wiki:query "Create a battlecard for Competitor X"`
288
-
289
- ---
290
-
291
- ## โฐ Scheduling (Auto-Update)
292
-
293
- Keep your wiki current without thinking about it:
294
-
295
- ```bash
296
- # Inside pi
297
- /wiki:run --schedule daily # Discover โ†’ ingest โ†’ lint every day at 8 AM
298
- /wiki:run --schedule weekly # Every Monday at 9 AM
299
- /wiki:run --schedule hourly # Every hour (for fast-moving topics)
300
- ```
301
-
302
- The scheduler uses pi's built-in `schedule_prompt` system. All operations run in the background and the wiki stays updated.
303
-
304
- ---
305
-
306
- ## ๐Ÿ“š Examples
307
-
308
- ### Research Wiki
309
-
310
- ```bash
311
- /wiki:init "LLM Agents"
312
- # Drop 5 papers into raw/papers/
313
- /wiki:ingest
314
- # Creates ~30-50 wiki pages (entities, concepts, cross-refs)
315
- /wiki:query "What are the main approaches to tool use in LLM agents?"
316
- /wiki:lint
317
- ```
318
-
319
- ### Book Companion
320
-
321
- ```bash
322
- /wiki:init "Dune" --mode personal
323
- # Drop chapter notes into raw/notes/
324
- /wiki:ingest raw/notes/ch01-opening-test.md
325
- /wiki:query "Who are the main factions and what do they want?"
326
- /wiki:query "Create a timeline of events up to Chapter 5"
327
- ```
328
-
329
- ### Competitive Intelligence
330
-
331
- ```bash
332
- /wiki:init "PM Tool Market" --mode company
333
- # Drop competitor landing pages, reviews, pricing pages
334
- /wiki:ingest
335
- /wiki:query "Create a comparison table of Linear, Notion, and Jira"
336
- /wiki:run --schedule weekly
337
- ```
338
-
339
- ---
340
-
341
- ## ๐Ÿค Contributing
342
-
343
- Contributions are welcome! This package is maintained at [zosmaai/pi-llm-wiki](https://github.com/zosmaai/pi-llm-wiki).
344
-
345
- 1. Fork the repo
346
- 2. Create a feature branch
347
- 3. Make your changes
348
- 4. Submit a PR
349
-
350
- ### Development
351
-
352
- ```bash
353
- git clone https://github.com/zosmaai/pi-llm-wiki.git
354
- cd pi-llm-wiki
355
- npm install
356
- pi install ./
357
- ```
56
+ Read [docs/architecture.md](docs/architecture.md) for details.
358
57
 
359
- ---
58
+ ## Documentation
360
59
 
361
- ## ๐Ÿ“„ License
60
+ - [Architecture](docs/architecture.md) โ€” How the four layers work
61
+ - [Commands](docs/commands.md) โ€” All slash commands and tools
62
+ - [Obsidian Integration](docs/obsidian.md) โ€” Vault setup and recommended plugins
63
+ - [Configuration](docs/configuration.md) โ€” Wiki modes, topics, settings
64
+ - [API](docs/api.md) โ€” Extension tool reference
362
65
 
363
- MIT ยฉ zosmaai
66
+ ## Contributing
364
67
 
365
- ---
68
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
366
69
 
367
- ## ๐Ÿ™ Acknowledgments
70
+ ## License
368
71
 
369
- - **Andrej Karpathy** โ€” For the [LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) that inspired this package
370
- - **mduongvandinh** โ€” For the comprehensive [llm-wiki](https://github.com/mduongvandinh/llm-wiki) reference implementation
371
- - **tonbistudio** โ€” For the [clean template](https://github.com/tonbistudio/llm-wiki) this draws from
372
- - **Vannevar Bush** โ€” For imagining the Memex in 1945. LLMs finally make it practical.
72
+ MIT
package/assets/README.md CHANGED
@@ -4,10 +4,10 @@ Placeholder for gallery screenshots.
4
4
 
5
5
  To generate a screenshot:
6
6
 
7
- 1. Create a wiki using `/wiki:init`
8
- 2. Add a few sources and run `/wiki:ingest`
7
+ 1. Create a wiki using `/wiki-init`
8
+ 2. Add a few sources and run `/wiki-ingest`
9
9
  3. Open `wiki/` in Obsidian for the graph view screenshot
10
10
  4. Save as `assets/screenshot.png`
11
11
 
12
12
  The screenshot URL in package.json should point to:
13
- `https://raw.githubusercontent.com/zosmaai/pi-llm-wiki/master/assets/screenshot.png`
13
+ `https://raw.githubusercontent.com/zosmaai/pi-llm-wiki/main/assets/screenshot.png`
@@ -71,7 +71,7 @@ flowchart TB
71
71
  | ---------- | -------------------- | ------------------------------------------------------------------------------------------- |
72
72
  | **Ingest** | Add source to `raw/` | LLM reads, creates summary, updates 5-15 wiki pages, cross-references, flags contradictions |
73
73
  | **Query** | Ask any question | LLM searches index, reads relevant pages, synthesizes answer with `[[citations]]` |
74
- | **Lint** | `/wiki:lint` | Health check: contradictions, orphans, missing pages, stale claims, knowledge gaps |
74
+ | **Lint** | `/wiki-lint` | Health check: contradictions, orphans, missing pages, stale claims, knowledge gaps |
75
75
 
76
76
  ## Two Modes
77
77
 
package/biome.json CHANGED
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3
+ "files": {
4
+ "ignore": ["coverage", "dist", "node_modules"]
5
+ },
3
6
  "organizeImports": {
4
7
  "enabled": true
5
8
  },
package/docs/api.md ADDED
@@ -0,0 +1,105 @@
1
+ # API Reference
2
+
3
+ ## Extension Tools
4
+
5
+ ### wiki_bootstrap
6
+
7
+ Initialize a new LLM Wiki vault.
8
+
9
+ ```
10
+ wiki_bootstrap(topic: string, mode?: "personal" | "company", root?: string)
11
+ ```
12
+
13
+ ### wiki_capture_source
14
+
15
+ Capture a URL, file, or text into an immutable source packet.
16
+
17
+ ```
18
+ wiki_capture_source(
19
+ inputType: "url" | "file" | "text",
20
+ value: string,
21
+ title?: string,
22
+ kind?: string,
23
+ tags?: string[],
24
+ createSourcePage?: boolean
25
+ )
26
+ ```
27
+
28
+ ### wiki_ingest
29
+
30
+ Get a batch of sources needing synthesis.
31
+
32
+ ```
33
+ wiki_ingest(batch_size?: number)
34
+ ```
35
+
36
+ ### wiki_ensure_page
37
+
38
+ Create or resolve a canonical page.
39
+
40
+ ```
41
+ wiki_ensure_page(
42
+ type: "concept" | "entity" | "synthesis" | "analysis",
43
+ title: string,
44
+ aliases?: string[],
45
+ tags?: string[],
46
+ summary?: string,
47
+ createIfMissing?: boolean
48
+ )
49
+ ```
50
+
51
+ ### wiki_search
52
+
53
+ Search the wiki registry.
54
+
55
+ ```
56
+ wiki_search(query: string, type?: string, limit?: number)
57
+ ```
58
+
59
+ ### wiki_lint
60
+
61
+ Health check the wiki.
62
+
63
+ ```
64
+ wiki_lint(mode?: string, writeReport?: boolean, limit?: number)
65
+ ```
66
+
67
+ ### wiki_status
68
+
69
+ Show wiki statistics.
70
+
71
+ ```
72
+ wiki_status()
73
+ ```
74
+
75
+ ### wiki_rebuild_meta
76
+
77
+ Force metadata rebuild.
78
+
79
+ ```
80
+ wiki_rebuild_meta()
81
+ ```
82
+
83
+ ### wiki_log_event
84
+
85
+ Record a structured event.
86
+
87
+ ```
88
+ wiki_log_event(
89
+ kind: string,
90
+ title: string,
91
+ summary?: string,
92
+ sourceIds?: string[],
93
+ pagePaths?: string[],
94
+ notes?: string[],
95
+ actor?: "agent" | "user" | "extension"
96
+ )
97
+ ```
98
+
99
+ ### wiki_watch
100
+
101
+ Schedule auto-updates.
102
+
103
+ ```
104
+ wiki_watch(schedule: string, command: string)
105
+ ```
@@ -0,0 +1,65 @@
1
+ # Architecture
2
+
3
+ ## Four Layers
4
+
5
+ ```
6
+ WIKI_ROOT/
7
+ โ”œโ”€โ”€ raw/sources/SRC-*/ # Immutable source packets (extension-owned)
8
+ โ”‚ โ”œโ”€โ”€ manifest.json # Capture metadata
9
+ โ”‚ โ”œโ”€โ”€ original/ # Original artifact
10
+ โ”‚ โ”œโ”€โ”€ extracted.md # Normalized markdown
11
+ โ”‚ โ””โ”€โ”€ attachments/ # Downloaded images, PDFs
12
+ โ”œโ”€โ”€ wiki/ # Editable knowledge pages (you + LLM)
13
+ โ”‚ โ”œโ”€โ”€ sources/ # One summary per source
14
+ โ”‚ โ”œโ”€โ”€ entities/ # People, orgs, tools, products
15
+ โ”‚ โ”œโ”€โ”€ concepts/ # Ideas, patterns, frameworks
16
+ โ”‚ โ”œโ”€โ”€ syntheses/ # Cross-cutting analyses
17
+ โ”‚ โ””โ”€โ”€ analyses/ # Durable query answers
18
+ โ”œโ”€โ”€ meta/ # Auto-generated (extension-owned)
19
+ โ”‚ โ”œโ”€โ”€ registry.json # Master page catalog
20
+ โ”‚ โ”œโ”€โ”€ backlinks.json # Inbound link map
21
+ โ”‚ โ”œโ”€โ”€ index.md # Human-readable catalog
22
+ โ”‚ โ”œโ”€โ”€ log.md # Activity log
23
+ โ”‚ โ””โ”€โ”€ events.jsonl # Structured event stream
24
+ โ””โ”€โ”€ .wiki/ # Config and templates
25
+ โ”œโ”€โ”€ config.json
26
+ โ””โ”€โ”€ templates/
27
+ ```
28
+
29
+ ## Ownership Rules
30
+
31
+ | Path | Owner | Rule |
32
+ | --------- | ------------------------ | ------------------------ |
33
+ | `raw/**` | Extension | Immutable after capture |
34
+ | `wiki/**` | Model + user | Editable knowledge pages |
35
+ | `meta/*` | Extension | Auto-generated |
36
+ | `.wiki/*` | Human + explicit request | Operating rules |
37
+
38
+ ## Source Packet Format
39
+
40
+ Each captured source becomes a packet:
41
+
42
+ ```
43
+ raw/sources/SRC-YYYY-MM-DD-NNN/
44
+ manifest.json
45
+ original/
46
+ extracted.md
47
+ attachments/
48
+ ```
49
+
50
+ ## Page Types
51
+
52
+ - **source** โ€” what this specific source says
53
+ - **entity** โ€” people, orgs, tools, products
54
+ - **concept** โ€” ideas, patterns, frameworks
55
+ - **synthesis** โ€” cross-source theses and tensions
56
+ - **analysis** โ€” durable filed answers from queries
57
+
58
+ ## Linking Style
59
+
60
+ - Internal: `[[folder/page-name]]`
61
+ - Citation: `[[sources/SRC-YYYY-MM-DD-NNN]]`
62
+
63
+ ## Guardrails
64
+
65
+ The extension blocks direct edits to `raw/**` and `meta/**`. Metadata rebuilds automatically after `wiki/**` edits.
@@ -0,0 +1,51 @@
1
+ # Commands
2
+
3
+ ## Slash Commands
4
+
5
+ | Command | Description |
6
+ | ---------------- | ------------------------------------- |
7
+ | `/wiki-init` | Create a new wiki vault |
8
+ | `/wiki-ingest` | Process new sources |
9
+ | `/wiki-query` | Ask questions against the wiki |
10
+ | `/wiki-lint` | Health check |
11
+ | `/wiki-discover` | Auto-discover sources |
12
+ | `/wiki-run` | Full cycle (discover โ†’ ingest โ†’ lint) |
13
+ | `/wiki-status` | Show wiki health |
14
+ | `/wiki-digest` | Daily/weekly summary |
15
+
16
+ ## Extension Tools
17
+
18
+ The extension registers 10 tools the LLM can call directly:
19
+
20
+ | Tool | Purpose |
21
+ | --------------------- | ------------------------------------------- |
22
+ | `wiki_bootstrap` | Initialize a new vault |
23
+ | `wiki_capture_source` | Capture URL/file/text into immutable packet |
24
+ | `wiki_ingest` | Get batch of uningested sources |
25
+ | `wiki_ensure_page` | Create canonical page from template |
26
+ | `wiki_search` | Search the wiki registry |
27
+ | `wiki_lint` | Health check with auto-fix |
28
+ | `wiki_status` | Instant stats |
29
+ | `wiki_rebuild_meta` | Force metadata rebuild |
30
+ | `wiki_log_event` | Record custom event |
31
+ | `wiki_watch` | Schedule auto-updates |
32
+
33
+ ## Workflows
34
+
35
+ ### Capture โ†’ Ingest โ†’ Synthesize
36
+
37
+ 1. `wiki_capture_source(url="...")` โ€” creates packet + skeleton
38
+ 2. `wiki_ingest()` โ€” get batch of sources needing synthesis
39
+ 3. Read `raw/sources/SRC-*/extracted.md`
40
+ 4. Update skeleton source page with summary, entities, concepts
41
+ 5. `wiki_ensure_page(type="entity", title="...")` for each entity
42
+ 6. Add `[[wikilinks]]` between related pages
43
+ 7. Extension auto-rebuilds metadata
44
+
45
+ ### Query โ†’ Answer โ†’ File
46
+
47
+ 1. `wiki_search(query="...")` to find relevant pages
48
+ 2. Read those pages
49
+ 3. Synthesize answer with `[[wikilink]]` citations
50
+ 4. If novel: create analysis page via `wiki_ensure_page(type="analysis")`
51
+ 5. Extension auto-updates metadata