@zosmaai/pi-llm-wiki 0.1.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 +44 -0
- package/.github/workflows/release.yml +76 -0
- package/README.md +356 -0
- package/assets/README.md +13 -0
- package/biome.json +27 -0
- package/extensions/llm-wiki-tools.ts +705 -0
- package/package.json +61 -0
- package/prompts/wiki-digest.md +23 -0
- package/prompts/wiki-discover.md +29 -0
- package/prompts/wiki-ingest.md +30 -0
- package/prompts/wiki-init.md +30 -0
- package/prompts/wiki-lint.md +29 -0
- package/prompts/wiki-query.md +32 -0
- package/prompts/wiki-run.md +35 -0
- package/prompts/wiki-status.md +33 -0
- package/skills/llm-wiki/SKILL.md +426 -0
- package/skills/llm-wiki/templates/DASHBOARD.md +50 -0
- package/skills/llm-wiki/templates/INDEX.md +33 -0
- package/skills/llm-wiki/templates/LOG.md +9 -0
- package/skills/llm-wiki/templates/config.yaml +38 -0
- package/skills/llm-wiki/templates/pages/concept.md +34 -0
- package/skills/llm-wiki/templates/pages/entity.md +31 -0
- package/skills/llm-wiki/templates/pages/source.md +45 -0
- package/skills/llm-wiki/templates/pages/synthesis.md +40 -0
- package/test/llm-wiki.test.ts +404 -0
- package/tsconfig.json +19 -0
- package/vitest.config.ts +16 -0
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zosmaai/pi-llm-wiki",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "LLM Wiki for Pi — self-maintaining knowledge base following Karpathy's pattern. Obsidian-friendly, auto-updating, personal & company wiki.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package",
|
|
7
|
+
"pi-skill",
|
|
8
|
+
"pi-extension",
|
|
9
|
+
"llm-wiki",
|
|
10
|
+
"karpathy",
|
|
11
|
+
"knowledge-base",
|
|
12
|
+
"obsidian",
|
|
13
|
+
"second-brain",
|
|
14
|
+
"wiki",
|
|
15
|
+
"zosmaai"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "zosmaai",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/zosmaai/pi-llm-wiki.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/zosmaai/pi-llm-wiki/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/zosmaai/pi-llm-wiki#readme",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "biome check .",
|
|
32
|
+
"lint:fix": "biome check --apply .",
|
|
33
|
+
"prepare": "node -e \"try { require('husky').install() } catch {}\""
|
|
34
|
+
},
|
|
35
|
+
"pi": {
|
|
36
|
+
"extensions": [
|
|
37
|
+
"./extensions"
|
|
38
|
+
],
|
|
39
|
+
"skills": [
|
|
40
|
+
"./skills"
|
|
41
|
+
],
|
|
42
|
+
"prompts": [
|
|
43
|
+
"./prompts"
|
|
44
|
+
],
|
|
45
|
+
"image": "https://raw.githubusercontent.com/zosmaai/pi-llm-wiki/main/assets/screenshot.png"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@mariozechner/pi-coding-agent": "*",
|
|
49
|
+
"typebox": "*"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=18"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@biomejs/biome": "^1.9.4",
|
|
56
|
+
"@mariozechner/pi-coding-agent": "^0.70.2",
|
|
57
|
+
"typebox": "^1.1.34",
|
|
58
|
+
"typescript": "^5.7.0",
|
|
59
|
+
"vitest": "^3.0.0"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate a daily or weekly digest of wiki changes — new sources, pages, insights, and gaps.
|
|
3
|
+
args: [--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
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
1. Read `wiki/LOG.md` — filter entries since last digest
|
|
15
|
+
2. Read pages created/updated in that period
|
|
16
|
+
3. Summarize:
|
|
17
|
+
- New sources ingested
|
|
18
|
+
- New pages created
|
|
19
|
+
- Key insights or connections
|
|
20
|
+
- Knowledge gaps identified
|
|
21
|
+
- Health trends
|
|
22
|
+
4. Save → `outputs/digest-YYYY-MM-DD.md`
|
|
23
|
+
5. Report concise digest
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Auto-discover new sources from the web. Searches based on config topics and known knowledge gaps.
|
|
3
|
+
args: [--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.
|
|
11
|
+
|
|
12
|
+
Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` first. Also read `config.yaml` for topics and feeds.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
1. Read `config.yaml` → extract topics, keywords, feeds
|
|
17
|
+
2. Read `.discoveries/gaps.json` → knowledge gaps to fill
|
|
18
|
+
3. Read `.discoveries/history.json` → already-fetched URLs
|
|
19
|
+
4. Search for new sources:
|
|
20
|
+
- Web search each topic + latest keywords
|
|
21
|
+
- Search for gaps from `.discoveries/gaps.json`
|
|
22
|
+
- If `--topic` specified, focus search on that topic
|
|
23
|
+
5. For each promising result:
|
|
24
|
+
a. Fetch full content
|
|
25
|
+
b. Save to `raw/articles/YYYY-MM-DD-slug.md` with frontmatter (title, url, discovered, topic)
|
|
26
|
+
6. Update `.discoveries/history.json`
|
|
27
|
+
7. Report: "Discovered [N] new sources. Run `/wiki:ingest` to process them."
|
|
28
|
+
|
|
29
|
+
**Rules:** Max 5-10 sources. Skip ads, listicles, duplicates. Prefer in-depth analysis.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Process new source files in raw/ and update the wiki. Creates summaries, entities, concepts, and cross-references.
|
|
3
|
+
args: [path]
|
|
4
|
+
section: LLM Wiki
|
|
5
|
+
topLevelCli: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wiki:ingest
|
|
9
|
+
|
|
10
|
+
Process new files in `raw/` and integrate them into the wiki.
|
|
11
|
+
|
|
12
|
+
Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` first to understand the full schema, page formats, and conventions.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
1. Read `config.yaml` and `.discoveries/history.json`
|
|
17
|
+
2. If a specific path is given (e.g., `/wiki:ingest raw/articles/my-file.md`), process just that file
|
|
18
|
+
3. If no path given, scan all files in `raw/` and find ones not in history
|
|
19
|
+
4. For each new source:
|
|
20
|
+
a. Read the full content
|
|
21
|
+
b. Briefly discuss with the user: "This is about [topic]. Key points: [summary]. Any specific emphasis?"
|
|
22
|
+
c. Create/update pages in `wiki/sources/`, `wiki/entities/`, `wiki/concepts/`
|
|
23
|
+
d. Add `[[wikilinks]]` cross-references between related pages
|
|
24
|
+
e. Flag any contradictions with existing wiki content
|
|
25
|
+
5. Update `wiki/INDEX.md` with all new/updated pages
|
|
26
|
+
6. Append to `wiki/LOG.md`
|
|
27
|
+
7. Update `.discoveries/history.json`
|
|
28
|
+
8. Report: "Ingested [N] sources → [M] pages created/updated. [X] contradictions flagged."
|
|
29
|
+
|
|
30
|
+
**Rules:** Never modify raw/ files. Never fabricate information. Always cite sources.
|
|
@@ -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
|
+
args: <topic> [--mode personal|company]
|
|
4
|
+
section: LLM Wiki
|
|
5
|
+
topLevelCli: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wiki:init
|
|
9
|
+
|
|
10
|
+
Initialize a new LLM Wiki in the current directory.
|
|
11
|
+
|
|
12
|
+
Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` (or wherever the skill is installed) first to understand the full schema and conventions.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
1. Ask the user for the wiki topic and mode (`personal` or `company`)
|
|
17
|
+
2. Create the directory structure:
|
|
18
|
+
- `raw/articles/`, `raw/papers/`, `raw/notes/`, `raw/assets/`
|
|
19
|
+
- `wiki/entities/`, `wiki/concepts/`, `wiki/sources/`, `wiki/syntheses/`, `wiki/changes/`
|
|
20
|
+
- `outputs/`
|
|
21
|
+
- `.discoveries/`
|
|
22
|
+
3. Create `config.yaml` with the topic, mode, and default settings
|
|
23
|
+
4. Create `wiki/INDEX.md` with section headings organized by page type
|
|
24
|
+
5. Create `wiki/LOG.md` with initial entry
|
|
25
|
+
6. Create `wiki/DASHBOARD.md` with Dataview queries for Obsidian
|
|
26
|
+
7. Create `.gitignore` to exclude `outputs/` from version control if desired
|
|
27
|
+
8. Initialize git repo if not already present
|
|
28
|
+
9. Report the structure and suggest first steps: "Drop sources into `raw/` and run `/wiki:ingest`"
|
|
29
|
+
|
|
30
|
+
If `--mode company`, add the `change_detection: true` flag to config.yaml and add a `wiki/decisions/` folder.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Health check the wiki. Detects contradictions, orphans, missing pages, stale claims, and knowledge gaps.
|
|
3
|
+
args: [--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
|
+
Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` first to understand the full schema and conventions.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
1. Scan all files in `wiki/`
|
|
17
|
+
2. Check for:
|
|
18
|
+
- **Contradictions:** Conflicting claims between pages
|
|
19
|
+
- **Orphans:** Pages with zero inbound `[[wikilinks]]`
|
|
20
|
+
- **Missing pages:** `[[links]]` pointing to non-existent files
|
|
21
|
+
- **Stale claims:** Info superseded by newer sources
|
|
22
|
+
- **Broken raw links:** References to `raw/` files that don't exist
|
|
23
|
+
- **Knowledge gaps:** Topics mentioned but lacking their own page
|
|
24
|
+
- **Quality:** Pages under 3 lines, pages with no sources or cross-refs
|
|
25
|
+
3. If `--fix` flag is present: auto-fix broken links, create missing pages for frequently-linked concepts, add cross-refs to orphans. Flag contradictions for human decision.
|
|
26
|
+
4. Save report → `outputs/lint-YYYY-MM-DD.md`
|
|
27
|
+
5. Update `.discoveries/gaps.json`
|
|
28
|
+
6. Append to `wiki/LOG.md`
|
|
29
|
+
7. Report key findings
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ask questions against the wiki. Synthesizes answers from wiki pages with cross-reference citations.
|
|
3
|
+
args: <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
|
+
Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` first to understand the full schema and conventions.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
1. Read `wiki/INDEX.md` to find pages relevant to the question
|
|
17
|
+
2. Read those pages in full (don't stop at 1-2 pages — get thorough context)
|
|
18
|
+
3. Synthesize an answer with `[[wikilink]]` citations to specific wiki pages
|
|
19
|
+
4. If the answer reveals a new connection or analysis, save it as a synthesis page in `wiki/syntheses/`
|
|
20
|
+
5. Append to `wiki/LOG.md`
|
|
21
|
+
|
|
22
|
+
**Rules:** Answer ONLY from wiki content, not from general knowledge. If the wiki lacks information, say so clearly and suggest what sources would help fill the gap.
|
|
23
|
+
|
|
24
|
+
**Example:**
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
/wiki:query What are the key differences between RAG and LLM Wiki?
|
|
28
|
+
→ Reads INDEX.md, finds pages on RAG and LLM Wiki patterns
|
|
29
|
+
→ Reads both pages
|
|
30
|
+
→ Synthesizes a comparison table with [[wikilink]] citations
|
|
31
|
+
→ Saves as wiki/syntheses/rag-vs-llm-wiki.md
|
|
32
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the full wiki cycle: discover → ingest → lint. Optionally schedule for auto-updates.
|
|
3
|
+
args: [--schedule daily|weekly]
|
|
4
|
+
section: LLM Wiki
|
|
5
|
+
topLevelCli: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wiki:run
|
|
9
|
+
|
|
10
|
+
Run the complete wiki maintenance cycle: discover new sources, ingest them, and lint for health.
|
|
11
|
+
|
|
12
|
+
Read the LLM Wiki skill at `.pi/skills/llm-wiki/SKILL.md` first.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
1. Run `/wiki:discover` → find new sources
|
|
17
|
+
2. Run `/wiki:ingest` → process all new files
|
|
18
|
+
3. Run `/wiki:lint` → health check
|
|
19
|
+
4. If critical gaps found → optionally one more discover+ingest cycle
|
|
20
|
+
5. Save summary → `outputs/run-YYYY-MM-DD.md`
|
|
21
|
+
6. Report final summary
|
|
22
|
+
|
|
23
|
+
### Scheduling
|
|
24
|
+
|
|
25
|
+
If `--schedule daily` is used, use `schedule_prompt` to set up daily runs:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
schedule_prompt action=add schedule="0 0 8 * * *" prompt="Run /wiki:run for the LLM Wiki"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If `--schedule weekly` is used:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
schedule_prompt action=add schedule="0 0 9 * * 1" prompt="Run /wiki:run for the LLM Wiki"
|
|
35
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show wiki health overview — source count, page stats, orphan count, last activity dates.
|
|
3
|
+
args: []
|
|
4
|
+
section: LLM Wiki
|
|
5
|
+
topLevelCli: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /wiki:status
|
|
9
|
+
|
|
10
|
+
Show a quick overview of wiki health and statistics.
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
1. Count sources in `raw/` (recursive)
|
|
15
|
+
2. Count pages in `wiki/` (by type: entities, concepts, sources, syntheses)
|
|
16
|
+
3. Check `wiki/LOG.md` for last ingest, lint, and discover dates
|
|
17
|
+
4. Check for orphan pages (zero inbound links)
|
|
18
|
+
5. Read `.discoveries/gaps.json` for known gaps
|
|
19
|
+
6. Report:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
📊 LLM Wiki Status
|
|
23
|
+
══════════════════
|
|
24
|
+
Wiki Root: [topic1], [topic2]
|
|
25
|
+
Mode: Personal | Company
|
|
26
|
+
Sources: [N] files
|
|
27
|
+
Wiki Pages: [N] total ([E] entities, [C] concepts, [S] sources, [Y] syntheses)
|
|
28
|
+
Last Ingest: YYYY-MM-DD
|
|
29
|
+
Last Lint: YYYY-MM-DD
|
|
30
|
+
Orphans: [N]
|
|
31
|
+
Knowledge Gaps: [N]
|
|
32
|
+
Health: ✅ Good | ⚠️ Warning | 🔴 Needs Attention
|
|
33
|
+
```
|