llm-wiki-kit 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/LICENSE +21 -0
- package/README.md +132 -0
- package/bin/llm-wiki.js +7 -0
- package/docs/concepts.md +29 -0
- package/docs/integrations/claude-code.md +48 -0
- package/docs/integrations/codex.md +45 -0
- package/docs/operations.md +137 -0
- package/docs/research/baseline.md +18 -0
- package/docs/security.md +27 -0
- package/docs/troubleshooting.md +101 -0
- package/examples/hook-fixtures/stop.json +6 -0
- package/examples/hook-fixtures/user-prompt-submit.json +7 -0
- package/examples/minimal-project/AGENTS.md +10 -0
- package/install.sh +5 -0
- package/package.json +27 -0
- package/src/cli.js +183 -0
- package/src/constants.js +69 -0
- package/src/doctor.js +89 -0
- package/src/fs-utils.js +173 -0
- package/src/hook.js +133 -0
- package/src/install.js +164 -0
- package/src/migrate.js +57 -0
- package/src/project-state.js +231 -0
- package/src/project.js +204 -0
- package/src/redaction.js +68 -0
- package/src/state.js +73 -0
- package/src/templates.js +31 -0
- package/src/update.js +133 -0
- package/src/version.js +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# llm-wiki-kit
|
|
2
|
+
|
|
3
|
+
`llm-wiki-kit` is a hook-first living wiki runtime for Claude Code and Codex.
|
|
4
|
+
|
|
5
|
+
The goal is not to make users run `ingest` or `record` commands. After install, normal Claude Code/Codex work should naturally become a project-local Markdown wiki under `llm-wiki/`.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
After the package is published to npm:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g llm-wiki-kit
|
|
13
|
+
llm-wiki install --workspace /apps --profile standard
|
|
14
|
+
llm-wiki doctor
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Restart Claude Code and Codex sessions after installation.
|
|
18
|
+
|
|
19
|
+
The default install mode is npm global install. On servers where the global npm prefix is root-owned, use sudo:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
sudo npm install -g llm-wiki-kit
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If sudo is not available, use a user-local npm prefix as a fallback:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm config set prefix "$HOME/.local"
|
|
29
|
+
npm install -g llm-wiki-kit
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For development or pre-publish server smoke tests, install from a local tarball instead:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm pack --pack-destination /tmp
|
|
36
|
+
npm install -g /tmp/llm-wiki-kit-<version>.tgz
|
|
37
|
+
llm-wiki install --workspace /apps --profile standard
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## What Gets Created
|
|
41
|
+
|
|
42
|
+
Each project gets a local wiki:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
llm-wiki/
|
|
46
|
+
├── .kit-state.json
|
|
47
|
+
├── raw/
|
|
48
|
+
├── wiki/
|
|
49
|
+
│ ├── index.md
|
|
50
|
+
│ ├── log.md
|
|
51
|
+
│ ├── sources/
|
|
52
|
+
│ ├── concepts/
|
|
53
|
+
│ ├── entities/
|
|
54
|
+
│ ├── decisions/
|
|
55
|
+
│ ├── architecture/
|
|
56
|
+
│ ├── debugging/
|
|
57
|
+
│ ├── context/
|
|
58
|
+
│ └── queries/
|
|
59
|
+
├── outputs/
|
|
60
|
+
└── procedures/
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`raw/` is the immutable or redacted evidence layer. `wiki/` is the LLM-maintained knowledge layer. `outputs/` stores live Q&A and requested reports. `.kit-state.json` records which runtime version last applied managed templates to the project.
|
|
64
|
+
|
|
65
|
+
## Normal Use
|
|
66
|
+
|
|
67
|
+
Use Claude Code or Codex normally.
|
|
68
|
+
|
|
69
|
+
The installed hooks:
|
|
70
|
+
|
|
71
|
+
- inject relevant wiki context at session start and prompt submit time
|
|
72
|
+
- record redacted turn summaries
|
|
73
|
+
- capture decision points, debugging findings, changed files, and verification notes
|
|
74
|
+
- update `llm-wiki/outputs/questions/YYYY-MM-DD-live-qa.md`
|
|
75
|
+
- promote useful answers into `llm-wiki/wiki/queries/`
|
|
76
|
+
- promote decision-like turns into `llm-wiki/wiki/decisions/`
|
|
77
|
+
|
|
78
|
+
If you need to think about saving every answer manually, the setup has failed.
|
|
79
|
+
|
|
80
|
+
## User-Facing Commands
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
llm-wiki install --workspace /path/to/project --profile standard
|
|
84
|
+
llm-wiki doctor
|
|
85
|
+
llm-wiki status --workspace /path/to/project
|
|
86
|
+
llm-wiki update --check --workspace /path/to/project
|
|
87
|
+
llm-wiki update --dry-run --workspace /path/to/project
|
|
88
|
+
llm-wiki update --workspace /path/to/project
|
|
89
|
+
llm-wiki uninstall
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`llm-wiki status` is an offline consistency check. It reports the installed runtime version, hook targets, and whether the current workspace has the current managed templates applied.
|
|
93
|
+
|
|
94
|
+
`llm-wiki update --check` is the online update check. It compares the installed package version with the npm registry without changing files.
|
|
95
|
+
|
|
96
|
+
`llm-wiki update` upgrades the global npm package, reinstalls the hook entries, and patches only managed project files such as the marked `AGENTS.md` policy block and generated `llm-wiki/AGENTS.md`/procedure files. Existing wiki content is not overwritten.
|
|
97
|
+
|
|
98
|
+
Real `update --check` and `update` require the package to exist in the npm registry. Before publication, use local tarball installs for smoke testing and fake npm in automated tests.
|
|
99
|
+
|
|
100
|
+
The hook subcommands are internal runtime targets:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
llm-wiki hook codex SessionStart
|
|
104
|
+
llm-wiki hook claude Stop
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Security Defaults
|
|
108
|
+
|
|
109
|
+
- Full raw transcript capture is disabled by default.
|
|
110
|
+
- `.env`, tokens, private keys, credentials, `raw_private/`, and `secrets/` are blocked or redacted.
|
|
111
|
+
- Hook payloads are stored only as redacted event envelopes.
|
|
112
|
+
- Store customer or personal data only after explicit sanitization.
|
|
113
|
+
|
|
114
|
+
## Development Notes
|
|
115
|
+
|
|
116
|
+
Source checkout installs are supported for development:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
git clone <your-git-url>/llm-wiki-kit.git /apps/llm-wiki-kit
|
|
120
|
+
cd /apps/llm-wiki-kit
|
|
121
|
+
./install.sh --workspace /apps --profile standard
|
|
122
|
+
node --test
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`llm-wiki update` intentionally refuses to self-update from a source checkout. Install the npm package or a tarball first when testing update behavior.
|
|
126
|
+
|
|
127
|
+
## Design Sources
|
|
128
|
+
|
|
129
|
+
- Kochim LLM Wiki implementation guide: `https://kochim.com/boards/posts/1779116400000_llm-wiki-implementation-guide-2026/`
|
|
130
|
+
- Local research baseline: `docs/research/baseline.md`
|
|
131
|
+
- Codex hooks and `AGENTS.md`
|
|
132
|
+
- Claude Code hooks and `CLAUDE.md`
|
package/bin/llm-wiki.js
ADDED
package/docs/concepts.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Concepts
|
|
2
|
+
|
|
3
|
+
`llm-wiki-kit` follows the LLM Wiki pattern:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
raw sources -> wiki -> schema/rules
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
- `raw/` is evidence. It is immutable unless a hook appends a redacted event envelope.
|
|
10
|
+
- `wiki/` is the living Markdown knowledge layer maintained by the agent.
|
|
11
|
+
- `AGENTS.md`, `CLAUDE.md`, and `procedures/` are the schema/rules layer.
|
|
12
|
+
- `.kit-state.json` records which managed rules/templates were applied by which runtime version.
|
|
13
|
+
|
|
14
|
+
The important behavior is a loop:
|
|
15
|
+
|
|
16
|
+
1. A Claude Code or Codex session starts.
|
|
17
|
+
2. Relevant wiki context is injected automatically.
|
|
18
|
+
3. The user works normally.
|
|
19
|
+
4. Hooks gather redacted prompt/tool/result summaries.
|
|
20
|
+
5. At stop/session end, useful knowledge is written back to Markdown.
|
|
21
|
+
6. Future sessions start from the improved wiki.
|
|
22
|
+
|
|
23
|
+
The kit is a template/runtime repository. It must not centralize project wiki contents.
|
|
24
|
+
|
|
25
|
+
Runtime updates and project knowledge are separate:
|
|
26
|
+
|
|
27
|
+
- npm updates replace the runtime package and hook targets.
|
|
28
|
+
- project patching updates only managed policy blocks and generated procedure files.
|
|
29
|
+
- curated wiki pages remain project-owned content and are not overwritten by runtime updates.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Claude Code Integration
|
|
2
|
+
|
|
3
|
+
`llm-wiki-kit` installs command hooks into `~/.claude/settings.json`.
|
|
4
|
+
|
|
5
|
+
The command target is:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
llm-wiki hook claude <EventName>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The installed hook stores the Node executable and the absolute package binary path. A system-wide npm install usually points at:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/usr/lib/node_modules/llm-wiki-kit/bin/llm-wiki.js
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
User-local fallback installs may instead point under `$HOME/.local/lib/node_modules`.
|
|
18
|
+
|
|
19
|
+
Handled events:
|
|
20
|
+
|
|
21
|
+
- `SessionStart`
|
|
22
|
+
- `InstructionsLoaded`
|
|
23
|
+
- `UserPromptSubmit`
|
|
24
|
+
- `PreToolUse`
|
|
25
|
+
- `PostToolUse`
|
|
26
|
+
- `PostToolBatch`
|
|
27
|
+
- `PreCompact`
|
|
28
|
+
- `PostCompact`
|
|
29
|
+
- `SubagentStop`
|
|
30
|
+
- `Stop`
|
|
31
|
+
- `SessionEnd`
|
|
32
|
+
|
|
33
|
+
Claude Code reads `CLAUDE.md`. For project compatibility, the kit creates a `CLAUDE.md` stub containing:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
@AGENTS.md
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
when no project `CLAUDE.md` exists. Existing `CLAUDE.md` files are not overwritten.
|
|
40
|
+
|
|
41
|
+
After installation or update, run:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
llm-wiki status --workspace /path/to/project
|
|
45
|
+
llm-wiki doctor
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Restart Claude Code so it reloads hook settings.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Codex Integration
|
|
2
|
+
|
|
3
|
+
`llm-wiki-kit` installs command hooks into the Codex hook configuration, usually `~/.codex/hooks.json`.
|
|
4
|
+
|
|
5
|
+
The command target is:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
llm-wiki hook codex <EventName>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The installed hook stores the Node executable and the absolute package binary path. A system-wide npm install usually points at:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/usr/lib/node_modules/llm-wiki-kit/bin/llm-wiki.js
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
User-local fallback installs may instead point under `$HOME/.local/lib/node_modules`.
|
|
18
|
+
|
|
19
|
+
Handled events:
|
|
20
|
+
|
|
21
|
+
- `SessionStart`
|
|
22
|
+
- `UserPromptSubmit`
|
|
23
|
+
- `PreToolUse`
|
|
24
|
+
- `PostToolUse`
|
|
25
|
+
- `PreCompact`
|
|
26
|
+
- `PostCompact`
|
|
27
|
+
- `SubagentStop`
|
|
28
|
+
- `Stop`
|
|
29
|
+
|
|
30
|
+
Expected behavior:
|
|
31
|
+
|
|
32
|
+
- `SessionStart` injects `llm-wiki/wiki/index.md`, recent log context, and operating rules.
|
|
33
|
+
- `UserPromptSubmit` searches project wiki pages and injects the smallest useful context set.
|
|
34
|
+
- `PreToolUse` blocks secret-looking paths or payloads.
|
|
35
|
+
- `PostToolUse` records redacted tool summaries in a turn buffer.
|
|
36
|
+
- `Stop` writes live Q&A and durable wiki pages.
|
|
37
|
+
|
|
38
|
+
Run these after install:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
llm-wiki status --workspace /path/to/project
|
|
42
|
+
llm-wiki doctor
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If Codex reports untrusted hooks, trust the hook through Codex's own trust flow or run a trusted automation profile that explicitly accepts the hook source. Restart Codex after hook installation or update.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Operations
|
|
2
|
+
|
|
3
|
+
## Profiles
|
|
4
|
+
|
|
5
|
+
`standard` is the default:
|
|
6
|
+
|
|
7
|
+
- inject context
|
|
8
|
+
- record redacted summaries
|
|
9
|
+
- block secret-looking tool access
|
|
10
|
+
- write live Q&A and wiki pages
|
|
11
|
+
|
|
12
|
+
`strict` is reserved for future stronger enforcement:
|
|
13
|
+
|
|
14
|
+
- fail closed when hooks are disabled
|
|
15
|
+
- require successful stop/session-end recording
|
|
16
|
+
- block raw/wiki boundary violations more aggressively
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
Published npm package:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g llm-wiki-kit
|
|
24
|
+
llm-wiki install --workspace /apps --profile standard
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The default install mode is npm global install. On servers where the global npm prefix is root-owned, use sudo:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
sudo npm install -g llm-wiki-kit
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If sudo is not available, configure a user-local prefix as a fallback:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm config set prefix "$HOME/.local"
|
|
37
|
+
npm install -g llm-wiki-kit
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Avoid mixing root-owned and user-local installs unless you intentionally choose which `llm-wiki` appears first on `PATH`.
|
|
41
|
+
|
|
42
|
+
The installer:
|
|
43
|
+
|
|
44
|
+
- creates `~/.local/bin/llm-wiki`
|
|
45
|
+
- backs up existing Codex/Claude settings before editing
|
|
46
|
+
- merges hook entries without removing existing hooks
|
|
47
|
+
- bootstraps the workspace `llm-wiki/`
|
|
48
|
+
- records managed template state in `llm-wiki/.kit-state.json`
|
|
49
|
+
|
|
50
|
+
Source checkout installs are still useful for development:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
./install.sh --workspace /apps --profile standard
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Pre-publish server smoke tests can use a local tarball:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm pack --pack-destination /tmp
|
|
60
|
+
npm install -g /tmp/llm-wiki-kit-<version>.tgz
|
|
61
|
+
llm-wiki install --workspace /apps --profile standard
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Do not delete a project `llm-wiki/` tree to reinstall the runtime. `llm-wiki uninstall` removes hook entries only; project knowledge is intentionally left intact.
|
|
65
|
+
|
|
66
|
+
## Status And Updates
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
llm-wiki status --workspace /path/to/project
|
|
70
|
+
llm-wiki update --check --workspace /path/to/project
|
|
71
|
+
llm-wiki update --dry-run --workspace /path/to/project
|
|
72
|
+
llm-wiki update --workspace /path/to/project
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`status` is offline and answers whether the local installation is internally consistent:
|
|
76
|
+
|
|
77
|
+
- runtime version and install source
|
|
78
|
+
- Codex/Claude hook entries pointing at the current runtime
|
|
79
|
+
- project template state from `llm-wiki/.kit-state.json`
|
|
80
|
+
- current managed file hashes
|
|
81
|
+
|
|
82
|
+
`update --check` is online and asks npm whether a newer package version exists.
|
|
83
|
+
|
|
84
|
+
`update` applies changes explicitly only when the user runs it:
|
|
85
|
+
|
|
86
|
+
- runs `npm install -g llm-wiki-kit@<target>`
|
|
87
|
+
- restarts into the updated binary for `post-update`
|
|
88
|
+
- reinstalls hook entries without duplicating them
|
|
89
|
+
- patches only managed project files
|
|
90
|
+
- backs up changed files under `~/.local/share/llm-wiki-kit/backups/`
|
|
91
|
+
|
|
92
|
+
Managed project files are conservative:
|
|
93
|
+
|
|
94
|
+
- root `AGENTS.md` is patched only inside the `llm-wiki-kit` marker block
|
|
95
|
+
- `llm-wiki/AGENTS.md` is replaced only when it is generated by the kit
|
|
96
|
+
- generated procedures are replaced only when their recorded hash still matches or their content is a known generated template
|
|
97
|
+
- `llm-wiki/wiki/index.md` and existing wiki pages are not overwritten
|
|
98
|
+
|
|
99
|
+
Real registry checks require `llm-wiki-kit` to be published to npm. Before publication, `llm-wiki update --check` returns npm 404. Use fake npm in tests or local tarball install for server smoke checks.
|
|
100
|
+
|
|
101
|
+
## Release Checklist
|
|
102
|
+
|
|
103
|
+
Before publishing:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
node --test
|
|
107
|
+
npm pack --dry-run
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Check that the tarball includes `bin/`, `src/`, `docs/`, `examples/`, `README.md`, `LICENSE`, `install.sh`, and `package.json`, but does not include project-local `llm-wiki/` contents.
|
|
111
|
+
|
|
112
|
+
After publishing:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm view llm-wiki-kit version
|
|
116
|
+
npm install -g llm-wiki-kit
|
|
117
|
+
llm-wiki install --workspace /apps --profile standard
|
|
118
|
+
llm-wiki status --workspace /apps
|
|
119
|
+
llm-wiki doctor
|
|
120
|
+
llm-wiki update --check --workspace /apps
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Uninstall
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
llm-wiki uninstall
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Only hook entries pointing at this kit are removed. Project wiki contents are left intact.
|
|
130
|
+
|
|
131
|
+
## Migration
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
llm-wiki migrate --workspace /path/to/project
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Migration is copy-only. Existing `omx_wiki/*.md` files are copied into `llm-wiki/wiki/context/`; originals are preserved.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Research Baseline
|
|
2
|
+
|
|
3
|
+
The implementation baseline is:
|
|
4
|
+
|
|
5
|
+
- Kochim LLM Wiki implementation guide: `https://kochim.com/boards/posts/1779116400000_llm-wiki-implementation-guide-2026/`
|
|
6
|
+
- `/apps/deep-research-report.md`
|
|
7
|
+
|
|
8
|
+
Important conclusions:
|
|
9
|
+
|
|
10
|
+
- The durable pattern is `raw sources -> wiki -> schema`.
|
|
11
|
+
- `raw/` and `wiki/` must not be mixed.
|
|
12
|
+
- `index.md` should be a small navigation surface.
|
|
13
|
+
- `log.md` should be append-only.
|
|
14
|
+
- Good answers should be written back into the wiki instead of remaining in chat history.
|
|
15
|
+
- Duplicate and stale pages are major failure modes.
|
|
16
|
+
- Full automation without human review is risky for large imports or high-stakes decisions.
|
|
17
|
+
- Obsidian, Graphify, MCP, and RAG can be useful extensions, but v1 must work with plain Markdown and hooks.
|
|
18
|
+
|
package/docs/security.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
The default policy is conservative.
|
|
4
|
+
|
|
5
|
+
Do not store:
|
|
6
|
+
|
|
7
|
+
- credentials
|
|
8
|
+
- tokens
|
|
9
|
+
- private keys
|
|
10
|
+
- `.env` contents
|
|
11
|
+
- customer identifiers
|
|
12
|
+
- personal data
|
|
13
|
+
- contracts, invoices, or financial details
|
|
14
|
+
- private raw transcripts unless the project explicitly opts in
|
|
15
|
+
|
|
16
|
+
The runtime redacts common secret patterns and blocks secret-looking tool paths such as:
|
|
17
|
+
|
|
18
|
+
- `.env`
|
|
19
|
+
- `*.pem`
|
|
20
|
+
- `*.key`
|
|
21
|
+
- `id_rsa`
|
|
22
|
+
- `secrets/`
|
|
23
|
+
- `credentials/`
|
|
24
|
+
- `raw_private/`
|
|
25
|
+
|
|
26
|
+
Full transcript capture is intentionally not implemented as a default. If a project needs it, add a project-local policy and a redaction path first.
|
|
27
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
## Hooks Do Not Run
|
|
4
|
+
|
|
5
|
+
Run:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
llm-wiki doctor
|
|
9
|
+
llm-wiki status
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Then restart Claude Code or Codex.
|
|
13
|
+
|
|
14
|
+
## Is An Update Available?
|
|
15
|
+
|
|
16
|
+
Use the offline check first:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
llm-wiki status --workspace /path/to/project
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If the runtime and project state are consistent but you want to know whether npm has a newer release:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
llm-wiki update --check --workspace /path/to/project
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`status` does not contact the network. `update --check` contacts npm but does not change files.
|
|
29
|
+
|
|
30
|
+
## npm Says The Package Is Not Found
|
|
31
|
+
|
|
32
|
+
If `llm-wiki update --check` returns npm 404, the package is not published to the registry being used. Until publish, test npm installation with a local tarball:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm pack --pack-destination /tmp
|
|
36
|
+
npm install -g /tmp/llm-wiki-kit-<version>.tgz
|
|
37
|
+
llm-wiki install --workspace /path/to/project --profile standard
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Real registry-based update checks will work only after `npm view llm-wiki-kit version` succeeds.
|
|
41
|
+
|
|
42
|
+
## npm install -g Fails With EACCES
|
|
43
|
+
|
|
44
|
+
If npm tries to write under `/usr` and fails with `EACCES`, use sudo when the server policy allows system-wide global packages:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
sudo npm install -g llm-wiki-kit
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If sudo is not available, set a user-local prefix:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm config set prefix "$HOME/.local"
|
|
54
|
+
npm install -g llm-wiki-kit
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Make sure `$HOME/.local/bin` is on `PATH`, then confirm:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
command -v llm-wiki
|
|
61
|
+
llm-wiki status --workspace /path/to/project
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Avoid mixing root-owned and user-local installs unless you intentionally choose which `llm-wiki` appears first on `PATH`.
|
|
65
|
+
|
|
66
|
+
## Update Fails From A Source Checkout
|
|
67
|
+
|
|
68
|
+
`llm-wiki update` is designed for global npm installs. If the command says it cannot self-update from a source checkout, install the package first:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install -g llm-wiki-kit
|
|
72
|
+
llm-wiki update --workspace /path/to/project
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
For pre-publish testing, use `npm pack` and install the generated tarball globally.
|
|
76
|
+
|
|
77
|
+
## Codex Says The Hook Is Untrusted
|
|
78
|
+
|
|
79
|
+
Use Codex's hook trust flow or run in a trusted automation profile. `llm-wiki-kit` does not silently bypass Codex trust.
|
|
80
|
+
|
|
81
|
+
## Claude Code Does Not Load Context
|
|
82
|
+
|
|
83
|
+
Check:
|
|
84
|
+
|
|
85
|
+
- `~/.claude/settings.json` contains a hook command pointing at the installed `llm-wiki-kit/bin/llm-wiki.js`
|
|
86
|
+
- project `CLAUDE.md` exists or imports `@AGENTS.md`
|
|
87
|
+
- the session was restarted after install
|
|
88
|
+
|
|
89
|
+
## A Secret Was Detected
|
|
90
|
+
|
|
91
|
+
The hook blocks or redacts secret-like content. Move sensitive material out of the project wiki path and use sanitized source notes.
|
|
92
|
+
|
|
93
|
+
## Duplicate Pages Appear
|
|
94
|
+
|
|
95
|
+
Run a manual review:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
rg -n "title:|aliases:|source_ids:" llm-wiki/wiki
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Prefer merging duplicates into existing pages and preserving contradictions in an `Open Questions` section.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Minimal Project Instructions
|
|
2
|
+
|
|
3
|
+
This project uses `llm-wiki-kit`.
|
|
4
|
+
|
|
5
|
+
- Start from `llm-wiki/wiki/index.md`.
|
|
6
|
+
- Keep raw source material immutable.
|
|
7
|
+
- Update existing wiki pages before creating duplicates.
|
|
8
|
+
- Store useful answers in `llm-wiki/wiki/queries/`.
|
|
9
|
+
- Do not store secrets or private data.
|
|
10
|
+
|
package/install.sh
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "llm-wiki-kit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Hook-first living LLM Wiki runtime for Codex and Claude Code.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"bin/",
|
|
8
|
+
"src/",
|
|
9
|
+
"docs/",
|
|
10
|
+
"examples/",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"install.sh"
|
|
14
|
+
],
|
|
15
|
+
"bin": {
|
|
16
|
+
"llm-wiki": "bin/llm-wiki.js"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "node --test",
|
|
20
|
+
"doctor": "node bin/llm-wiki.js doctor",
|
|
21
|
+
"status": "node bin/llm-wiki.js status"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=20"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT"
|
|
27
|
+
}
|