llm-wiki-kit 0.2.11 → 0.2.13

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/docs/manual.md CHANGED
@@ -1,36 +1,45 @@
1
1
  # llm-wiki-kit Manual
2
2
 
3
- `llm-wiki-kit`은 Codex와 Claude Code를 평소처럼 사용하는 동안 프로젝트 안에 living Markdown wiki 유지하는 hook-first runtime이다.
3
+ `llm-wiki-kit` is a hook-first runtime that keeps a project-local living Markdown wiki while users work normally in Codex or Claude Code.
4
4
 
5
- 핵심 원칙은 단순하다. 사용자는 별도 기록 명령을 외워서 매번 실행하지 않는다. 평소처럼 질문하고, 구현하고, 검증한다. 내부적으로는 hook이 필요한 context 주입하고, 안전하게 요약을 남기고, 오래 지식을 agent `llm-wiki/` Markdown에 정리할 수 있도록 돕는다.
5
+ The core rule is answer-first operation. Users should not need to remember a separate `record`, `ingest`, or maintenance command loop. Hooks inject useful context, store redacted operational evidence, and help the active agent move durable knowledge into `llm-wiki/` when it matters.
6
+
7
+ ## Language Behavior
8
+
9
+ The runtime supports seamless Korean/English use:
10
+
11
+ - If the current user prompt is clearly Korean, hook-visible guidance is Korean.
12
+ - If the current user prompt is clearly English, hook-visible guidance is English.
13
+ - When there is no clear prompt language, Claude Code may use its `settings.json` `language` value when present.
14
+ - If no setting exists, the runtime checks local `CLAUDE.md` and `AGENTS.md` language signals.
15
+ - The fallback is English.
16
+ - Commands, paths, code identifiers, package names, API names, logs, and original error text are kept unchanged.
17
+
18
+ This is intentionally instruction-driven for both Codex and Claude Code. Claude Code may expose a language setting in some versions, but the kit does not depend on that setting being present.
6
19
 
7
20
  ## Mental Model
8
21
 
9
- LLM Wiki는 층으로 움직인다.
22
+ The wiki has three layers:
10
23
 
11
24
  ```text
12
25
  raw evidence -> curated wiki -> rules and retrieval
13
26
  ```
14
27
 
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를 다루는 규칙과 절차다.
28
+ - `raw/`: immutable or redacted evidence. Default hooks store small redacted event envelopes, not full transcripts.
29
+ - `wiki/`: curated project knowledge maintained by the agent.
30
+ - `outputs/`: live Q&A chunks, reports, and maintenance candidates.
31
+ - `AGENTS.md`, `CLAUDE.md`, and `procedures/`: instructions and operating rules for agents.
19
32
 
20
- 채팅 history 임시 context다. 오래 남길 지식은 repository Markdown으로 이동해야 다음 세션, 다른 agent, compact 이후에도 검색 가능하다.
33
+ Chat history is temporary. Durable project knowledge belongs in repository Markdown so it survives new sessions, compaction, and different agents.
21
34
 
22
- ## What Gets Created
35
+ ## Created Structure
23
36
 
24
- 프로젝트를 bootstrap하거나 install하면 보통 다음 구조가 생긴다.
37
+ Bootstrap or install creates:
25
38
 
26
39
  ```text
27
40
  llm-wiki/
28
41
  ├── .kit-state.json
29
42
  ├── raw/
30
- │ ├── inbox/
31
- │ ├── sessions/
32
- │ ├── sources/
33
- │ └── assets/
34
43
  ├── wiki/
35
44
  │ ├── index.md
36
45
  │ ├── memory.md
@@ -50,80 +59,55 @@ llm-wiki/
50
59
  └── procedures/
51
60
  ```
52
61
 
53
- `wiki/memory.md`는 hook context에 들어가는 짧은 hot index다. hook 기능을 유지하되 사용자 화면에 보일 있는 부분을 functional compact context로 정제하므로, 설명을 복사하지 말고 중요한 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 내용을 덮어쓰지 않는다.
62
+ `wiki/memory.md` is the short hot index used in hook context. `wiki/index.md` is the navigation map. `.kit-state.json` records which runtime last applied managed templates. Runtime updates do not overwrite curated project knowledge.
58
63
 
59
64
  ## Normal Use
60
65
 
61
- 평소처럼 Codex 또는 Claude Code 사용한다.
62
-
63
- 설치된 hook은 다음 일을 자동으로 수행한다.
66
+ Use Codex or Claude Code normally. Installed hooks:
64
67
 
