llm-wiki-kit 0.2.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/README.md CHANGED
@@ -92,9 +92,12 @@ Most users should not need these during daily Claude Code/Codex work. They exist
92
92
 
93
93
  - Install/update: `llm-wiki install`, `llm-wiki update`, `llm-wiki post-update`, `llm-wiki projects`
94
94
  - Diagnostics: `llm-wiki doctor`, `llm-wiki status`, `llm-wiki version`
95
+ - Manual: `llm-wiki manual`
95
96
  - Agent maintenance helpers: `llm-wiki context`, `llm-wiki lint`, `llm-wiki consolidate`, `llm-wiki maintenance`
96
97
  - Cleanup: `llm-wiki uninstall`
97
98
 
99
+ `llm-wiki manual` prints the full package manual from `docs/manual.md`. Keep that document current when adding public commands, options, hook behavior, directory conventions, security policy, or update flows.
100
+
98
101
  `llm-wiki status` is an offline consistency check. It reports the installed runtime version, hook targets, whether the `llm-wiki` command on `PATH` resolves to the current runtime, whether the current workspace has the current managed templates applied, how many rules are auto-updateable, how many managed-looking rules need agent cleanup, and how many wiki maintenance items are pending.
99
102
 
100
103
  `llm-wiki update --check [--to <version-or-tag>]` is the online update check. It compares the installed package version with the npm registry target without changing files, and reports an available update only when the target version is newer than the installed version.
