@zosmaai/pi-llm-wiki 0.1.6 → 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/.github/workflows/ci.yml +7 -6
- package/.github/workflows/release.yml +3 -3
- package/AGENTS.md +57 -0
- package/CHANGELOG.md +30 -0
- package/CONTRIBUTING.md +43 -0
- package/LICENSE +21 -0
- package/README.md +42 -342
- package/biome.json +3 -0
- package/docs/api.md +105 -0
- package/docs/architecture.md +65 -0
- package/docs/commands.md +51 -0
- package/docs/configuration.md +38 -0
- package/docs/obsidian.md +21 -0
- package/extensions/llm-wiki/index.ts +53 -0
- package/extensions/llm-wiki/lib/guardrails.ts +69 -0
- package/extensions/llm-wiki/lib/metadata.ts +218 -0
- package/extensions/llm-wiki/lib/source-packet.ts +292 -0
- package/extensions/llm-wiki/lib/tools.ts +932 -0
- package/extensions/llm-wiki/lib/utils.ts +222 -0
- package/package.json +7 -2
- package/scripts/release.js +72 -0
- package/skills/llm-wiki/SKILL.md +95 -369
- package/skills/llm-wiki/templates/pages/analysis.md +35 -0
- package/test/llm-wiki.test.ts +18 -9
- package/extensions/llm-wiki-tools.ts +0 -705
package/skills/llm-wiki/SKILL.md
CHANGED
|
@@ -1,426 +1,152 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: llm-wiki
|
|
3
|
-
description: Build and maintain a persistent, interlinked Obsidian-compatible markdown wiki using Karpathy's LLM Wiki pattern.
|
|
3
|
+
description: Build and maintain a persistent, interlinked Obsidian-compatible markdown wiki using Karpathy's LLM Wiki pattern. Extension-backed with auto-generated metadata, guardrails, and 10 custom tools.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# LLM Wiki for Pi
|
|
7
7
|
|
|
8
|
-
You are a disciplined wiki maintainer.
|
|
8
|
+
You are a disciplined wiki maintainer. The extension handles all mechanical work — you focus on synthesis, reasoning, and knowledge organization.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Architecture
|
|
10
|
+
## Architecture (4 Layers)
|
|
15
11
|
|
|
16
12
|
```
|
|
17
13
|
WIKI_ROOT/
|
|
18
|
-
├── raw/
|
|
19
|
-
│ ├──
|
|
20
|
-
│ ├──
|
|
21
|
-
│ ├──
|
|
22
|
-
│
|
|
23
|
-
|
|
24
|
-
│
|
|
25
|
-
├──
|
|
26
|
-
│ ├──
|
|
27
|
-
│ ├──
|
|
28
|
-
│
|
|
29
|
-
|
|
30
|
-
│ ├──
|
|
31
|
-
│ ├──
|
|
32
|
-
│ ├──
|
|
33
|
-
│
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
└── gaps.json # Knowledge gaps discovered by lint
|
|
14
|
+
├── raw/sources/SRC-*/ # Immutable source packets (extension-owned)
|
|
15
|
+
│ ├── manifest.json
|
|
16
|
+
│ ├── original/
|
|
17
|
+
│ ├── extracted.md
|
|
18
|
+
│ └── attachments/
|
|
19
|
+
├── wiki/ # Editable knowledge pages (you own this)
|
|
20
|
+
│ ├── sources/ # One summary per source
|
|
21
|
+
│ ├── entities/ # People, orgs, tools, products
|
|
22
|
+
│ ├── concepts/ # Ideas, patterns, frameworks
|
|
23
|
+
│ ├── syntheses/ # Cross-cutting analyses
|
|
24
|
+
│ └── analyses/ # Durable query answers
|
|
25
|
+
├── meta/ # Auto-generated (extension-owned)
|
|
26
|
+
│ ├── registry.json # Master page catalog
|
|
27
|
+
│ ├── backlinks.json # Inbound link map
|
|
28
|
+
│ ├── index.md # Human-readable catalog
|
|
29
|
+
│ ├── log.md # Activity log
|
|
30
|
+
│ └── events.jsonl # Structured event stream
|
|
31
|
+
└── .wiki/ # Config and templates
|
|
32
|
+
├── config.json
|
|
33
|
+
└── templates/
|
|
39
34
|
```
|
|
40
35
|
|
|
41
|
-
### Three Layers
|
|
42
|
-
|
|
43
|
-
| Layer | Path | Owner | Purpose |
|
|
44
|
-
| --------------- | ----------------------------- | ---------- | ----------------------------------------------------- |
|
|
45
|
-
| **Raw Sources** | `raw/` | Human | Immutable source of truth. You READ ONLY. |
|
|
46
|
-
| **The Wiki** | `wiki/` | You (LLM) | Interlinked markdown pages. You write and maintain. |
|
|
47
|
-
| **The Schema** | This SKILL.md + `config.yaml` | Co-evolved | Rules, conventions, workflows. Updated as needs grow. |
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
36
|
## Golden Rules
|
|
52
37
|
|
|
53
|
-
1. **RAW IS IMMUTABLE.** Never edit
|
|
54
|
-
2. **
|
|
55
|
-
3. **
|
|
56
|
-
4. **
|
|
57
|
-
5. **
|
|
58
|
-
6. **
|
|
59
|
-
7. **
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
38
|
+
1. **RAW IS IMMUTABLE.** Never edit `raw/`. Use `wiki_capture_source` to add sources.
|
|
39
|
+
2. **META IS AUTO-GENERATED.** Never edit `meta/`. The extension rebuilds it automatically.
|
|
40
|
+
3. **YOU OWN THE WIKI.** Create, update, and cross-reference everything in `wiki/`.
|
|
41
|
+
4. **ONE FILE PER THING.** Each entity, concept, source gets its own `.md` file.
|
|
42
|
+
5. **CROSS-REFERENCE EVERYTHING.** Every page needs at least 2 `[[wikilinks]]`.
|
|
43
|
+
6. **CITE SOURCES.** Every claim links back to its raw source packet.
|
|
44
|
+
7. **FLAG CONTRADICTIONS.** When sources disagree, document both sides.
|
|
45
|
+
|
|
46
|
+
## How the Extension Helps You
|
|
47
|
+
|
|
48
|
+
| Task | Before (skill-only) | Now (extension-backed) |
|
|
49
|
+
| ------------------ | ---------------------------- | ------------------------------------- |
|
|
50
|
+
| Track ingestion | Manual `history.json` | Automatic via `meta/registry.json` |
|
|
51
|
+
| Update INDEX | Manual edit after every page | Auto-rebuilds on turn end |
|
|
52
|
+
| Update LOG | Manual append | Auto-generated from `events.jsonl` |
|
|
53
|
+
| Find orphans | Shell `grep` scans | Instant from `backlinks.json` |
|
|
54
|
+
| Block raw edits | Skill says "don't" | Extension **enforces** immutability |
|
|
55
|
+
| Create source page | 8 tool calls | `wiki_capture_source` + LLM synthesis |
|
|
56
|
+
|
|
57
|
+
## Available Tools
|
|
58
|
+
|
|
59
|
+
Use these directly — they handle scaffolding and bookkeeping:
|
|
60
|
+
|
|
61
|
+
- `wiki_bootstrap` — Initialize a new vault
|
|
62
|
+
- `wiki_capture_source` — Capture URL/file/text into immutable packet + skeleton page
|
|
63
|
+
- `wiki_ingest` — Get batch of uningested sources with extracted text
|
|
64
|
+
- `wiki_ensure_page` — Create entity/concept/synthesis/analysis page from template
|
|
65
|
+
- `wiki_search` — Search registry for existing pages
|
|
66
|
+
- `wiki_lint` — Health check (orphans, missing, contradictions, gaps)
|
|
67
|
+
- `wiki_status` — Instant stats
|
|
68
|
+
- `wiki_rebuild_meta` — Force metadata rebuild
|
|
69
|
+
- `wiki_log_event` — Record a custom event
|
|
70
|
+
- `wiki_watch` — Schedule auto-updates
|
|
63
71
|
|
|
64
72
|
## Workflows
|
|
65
73
|
|
|
66
|
-
###
|
|
67
|
-
|
|
68
|
-
**When:** The user wants to start a new wiki on a topic.
|
|
69
|
-
|
|
70
|
-
1. Create directory structure: `raw/`, `wiki/entities/`, `wiki/concepts/`, `wiki/sources/`, `wiki/syntheses/`, `wiki/changes/`, `outputs/`, `.discoveries/`
|
|
71
|
-
2. Create `config.yaml` with the topic, any feeds, and default settings
|
|
72
|
-
3. Create `wiki/INDEX.md` with placeholder sections
|
|
73
|
-
4. Create `wiki/LOG.md` with initial entry
|
|
74
|
-
5. Create `wiki/DASHBOARD.md` with Dataview queries
|
|
75
|
-
6. Report the structure and suggest first steps
|
|
76
|
-
|
|
77
|
-
### `/wiki-ingest [path]` — Process new sources
|
|
78
|
-
|
|
79
|
-
**When:** New files appear in `raw/`. Process one or all new sources.
|
|
80
|
-
|
|
81
|
-
1. Read `config.yaml` and this schema (for rules)
|
|
82
|
-
2. Read `.discoveries/history.json` → get already-processed files
|
|
83
|
-
3. Scan `raw/` → identify files not yet in history
|
|
84
|
-
4. For each new source file:
|
|
85
|
-
a. Read the full content (use `read` for text, `fetch_content` for URLs, bash for PDF text extraction)
|
|
86
|
-
b. Discuss key takeaways with the user (1-2 sentence summary, ask if they want emphasis on anything)
|
|
87
|
-
c. Create a source summary page in `wiki/sources/`:
|
|
88
|
-
```markdown
|
|
89
|
-
---
|
|
90
|
-
type: source
|
|
91
|
-
format: article | paper | note | video | slack | podcast
|
|
92
|
-
raw_path: raw/articles/filename.md
|
|
93
|
-
ingested: YYYY-MM-DD
|
|
94
|
-
topics: [topic1, topic2]
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
# Source Title
|
|
98
|
-
|
|
99
|
-
## Summary
|
|
100
|
-
|
|
101
|
-
[2-3 paragraph summary of key content]
|
|
102
|
-
|
|
103
|
-
## Key Takeaways
|
|
104
|
-
|
|
105
|
-
- [Bullet points of most important points]
|
|
106
|
-
|
|
107
|
-
## Entities Mentioned
|
|
108
|
-
|
|
109
|
-
- [[entity-name]]
|
|
110
|
-
|
|
111
|
-
## Concepts Mentioned
|
|
112
|
-
|
|
113
|
-
- [[concept-name]]
|
|
114
|
-
|
|
115
|
-
## Notable Quotes
|
|
116
|
-
|
|
117
|
-
> "Quote" — attribution
|
|
118
|
-
```
|
|
119
|
-
d. Create or update entity pages in `wiki/entities/`:
|
|
120
|
-
```markdown
|
|
121
|
-
---
|
|
122
|
-
type: entity
|
|
123
|
-
category: person | organization | tool | project | product
|
|
124
|
-
created: YYYY-MM-DD
|
|
125
|
-
updated: YYYY-MM-DD
|
|
126
|
-
sources: [raw/articles/filename.md]
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
# Entity Name
|
|
130
|
-
|
|
131
|
-
One-line description.
|
|
132
|
-
|
|
133
|
-
## Overview
|
|
134
|
-
|
|
135
|
-
[Key facts, role, significance]
|
|
136
|
-
|
|
137
|
-
## Links
|
|
138
|
-
|
|
139
|
-
- [[related-concept]]
|
|
140
|
-
- [[related-entity]]
|
|
141
|
-
|
|
142
|
-
## Sources
|
|
143
|
-
|
|
144
|
-
- [raw/articles/filename.md](../raw/articles/filename.md)
|
|
145
|
-
```
|
|
146
|
-
e. Create or update concept pages in `wiki/concepts/`:
|
|
147
|
-
```markdown
|
|
148
|
-
---
|
|
149
|
-
type: concept
|
|
150
|
-
domain: ai | engineering | business | product | design | personal
|
|
151
|
-
created: YYYY-MM-DD
|
|
152
|
-
updated: YYYY-MM-DD
|
|
153
|
-
sources: [raw/articles/filename.md]
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
# Concept Name
|
|
157
|
-
|
|
158
|
-
One-line definition.
|
|
159
|
-
|
|
160
|
-
## Definition
|
|
161
|
-
|
|
162
|
-
[Clear explanation]
|
|
163
|
-
|
|
164
|
-
## How It Works
|
|
165
|
-
|
|
166
|
-
[Technical details if applicable]
|
|
167
|
-
|
|
168
|
-
## Examples
|
|
169
|
-
|
|
170
|
-
[Concrete examples from sources]
|
|
171
|
-
|
|
172
|
-
## Links
|
|
173
|
-
|
|
174
|
-
- [[related-concept]]
|
|
175
|
-
|
|
176
|
-
## Sources
|
|
177
|
-
|
|
178
|
-
- [raw/articles/filename.md](../raw/articles/filename.md)
|
|
179
|
-
```
|
|
180
|
-
f. Add `[[wikilinks]]` cross-references to all related pages
|
|
181
|
-
g. Flag contradictions: if new info conflicts with existing wiki pages, add a note to both pages: `> ⚠️ **Contradiction:** [description]. See [[other-page]] and [source](../raw/path).`
|
|
182
|
-
5. Update `wiki/INDEX.md` — add entries for every new or updated page
|
|
183
|
-
6. Append to `wiki/LOG.md`: `## [YYYY-MM-DD HH:mm] ingest | [filename] | [N] pages affected`
|
|
184
|
-
7. Update `.discoveries/history.json`
|
|
185
|
-
8. Report summary: `Ingested [N] sources → [M] wiki pages created/updated. [X] contradictions flagged.`
|
|
186
|
-
|
|
187
|
-
**Rules:**
|
|
188
|
-
|
|
189
|
-
- One source can affect 5-15 wiki pages
|
|
190
|
-
- Never fabricate — only write what's in the raw sources
|
|
191
|
-
- If a file can't be read → log the error, skip it, continue
|
|
192
|
-
- Batch size: process files one at a time for quality, or batch up to 5 for speed
|
|
74
|
+
### Capture → Ingest → Synthesize
|
|
193
75
|
|
|
194
|
-
|
|
76
|
+
1. **Capture**: `wiki_capture_source(url="...")` → creates packet + skeleton
|
|
77
|
+
2. **Ingest**: `wiki_ingest()` → get batch of sources needing synthesis
|
|
78
|
+
3. **Read**: `read raw/sources/SRC-*/extracted.md`
|
|
79
|
+
4. **Write**: Update skeleton source page with summary, entities, concepts
|
|
80
|
+
5. **Ensure**: `wiki_ensure_page(type="entity", title="...")` for each entity
|
|
81
|
+
6. **Cross-ref**: Add `[[wikilinks]]` between related pages
|
|
82
|
+
7. **Done**: Extension auto-rebuilds metadata
|
|
195
83
|
|
|
196
|
-
|
|
84
|
+
### Query → Answer → File
|
|
197
85
|
|
|
198
|
-
1.
|
|
199
|
-
2. Read those pages
|
|
200
|
-
3. Synthesize
|
|
201
|
-
4. If
|
|
202
|
-
5.
|
|
203
|
-
6. Report the answer clearly with citations
|
|
204
|
-
|
|
205
|
-
**Rules:**
|
|
206
|
-
|
|
207
|
-
- Answer ONLY from wiki content, not from general knowledge
|
|
208
|
-
- If the wiki lacks sufficient information → say so clearly, suggest what sources would help
|
|
209
|
-
- Comparisons, analyses, and new connections → always save as synthesis pages (knowledge compounds)
|
|
210
|
-
|
|
211
|
-
### `/wiki-lint` — Health check the wiki
|
|
212
|
-
|
|
213
|
-
**When:** The user asks for a health check, or periodically.
|
|
214
|
-
|
|
215
|
-
1. Read `wiki/INDEX.md` and scan all files in `wiki/`
|
|
216
|
-
2. Check for:
|
|
217
|
-
- **Contradictions**: Claims that conflict between pages. Read related pages together to verify consistency.
|
|
218
|
-
- **Orphans**: Pages with zero inbound `[[wikilinks]]`
|
|
219
|
-
- **Missing pages**: `[[links]]` pointing to files that don't exist
|
|
220
|
-
- **Stale claims**: Information superseded by newer sources (check dates)
|
|
221
|
-
- **Broken raw links**: Links to `raw/` files that no longer exist
|
|
222
|
-
- **Knowledge gaps**: Important concepts mentioned but lacking their own page
|
|
223
|
-
- **Quality issues**: Pages under 3 lines, pages with no sources, pages with no cross-references
|
|
224
|
-
3. Auto-fix: fix broken links, create missing pages for frequently-linked concepts, add cross-refs to orphans
|
|
225
|
-
4. If contradictions found → flag them, don't silently resolve (ask the human which version is correct)
|
|
226
|
-
5. Save report → `outputs/lint-YYYY-MM-DD.md`
|
|
227
|
-
6. Update `.discoveries/gaps.json` with discovered gaps
|
|
228
|
-
7. Append to `wiki/LOG.md`
|
|
229
|
-
8. Report key findings
|
|
230
|
-
|
|
231
|
-
### `/wiki-discover` — Auto-discover new sources
|
|
232
|
-
|
|
233
|
-
**When:** The user wants to find new content for the wiki.
|
|
234
|
-
|
|
235
|
-
1. Read `config.yaml` → extract topics, keywords, feeds, subreddits
|
|
236
|
-
2. Read `.discoveries/gaps.json` → knowledge gaps identified by lint
|
|
237
|
-
3. Read `.discoveries/history.json` → URLs already fetched
|
|
238
|
-
4. Search for new sources using:
|
|
239
|
-
- **Web search**: Search topics + keywords from config
|
|
240
|
-
- **Gap filling**: Search for gaps identified in `.discoveries/gaps.json`
|
|
241
|
-
- **Trending**: Search for latest content on each topic
|
|
242
|
-
5. For each promising source found:
|
|
243
|
-
a. Fetch the full content (use `fetch_content` or `web_search`)
|
|
244
|
-
b. Save to `raw/articles/YYYY-MM-DD-slug.md` with frontmatter:
|
|
245
|
-
```markdown
|
|
246
|
-
---
|
|
247
|
-
title: "Original Title"
|
|
248
|
-
url: "https://..."
|
|
249
|
-
discovered: YYYY-MM-DD
|
|
250
|
-
topic: "topic-name"
|
|
251
|
-
---
|
|
252
|
-
```
|
|
253
|
-
6. Update `.discoveries/history.json`
|
|
254
|
-
7. Report: `Discovered [N] new sources. Run /wiki-ingest to process them.`
|
|
255
|
-
|
|
256
|
-
**Rules:**
|
|
257
|
-
|
|
258
|
-
- Max 5-10 new sources per discover cycle
|
|
259
|
-
- Skip: ads, shallow listicles, duplicates, paywalled content
|
|
260
|
-
- Prefer: in-depth articles, papers, guides, high-quality analysis
|
|
261
|
-
|
|
262
|
-
### `/wiki-run` — Full cycle: discover → ingest → lint
|
|
263
|
-
|
|
264
|
-
**When:** The user wants a complete refresh.
|
|
265
|
-
|
|
266
|
-
1. Run `discover` → find new sources
|
|
267
|
-
2. Run `ingest` → process all new files in `raw/`
|
|
268
|
-
3. Run `lint` → health check
|
|
269
|
-
4. If lint found critical gaps → optionally run one more discover+ingest cycle
|
|
270
|
-
5. Save summary report → `outputs/run-YYYY-MM-DD.md`
|
|
271
|
-
6. Report final summary
|
|
272
|
-
|
|
273
|
-
### `/wiki-status` — Show wiki health
|
|
274
|
-
|
|
275
|
-
**When:** The user wants a quick overview.
|
|
276
|
-
|
|
277
|
-
Report:
|
|
278
|
-
|
|
279
|
-
```
|
|
280
|
-
📊 LLM Wiki Status
|
|
281
|
-
══════════════════
|
|
282
|
-
Wiki Roots: [topic1], [topic2]
|
|
283
|
-
Sources: [N] files
|
|
284
|
-
Wiki Pages: [N] total ([E] entities, [C] concepts, [S] sources, [Y] syntheses)
|
|
285
|
-
Last Ingest: YYYY-MM-DD
|
|
286
|
-
Last Lint: YYYY-MM-DD
|
|
287
|
-
Orphans: [N]
|
|
288
|
-
Knowledge Gaps: [N]
|
|
289
|
-
Health: ✅ Good | ⚠️ Warning | 🔴 Needs Attention
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
### `/wiki-digest` — Daily/Weekly digest
|
|
293
|
-
|
|
294
|
-
**When:** The user wants a summary of recent changes.
|
|
295
|
-
|
|
296
|
-
1. Read `wiki/LOG.md` — filter entries since last digest
|
|
297
|
-
2. Summarize: new sources ingested, pages created/updated, insights discovered
|
|
298
|
-
3. Report in a concise digest format
|
|
299
|
-
4. Save → `outputs/digest-YYYY-MM-DD.md`
|
|
300
|
-
|
|
301
|
-
### `/wiki-watch <interval>` — Auto-run on schedule
|
|
302
|
-
|
|
303
|
-
**When:** The user wants the wiki to stay current automatically.
|
|
304
|
-
|
|
305
|
-
Set up a recurring schedule using pi's schedule system:
|
|
306
|
-
|
|
307
|
-
```
|
|
308
|
-
/wiki-watch daily → schedule_prompt action=add schedule="0 0 8 * * *" prompt="Run `/wiki-run` for the LLM Wiki"
|
|
309
|
-
/wiki-watch weekly → schedule_prompt action=add schedule="0 0 9 * * 1" prompt="Run `/wiki-run` for the LLM Wiki"
|
|
310
|
-
/wiki-watch hourly → schedule_prompt action=add schedule="0 0 * * * *" prompt="Run `/wiki-run` for the LLM Wiki"
|
|
311
|
-
/wiki-watch stop → list and remove scheduled wiki jobs
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
---
|
|
86
|
+
1. `wiki_search(query="...")` to find relevant pages
|
|
87
|
+
2. Read those pages
|
|
88
|
+
3. Synthesize answer with `[[wikilink]]` citations
|
|
89
|
+
4. If novel: create analysis page via `wiki_ensure_page(type="analysis")`
|
|
90
|
+
5. Extension auto-updates metadata
|
|
315
91
|
|
|
316
92
|
## Page Conventions
|
|
317
93
|
|
|
318
94
|
### Naming
|
|
319
95
|
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
- Concept names: brief descriptive slug
|
|
96
|
+
- `kebab-case.md` for all files
|
|
97
|
+
- Folder-qualified wikilinks: `[[concepts/retrieval-augmented-generation]]`
|
|
323
98
|
|
|
324
99
|
### Frontmatter
|
|
325
100
|
|
|
326
|
-
Every page MUST have YAML frontmatter:
|
|
327
|
-
|
|
328
101
|
```yaml
|
|
329
102
|
---
|
|
330
|
-
type: entity | concept | source | synthesis |
|
|
103
|
+
type: entity | concept | source | synthesis | analysis
|
|
331
104
|
created: YYYY-MM-DD
|
|
332
105
|
updated: YYYY-MM-DD
|
|
333
|
-
sources: [
|
|
106
|
+
sources: [sources/SRC-YYYY-MM-DD-NNN]
|
|
334
107
|
---
|
|
335
108
|
```
|
|
336
109
|
|
|
337
|
-
Entity
|
|
338
|
-
Concept
|
|
110
|
+
Entity: add `category: person | organization | tool | project | product`
|
|
111
|
+
Concept: add `domain: ai | engineering | business | product | design | personal`
|
|
339
112
|
|
|
340
|
-
###
|
|
113
|
+
### Citations
|
|
341
114
|
|
|
342
|
-
|
|
343
|
-
- External links: `[text](url)`
|
|
344
|
-
- Source citations: `[Source: filename](../raw/path/file.md)`
|
|
345
|
-
- Every page needs ≥2 `[[wikilinks]]`
|
|
115
|
+
Use stable source IDs: `[[sources/SRC-2026-04-28-001]]`
|
|
346
116
|
|
|
347
117
|
### Contradictions
|
|
348
118
|
|
|
349
|
-
When sources disagree, document both sides:
|
|
350
|
-
|
|
351
119
|
```markdown
|
|
352
120
|
> ⚠️ **Contradiction:** Source A claims X, but Source B claims Y.
|
|
353
|
-
> See [[page-a]] and [[page-b]]
|
|
354
|
-
>
|
|
355
|
-
> - X: [Source A](../raw/path/a.md)
|
|
356
|
-
> - Y: [Source B](../raw/path/b.md)
|
|
121
|
+
> See [[page-a]] and [[page-b]].
|
|
357
122
|
```
|
|
358
123
|
|
|
359
|
-
---
|
|
360
|
-
|
|
361
124
|
## Variants
|
|
362
125
|
|
|
363
|
-
### Personal Wiki
|
|
364
|
-
|
|
365
|
-
Track: learning, journaling, book notes, health, goals, reflections.
|
|
366
|
-
|
|
367
|
-
- Extra folders: `wiki/journal/`, `wiki/goals/`
|
|
368
|
-
- Personal entities: people you meet, books you read, courses you take
|
|
369
|
-
- Daily journal entries can be ingested as raw notes
|
|
126
|
+
### Personal Wiki
|
|
370
127
|
|
|
371
|
-
|
|
128
|
+
- Extra: `wiki/journal/`, `wiki/goals/`
|
|
129
|
+
- Track: learning, books, health, reflections
|
|
372
130
|
|
|
373
|
-
|
|
131
|
+
### Company Wiki
|
|
374
132
|
|
|
375
|
-
- Extra
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
- Confidence levels in frontmatter: `confidence: high | medium | low`
|
|
379
|
-
|
|
380
|
-
---
|
|
133
|
+
- Extra: `wiki/changes/`, `wiki/decisions/`
|
|
134
|
+
- Track: competitors, market, strategy
|
|
135
|
+
- Frontmatter: `confidence: high | medium | low`
|
|
381
136
|
|
|
382
137
|
## Obsidian Integration
|
|
383
138
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
**Recommended Obsidian plugins:**
|
|
139
|
+
Open `wiki/` as an Obsidian vault. The extension generates:
|
|
387
140
|
|
|
388
|
-
-
|
|
389
|
-
-
|
|
390
|
-
-
|
|
391
|
-
- **Spaced Repetition** — Flashcards from `wiki/flashcards.md`
|
|
392
|
-
- **Charts View** — Dashboard analytics
|
|
393
|
-
- **Marp** — Markdown slide decks
|
|
141
|
+
- `meta/index.md` — browsable catalog
|
|
142
|
+
- `meta/backlinks.json` — for graph plugins
|
|
143
|
+
- `[[wikilinks]]` — native Obsidian links
|
|
394
144
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
- Low-confidence pages needing review
|
|
398
|
-
- Recent updates
|
|
399
|
-
- Concepts by domain
|
|
400
|
-
- Pages with the most sources
|
|
401
|
-
|
|
402
|
-
---
|
|
403
|
-
|
|
404
|
-
## Scheduling (Auto-Update)
|
|
405
|
-
|
|
406
|
-
To keep the wiki always fresh, use pi's scheduling:
|
|
407
|
-
|
|
408
|
-
```bash
|
|
409
|
-
# Daily at 8 AM — discover + ingest + lint
|
|
410
|
-
/wiki-watch daily
|
|
411
|
-
|
|
412
|
-
# Or manually:
|
|
413
|
-
/wiki-run
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
The schedule checks your configured topics, discovers new sources, ingests them, and lints for health — all automatically.
|
|
417
|
-
|
|
418
|
-
---
|
|
145
|
+
Recommended plugins: Dataview, Graph View, Backlinks
|
|
419
146
|
|
|
420
147
|
## Tips
|
|
421
148
|
|
|
422
|
-
- **
|
|
423
|
-
- **
|
|
424
|
-
- **
|
|
425
|
-
- **
|
|
426
|
-
- **Evolve the schema**: As you use the wiki, you'll find what works. Update rules here as you go.
|
|
149
|
+
- **Start small:** 3-5 sources, let it grow organically
|
|
150
|
+
- **Batch efficiently:** Plan all pages for a source, then write them rapidly
|
|
151
|
+
- **Trust the extension:** Never waste tokens updating INDEX.md or LOG.md manually
|
|
152
|
+
- **Evolve the schema:** Update `WIKI_SCHEMA.md` as conventions mature
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: analysis
|
|
3
|
+
topic: ""
|
|
4
|
+
created: YYYY-MM-DD
|
|
5
|
+
updated: YYYY-MM-DD
|
|
6
|
+
sources_count: 0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Analysis Title
|
|
10
|
+
|
|
11
|
+
> _Durable answer derived from wiki content._
|
|
12
|
+
|
|
13
|
+
## Question
|
|
14
|
+
|
|
15
|
+
[The original question that drove this analysis.]
|
|
16
|
+
|
|
17
|
+
## Answer
|
|
18
|
+
|
|
19
|
+
[Synthesized answer with [[wikilink]] citations to specific pages.]
|
|
20
|
+
|
|
21
|
+
## Key Insights
|
|
22
|
+
|
|
23
|
+
1. [Insight 1]
|
|
24
|
+
2. [Insight 2]
|
|
25
|
+
3. [Insight 3]
|
|
26
|
+
|
|
27
|
+
## Sources Used
|
|
28
|
+
|
|
29
|
+
- [[source-1]]
|
|
30
|
+
- [[source-2]]
|
|
31
|
+
|
|
32
|
+
## Related Pages
|
|
33
|
+
|
|
34
|
+
- [[concept-1]]
|
|
35
|
+
- [[entity-1]]
|
package/test/llm-wiki.test.ts
CHANGED
|
@@ -89,7 +89,7 @@ describe("package structure", () => {
|
|
|
89
89
|
expect(content).toContain("## Golden Rules");
|
|
90
90
|
expect(content).toContain("RAW IS IMMUTABLE");
|
|
91
91
|
expect(content).toContain("## Workflows");
|
|
92
|
-
expect(content).toContain("
|
|
92
|
+
expect(content).toContain("wiki_ingest");
|
|
93
93
|
expect(content).toContain("Obsidian Integration");
|
|
94
94
|
expect(content).toContain("Personal Wiki");
|
|
95
95
|
expect(content).toContain("Company Wiki");
|
|
@@ -128,17 +128,28 @@ describe("package structure", () => {
|
|
|
128
128
|
expect(existsSync(join(t, "pages", "synthesis.md"))).toBe(true);
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
it("should have the extension
|
|
132
|
-
const extPath = join(rootDir, "extensions", "llm-wiki
|
|
131
|
+
it("should have the extension entry point", () => {
|
|
132
|
+
const extPath = join(rootDir, "extensions", "llm-wiki", "index.ts");
|
|
133
133
|
expect(existsSync(extPath)).toBe(true);
|
|
134
134
|
const content = readFile(extPath);
|
|
135
135
|
expect(content).toContain("ExtensionAPI");
|
|
136
|
-
expect(content).toContain("
|
|
136
|
+
expect(content).toContain("registerWikiBootstrap");
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("should have all custom tools in the extension", () => {
|
|
140
|
+
const toolsPath = join(rootDir, "extensions", "llm-wiki", "lib", "tools.ts");
|
|
141
|
+
expect(existsSync(toolsPath)).toBe(true);
|
|
142
|
+
const content = readFile(toolsPath);
|
|
137
143
|
const tools = [
|
|
144
|
+
"wiki_bootstrap",
|
|
145
|
+
"wiki_capture_source",
|
|
138
146
|
"wiki_ingest",
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
147
|
+
"wiki_ensure_page",
|
|
148
|
+
"wiki_search",
|
|
149
|
+
"wiki_lint",
|
|
150
|
+
"wiki_status",
|
|
151
|
+
"wiki_rebuild_meta",
|
|
152
|
+
"wiki_log_event",
|
|
142
153
|
"wiki_watch",
|
|
143
154
|
];
|
|
144
155
|
for (const tool of tools) {
|
|
@@ -152,8 +163,6 @@ describe("package structure", () => {
|
|
|
152
163
|
expect(readme).toContain("pi install npm:@zosmaai/pi-llm-wiki");
|
|
153
164
|
expect(readme).toContain("Karpathy");
|
|
154
165
|
expect(readme).toContain("Obsidian");
|
|
155
|
-
expect(readme).toContain("Personal Wiki");
|
|
156
|
-
expect(readme).toContain("Company Wiki");
|
|
157
166
|
});
|
|
158
167
|
});
|
|
159
168
|
|