65
- - session start, instructions loaded, prompt submit 시점에 functional compact context 주입한다. `wiki/memory.md`, `wiki/index.md`, 관련 wiki 검색 결과, maintenance signal, update status, compact recovery packet은 계속 사용하되 사용자 화면에 보일 수 있는 hook context는 필요한 정보 중심으로 정제한다.
66
- - pre compact 시점에는 현재 turn을 분류하고, simple turn은 context note만 남기며, 실제 작업 evidence가 있거나 구조화된 decision 결과가 있는 turn만 redacted live Q&A checkpoint로 남긴다. 명시적 durable 기록 요청이 durable wiki에 반영되지 않았을 때만 maintenance queue 후보를 남긴다. 저장 실패 시에도 compact는 진행시키고, 중요한 내용만 recovery packet으로 준비한다.
67
- - prompt/tool/result summary를 redaction한 turn buffer에 기록한다.
68
- - 의미 있는 작업/결정 turn만 `outputs/questions/YYYY-MM-DD/live-qa-001.md` 같은 chunked live Q&A archive에 남긴다.
69
- - 기본 answer-first mode에서는 `wiki/queries/`와 `wiki/decisions/`를 turn 자동 생성하지 않는다.
70
- - 사용자가 명시적으로 문서화/기록을 요청했는데 durable wiki 반영이 없으면 `outputs/maintenance/queue.md`에 정리 후보를 남긴다.
71
- - 이전 session이 깨끗하게 종료되지 않았을 stale turn state maintenance queue로 복구할 수 있다.
72
- - runtime이 오래된 project rules/templates 발견하면 안전하게 갱신 가능한 managed file만 refresh한다.
73
- - `SessionStart`/`InstructionsLoaded`에서 Codex-facing legacy `oh-my-codex:wiki`/`omx_wiki` 설정과 스킬 표면이 되살아났는지 확인하고 제거한다. wiki 기능은 `llm-wiki/`가 단일 활성 구현이다.
68
+ - inject functional compact context at session start, instructions loaded, and prompt submit;
69
+ - select Korean or English hook guidance from the current user prompt and local instruction files;
70
+ - use `wiki/memory.md`, `wiki/index.md`, relevant wiki search, maintenance signals, update notices, and compact recovery packets;
71
+ - record redacted prompt/tool/result summaries in per-turn state;
72
+ - archive only meaningful work turns or structured decision/debugging turns into chunked `outputs/questions/YYYY-MM-DD/live-qa-001.md` files;
73
+ - avoid automatic `wiki/queries/` and `wiki/decisions/` promotion in the default answer-first mode;
74
+ - queue durable cleanup candidates only for explicit documentation requests that were not reflected in durable wiki files, or when stale turn state is recovered;
75
+ - refresh clearly managed rules/templates for older projects at session start;
76
+ - remove legacy Codex-facing `oh-my-codex:wiki`/`omx_wiki` surfaces when they reappear.
74
77
 
75
- hook UX 정책은 기능 보존이 우선이다. Codex와 Claude Code 모두 같은 기능 신호를 받으며, 차이는 raw dump가 아니라 읽기 쉬운 functional compact formatting으로 보여주는 것이다.
76
-
77
- 매번 저장 여부를 사용자가 고민해야 한다면 잘못 쓰고 있는 것이다. 답변보다 wiki maintenance가 먼저 오면 안 된다. 현재 사용자 요청을 먼저 처리하고, 오래 쓸 지식만 필요한 만큼 정리한다.
78
+ If wiki maintenance delays the actual answer, the workflow is being used wrong. The current user request comes first.
78
79
 
79
80
  ## Capture Modes
80
81
 
81
- 기본값은 다음과 같다.
82
+ Default:
82
83
 
83
84
  ```bash
84
85
  LLM_WIKI_KIT_CAPTURE_MODE=answer-first
85
86
  ```
86
87
 
87
- `answer-first` mode는 현재 답변을 우선한다.
88
-
89
- - 단순 Q&A, 상태 확인, 키워드만 포함된 답변은 durable wiki나 live Q&A archive로 승격하지 않는다.
90
- - tool evidence, changed-file evidence, verification, 구조화된 `Decision:`/`Root cause:` 같은 결론이 있는 turn은 live Q&A archive에 남길 수 있다.
91
- - explicit durable request가 durable wiki에 반영되지 않았을 때만 selective maintenance queue를 만든다.
92
- - reusable fact는 active agent가 기존 wiki 문서에 병합한다.
88
+ `answer-first` keeps simple Q&A, status checks, and keyword-only replies out of durable wiki and live Q&A by default. It archives work turns with tool evidence, changed-file evidence, verification, or structured `Decision:`/`Root cause:` style conclusions. Explicit durable requests create maintenance queue candidates only when no durable wiki update is detected.
93
89
 
94
- 과거 호환용 eager mode도 남아 있다.
90
+ Deprecated compatibility mode:
95
91
 
96
92
  ```bash
97
93
  LLM_WIKI_KIT_CAPTURE_MODE=legacy-eager
98
94
  ```
99
95
 
100
- `legacy-eager`는 old query/decision auto-promotion 흐름을 유지하기 위한 deprecated compatibility mode다. 새 project는 answer-first mode를 사용한다.
96
+ Use `legacy-eager` only to preserve older query/decision auto-promotion behavior.
101
97
 
102
- ## Command Reference
98
+ ## Install
103
99
 
104
- 대부분의 사용자는 일상 작업 중 이 명령들을 직접 실행할 필요가 없다. 설치, 업데이트, 진단, agent-side maintenance용 interface다.
105
-
106
- ### `llm-wiki manual`
107
-
108
- 이 문서를 출력한다.
109
-
110
- ```bash
111
- llm-wiki manual
112
- ```
113
-
114
- 새 기능이나 명령이 추가되면 `docs/manual.md`를 함께 갱신한다. 이 문서가 CLI manual의 단일 원본이다.
115
-
116
- ### `llm-wiki install`
117
-
118
- Codex/Claude Code hook을 설치하고 workspace를 bootstrap한다.
100
+ Linux/macOS:
119
101
 