package/docs/manual.md ADDED
@@ -0,0 +1,461 @@
1
+ # llm-wiki-kit Manual
2
+
3
+ `llm-wiki-kit`은 Codex와 Claude Code를 평소처럼 사용하는 동안 프로젝트 안에 living Markdown wiki를 유지하는 hook-first runtime이다.
4
+
5
+ 핵심 원칙은 단순하다. 사용자는 별도 기록 명령을 외워서 매번 실행하지 않는다. 평소처럼 질문하고, 구현하고, 검증한다. 내부적으로는 hook이 필요한 context를 주입하고, 안전하게 요약을 남기고, 오래 쓸 지식을 agent가 `llm-wiki/` Markdown에 정리할 수 있도록 돕는다.
6
+
7
+ ## Mental Model
8
+
9
+ LLM Wiki는 세 층으로 움직인다.
10
+
11
+ ```text
12
+ raw evidence -> curated wiki -> rules and retrieval
13
+ ```
14
+
15
+ - `raw/`: 원본 또는 redacted 근거 저장소다. 기본 hook은 작은 redacted event envelope만 저장한다.
16
+ - `wiki/`: agent가 관리하는 정식 지식층이다. 결정, 구조, 디버깅, 개념, 절차, 맥락을 Markdown으로 보존한다.
17
+ - `outputs/`: live Q&A, 보고서, maintenance queue 같은 일회성 또는 작업 산출물을 둔다.
18
+ - `AGENTS.md`, `CLAUDE.md`, `procedures/`: agent가 wiki를 다루는 규칙과 절차다.
19
+
20
+ 채팅 history는 임시 context다. 오래 남길 지식은 repository Markdown으로 이동해야 다음 세션, 다른 agent, compact 이후에도 검색 가능하다.
21
+
22
+ ## What Gets Created
23
+
24
+ 프로젝트를 bootstrap하거나 install하면 보통 다음 구조가 생긴다.
25
+
26
+ ```text
27
+ llm-wiki/
28
+ ├── .kit-state.json
29
+ ├── raw/
30
+ │ ├── inbox/
31
+ │ ├── sessions/
32
+ │ ├── sources/
33
+ │ └── assets/
34
+ ├── wiki/
35
+ │ ├── index.md
36
+ │ ├── memory.md
37
+ │ ├── log.md
38
+ │ ├── sources/
39
+ │ ├── concepts/
40
+ │ ├── entities/
41
+ │ ├── decisions/
42
+ │ ├── architecture/
43
+ │ ├── debugging/
44
+ │ ├── context/
45
+ │ └── queries/
46
+ ├── outputs/
47
+ │ ├── questions/
48
+ │ ├── reports/
49
+ │ └── maintenance/
50
+ └── procedures/
51
+ ```
52
+
53
+ `wiki/memory.md`는 hook context에 들어가는 짧은 hot index다. 긴 설명을 복사하지 말고 중요한 entry point만 둔다.
54
+
55
+ `wiki/index.md`는 wiki 전체의 navigation map이다. agent는 넓은 질문을 받으면 여기와 `memory.md`에서 시작한다.
56
+
57
+ `.kit-state.json`은 현재 project rules/templates가 어느 runtime version으로 적용되었는지 기록한다. runtime update와 project knowledge는 별개다. npm package update가 기존 wiki 내용을 덮어쓰지 않는다.
58
+
59
+ ## Normal Use
60
+
61
+ 평소처럼 Codex 또는 Claude Code를 사용한다.
62
+
63
+ 설치된 hook은 다음 일을 자동으로 수행한다.
64
+
65
+ - session start, prompt submit, post compact 시점에 `wiki/memory.md`, `wiki/index.md`, 관련 wiki 검색 결과를 context로 주입한다.
66
+ - prompt/tool/result summary를 redaction한 뒤 turn buffer에 기록한다.
67
+ - 의미 있는 작업 turn만 `outputs/questions/YYYY-MM-DD-live-qa.md`에 live Q&A로 남긴다.
68
+ - 기본 answer-first mode에서는 `wiki/queries/`와 `wiki/decisions/`를 매 turn 자동 생성하지 않는다.
69
+ - 사용자가 명시적으로 문서화/기록을 요청했는데 durable wiki 반영이 없으면 `outputs/maintenance/queue.md`에 정리 후보를 남긴다.
70
+ - 이전 session이 깨끗하게 종료되지 않았을 때 stale turn state를 maintenance queue로 복구할 수 있다.
71
+ - 새 runtime이 오래된 project rules/templates를 발견하면 안전하게 갱신 가능한 managed file만 refresh한다.
72
+
73
+ 매번 저장 여부를 사용자가 고민해야 한다면 잘못 쓰고 있는 것이다. 답변보다 wiki maintenance가 먼저 오면 안 된다. 현재 사용자 요청을 먼저 처리하고, 오래 쓸 지식만 필요한 만큼 정리한다.
74
+
75
+ ## Capture Modes
76
+
77
+ 기본값은 다음과 같다.
78
+
79
+ ```bash
80
+ LLM_WIKI_KIT_CAPTURE_MODE=answer-first
81
+ ```
82
+
83
+ `answer-first` mode는 현재 답변을 우선한다.
84
+
85
+ - 단순 Q&A나 상태 확인은 durable wiki로 승격하지 않는다.
86
+ - 의미 있는 작업 turn은 live Q&A archive에 남길 수 있다.
87
+ - explicit durable request가 빠졌을 때만 selective maintenance queue를 만든다.
88
+ - reusable fact는 active agent가 기존 wiki 문서에 병합한다.
89
+
90
+ 과거 호환용 eager mode도 남아 있다.
91
+
92
+ ```bash
93
+ LLM_WIKI_KIT_CAPTURE_MODE=legacy-eager
94
+ ```
95
+
96
+ `legacy-eager`는 old query/decision auto-promotion 흐름을 유지하기 위한 deprecated compatibility mode다. 새 project는 answer-first mode를 사용한다.
97
+
98
+ ## Command Reference
99
+
100
+ 대부분의 사용자는 일상 작업 중 이 명령들을 직접 실행할 필요가 없다. 설치, 업데이트, 진단, agent-side maintenance용 interface다.
101
+
102
+ ### `llm-wiki manual`
103
+
104
+ 이 문서를 출력한다.
105
+
106
+ ```bash
107
+ llm-wiki manual
108
+ ```
109
+
110
+ 새 기능이나 명령이 추가되면 `docs/manual.md`를 함께 갱신한다. 이 문서가 CLI manual의 단일 원본이다.
111
+
112
+ ### `llm-wiki install`
113
+
114
+ Codex/Claude Code hook을 설치하고 workspace를 bootstrap한다.
115
+
116
+ ```bash
117
+ llm-wiki install --workspace /apps --profile standard
118
+ llm-wiki install --workspace /path/to/project --profile standard
119
+ llm-wiki install --workspace /path/to/project --profile standard --no-project
120
+ ```
121
+
122
+ `standard` profile은 기본 profile이다.
123
+
124
+ - context injection
125
+ - redacted summary recording
126
+ - tool call allow with storage redaction
127
+ - project-local `llm-wiki/` bootstrap
128
+ - hook entry merge
129
+
130
+ `--no-project`는 hook/bin 설치만 하고 현재 workspace bootstrap은 하지 않을 때 사용한다.
131
+
132
+ global npm package 설치 자체는 환경에 따라 `npm install -g` 또는 `sudo npm install -g`로 수행한다. hook 설정 갱신은 보통 일반 사용자 home 아래 파일을 수정하므로 `llm-wiki install`은 해당 user로 실행한다.
133
+
134
+ ### `llm-wiki update`
135
+
136
+ npm registry target과 installed runtime을 비교하고, 필요하면 global package를 업데이트한 뒤 hook과 managed project templates를 갱신한다.
137
+
138
+ ```bash
139
+ llm-wiki update --check --workspace /path/to/project
140
+ llm-wiki update --workspace /path/to/search-root
141
+ llm-wiki update --workspace /path/to/search-root --to 0.2.1
142
+ llm-wiki update --workspace /path/to/project --current-only
143
+ llm-wiki update --workspace /path/to/project --dry-run
144
+ ```
145
+
146
+ `--check`는 network를 사용하지만 파일을 변경하지 않는다. installed version보다 registry target이 최신일 때만 update available을 보고한다.
147
+
148
+ 기본 `update --workspace <search-root>`는 runtime update를 한 번 수행한 뒤, known/discovered project roots의 managed templates를 재적용한다. 기존 wiki contents는 덮어쓰지 않는다.
149
+
150
+ `update`는 source checkout에서 self-update하지 않는다. source checkout 개발 중에는 npm package나 local tarball로 global install한 뒤 update behavior를 테스트한다.
151
+
152
+ ### `llm-wiki post-update`
153
+
154
+ npm install 없이 현재 runtime으로 hook entries와 managed project templates를 다시 적용한다.
155
+
156
+ ```bash
157
+ llm-wiki post-update --workspace /path/to/project
158
+ llm-wiki post-update --all --workspace /path/to/search-root
159
+ ```
160
+
161
+ plain `npm install -g llm-wiki-kit@latest` 후 hook/template을 다시 맞출 때 사용한다.
162
+
163
+ ### `llm-wiki projects`
164
+
165
+ search root 아래의 project roots를 찾고 update 상태를 요약한다.
166
+
167
+ ```bash
168
+ llm-wiki projects --workspace /apps
169
+ ```
170
+
171
+ `llm-wiki/.kit-state.json`이 있거나 older `llm-wiki/wiki/index.md`가 있는 root를 찾는다. 출력 끝에는 전체 update, current-only update, post-update command 예시가 함께 나온다.
172
+
173
+ ### `llm-wiki status`
174
+
175
+ offline consistency check다.
176
+
177
+ ```bash
178
+ llm-wiki status --workspace /path/to/project
179
+ llm-wiki status
180
+ ```
181
+
182
+ 보고 항목:
183
+
184
+ - runtime version과 install source
185
+ - binary path와 `PATH` command가 current runtime을 가리키는지
186
+ - Codex/Claude hook이 current runtime인지
187
+ - project applied runtime
188
+ - managed templates current 여부
189
+ - auto-updateable rules count
190
+ - agent cleanup이 필요한 managed-looking rules count
191
+ - pending maintenance count
192
+
193
+ network를 사용하지 않는다.
194
+
195
+ ### `llm-wiki version`
196
+
197
+ installed runtime version만 출력한다.
198
+
199
+ ```bash
200
+ llm-wiki version
201
+ llm-wiki --version
202
+ llm-wiki -v
203
+ ```
204
+
205
+ script나 smoke test에서 가장 가볍게 runtime version을 확인할 때 쓴다.
206
+
207
+ ### `llm-wiki doctor`
208
+
209
+ 설치와 hook roundtrip을 진단한다.
210
+
211
+ ```bash
212
+ llm-wiki doctor --workspace /path/to/project
213
+ ```
214
+
215
+ 확인 항목:
216
+
217
+ - Node version
218
+ - docs presence
219
+ - Codex/Claude command availability
220
+ - state directory writability
221
+ - hook target 상태
222
+ - sample hook roundtrip
223
+ - status summary
224
+
225
+ 문제가 있으면 remediation hint를 출력한다.
226
+
227
+ ### `llm-wiki bootstrap`
228
+
229
+ project-local `llm-wiki/` 구조와 root policy block을 생성한다.
230
+
231
+ ```bash
232
+ llm-wiki bootstrap --workspace /path/to/project
233
+ ```
234
+
235
+ 직접 bootstrap할 수 있지만 보통 `install`이 함께 처리한다. 기존 wiki content는 덮어쓰지 않는다.
236
+
237
+ ### `llm-wiki migrate`
238
+
239
+ legacy wiki material을 current `llm-wiki/` 구조로 copy-only migration한다.
240
+
241
+ ```bash
242
+ llm-wiki migrate --workspace /path/to/project
243
+ ```
244
+
245
+ older OMX/OMC/`omx_wiki/` material은 migration input일 뿐이다. 현재 project knowledge는 `llm-wiki-kit`과 `llm-wiki/` 아래에서 유지한다.
246
+
247
+ ### `llm-wiki context`
248
+
249
+ hook이 주입하는 layered context를 수동으로 확인한다.
250
+
251
+ ```bash
252
+ llm-wiki context "auth architecture" --workspace /path/to/project
253
+ llm-wiki context "auth architecture" --workspace /path/to/project --json
254
+ llm-wiki context "auth architecture" --workspace /path/to/project --limit 8
255
+ llm-wiki context "auth architecture" --workspace /path/to/project --no-expand
256
+ llm-wiki context "auth architecture" --workspace /path/to/project --include-episodic
257
+ ```
258
+
259
+ 읽는 자료:
260
+
261
+ - `wiki/memory.md`
262
+ - `wiki/index.md`
263
+ - recent `wiki/log.md` excerpt
264
+ - MiniSearch 또는 substring fallback 결과
265
+ - strong match의 one-hop wikilink neighbors
266
+
267
+ 기본 검색은 episodic `wiki/queries/`를 제외한다. 오래된 automatic query record까지 보고 싶을 때만 `--include-episodic`을 쓴다.
268
+
269
+ ### `llm-wiki lint`
270
+
271
+ wiki health check를 수행한다. 파일을 수정하지 않는다.
272
+
273
+ ```bash
274
+ llm-wiki lint --workspace /path/to/project
275
+ ```
276
+
277
+ 점검 항목:
278
+
279
+ - missing `index.md`, `memory.md`, `log.md`
280
+ - missing/invalid frontmatter
281
+ - broken or ambiguous `[[wikilinks]]`
282
+ - broken relative Markdown links
283
+ - invalid or unsafe `source_ids`
284
+ - missing source files
285
+ - secret-like content
286
+ - duplicate aliases/titles
287
+ - stale pages and orphan candidates
288
+ - outdated managed rules/templates
289
+ - stale or oversized maintenance queue
290
+
291
+ broken links, invalid source IDs, secret-like content는 error이며 exit code 1을 반환한다. metadata/discoverability gap은 warning이다.
292
+
293
+ ### `llm-wiki consolidate`
294
+
295
+ generated marker block만 보수적으로 갱신한다.
296
+
297
+ ```bash
298
+ llm-wiki consolidate --workspace /path/to/project
299
+ llm-wiki consolidate --workspace /path/to/project --dry-run
300
+ ```
301
+
302
+ 갱신 대상:
303
+
304
+ - `wiki/memory.md`의 generated memory map
305
+ - `wiki/index.md`의 generated page map
306
+
307
+ handwritten content는 보존한다. malformed marker block은 덮어쓰지 않고 건너뛴다. 기본 `query`, `context`, `session-log` page는 explicit durable metadata가 없으면 generated map에서 제외한다.
308
+
309
+ ### `llm-wiki maintenance`
310
+
311
+ maintenance queue summary를 출력한다.
312
+
313
+ ```bash
314
+ llm-wiki maintenance --workspace /path/to/project
315
+ llm-wiki maintenance --workspace /path/to/project --json
316
+ ```
317
+
318
+ 이 명령은 page merge를 자동 수행하지 않는다. active agent가 pending item을 읽고, 가장 가까운 durable wiki 문서에 병합한 뒤 queue item을 `done` 또는 `skipped`로 표시한다.
319
+
320
+ ### `llm-wiki uninstall`
321
+
322
+ kit이 설치한 hook entries를 제거한다.
323
+
324
+ ```bash
325
+ llm-wiki uninstall
326
+ ```
327
+
328
+ project-local `llm-wiki/` contents는 남긴다. 지식 저장소를 삭제하는 명령이 아니다.
329
+
330
+ ### `llm-wiki hook`
331
+
332
+ Codex/Claude Code hook target으로 쓰는 내부 runtime command다.
333
+
334
+ ```bash
335
+ llm-wiki hook codex SessionStart
336
+ llm-wiki hook codex UserPromptSubmit
337
+ llm-wiki hook codex Stop
338
+ llm-wiki hook claude InstructionsLoaded
339
+ llm-wiki hook claude Stop
340
+ ```
341
+
342
+ 일반 사용자가 직접 호출할 필요는 거의 없다. hook integration이나 smoke test를 디버깅할 때만 사용한다.
343
+
344
+ ## Hook Events
345
+
346
+ Codex handled events:
347
+
348
+ - `SessionStart`
349
+ - `UserPromptSubmit`
350
+ - `PreToolUse`
351
+ - `PostToolUse`
352
+ - `PreCompact`
353
+ - `PostCompact`
354
+ - `SubagentStop`
355
+ - `Stop`
356
+
357
+ Claude Code handled events:
358
+
359
+ - `SessionStart`
360
+ - `InstructionsLoaded`
361
+ - `UserPromptSubmit`
362
+ - `PreToolUse`
363
+ - `PostToolUse`
364
+ - `PostToolBatch`
365
+ - `PreCompact`
366
+ - `PostCompact`
367
+ - `SubagentStop`
368
+ - `Stop`
369
+ - `SessionEnd`
370
+
371
+ Hook payload는 full transcript가 아니라 작은 redacted event envelope다. context output도 field별 redaction을 거친다.
372
+
373
+ ## Security Defaults
374
+
375
+ 기본 정책은 aggressive blocking보다 useful local work wiki를 우선한다.
376
+
377
+ - input이 민감해 보인다는 이유만으로 tool call을 막지 않는다.
378
+ - token, password, bearer credential, private key, `.env` 원문 같은 authentication value는 durable summary에 쓰기 전 redaction한다.
379
+ - phone number, email, date, business identifier는 local work context로 유용할 수 있어 기본 보존한다.
380
+ - full raw transcript capture는 기본 기능이 아니다.
381
+ - `llm-wiki lint`는 wiki 안의 secret-like content를 error로 보고한다.
382
+
383
+ 민감한 raw command output, log, screenshot, transcript를 저장해야 할 때는 먼저 redaction한다. 인증값은 wiki, report, live Q&A, command history에 남기지 않는다.
384
+
385
+ ## Updating Existing Installs
386
+
387
+ 일반 흐름:
388
+
389
+ ```bash
390
+ npm install -g llm-wiki-kit@latest --registry=https://registry.npmjs.org/ --prefer-online
391
+ llm-wiki post-update --all --workspace /apps
392
+ llm-wiki status --workspace /apps
393
+ llm-wiki doctor --workspace /apps
394
+ ```
395
+
396
+ system global npm prefix가 root-owned인 서버에서는 package install에 `sudo npm install -g`가 필요할 수 있다. 단, user home의 Codex/Claude hook 설정을 갱신하는 `llm-wiki install` 또는 `llm-wiki post-update`는 해당 user로 실행하는 것이 일반적으로 맞다.
397
+
398
+ source checkout 개발 중 pre-publish smoke:
399
+
400
+ ```bash
401
+ npm pack --pack-destination /tmp
402
+ npm install -g /tmp/llm-wiki-kit-<version>.tgz
403
+ llm-wiki install --workspace /apps --profile standard
404
+ ```
405
+
406
+ publish 전 검증:
407
+
408
+ ```bash
409
+ node --test
410
+ npm pack --dry-run
411
+ ```
412
+
413
+ publish 후 검증:
414
+
415
+ ```bash
416
+ npm view llm-wiki-kit version --registry=https://registry.npmjs.org/
417
+ llm-wiki version
418
+ llm-wiki manual
419
+ llm-wiki status --workspace /apps
420
+ llm-wiki doctor --workspace /apps
421
+ ```
422
+
423
+ ## Troubleshooting Shortcuts
424
+
425
+ hook이 안 돈다면:
426
+
427
+ ```bash
428
+ llm-wiki status --workspace /path/to/project
429
+ llm-wiki doctor --workspace /path/to/project
430
+ ```
431
+
432
+ `npm install -g` 후에도 old command가 실행된다면:
433
+
434
+ ```bash
435
+ which -a llm-wiki
436
+ readlink -f "$(command -v llm-wiki)"
437
+ npm root -g
438
+ node "$(npm root -g)/llm-wiki-kit/bin/llm-wiki.js" version
439
+ ```
440
+
441
+ local shim이 npm global command를 shadowing하면:
442
+
443
+ ```bash
444
+ llm-wiki install --workspace /path/to/project --profile standard
445
+ hash -r
446
+ llm-wiki version
447
+ ```
448
+
449
+ wiki page가 중복되거나 오래된 것 같다면:
450
+
451
+ ```bash
452
+ llm-wiki lint --workspace /path/to/project
453
+ llm-wiki maintenance --workspace /path/to/project
454
+ llm-wiki consolidate --workspace /path/to/project
455
+ ```
456
+
457
+ ## Manual Maintenance Rule
458
+
459
+ 이 문서는 `llm-wiki manual`의 출력 원본이다.
460
+
461
+ 새 public command, option, hook behavior, directory convention, security policy, update flow가 생기면 구현과 같은 change set에서 `docs/manual.md`를 갱신한다. README는 빠른 시작과 요약을 담고, 자세한 기능 설명은 이 manual에 둔다.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-wiki-kit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Hook-first living LLM Wiki runtime for Codex and Claude Code.",
5
5
  "type": "module",
6
6
  "files": [
package/src/cli.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { readFile } from 'fs/promises';
1
2
  import { resolve } from 'path';
2
3
  import { formatConsolidateResult, runConsolidate } from './consolidate.js';
3
4
  import { handleHook } from './hook.js';
@@ -93,6 +94,7 @@ Usage:
93
94
  llm-wiki projects --workspace /apps
94
95
  llm-wiki status
95
96
  llm-wiki version
97
+ llm-wiki manual
96
98
  llm-wiki uninstall
97
99
  llm-wiki hook codex <EventName>
98
100
  llm-wiki hook claude <EventName>
@@ -141,6 +143,12 @@ Usage:
141
143
  return;
142
144
  }
143
145
 
146
+ if (command === 'manual') {
147
+ const manual = await readFile(new URL('../docs/manual.md', import.meta.url), 'utf8');
148
+ process.stdout.write(manual.endsWith('\n') ? manual : `${manual}\n`);
149
+ return;
150
+ }
151
+
144
152
  if (command === 'projects') {
145
153
  const result = await listProjects(options);
146
154
  printJsonOrText(result, options, formatProjects);