llm-wikis 0.1.0 → 0.2.1
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/publish.yml +32 -0
- package/package.json +2 -1
- package/scripts/wiki-scan.js +1 -1
- package/scripts/wikis.js +65 -0
- package/skill/SKILL.md +43 -43
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: '20'
|
|
19
|
+
registry-url: 'https://registry.npmjs.org'
|
|
20
|
+
|
|
21
|
+
- name: Verify tag matches package version
|
|
22
|
+
run: |
|
|
23
|
+
PKG_VERSION="v$(node -p "require('./package.json').version")"
|
|
24
|
+
TAG_VERSION="${GITHUB_REF_NAME}"
|
|
25
|
+
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
|
|
26
|
+
echo "Tag $TAG_VERSION does not match package version $PKG_VERSION"
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
- run: npm publish
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "llm-wikis",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Multi-wiki sync observability for the Karpathy LLM Wiki pattern",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
|
+
"wikis": "scripts/wikis.js",
|
|
7
8
|
"wiki-scan": "scripts/wiki-scan.js",
|
|
8
9
|
"wiki-ingest-record": "scripts/wiki-ingest-record.js",
|
|
9
10
|
"wiki-status-html": "scripts/wiki-status-html.js"
|
package/scripts/wiki-scan.js
CHANGED
package/scripts/wikis.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { execFileSync } = require('child_process');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
const VERSION = '0.2.1';
|
|
8
|
+
|
|
9
|
+
const HELP = `
|
|
10
|
+
llm-wikis v${VERSION}
|
|
11
|
+
|
|
12
|
+
Usage: wikis <command> [args]
|
|
13
|
+
|
|
14
|
+
Commands:
|
|
15
|
+
wikis scan --list <project-root> List all wikis in a project
|
|
16
|
+
wikis scan --status <wiki-path> Show sync status for a wiki
|
|
17
|
+
wikis record <wiki-path> ... Record an ingestion in the manifest
|
|
18
|
+
wikis report <wiki-path> <out.html> Generate HTML status report
|
|
19
|
+
|
|
20
|
+
Slash commands (Claude Code / Gemini CLI / Codex):
|
|
21
|
+
/wikis init <name> Create a new wiki
|
|
22
|
+
/wikis use <name> Set the active wiki
|
|
23
|
+
/wikis list List all wikis
|
|
24
|
+
/wikis status Show sync status
|
|
25
|
+
/wikis ingest [--defer] Ingest unsynced files
|
|
26
|
+
/wikis trace <file> Show file provenance
|
|
27
|
+
/wikis report Generate HTML report
|
|
28
|
+
/wikis recover manifest Restore manifest from backup
|
|
29
|
+
/wikis rebuild-manifest Re-derive manifest from disk
|
|
30
|
+
/wikis recover schema Reset WIKI.md to default template
|
|
31
|
+
|
|
32
|
+
Install the Claude Code skill:
|
|
33
|
+
npm install -g llm-wikis (skill auto-installs to ~/.claude/skills/wikis/)
|
|
34
|
+
`.trim();
|
|
35
|
+
|
|
36
|
+
const [,, cmd, ...args] = process.argv;
|
|
37
|
+
|
|
38
|
+
if (!cmd || cmd === '--help' || cmd === '-h') {
|
|
39
|
+
console.log(HELP);
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (cmd === '--version' || cmd === '-v') {
|
|
44
|
+
console.log(VERSION);
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const scriptsDir = path.join(__dirname);
|
|
49
|
+
|
|
50
|
+
const dispatch = {
|
|
51
|
+
scan: 'wiki-scan.js',
|
|
52
|
+
record: 'wiki-ingest-record.js',
|
|
53
|
+
report: 'wiki-status-html.js',
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (dispatch[cmd]) {
|
|
57
|
+
try {
|
|
58
|
+
execFileSync(process.execPath, [path.join(scriptsDir, dispatch[cmd]), ...args], { stdio: 'inherit' });
|
|
59
|
+
} catch (e) {
|
|
60
|
+
process.exit(e.status ?? 1);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
console.error(`Unknown command: ${cmd}\nRun "wikis --help" for usage.`);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
package/skill/SKILL.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: wikis
|
|
3
3
|
description: >
|
|
4
4
|
Multi-wiki sync layer for the Karpathy LLM Wiki pattern. Manages multiple independent
|
|
5
5
|
named wikis per project with sync observability, rename detection, and deferred ingestion.
|
|
6
|
-
Use when user types /
|
|
6
|
+
Use when user types /wikis followed by a subcommand: init, use, list, status, ingest,
|
|
7
7
|
trace, report, recover, rebuild-manifest.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Wiki Skill
|
|
11
11
|
|
|
12
|
-
You are the `/
|
|
12
|
+
You are the `/wikis` command handler. Parse the first argument to determine the subcommand, then follow the instructions for that subcommand exactly.
|
|
13
13
|
|
|
14
14
|
**Active wiki**: read from `.wiki-context` in the project root (the current working directory). Commands that require an active wiki must fail with this message if `.wiki-context` is missing or the named wiki no longer exists:
|
|
15
|
-
> No active wiki. Run `/
|
|
15
|
+
> No active wiki. Run `/wikis use <name>` or `/wikis list` to see available wikis.
|
|
16
16
|
|
|
17
17
|
See [MANIFEST-FORMAT.md](MANIFEST-FORMAT.md) for the manifest schema.
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
## `/
|
|
21
|
+
## `/wikis init <name>`
|
|
22
22
|
|
|
23
|
-
1. If `<name>` is not provided: print `"Usage: /
|
|
24
|
-
2. If `wikis/<name>/` already exists: print `"Wiki '<name>' already exists. Use /
|
|
23
|
+
1. If `<name>` is not provided: print `"Usage: /wikis init <name>"` and stop.
|
|
24
|
+
2. If `wikis/<name>/` already exists: print `"Wiki '<name>' already exists. Use /wikis use <name> to activate it."` and stop.
|
|
25
25
|
3. Create directories: `wikis/<name>/raw/` and `wikis/<name>/wiki/`
|
|
26
26
|
4. Write `wikis/<name>/WIKI.md` using the content from [WIKI-TEMPLATE.md](WIKI-TEMPLATE.md), replacing `{{WIKI_NAME}}` with the actual name.
|
|
27
27
|
5. Write `wikis/<name>/.wiki-manifest.json`:
|
|
@@ -40,20 +40,20 @@ See [MANIFEST-FORMAT.md](MANIFEST-FORMAT.md) for the manifest schema.
|
|
|
40
40
|
|
|
41
41
|
Next steps:
|
|
42
42
|
1. Add source files to wikis/<name>/raw/
|
|
43
|
-
2. Run /
|
|
44
|
-
3. Run /
|
|
45
|
-
4. Run /
|
|
43
|
+
2. Run /wikis use <name> to activate this wiki
|
|
44
|
+
3. Run /wikis status to see what needs ingesting
|
|
45
|
+
4. Run /wikis ingest to compile your first wiki pages
|
|
46
46
|
|
|
47
47
|
Tip: git add wikis/<name>/ && git commit -m "Add <name> wiki"
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
|
|
52
|
-
## `/
|
|
52
|
+
## `/wikis list`
|
|
53
53
|
|
|
54
54
|
1. Run: `wiki-scan --list .`
|
|
55
55
|
2. Parse the JSON array output.
|
|
56
|
-
3. If the array is empty: print `"No wikis found. Run /
|
|
56
|
+
3. If the array is empty: print `"No wikis found. Run /wikis use <name> to create one."` and stop.
|
|
57
57
|
4. For each wiki entry, print one line:
|
|
58
58
|
```
|
|
59
59
|
<name> (0 unsynced, 0 integrity warnings)
|
|
@@ -63,16 +63,16 @@ See [MANIFEST-FORMAT.md](MANIFEST-FORMAT.md) for the manifest schema.
|
|
|
63
63
|
|
|
64
64
|
---
|
|
65
65
|
|
|
66
|
-
## `/
|
|
66
|
+
## `/wikis use <name>`
|
|
67
67
|
|
|
68
|
-
1. If `<name>` is not provided: print `"Usage: /
|
|
69
|
-
2. Check that `wikis/<name>/.wiki-manifest.json` exists. If not: print `"Wiki '<name>' not found. Run /
|
|
68
|
+
1. If `<name>` is not provided: print `"Usage: /wikis use <name>"` and stop.
|
|
69
|
+
2. Check that `wikis/<name>/.wiki-manifest.json` exists. If not: print `"Wiki '<name>' not found. Run /wikis list to see available wikis."` and stop.
|
|
70
70
|
3. Write `<name>` to `.wiki-context` (overwrite if exists). The file should contain only the wiki name, no trailing whitespace.
|
|
71
71
|
4. Print: `"Active wiki set to: <name>"`
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
|
75
|
-
## `/
|
|
75
|
+
## `/wikis status`
|
|
76
76
|
|
|
77
77
|
### No active wiki (`.wiki-context` missing or empty)
|
|
78
78
|
Run `wiki-scan --list .` and print a project-wide summary:
|
|
@@ -82,7 +82,7 @@ Wikis in this project:
|
|
|
82
82
|
auditor 0 unsynced
|
|
83
83
|
developer 2 unsynced
|
|
84
84
|
|
|
85
|
-
Run /
|
|
85
|
+
Run /wikis use <name> to activate a wiki and see detailed status.
|
|
86
86
|
```
|
|
87
87
|
Count "unsynced" as entries in `raw_to_wiki` where `ingested` is null and `deferred` is false, plus any added/modified files visible in the manifest's stored state.
|
|
88
88
|
|
|
@@ -110,7 +110,7 @@ Count "unsynced" as entries in `raw_to_wiki` where `ingested` is null and `defer
|
|
|
110
110
|
|
|
111
111
|
---
|
|
112
112
|
|
|
113
|
-
## `/
|
|
113
|
+
## `/wikis ingest [--defer]`
|
|
114
114
|
|
|
115
115
|
Requires active wiki. Read `.wiki-context` for `<name>`.
|
|
116
116
|
|
|
@@ -118,12 +118,12 @@ Requires active wiki. Read `.wiki-context` for `<name>`.
|
|
|
118
118
|
|
|
119
119
|
1. Run: `wiki-scan --status wikis/<name>`
|
|
120
120
|
2. Collect all files in `added` and `modified` from the scan output.
|
|
121
|
-
3. If none: print `"Nothing to defer. Run /
|
|
121
|
+
3. If none: print `"Nothing to defer. Run /wikis status to check."` and stop.
|
|
122
122
|
4. For each file, run: `wiki-ingest-record wikis/<name> --defer <file>`
|
|
123
123
|
5. Print:
|
|
124
124
|
```
|
|
125
125
|
Deferred N file(s). No tokens consumed.
|
|
126
|
-
Run /
|
|
126
|
+
Run /wikis ingest (without --defer) when ready to process them.
|
|
127
127
|
```
|
|
128
128
|
6. **Zero LLM calls** — this entire command is pure script execution. Do not read or process any raw files.
|
|
129
129
|
|
|
@@ -155,7 +155,7 @@ Requires active wiki. Read `.wiki-context` for `<name>`.
|
|
|
155
155
|
```
|
|
156
156
|
e. Run: `wiki-ingest-record wikis/<name> <raw-file> <wiki-page>`
|
|
157
157
|
f. Print: `✓ <raw-file> → <wiki-page>`
|
|
158
|
-
8. Print: `"Ingested N file(s). Run /
|
|
158
|
+
8. Print: `"Ingested N file(s). Run /wikis status to verify."`
|
|
159
159
|
|
|
160
160
|
### Wiki Integrity Resolution
|
|
161
161
|
|
|
@@ -169,7 +169,7 @@ When `wiki-scan --status` returns entries in `wiki_integrity`:
|
|
|
169
169
|
|
|
170
170
|
---
|
|
171
171
|
|
|
172
|
-
## `/
|
|
172
|
+
## `/wikis trace <file>`
|
|
173
173
|
|
|
174
174
|
Requires active wiki.
|
|
175
175
|
|
|
@@ -213,23 +213,23 @@ Use `—` for null/missing values. Format timestamps as `YYYY-MM-DD HH:MM:SS UTC
|
|
|
213
213
|
|
|
214
214
|
---
|
|
215
215
|
|
|
216
|
-
## `/
|
|
216
|
+
## `/wikis report`
|
|
217
217
|
|
|
218
218
|
Requires active wiki.
|
|
219
219
|
|
|
220
220
|
1. Read `.wiki-context` for `<name>`.
|
|
221
221
|
2. Run: `wiki-scan --status wikis/<name>`
|
|
222
|
-
3. Write the scan JSON output to a temp file at `/tmp/
|
|
223
|
-
4. Run: `wiki-status-html wikis/<name> /tmp/
|
|
222
|
+
3. Write the scan JSON output to a temp file at `/tmp/wikis-scan-<name>.json`
|
|
223
|
+
4. Run: `wiki-status-html wikis/<name> /tmp/wikis-report-<name>.html --scan-json /tmp/wikis-scan-<name>.json`
|
|
224
224
|
5. Open the HTML file in the default browser:
|
|
225
|
-
- Linux: `xdg-open /tmp/
|
|
226
|
-
- macOS: `open /tmp/
|
|
227
|
-
- If `open`/`xdg-open` fails: print the path instead: `"Report generated: /tmp/
|
|
228
|
-
6. Print: `"Report generated: /tmp/
|
|
225
|
+
- Linux: `xdg-open /tmp/wikis-report-<name>.html`
|
|
226
|
+
- macOS: `open /tmp/wikis-report-<name>.html`
|
|
227
|
+
- If `open`/`xdg-open` fails: print the path instead: `"Report generated: /tmp/wikis-report-<name>.html"`
|
|
228
|
+
6. Print: `"Report generated: /tmp/wikis-report-<name>.html"`
|
|
229
229
|
|
|
230
230
|
---
|
|
231
231
|
|
|
232
|
-
## `/
|
|
232
|
+
## `/wikis recover manifest`
|
|
233
233
|
|
|
234
234
|
Requires active wiki.
|
|
235
235
|
|
|
@@ -249,7 +249,7 @@ Requires active wiki.
|
|
|
249
249
|
|
|
250
250
|
---
|
|
251
251
|
|
|
252
|
-
## `/
|
|
252
|
+
## `/wikis rebuild-manifest`
|
|
253
253
|
|
|
254
254
|
Requires active wiki.
|
|
255
255
|
|
|
@@ -275,12 +275,12 @@ Requires active wiki.
|
|
|
275
275
|
N raw files, M wiki files found.
|
|
276
276
|
All wiki provenance marked as unknown.
|
|
277
277
|
|
|
278
|
-
Run /
|
|
278
|
+
Run /wikis ingest to re-establish source→page links.
|
|
279
279
|
```
|
|
280
280
|
|
|
281
281
|
---
|
|
282
282
|
|
|
283
|
-
## `/
|
|
283
|
+
## `/wikis recover schema`
|
|
284
284
|
|
|
285
285
|
Requires active wiki.
|
|
286
286
|
|
|
@@ -305,14 +305,14 @@ Requires active wiki.
|
|
|
305
305
|
Print:
|
|
306
306
|
```
|
|
307
307
|
Unknown subcommand. Available commands:
|
|
308
|
-
/
|
|
309
|
-
/
|
|
310
|
-
/
|
|
311
|
-
/
|
|
312
|
-
/
|
|
313
|
-
/
|
|
314
|
-
/
|
|
315
|
-
/
|
|
316
|
-
/
|
|
317
|
-
/
|
|
308
|
+
/wikis init <name> Create a new wiki
|
|
309
|
+
/wikis use <name> Set the active wiki
|
|
310
|
+
/wikis list List all wikis
|
|
311
|
+
/wikis status Show sync status
|
|
312
|
+
/wikis ingest [--defer] Ingest unsynced files
|
|
313
|
+
/wikis trace <file> Show file provenance
|
|
314
|
+
/wikis report Generate HTML report
|
|
315
|
+
/wikis recover manifest Restore manifest from backup
|
|
316
|
+
/wikis rebuild-manifest Re-derive manifest from disk
|
|
317
|
+
/wikis recover schema Reset WIKI.md to default template
|
|
318
318
|
```
|