120
102
  ```bash
121
- llm-wiki install --workspace /apps --profile standard
103
+ npm install -g llm-wiki-kit@latest
122
104
  llm-wiki install --workspace /path/to/project --profile standard
123
- llm-wiki install --workspace /path/to/project --profile standard --no-project
105
+ llm-wiki doctor --workspace /path/to/project
124
106
  ```
125
107
 
126
- Native Windows에서는 PowerShell/Windows Terminal에서 npm shim을 사용한다.
108
+ Use `sudo npm install -g llm-wiki-kit@latest` only when the global npm prefix is root-owned. Run `llm-wiki install` as the user who owns the Codex/Claude settings.
109
+
110
+ Native Windows:
127
111
 
128
112
  ```powershell
129
113
  npm install -g llm-wiki-kit@latest
@@ -131,409 +115,164 @@ llm-wiki install --workspace C:\path\to\project --profile standard
131
115
  llm-wiki doctor --workspace C:\path\to\project
132
116
  ```
133
117
 
134
- `standard` profile은 기본 profile이다.
135
-
136
- - context injection
137
- - redacted summary recording
138
- - tool call allow with storage redaction
139
- - project-local `llm-wiki/` bootstrap
140
- - hook entry merge
141
-
142
- `--no-project`는 hook/bin 설치만 하고 현재 workspace bootstrap은 하지 않을 때 사용한다.
143
-
144
- global npm package 설치 자체는 환경에 따라 `npm install -g` 또는 `sudo npm install -g`로 수행한다. hook 설정 갱신은 보통 일반 사용자 home 아래 파일을 수정하므로 `llm-wiki install`은 해당 user로 실행한다. Windows에서는 npm이 만든 `llm-wiki.cmd`를 표준 command shim으로 사용하며 Unix-style `~/.local/bin` symlink를 만들지 않는다. Codex hook에는 Windows 실행용 `commandWindows`가 함께 기록된다.
145
-
146
- ### `llm-wiki update`
147
-
148
- npm registry target과 installed runtime을 비교하고, 필요하면 global package를 업데이트한 뒤 hook과 managed project templates를 갱신한다.
149
-
150
- ```bash
151
- llm-wiki update --check --workspace /path/to/project
152
- llm-wiki update --workspace /path/to/search-root
153
- llm-wiki update --workspace /path/to/search-root --to 0.2.1
154
- llm-wiki update --workspace /path/to/project --current-only
155
- llm-wiki update --workspace /path/to/project --dry-run
156
- llm-wiki update --workspace /path/to/search-root --timeout-ms 120000 --max-dirs 5000
157
- ```
158
-
159
- `--check`는 network를 사용하지만 파일을 변경하지 않는다. installed version보다 registry target이 최신일 때만 update available을 보고한다.
160
-
161
- 기본 `update --workspace <search-root>`는 runtime update를 한 번 수행한 뒤, known/discovered project roots의 managed templates를 재적용한다. 기존 wiki contents는 덮어쓰지 않는다. `update`는 registry lookup, npm install, post-update, project discovery 진행 상태를 stderr에 출력한다. JSON 모드에서도 stdout은 JSON만 유지하고 progress는 stderr로 분리한다.
162
-
163
- `--timeout-ms`는 `npm view`, `npm install -g`, internal `post-update` 같은 외부 command timeout을 지정한다. timeout 후 SIGTERM과 짧은 grace period 뒤 SIGKILL을 사용해 child process가 terminal을 계속 붙잡는 hard hang을 방지한다. `--max-dirs`는 search root 아래 project discovery가 검사할 최대 directory 수를 제한한다.
164
-
165
- `update`는 source checkout에서 self-update하지 않는다. source checkout 개발 중에는 npm package나 local tarball로 global install한 뒤 update behavior를 테스트한다.
166
-
167
- global npm runtime으로 설치된 경우 hook은 사용 흐름 중 cached update notice check를 수행한다. 자동 설치는 하지 않는다. 새 npm release가 감지되면 hook context에는 passive runtime update status가 들어간다. 이 block은 현재 runtime, npm registry target, 업데이트/정비 요청이 있을 때 쓸 수 있는 `llm-wiki update --workspace <project-or-search-root>` 명령을 짧게 보여주는 상태 정보다. 현재 답변을 중단하거나 업데이트 권유를 하라는 지시문이 아니다. cache는 lookup에 사용한 npm command별로 분리되어 test/fake npm 결과가 일반 hook session에 섞이지 않는다. `LLM_WIKI_KIT_UPDATE_NOTICE=0`으로 이 status block만 끌 수 있다.
168
-
169
- ### `llm-wiki post-update`
170
-
171
- npm install 없이 현재 runtime으로 hook entries와 managed project templates를 다시 적용한다.
172
-
173
- ```bash
174
- llm-wiki post-update --workspace /path/to/project
175
- llm-wiki post-update --all --workspace /path/to/search-root
176
- ```
177
-
178
- plain `npm install -g llm-wiki-kit@latest` 후 hook/template을 다시 맞출 때 사용한다.
179
-
180
- ### `llm-wiki projects`
181
-
182
- search root 아래의 project roots를 찾고 update 상태를 요약한다.
183
-
184
- ```bash
185
- llm-wiki projects --workspace /apps
186
- ```
187
-
188
- `llm-wiki/.kit-state.json`이 있거나 older `llm-wiki/wiki/index.md`가 있는 root를 찾는다. 출력 끝에는 전체 update, current-only update, post-update command 예시가 함께 나온다.
189
-
190
- ### `llm-wiki status`
191
-
192
- offline consistency check다.
193
-
194
- ```bash
195
- llm-wiki status --workspace /path/to/project
196
- llm-wiki status
197
- ```
198
-
199
- 보고 항목:
200
-
201
- - runtime version과 install source
202
- - binary path와 `PATH` command가 current runtime을 가리키는지
203
- - Codex/Claude hook이 current runtime인지
204
- - project applied runtime
205
- - managed templates current 여부
206
- - auto-updateable rules count
207
- - agent cleanup이 필요한 managed-looking rules count
208
- - pending maintenance count
118
+ Windows uses npm's `llm-wiki.cmd` shim. The installer writes Codex `commandWindows` hooks and Claude Code Windows-safe `node.exe <bin>` commands. Restart Codex and Claude Code after installing or updating hooks.
209
119
 
210
- network를 사용하지 않는다.
211
-
212
- ### `llm-wiki version`
213
-
214
- installed runtime version만 출력한다.
120
+ Source checkout development:
215
121
 
216
122
  ```bash
217
- llm-wiki version
218
- llm-wiki --version
219
- llm-wiki -v
123
+ npm install
124
+ ./install.sh --workspace /apps --profile standard
125
+ node --test
220
126
  ```
221
127
 
222
- script나 smoke test에서 가장 가볍게 runtime version을 확인할 때 쓴다.
223
-
224
- ### `llm-wiki doctor`
225
-
226
- 설치와 hook roundtrip을 진단한다.
128
+ Pre-publish smoke:
227
129
 
228
130
  ```bash
229
- llm-wiki doctor --workspace /path/to/project
131
+ npm pack --pack-destination /tmp
132
+ npm install -g /tmp/llm-wiki-kit-<version>.tgz
133
+ llm-wiki install --workspace /path/to/project --profile standard
230
134
  ```
231
135
 
232
- 확인 항목:
136
+ ## Commands
233
137
 
234
- - Node version
235
- - docs presence
236
- - Codex/Claude command availability
237
- - state directory writability
238
- - hook target 상태
239
- - sample hook roundtrip
240
- - status summary
138
+ Most users should not need these during daily coding. They are for install, update, diagnostics, and agent-side maintenance.
241
139
 
242
- 문제가 있으면 remediation hint를 출력한다.
243
-
244
- ### `llm-wiki bootstrap`
245
-
246
- project-local `llm-wiki/` 구조와 root policy block을 생성한다.
247
-
248
- ```bash
249
- llm-wiki bootstrap --workspace /path/to/project
250
- ```
140
+ - `llm-wiki manual`: print this manual.
141
+ - `llm-wiki install --workspace <project> --profile standard`: install hooks and bootstrap the workspace.
142
+ - `llm-wiki update --check --workspace <project> [--to <version-or-tag>]`: check npm without changing files.
143
+ - `llm-wiki update --workspace <project-or-search-root>`: update the global runtime when npm has a newer target, then reapply hooks and managed templates.
144
+ - `llm-wiki post-update --workspace <project> [--all]`: reapply hooks and managed templates without running npm install.
145
+ - `llm-wiki projects --workspace <search-root>`: list known/discovered project roots and update commands.
146
+ - `llm-wiki status --workspace <project>`: offline consistency report.
147
+ - `llm-wiki version`: print the installed runtime version.
148
+ - `llm-wiki doctor --workspace <project>`: installation and hook roundtrip diagnostics.
149
+ - `llm-wiki bootstrap --workspace <project>`: create project-local wiki structure.
150
+ - `llm-wiki migrate --workspace <project>`: copy legacy wiki material into the current layout.
151
+ - `llm-wiki context "<query>" --workspace <project>`: verbose debug view of hook context sources.
152
+ - `llm-wiki lint --workspace <project>`: wiki health check.
153
+ - `llm-wiki consolidate --workspace <project> [--dry-run]`: refresh generated blocks in `memory.md` and `index.md`.
154
+ - `llm-wiki maintenance --workspace <project> [--json]`: show pending durable cleanup candidates and review health.
155
+ - `llm-wiki archive-questions --workspace <project> [--date YYYY-MM-DD] [--dry-run]`: split old flat live Q&A files into chunks.
156
+ - `llm-wiki uninstall`: remove kit-managed hook entries, leaving project wiki contents intact.
251
157
 
252
- 직접 bootstrap할 수 있지만 보통 `install`이 함께 처리한다. 기존 wiki content는 덮어쓰지 않는다.
158
+ ## Update Flow
253
159
 
254
- ### `llm-wiki migrate`
160
+ `llm-wiki update --check` contacts npm and reports an update only when the registry target is newer than the installed runtime.
255
161
 
256
- legacy wiki material을 current `llm-wiki/` 구조로 copy-only migration한다.
162
+ `llm-wiki update`:
257
163
 
258
- ```bash
259
- llm-wiki migrate --workspace /path/to/project
260
- ```
164
+ - runs `npm install -g llm-wiki-kit@<target>` only when needed;
165
+ - skips npm install when the installed runtime already satisfies the target;
166
+ - checks that `npm root -g` points at the active runtime package root before installing;
167
+ - verifies that the active runtime and `post-update` runtime reached the registry target after installing;
168
+ - exits nonzero instead of printing `updated` when `npm install -g` succeeds but the active runtime is still old;
169
+ - reinstalls hooks without duplicating them;
170
+ - updates only managed project templates and policy blocks;
171
+ - preserves user-edited files and curated wiki contents;
172
+ - prints before/after runtime, registry target, npm global root, active runtime root, and PATH command diagnostics;
173
+ - prints progress to stderr so JSON stdout remains parseable;
174
+ - supports `--timeout-ms` and `--max-dirs` for slow npm, WSL, or large search roots.
261
175
 
262
- older OMX/OMC/`omx_wiki/` material은 migration input일 뿐이다. 현재 project knowledge는 `llm-wiki-kit`과 `llm-wiki/` 아래에서 유지한다.
176
+ Installed npm runtimes also perform a cached hook-side update notice check. It never installs automatically. It only shows passive status in hook context when a newer npm release exists and the user is already working.
263
177
 
264
- ### `llm-wiki context`
178
+ ## Context And Search
265
179
 
266
- hook이 사용하는 layered context source를 full debug 형태로 수동 확인한다. Codex/Claude hook은 같은 source를 functional compact context로 정제해 주입할 있지만, 이 CLI는 retrieval과 formatting 문제를 점검할 수 있도록 verbose debug 출력을 유지한다.
180
+ Hook context is compact and function-focused. The full debug form is:
267
181
 
268
182
  ```bash
269
183
  llm-wiki context "auth architecture" --workspace /path/to/project
270
184
  llm-wiki context "auth architecture" --workspace /path/to/project --json
271
- llm-wiki context "auth architecture" --workspace /path/to/project --limit 8
272
- llm-wiki context "auth architecture" --workspace /path/to/project --no-expand
185
+ llm-wiki context "auth architecture" --workspace /path/to/project --limit 8 --no-expand
273
186
  llm-wiki context "auth architecture" --workspace /path/to/project --include-episodic
274
187
  llm-wiki context "auth architecture" --workspace /path/to/project --include-archived
275
188
  ```
276
189
 
277
- 읽는 자료:
278
-
279
- - `wiki/memory.md`
280
- - `wiki/index.md`
281
- - recent `wiki/log.md` excerpt
282
- - MiniSearch 또는 substring fallback 결과
283
- - strong match의 one-hop wikilink neighbors
284
-
285
- 기본 검색은 durable semantic/procedural page를 우선하고, episodic `wiki/queries/`, `wiki/context/`, `session-log` 계열은 숨긴다. 해당 page가 `memory_type: semantic|procedural`이고 `importance >= 4`이면 promoted durable page로 취급한다. `status: archived` 또는 `superseded_by`가 있는 page도 기본 검색에서 제외하며, 필요한 조사 때만 `--include-archived`로 복구한다. `status: stale` page는 보존하고 검색할 수 있지만 score를 낮춘다. JSON 출력에는 memory/index/hit/snippet budget metadata가 포함된다.
286
-
287
- ### `llm-wiki lint`
288
-
289
- wiki health check를 수행한다. 파일을 수정하지 않는다.
290
-
291
- ```bash
292
- llm-wiki lint --workspace /path/to/project
293
- ```
294
-
295
- 점검 항목:
190
+ Default search prioritizes durable semantic/procedural wiki pages. Episodic `wiki/queries/`, `wiki/context/`, and `session-log` pages are hidden unless promoted with durable metadata or explicitly requested. Archived and superseded pages are hidden unless `--include-archived` is used. Stale pages remain searchable with lower score.
296
191
 
297
- - missing `index.md`, `memory.md`, `log.md`
298
- - missing/invalid frontmatter
299
- - broken or ambiguous `[[wikilinks]]`
300
- - broken relative Markdown links
301
- - invalid or unsafe `source_ids`
302
- - missing source files
303
- - secret-like content
304
- - duplicate aliases/titles
305
- - stale pages and orphan candidates
306
- - `memory.md` near-budget/oversized 상태
307
- - wiki page count가 search cap에 근접했는지
308
- - default-hidden episodic/context/session page 성장
309
- - stale/archived page의 supersession/link discoverability
310
- - outdated managed rules/templates
311
- - stale or oversized maintenance queue
312
- - oversized legacy live Q&A files or oversized live Q&A chunks
192
+ ## Maintenance
313
193
 
314
- broken links, invalid source IDs, secret-like content는 error이며 exit code 1을 반환한다. metadata/discoverability gap은 warning이다.
194
+ `llm-wiki maintenance` reports pending queue state and review health. It does not merge pages automatically. The active agent should merge reusable items into existing durable pages and mark queue items `done` or `skipped`.
315
195
 
316
- ### `llm-wiki consolidate`
196
+ Hook reminders are soft:
317
197
 
318
- generated marker block만 보수적으로 갱신한다.
198
+ - session start and instructions loaded may show a one-item summary;
199
+ - prompt submit shows a reminder only when the prompt is wiki/maintenance-related or matches a queue topic.
319
200
 
320
- ```bash
321
- llm-wiki consolidate --workspace /path/to/project
322
- llm-wiki consolidate --workspace /path/to/project --dry-run
323
- ```
324
-
325
- 갱신 대상:
326
-
327
- - `wiki/memory.md`의 generated memory map
328
- - `wiki/index.md`의 generated page map
329
-
330
- handwritten content는 보존한다. malformed marker block은 덮어쓰지 않고 건너뛴다. generated map에는 durable non-archived page만 넣는다. `stale`, `archived`, `superseded_by` page는 보존하지만 generated map에서는 제외한다. 기본 `query`, `context`, `session-log` page는 explicit durable metadata가 없으면 generated map에서 제외한다. `--dry-run` 결과는 indexed durable pages, hidden episodic pages, archived/stale/superseded skipped counts를 보고한다.
331
-
332
- ### `llm-wiki maintenance`
333
-
334
- maintenance queue summary를 출력한다.
335
-
336
- ```bash
337
- llm-wiki maintenance --workspace /path/to/project
338
- llm-wiki maintenance --workspace /path/to/project --json
339
- ```
340
-
341
- 이 명령은 page merge를 자동 수행하지 않는다. 정기 maintenance는 agent-side task이며 사용자가 매 turn 실행할 필요가 없다. active agent가 pending item을 읽고, 가장 가까운 durable wiki 문서에 병합한 뒤 queue item을 `done` 또는 `skipped`로 표시한다.
342
-
343
- JSON 출력에는 `reviewDue`, `reviewReasons`, `pendingCount`, `stalePendingCount`, `health`, `recommendedCommands`가 포함된다. Review due 조건은 마지막 review 후 14일 경과, pending 5개 이상, stale/result-missing pending item, lint warning/error, `memory.md` near-budget 이상, wiki page count가 search cap의 80% 이상인 경우다. Hook은 due 상태를 `SessionStart`/`InstructionsLoaded`에서만 짧게 보여주고, `UserPromptSubmit`에서는 사용자가 wiki/maintenance/정리 관련 질문을 했을 때만 보여준다. 현재 답변을 중단하거나 정리를 강제하지 않는다.
344
-
345
- ### `llm-wiki archive-questions`
346
-
347
- legacy daily live Q&A 파일을 chunked archive layout으로 분할한다.
348
-
349
- ```bash
350
- llm-wiki archive-questions --workspace /path/to/project --dry-run
351
- llm-wiki archive-questions --workspace /path/to/project --date 2026-06-07
352
- llm-wiki archive-questions --workspace /path/to/project --date 2026-06-07 --json
353
- ```
354
-
355
- 대상은 `outputs/questions/YYYY-MM-DD-live-qa.md` 형식의 기존 파일이다. 실행하면 원본은 `outputs/questions/archive/originals/` 아래에 SHA-256 sidecar와 함께 보존하고, 새 기록은 `outputs/questions/YYYY-MM-DD/index.md`와 `live-qa-001.md` style chunk들로 나눈다. 기존 top-level 파일은 새 위치를 가리키는 짧은 stub로 대체한다. `--dry-run`은 어떤 파일도 쓰지 않고 split 계획만 출력한다.
356
-
357
- Agent checklist:
358
-
359
- ```bash
360
- llm-wiki lint --workspace /path/to/project
361
- llm-wiki maintenance --workspace /path/to/project
362
- llm-wiki consolidate --workspace /path/to/project --dry-run
363
- llm-wiki consolidate --workspace /path/to/project
364
- ```
365
-
366
- ### `llm-wiki uninstall`
367
-
368
- kit이 설치한 hook entries를 제거한다.
369
-
370
- ```bash
371
- llm-wiki uninstall
372
- ```
373
-
374
- project-local `llm-wiki/` contents는 남긴다. 지식 저장소를 삭제하는 명령이 아니다.
201
+ ## PreCompact
375
202
 
376
- ### `llm-wiki hook`
377
-
378
- Codex/Claude Code hook target으로 쓰는 내부 runtime command다.
203
+ Pre-compact preservation never blocks compaction. Defaults:
379
204
 
380
205
  ```bash
381
- llm-wiki hook codex SessionStart
382
- llm-wiki hook codex UserPromptSubmit
383
- llm-wiki hook codex Stop
384
- llm-wiki hook claude InstructionsLoaded
385
- llm-wiki hook claude Stop
206
+ LLM_WIKI_KIT_PRECOMPACT_ENFORCEMENT=limited
386
207
  ```
387
208
 
388
- 일반 사용자가 직접 호출할 필요는 거의 없다. hook integration이나 smoke test를 디버깅할 때만 사용한다.
389
-
390
- ## Hook Events
391
-
392
- Codex handled events:
393
-
394
- - `SessionStart`
395
- - `UserPromptSubmit`
396
- - `PreToolUse`
397
- - `PostToolUse`
398
- - `PreCompact`
399
- - `PostCompact`
400
- - `SubagentStop`
401
- - `Stop`
402
-
403
- Claude Code handled events:
404
-
405
- - `SessionStart`
406
- - `InstructionsLoaded`
407
- - `UserPromptSubmit`
408
- - `PreToolUse`
409
- - `PostToolUse`
410
- - `PostToolBatch`
411
- - `PreCompact`
412
- - `PostCompact`
413
- - `SubagentStop`
414
- - `Stop`
415
- - `SessionEnd`
416
-
417
- Hook payload는 full transcript가 아니라 작은 redacted event envelope다. context output도 field별 redaction을 거친다. `PreCompact`는 checkpoint 생성을 위해 작은 bounded transcript tail만 읽을 수 있고, 저장 전 인증값과 raw `transcript_path`를 redaction한다.
418
-
419
- Context를 반환하는 Codex/Claude hook event는 기능을 제거하지 않는다. memory hot index, navigation index, relevant wiki hits, link expansion, maintenance signal, passive runtime update status, compact recovery packet을 계속 사용할 수 있고, 사용자 화면에 보일 수 있는 `additionalContext`만 functional compact context로 정제한다. `PostCompact`는 compact summary 저장과 recovery packet 준비만 수행하고 model-visible context를 직접 반환하지 않는다. `llm-wiki context` CLI의 full debug 출력은 이 hook formatting 정책과 별도로 유지한다.
420
-
421
- Pre-compact 보존은 compact를 block하지 않는다. `LLM_WIKI_KIT_PRECOMPACT_ENFORCEMENT=off`는 실패 warning을 억제하고, `limited`/`soft`는 checkpoint/queue 저장 실패 시 non-blocking warning만 남긴다. `LLM_WIKI_KIT_PRECOMPACT_TRANSCRIPT_TAIL_BYTES`로 transcript tail byte 한도를 조정한다.
422
-
423
- ## Security Defaults
424
-
425
- 기본 정책은 aggressive blocking보다 useful local work wiki를 우선한다.
426
-
427
- - input이 민감해 보인다는 이유만으로 tool call을 막지 않는다.
428
- - token, password, bearer credential, private key, `.env` 원문 같은 authentication value는 durable summary에 쓰기 전 redaction한다.
429
- - phone number, email, date, business identifier는 local work context로 유용할 수 있어 기본 보존한다.
430
- - full raw transcript capture는 기본 기능이 아니다.
431
- - `PreCompact` checkpoint는 bounded redacted transcript tail만 사용할 수 있으며 full transcript와 raw `transcript_path`는 저장하지 않는다.
432
- - `llm-wiki lint`는 wiki 안의 secret-like content를 error로 보고한다.
209
+ `limited` and `soft` emit non-blocking warnings on checkpoint failure. `off` suppresses warnings. `LLM_WIKI_KIT_PRECOMPACT_TRANSCRIPT_TAIL_BYTES` controls the small bounded transcript tail used for redacted checkpoints.
433
210
 
434
- 민감한 raw command output, log, screenshot, transcript를 저장해야 할 때는 먼저 redaction한다. 인증값은 wiki, report, live Q&A, command history에 남기지 않는다.
211
+ ## Security
435
212
 
436
- ## Updating Existing Installs
213
+ - Full raw transcript capture is disabled by default.
214
+ - Hook payloads are stored as small redacted event envelopes.
215
+ - Tool calls are not blocked only because input looks sensitive.
216
+ - Tokens, passwords, bearer credentials, private keys, and raw `.env` contents are redacted before durable storage.
217
+ - Phone numbers, emails, dates, and business identifiers are preserved by default because they can be useful local work context.
218
+ - `llm-wiki lint` reports secret-like wiki content as an error.
437
219
 
438
- 일반 흐름:
220
+ ## Release Verification
439
221
 
440
- ```bash
441
- npm install -g llm-wiki-kit@latest --registry=https://registry.npmjs.org/ --prefer-online
442
- llm-wiki post-update --all --workspace /apps
443
- llm-wiki status --workspace /apps
444
- llm-wiki doctor --workspace /apps
445
- ```
446
-
447
- 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로 실행하는 것이 일반적으로 맞다.
448
-
449
- source checkout 개발 중 pre-publish smoke:
450
-
451
- ```bash
452
- npm pack --pack-destination /tmp
453
- npm install -g /tmp/llm-wiki-kit-<version>.tgz
454
- llm-wiki install --workspace /apps --profile standard
455
- ```
456
-
457
- publish 전 검증:
222
+ For `llm-wiki-kit` releases, source tests are not enough. A complete release includes:
458
223
 
459
224
  ```bash
460
225
  node --test
461
226
  npm pack --dry-run
462
- ```
463
-
464
- Native Windows 관련 변경은 publish 전 실제 Windows 설치 검증이 필수다. 후보 tarball을 Windows host에 설치하고 임시 project에서 다음을 확인한다.
465
-
466
- ```powershell
467
- npm install -g .\llm-wiki-kit-<version>.tgz
468
- llm-wiki version
469
- llm-wiki install --workspace C:\Temp\llm-wiki-kit-smoke --profile standard
470
- llm-wiki status --workspace C:\Temp\llm-wiki-kit-smoke
471
- llm-wiki doctor --workspace C:\Temp\llm-wiki-kit-smoke
472
- ```
473
-
474
- 검증에는 `%USERPROFILE%\.codex\hooks.json`의 `commandWindows`, `%USERPROFILE%\.claude\settings.json`의 Windows-safe `node.exe` command, project-local `llm-wiki/` 생성, sample hook roundtrip이 포함된다. 원격 자동화는 WinRM을 사용하되 credential은 환경변수나 secret store로만 전달하고 wiki/log에 저장하지 않는다.
475
-
476
- publish 후 검증:
477
-
478
- ```bash
479
- npm view llm-wiki-kit version --registry=https://registry.npmjs.org/
480
- npm install -g llm-wiki-kit@<published-version> --registry=https://registry.npmjs.org/ --prefer-online
227
+ git diff --check
228
+ npm publish
229
+ npm view llm-wiki-kit version dist-tags
230
+ sudo npm install -g llm-wiki-kit@latest
481
231
  llm-wiki version
482
- llm-wiki manual
483
- llm-wiki status --workspace /apps
484
- llm-wiki doctor --workspace /apps
485
- llm-wiki update --workspace /apps --dry-run
486
- llm-wiki update --workspace /apps --current-only
232
+ llm-wiki status --workspace /path/to/project
233
+ llm-wiki doctor --workspace /path/to/project
234
+ llm-wiki update --check --workspace /path/to/project
487
235
  ```
488
236
 
489
- `llm-wiki-kit` 코드 변경 릴리스는 publish와 published version 설치 검증까지 끝나야 완료로 본다. root-owned global npm prefix에서는 package install에 `sudo npm install -g`가 필요할 있고, user home hook 갱신은 일반 user로 `llm-wiki install` 또는 `post-update`를 실행한다.
237
+ Native Windows support claims require a real Windows smoke: install the published package, run `install`, `status`, and `doctor` against a Windows project, inspect `%USERPROFILE%\.codex\hooks.json` and `%USERPROFILE%\.claude\settings.json`, and run hook smoke tests through `llm-wiki.cmd`.
490
238
 
491
- Windows 지원 변경이 포함된 릴리스는 publish 후에도 같은 Windows host에서 `npm install -g llm-wiki-kit@latest` 후 최소 `version/status/doctor` smoke를 반복한다.
239
+ ## Troubleshooting
492
240
 
493
- ## Troubleshooting Shortcuts
494
-
495
- hook이 안 돈다면:
241
+ If hooks do not run:
496
242
 
497
243
  ```bash
498
- llm-wiki status --workspace /path/to/project
499
244
  llm-wiki doctor --workspace /path/to/project
245
+ llm-wiki status --workspace /path/to/project
246
+ llm-wiki install --workspace /path/to/project --profile standard
500
247
  ```
501
248
 
502
- `npm install -g` 후에도 old command가 실행된다면:
249
+ If npm install succeeds but `llm-wiki` is old:
503
250
 
504
251
  ```bash
505
252
  which -a llm-wiki
506
253
  readlink -f "$(command -v llm-wiki)"
254
+ npm ls -g llm-wiki-kit --depth=0
507
255
  npm root -g
508
256
  node "$(npm root -g)/llm-wiki-kit/bin/llm-wiki.js" version
257
+ llm-wiki install --workspace /path/to/project --profile standard
258
+ hash -r
509
259
  ```
510
260
 
511
- Windows에서는 `where llm-wiki`와 npm prefix를 먼저 확인한다.
261
+ On Windows:
512
262
 
513
263
  ```powershell
514
264
  where llm-wiki
265
+ npm ls -g llm-wiki-kit --depth=0
515
266
  npm root -g
516
- node "$(npm root -g)\llm-wiki-kit\bin\llm-wiki.js" version
517
- ```
518
-
519
- local shim이 npm global command를 shadowing하면:
520
-
521
- ```bash
522
- llm-wiki install --workspace /path/to/project --profile standard
523
- hash -r
524
- llm-wiki version
267
+ llm-wiki install --workspace C:\path\to\project --profile standard
268
+ llm-wiki doctor --workspace C:\path\to\project
525
269
  ```
526
270
 
527
- wiki page가 중복되거나 오래된 같다면:
271
+ If `update` appears slow, use bounded dry runs:
528
272
 
529
273
  ```bash
530
- llm-wiki lint --workspace /path/to/project
531
- llm-wiki maintenance --workspace /path/to/project
532
- llm-wiki consolidate --workspace /path/to/project
274
+ llm-wiki update --dry-run --workspace /path/to/project --current-only --timeout-ms 30000
275
+ llm-wiki update --dry-run --workspace /path/to/search-root --max-dirs 1000 --timeout-ms 30000
533
276
  ```
534
277
 
535
- ## Manual Maintenance Rule
536
-
537
- 이 문서는 `llm-wiki manual`의 출력 원본이다.
538
-
539
- 새 public command, option, hook behavior, directory convention, security policy, update flow가 생기면 구현과 같은 change set에서 `docs/manual.md`를 갱신한다. README는 빠른 시작과 요약을 담고, 자세한 기능 설명은 이 manual에 둔다.
278
+ This file is the source for `llm-wiki manual`. Update it in the same change set as public command, option, hook behavior, directory convention, security policy, language behavior, or update-flow changes.