project-librarian 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.ja.md +34 -46
- package/README.ko.md +35 -47
- package/README.md +38 -47
- package/README.zh.md +34 -46
- package/SKILL.md +27 -12
- package/dist/args.js +10 -1
- package/dist/code-index-file-policy.js +2 -0
- package/dist/hooks.js +65 -7
- package/dist/init-project-wiki.js +25 -1
- package/dist/install-skill.js +28 -9
- package/dist/migration.js +203 -4
- package/dist/modes.js +129 -100
- package/dist/templates.js +28 -7
- package/dist/wiki-files.js +9 -1
- package/package.json +9 -6
package/README.ja.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://nodejs.org/)
|
|
6
6
|
[](https://nodejs.org/api/sqlite.html)
|
|
7
7
|
|
|
8
|
-
Codex
|
|
8
|
+
Codex、Claude Code、Cursor、Gemini CLI のための簡潔なプロジェクトメモリとコード根拠。
|
|
9
9
|
|
|
10
10
|
Project Librarian は、リポジトリローカルの計画 wiki、簡潔な起動 hook、任意の SQLite コード根拠 index を作成します。エージェントはプロジェクト計画から開始し、必要な文書へルーティングされ、リポジトリ全体を繰り返しスキャンせずにコードに基づく根拠を確認できます。
|
|
11
11
|
|
|
@@ -21,7 +21,8 @@ Project Librarian はエージェントに 2 つのローカル正本を提供
|
|
|
21
21
|
| --- | --- |
|
|
22
22
|
| `wiki/startup.md` + `wiki/index.md` | 短いセッション開始要約とルーター。必要な計画ページだけを読みます。 |
|
|
23
23
|
| `wiki/canonical/` および `wiki/decisions/` | 現在のプロジェクト事実、制約、リスク、パッケージ契約、CLI 動作、持続的な意思決定。 |
|
|
24
|
-
| `.codex
|
|
24
|
+
| `.codex/`、`.claude/`、`.cursor/`、`.gemini/` hook | 全 wiki をロードしない Codex/Claude Code/Cursor/Gemini CLI 起動コンテキスト。 |
|
|
25
|
+
| `GEMINI.md` および `.cursor/rules/` | Gemini CLI と Cursor を同じ簡潔な wiki-first 契約へルーティングする instruction ファイル。 |
|
|
25
26
|
| `.project-wiki/code-evidence.sqlite` | ファイル、シンボル、import、route、所有者、ワークスペースグラフ、レポート、影響確認のための再生成可能なコード根拠。 |
|
|
26
27
|
| 診断とマイグレーションモード | リンク確認、品質確認、マイグレーション受信箱、古い信号のレポート、作業フローの問題発見時の issue draft。 |
|
|
27
28
|
|
|
@@ -31,64 +32,41 @@ Project Librarian はエージェントに 2 つのローカル正本を提供
|
|
|
31
32
|
|
|
32
33
|
ベンチマークはメンテナー向けリリース根拠であり、公開ユーザー向け作業フローではありません。README とリリースノートが曖昧な性能表現ではなく、境界付きの数値で説明できるようにする根拠です。
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
| --- | ---: |
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
| コード index ファイル | 1,608 |
|
|
44
|
-
| コード index 時間 | 336.312ms |
|
|
45
|
-
| コード index スループット | 4,781.27 files/sec |
|
|
46
|
-
| 増分 index 時間 | 186.776ms |
|
|
47
|
-
| 全体に対する増分時間削減 | 45.52% |
|
|
48
|
-
| アーキテクチャレポート時間 | 251.175ms |
|
|
49
|
-
| アーキテクチャレポート根拠テーブル | 6 |
|
|
50
|
-
| アーキテクチャレポート route | 24 |
|
|
51
|
-
| サンプルリポジトリ | 3 |
|
|
52
|
-
| ベンチマーク実行 | 5 |
|
|
53
|
-
| ウォームアップ実行 | 1 |
|
|
54
|
-
| 時間測定状態 | stable |
|
|
55
|
-
| 不安定な測定値 | none |
|
|
56
|
-
|
|
57
|
-
シナリオ要約:
|
|
58
|
-
|
|
59
|
-
| シナリオ | 規模 | 結果 |
|
|
60
|
-
| --- | ---: | --- |
|
|
61
|
-
| 文書の多い wiki | 500ページ | 99.74% Markdown コンテキスト推定回避、99.47% 読み取り削減、43.83ms query |
|
|
62
|
-
| モノレポ wiki | 320ページ | 99.43% Markdown コンテキスト推定回避、99.26% 読み取り削減、81.12ms doctor |
|
|
63
|
-
| スコープ別ルーター wiki | 720ページ | 99.61% Markdown コンテキスト推定回避、99.55% 読み取り削減、67.684ms refresh |
|
|
64
|
-
| コードの多い混合 index | 1,608ファイル | 336.312ms full index、186.776ms incremental、251.175ms report、626.969ms Tree-sitter index |
|
|
65
|
-
| サンプルリポジトリ検証 | 3リポジトリ、16ファイル | 132.363ms コード index 中央値、135.694ms アーキテクチャレポート中央値 |
|
|
66
|
-
|
|
67
|
-
主張範囲: トークン推定値は `ceil(characters / 4)` による Markdown コンテキストサイズ推定です。モデル tokenizer 出力や API 課金カウンターではなく、実際の LLM トークン使用量を測定していません。ベンチマークは、targeted retrieval で読む wiki コンテキストが、fixture の全 wiki Markdown ファイルを読む naive full-wiki scan に比べてどれだけ Markdown コンテキスト入力を避けるかを比較します。コード index 測定値は生成/サンプルリポジトリで測定したローカル CLI 子プロセス時間です。
|
|
35
|
+
現在のローカル測定レポート: `benchmarks/reports/llm/current-local.json` と `benchmarks/reports/llm/current-local.md`。2026-06-10 生成、ChatGPT/Codex auth、`gpt-5.5`、`decision_lookup`、条件ごとに測定 1 回、ウォームアップなし。以下は実際の Codex JSONL usage とローカル wall-clock 測定です。正の delta は Project Librarian 条件が no-Project-Librarian control より多く使ったことを意味します。
|
|
36
|
+
|
|
37
|
+
| Scale | Project Librarian なし | Project Librarian あり | 実測 delta |
|
|
38
|
+
| --- | ---: | ---: | ---: |
|
|
39
|
+
| Small | total 102,655 tokens; input 101,226; 37.15s; command 9回 | total 176,104 tokens; input 173,733; 61.04s; command 15回 | tokens +71.55%; time +64.33%; commands +66.67% |
|
|
40
|
+
| Medium | total 79,340 tokens; input 78,348; 44.28s; command 5回 | total 165,840 tokens; input 163,856; 48.48s; command 10回 | tokens +109.02%; time +9.5%; commands +100% |
|
|
41
|
+
| Large | total 197,097 tokens; input 195,278; 45.87s; command 10回 | total 183,959 tokens; input 181,897; 49.42s; command 13回 | tokens -6.67%; time +7.72%; commands +30% |
|
|
42
|
+
|
|
43
|
+
Claim boundary: この承認済みローカル実行は benchmark claim gate を通過しましたが、clean release baseline ではありません。dirty worktree、条件ごとに 1 回の実行であり、runtime state files が生成 fixture ディレクトリに触れたため、post-run fixture fingerprint validator には clean isolated rerun が必要です。繰り返しの clean actual-LLM 実行で安定した delta が出るまで、Project Librarian の token/time 改善は主張しません。
|
|
68
44
|
|
|
69
45
|
## インストール
|
|
70
46
|
|
|
71
47
|
初期 skill install にだけ `npx` を使います。
|
|
72
48
|
|
|
73
49
|
```bash
|
|
74
|
-
npx project-librarian install-skill --scope user --agents
|
|
50
|
+
npx project-librarian install-skill --scope user --agents all
|
|
75
51
|
```
|
|
76
52
|
|
|
77
53
|
現在のリポジトリにインストール:
|
|
78
54
|
|
|
79
55
|
```bash
|
|
80
|
-
npx project-librarian install-skill --scope project --agents
|
|
56
|
+
npx project-librarian install-skill --scope project --agents all
|
|
81
57
|
```
|
|
82
58
|
|
|
83
|
-
`install-skill` は再利用可能な skill ファイルだけをコピーします。`AGENTS.md`、`CLAUDE.md`、`wiki/`、`.codex/hooks.json`、`.claude/settings.json` は作成または更新しません。
|
|
59
|
+
`install-skill` は再利用可能な skill ファイルだけをコピーします。`AGENTS.md`、`CLAUDE.md`、`GEMINI.md`、`wiki/`、`.cursor/rules/`、`.cursor/hooks.json`、`.gemini/settings.json`、`.codex/hooks.json`、`.claude/settings.json` は作成または更新しません。
|
|
84
60
|
|
|
85
61
|
| 状況 | コマンド |
|
|
86
62
|
| --- | --- |
|
|
87
|
-
|
|
|
88
|
-
| 現在のリポジトリにインストール | `npx project-librarian install-skill --scope project --agents
|
|
63
|
+
| 対応するすべての agent にグローバルインストール | `npx project-librarian install-skill --scope user --agents all` |
|
|
64
|
+
| 現在のリポジトリにインストール | `npx project-librarian install-skill --scope project --agents all` |
|
|
89
65
|
| Codex のみ | `npx project-librarian install-skill --agents codex` |
|
|
90
66
|
| Claude Code のみ | `npx project-librarian install-skill --agents claude` |
|
|
91
|
-
|
|
|
67
|
+
| Cursor のみ | `npx project-librarian install-skill --agents cursor` |
|
|
68
|
+
| Gemini CLI のみ | `npx project-librarian install-skill --agents gemini` |
|
|
69
|
+
| インストール結果をプレビュー | `npx project-librarian install-skill --scope project --agents all --dry-run` |
|
|
92
70
|
|
|
93
71
|
## エージェント実行経路
|
|
94
72
|
|
|
@@ -98,8 +76,12 @@ npx project-librarian install-skill --scope project --agents both
|
|
|
98
76
|
| --- | --- |
|
|
99
77
|
| プロジェクト範囲 Codex skill | `node .codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
100
78
|
| プロジェクト範囲 Claude skill | `node .claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
79
|
+
| プロジェクト範囲 Cursor skill | `node .cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
80
|
+
| プロジェクト範囲 Gemini skill | `node .gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
101
81
|
| ユーザー範囲 Codex skill | `node ~/.codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
102
82
|
| ユーザー範囲 Claude skill | `node ~/.claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
83
|
+
| ユーザー範囲 Cursor skill | `node ~/.cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
84
|
+
| ユーザー範囲 Gemini skill | `node ~/.gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
103
85
|
|
|
104
86
|
以下の例では次を使います。
|
|
105
87
|
|
|
@@ -154,11 +136,17 @@ Wiki の検証と保守:
|
|
|
154
136
|
|
|
155
137
|
- `AGENTS.md`
|
|
156
138
|
- `CLAUDE.md`
|
|
139
|
+
- `GEMINI.md`
|
|
157
140
|
- `wiki/AGENTS.md`
|
|
141
|
+
- `.cursor/rules/project-librarian.mdc`
|
|
158
142
|
- `.codex/hooks.json`
|
|
159
143
|
- `.codex/hooks/wiki-session-start.js`
|
|
160
144
|
- `.claude/settings.json`
|
|
161
145
|
- `.claude/hooks/wiki-session-start.js`
|
|
146
|
+
- `.cursor/hooks.json`
|
|
147
|
+
- `.cursor/hooks/wiki-session-start.js`
|
|
148
|
+
- `.gemini/settings.json`
|
|
149
|
+
- `.gemini/hooks/wiki-session-start.js`
|
|
162
150
|
- `.githooks/prepare-commit-msg`
|
|
163
151
|
- `.githooks/wiki-commit-trailers.js`
|
|
164
152
|
- `wiki/canonical/`, `wiki/decisions/`, `wiki/inbox/`, `wiki/meta/`, `wiki/sources/`, `wiki/migration/`
|
|
@@ -172,9 +160,9 @@ Wiki の検証と保守:
|
|
|
172
160
|
4. `--refresh-index` は新しい wiki page をルーティングし、route が多い場合は `wiki/indexes/auto-*.md` スコープ別ルーターに分割します。
|
|
173
161
|
5. `--code-index` は `.project-wiki/` 配下に破棄可能な SQLite 根拠 cache を作ります。
|
|
174
162
|
6. `--code-report`、`--code-impact`、`--code-search-symbol`、`--code-query` が計画更新用のコード根拠を提供します。
|
|
175
|
-
7. 診断は壊れたリンク、重複 route、orphan page、古いページ、欠落した TL;DR、根拠 gap
|
|
163
|
+
7. 診断は壊れたリンク、重複 route、orphan page、古いページ、欠落した TL;DR、根拠 gap、マイグレーション方針違反を報告します。
|
|
176
164
|
|
|
177
|
-
マイグレーションはレビュー優先です。`--migrate` は既存 `wiki/` を `wiki_legacy*` として保存し、migration inbox を作成し、legacy
|
|
165
|
+
マイグレーションはレビュー優先です。`--migrate` は既存 `wiki/` を `wiki_legacy*` として保存し、migration inbox と unit-level coverage ledger を作成し、legacy の意味を現在の wiki ルールに合わせて再構成します。保持またはコピーした legacy 内容は、新しい wiki の方針と構造に合う場合は許容されます。新しい wiki は `wiki_legacy*` への参照に依存してはいけません。
|
|
178
166
|
|
|
179
167
|
## 言語サポート表
|
|
180
168
|
|
|
@@ -201,10 +189,10 @@ Wiki の検証と保守:
|
|
|
201
189
|
|
|
202
190
|
```bash
|
|
203
191
|
$PROJECT_LIBRARIAN [init] [options]
|
|
204
|
-
$PROJECT_LIBRARIAN install-skill [--scope user|project] [--agents codex|claude|both]
|
|
192
|
+
$PROJECT_LIBRARIAN install-skill [--scope user|project] [--agents codex|claude|cursor|gemini|all|both]
|
|
205
193
|
```
|
|
206
194
|
|
|
207
|
-
重要なオプション: `--migrate`, `--lint`, `--link-check`, `--quality-check`, `--doctor`, `--doctor --fix`, `--query`, `--refresh-index`, `--capture-inbox`, `--issue-draft`, `--issue-create`, `--glossary-init`, `--prune-check`, `--review-migration`, `--no-git-config`, `--code-index`, `--code-report`, `--code-impact`, `--code-search-symbol`, `--code-query`.
|
|
195
|
+
重要なオプション: `--migrate`, `--lint`, `--link-check`, `--quality-check`, `--doctor`, `--doctor --fix`, `--migration-lint`, `--migration-quality-check`, `--migration-doctor`, `--query`, `--refresh-index`, `--capture-inbox`, `--issue-draft`, `--issue-create`, `--glossary-init`, `--prune-check`, `--review-migration`, `--no-git-config`, `--code-index`, `--code-report`, `--code-impact`, `--code-search-symbol`, `--code-query`.
|
|
208
196
|
|
|
209
197
|
## 開発
|
|
210
198
|
|
package/README.ko.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://nodejs.org/)
|
|
6
6
|
[](https://nodejs.org/api/sqlite.html)
|
|
7
7
|
|
|
8
|
-
Codex
|
|
8
|
+
Codex, Claude Code, Cursor, Gemini CLI를 위한 간결한 프로젝트 메모리와 코드 근거.
|
|
9
9
|
|
|
10
10
|
Project Librarian은 저장소 로컬 계획 위키, 간결한 시작 훅, 선택적 SQLite 코드 근거 인덱스를 생성합니다. 에이전트는 프로젝트 계획에서 시작하고, 필요한 문서로 라우팅하며, 전체 저장소를 반복 스캔하지 않고 코드로 뒷받침되는 근거를 확인할 수 있습니다.
|
|
11
11
|
|
|
@@ -21,7 +21,8 @@ Project Librarian은 에이전트에게 두 가지 로컬 정본을 제공합니
|
|
|
21
21
|
| --- | --- |
|
|
22
22
|
| `wiki/startup.md` + `wiki/index.md` | 짧은 세션 시작 요약과 라우터. 필요한 계획 페이지만 읽습니다. |
|
|
23
23
|
| `wiki/canonical/` 및 `wiki/decisions/` | 현재 프로젝트 사실, 제약, 리스크, 패키지 계약, CLI 동작, 지속되는 결정. |
|
|
24
|
-
| `.codex
|
|
24
|
+
| `.codex/`, `.claude/`, `.cursor/`, `.gemini/` 훅 | 전체 위키를 로드하지 않는 Codex/Claude Code/Cursor/Gemini CLI 시작 컨텍스트. |
|
|
25
|
+
| `GEMINI.md` 및 `.cursor/rules/` | Gemini CLI와 Cursor가 같은 compact wiki-first 계약으로 진입하게 하는 instruction 파일. |
|
|
25
26
|
| `.project-wiki/code-evidence.sqlite` | 파일, 심볼, import, route, 소유권, 작업공간 그래프, 보고서, 영향 확인을 위한 재생성 가능한 코드 근거. |
|
|
26
27
|
| 진단 및 마이그레이션 모드 | 링크 확인, 품질 확인, 마이그레이션 수신함, 오래된 신호 보고서, 작업 흐름 문제 발견 시 이슈 초안. |
|
|
27
28
|
|
|
@@ -31,66 +32,43 @@ Project Librarian은 에이전트에게 두 가지 로컬 정본을 제공합니
|
|
|
31
32
|
|
|
32
33
|
벤치마크는 관리자 릴리스 근거이며 공개 사용자 작업 흐름이 아닙니다. README와 릴리스 노트가 모호한 성능 표현 대신 경계가 있는 숫자로 설명할 수 있게 하기 위한 근거입니다.
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
| --- | ---: |
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
| 코드 인덱스 파일 | 1,608 |
|
|
44
|
-
| 코드 인덱스 시간 | 336.312ms |
|
|
45
|
-
| 코드 인덱스 처리량 | 4,781.27 files/sec |
|
|
46
|
-
| 증분 인덱스 시간 | 186.776ms |
|
|
47
|
-
| 전체 대비 증분 시간 감소 | 45.52% |
|
|
48
|
-
| 아키텍처 보고서 시간 | 251.175ms |
|
|
49
|
-
| 아키텍처 보고서 근거 테이블 | 6 |
|
|
50
|
-
| 아키텍처 보고서 라우트 | 24 |
|
|
51
|
-
| 샘플 저장소 | 3 |
|
|
52
|
-
| 벤치마크 실행 | 5 |
|
|
53
|
-
| 예열 실행 | 1 |
|
|
54
|
-
| 시간 측정 상태 | stable |
|
|
55
|
-
| 불안정한 측정값 | none |
|
|
56
|
-
|
|
57
|
-
시나리오 요약:
|
|
58
|
-
|
|
59
|
-
| 시나리오 | 규모 | 결과 |
|
|
60
|
-
| --- | ---: | --- |
|
|
61
|
-
| 문서가 많은 위키 | 500페이지 | 99.74% Markdown 컨텍스트 추정 회피, 99.47% 읽기 감소, 43.83ms query |
|
|
62
|
-
| 모노레포 위키 | 320페이지 | 99.43% Markdown 컨텍스트 추정 회피, 99.26% 읽기 감소, 81.12ms doctor |
|
|
63
|
-
| 범위별 라우터 위키 | 720페이지 | 99.61% Markdown 컨텍스트 추정 회피, 99.55% 읽기 감소, 67.684ms refresh |
|
|
64
|
-
| 코드가 많은 혼합 인덱스 | 1,608파일 | 336.312ms 전체 인덱스, 186.776ms 증분, 251.175ms 보고서, 626.969ms Tree-sitter 인덱스 |
|
|
65
|
-
| 샘플 저장소 검증 | 3개 저장소, 16파일 | 132.363ms 코드 인덱스 중앙값, 135.694ms 아키텍처 보고서 중앙값 |
|
|
66
|
-
|
|
67
|
-
주장 범위: 토큰 추정치는 `ceil(characters / 4)`를 사용한 Markdown 컨텍스트 크기 추정입니다. 모델 토크나이저 출력이나 API 과금 카운터가 아니며, 실제 LLM 토큰 사용량을 측정하지 않습니다. 벤치마크는 targeted retrieval로 읽는 위키 컨텍스트가 fixture의 모든 위키 Markdown 파일을 읽는 naive full-wiki scan 대비 얼마나 많은 Markdown 컨텍스트 입력을 피하는지 비교합니다. 코드 인덱스 측정값은 생성/샘플 저장소에서 측정한 로컬 CLI 하위 프로세스 시간입니다.
|
|
35
|
+
현재 로컬 측정 보고서: `benchmarks/reports/llm/current-local.json`, `benchmarks/reports/llm/current-local.md`, 2026-06-10 생성, ChatGPT/Codex 인증, `gpt-5.5`, `decision_lookup`, 조건별 측정 1회, 예열 없음. 아래 값은 실제 Codex JSONL usage와 로컬 wall-clock 측정값입니다. 양수 delta는 Project Librarian 조건이 미사용 control보다 더 많이 사용했다는 뜻입니다.
|
|
36
|
+
|
|
37
|
+
| 규모 | Project Librarian 미사용 | Project Librarian 사용 | 실제 delta |
|
|
38
|
+
| --- | ---: | ---: | ---: |
|
|
39
|
+
| 소형 | total 102,655 tokens; input 101,226; 37.15s; command 9회 | total 176,104 tokens; input 173,733; 61.04s; command 15회 | tokens +71.55%; time +64.33%; commands +66.67% |
|
|
40
|
+
| 중형 | total 79,340 tokens; input 78,348; 44.28s; command 5회 | total 165,840 tokens; input 163,856; 48.48s; command 10회 | tokens +109.02%; time +9.5%; commands +100% |
|
|
41
|
+
| 대형 | total 197,097 tokens; input 195,278; 45.87s; command 10회 | total 183,959 tokens; input 181,897; 49.42s; command 13회 | tokens -6.67%; time +7.72%; commands +30% |
|
|
42
|
+
|
|
43
|
+
주장 범위: 이 승인된 로컬 실행은 benchmark claim gate를 통과했지만 clean release baseline은 아닙니다. dirty worktree, 조건별 1회 실행이며, 런타임 상태 파일이 생성 fixture 디렉터리를 건드렸기 때문에 post-run fixture fingerprint validator는 clean isolated rerun이 필요합니다. 반복 clean actual-LLM 실행에서 안정적인 delta가 나오기 전까지 Project Librarian의 토큰/시간 개선을 주장하지 않습니다.
|
|
68
44
|
|
|
69
45
|
## 설치
|
|
70
46
|
|
|
71
47
|
초기 skill 설치에만 `npx`를 사용합니다.
|
|
72
48
|
|
|
73
49
|
```bash
|
|
74
|
-
npx project-librarian install-skill --scope user --agents
|
|
50
|
+
npx project-librarian install-skill --scope user --agents all
|
|
75
51
|
```
|
|
76
52
|
|
|
77
53
|
현재 저장소에 설치:
|
|
78
54
|
|
|
79
55
|
```bash
|
|
80
|
-
npx project-librarian install-skill --scope project --agents
|
|
56
|
+
npx project-librarian install-skill --scope project --agents all
|
|
81
57
|
```
|
|
82
58
|
|
|
83
|
-
`install-skill`은 재사용 가능한 skill 파일만 복사합니다. `AGENTS.md`, `CLAUDE.md`, `wiki/`, `.codex/hooks.json`, `.claude/settings.json`은 만들거나 갱신하지 않습니다.
|
|
59
|
+
`install-skill`은 재사용 가능한 skill 파일만 복사합니다. `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `wiki/`, `.cursor/rules/`, `.cursor/hooks.json`, `.gemini/settings.json`, `.codex/hooks.json`, `.claude/settings.json`은 만들거나 갱신하지 않습니다.
|
|
84
60
|
|
|
85
61
|
| 상황 | 명령 |
|
|
86
62
|
| --- | --- |
|
|
87
|
-
|
|
|
88
|
-
| 현재 저장소에 설치 | `npx project-librarian install-skill --scope project --agents
|
|
63
|
+
| 지원하는 모든 agent에 전역 설치 | `npx project-librarian install-skill --scope user --agents all` |
|
|
64
|
+
| 현재 저장소에 설치 | `npx project-librarian install-skill --scope project --agents all` |
|
|
89
65
|
| Codex만 설치 | `npx project-librarian install-skill --agents codex` |
|
|
90
66
|
| Claude Code만 설치 | `npx project-librarian install-skill --agents claude` |
|
|
91
|
-
| 설치
|
|
67
|
+
| Cursor만 설치 | `npx project-librarian install-skill --agents cursor` |
|
|
68
|
+
| Gemini CLI만 설치 | `npx project-librarian install-skill --agents gemini` |
|
|
69
|
+
| 설치 결과 미리 보기 | `npx project-librarian install-skill --scope project --agents all --dry-run` |
|
|
92
70
|
|
|
93
|
-
`--agents`는 `codex,claude` 같은 comma-separated 값도 받습니다. `--scope`는 `user` 또는 `project`를 받습니다.
|
|
71
|
+
`--agents`는 `codex,claude,cursor,gemini` 같은 comma-separated 값도 받습니다. `all`은 지원하는 모든 agent를 대상으로 하며, `both`는 Codex/Claude 호환 alias입니다. `--scope`는 `user` 또는 `project`를 받습니다.
|
|
94
72
|
|
|
95
73
|
## 에이전트 실행 경로
|
|
96
74
|
|
|
@@ -100,8 +78,12 @@ npx project-librarian install-skill --scope project --agents both
|
|
|
100
78
|
| --- | --- |
|
|
101
79
|
| 프로젝트 범위 Codex skill | `node .codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
102
80
|
| 프로젝트 범위 Claude skill | `node .claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
81
|
+
| 프로젝트 범위 Cursor skill | `node .cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
82
|
+
| 프로젝트 범위 Gemini skill | `node .gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
103
83
|
| 사용자 범위 Codex skill | `node ~/.codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
104
84
|
| 사용자 범위 Claude skill | `node ~/.claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
85
|
+
| 사용자 범위 Cursor skill | `node ~/.cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
86
|
+
| 사용자 범위 Gemini skill | `node ~/.gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
105
87
|
|
|
106
88
|
아래 예시는 다음 runner를 사용합니다.
|
|
107
89
|
|
|
@@ -156,11 +138,17 @@ $PROJECT_LIBRARIAN
|
|
|
156
138
|
|
|
157
139
|
- `AGENTS.md`
|
|
158
140
|
- `CLAUDE.md`
|
|
141
|
+
- `GEMINI.md`
|
|
159
142
|
- `wiki/AGENTS.md`
|
|
143
|
+
- `.cursor/rules/project-librarian.mdc`
|
|
160
144
|
- `.codex/hooks.json`
|
|
161
145
|
- `.codex/hooks/wiki-session-start.js`
|
|
162
146
|
- `.claude/settings.json`
|
|
163
147
|
- `.claude/hooks/wiki-session-start.js`
|
|
148
|
+
- `.cursor/hooks.json`
|
|
149
|
+
- `.cursor/hooks/wiki-session-start.js`
|
|
150
|
+
- `.gemini/settings.json`
|
|
151
|
+
- `.gemini/hooks/wiki-session-start.js`
|
|
164
152
|
- `.githooks/prepare-commit-msg`
|
|
165
153
|
- `.githooks/wiki-commit-trailers.js`
|
|
166
154
|
- `wiki/canonical/`, `wiki/decisions/`, `wiki/inbox/`, `wiki/meta/`, `wiki/sources/`, `wiki/migration/`
|
|
@@ -174,9 +162,9 @@ $PROJECT_LIBRARIAN
|
|
|
174
162
|
4. `--refresh-index`는 새 위키 페이지를 라우팅하며, route가 많으면 `wiki/indexes/auto-*.md` 범위별 라우터로 분리합니다.
|
|
175
163
|
5. `--code-index`는 `.project-wiki/` 아래 폐기 가능한 SQLite 근거 캐시를 만듭니다.
|
|
176
164
|
6. `--code-report`, `--code-impact`, `--code-search-symbol`, `--code-query`가 계획 갱신용 코드 근거를 제공합니다.
|
|
177
|
-
7. 진단은 깨진 링크, 중복 route, orphan page, 오래된 페이지, 누락된 TL;DR, 근거 gap, 마이그레이션
|
|
165
|
+
7. 진단은 깨진 링크, 중복 route, orphan page, 오래된 페이지, 누락된 TL;DR, 근거 gap, 마이그레이션 정책 위반을 보고합니다.
|
|
178
166
|
|
|
179
|
-
마이그레이션은 검토 우선입니다. `--migrate`는 기존 `wiki/`를 `wiki_legacy*`로 보존하고 마이그레이션 inbox를
|
|
167
|
+
마이그레이션은 검토 우선입니다. `--migrate`는 기존 `wiki/`를 `wiki_legacy*`로 보존하고 마이그레이션 inbox와 unit-level coverage ledger를 작성하며, legacy 의미를 현재 wiki 규칙에 맞게 재구성합니다. 보존하거나 복사한 legacy 내용은 새 wiki 정책과 구조에 맞으면 허용되며, 새 wiki가 `wiki_legacy*` 참조에 의존하면 안 됩니다.
|
|
180
168
|
|
|
181
169
|
## 언어 지원 표
|
|
182
170
|
|
|
@@ -203,10 +191,10 @@ $PROJECT_LIBRARIAN
|
|
|
203
191
|
|
|
204
192
|
```bash
|
|
205
193
|
$PROJECT_LIBRARIAN [init] [options]
|
|
206
|
-
$PROJECT_LIBRARIAN install-skill [--scope user|project] [--agents codex|claude|both]
|
|
194
|
+
$PROJECT_LIBRARIAN install-skill [--scope user|project] [--agents codex|claude|cursor|gemini|all|both]
|
|
207
195
|
```
|
|
208
196
|
|
|
209
|
-
중요 옵션: `--migrate`, `--lint`, `--link-check`, `--quality-check`, `--doctor`, `--doctor --fix`, `--query`, `--refresh-index`, `--capture-inbox`, `--issue-draft`, `--issue-create`, `--glossary-init`, `--prune-check`, `--review-migration`, `--no-git-config`, `--code-index`, `--code-report`, `--code-impact`, `--code-search-symbol`, `--code-query`.
|
|
197
|
+
중요 옵션: `--migrate`, `--lint`, `--link-check`, `--quality-check`, `--doctor`, `--doctor --fix`, `--migration-lint`, `--migration-quality-check`, `--migration-doctor`, `--query`, `--refresh-index`, `--capture-inbox`, `--issue-draft`, `--issue-create`, `--glossary-init`, `--prune-check`, `--review-migration`, `--no-git-config`, `--code-index`, `--code-report`, `--code-impact`, `--code-search-symbol`, `--code-query`.
|
|
210
198
|
|
|
211
199
|
## 개발
|
|
212
200
|
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://nodejs.org/)
|
|
6
6
|
[](https://nodejs.org/api/sqlite.html)
|
|
7
7
|
|
|
8
|
-
Compact project memory and code evidence for Codex and
|
|
8
|
+
Compact project memory and code evidence for Codex, Claude Code, Cursor, and Gemini CLI.
|
|
9
9
|
|
|
10
10
|
Project Librarian creates a repo-local planning wiki, compact startup hooks, and an optional SQLite code evidence index so agents can start with the project plan, route to the right document, and inspect code-backed evidence without repeatedly scanning the whole repository.
|
|
11
11
|
|
|
@@ -21,7 +21,8 @@ Project Librarian gives agents two local sources of truth:
|
|
|
21
21
|
| --- | --- |
|
|
22
22
|
| `wiki/startup.md` + `wiki/index.md` | A compact session-start summary and router, so only the relevant planning pages are read. |
|
|
23
23
|
| `wiki/canonical/` and `wiki/decisions/` | Current project facts, constraints, risks, package contracts, CLI behavior, and durable decisions. |
|
|
24
|
-
| `.codex
|
|
24
|
+
| `.codex/`, `.claude/`, `.cursor/`, and `.gemini/` hooks | Automatic startup context for Codex, Claude Code, Cursor, and Gemini CLI without loading the full wiki. |
|
|
25
|
+
| `GEMINI.md` and `.cursor/rules/` | Gemini CLI and Cursor instruction files that route agents to the same compact wiki-first contract. |
|
|
25
26
|
| `.project-wiki/code-evidence.sqlite` | Regenerable code evidence for files, symbols, imports, routes, ownership, workspace graph, reports, and impact checks. |
|
|
26
27
|
| Diagnostics and migration modes | Link checks, quality checks, migration inboxes, stale-signal reports, and issue drafts when the workflow exposes a problem. |
|
|
27
28
|
|
|
@@ -31,66 +32,43 @@ The core idea is not "write more docs." It is "keep the first agent read small,
|
|
|
31
32
|
|
|
32
33
|
Benchmarks are maintainer release evidence, not a public user workflow. They exist so README and release notes can make bounded claims with numbers instead of vague performance language.
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
| --- | ---: |
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
| Code-index files | 1,608 |
|
|
44
|
-
| Code-index time | 336.312ms |
|
|
45
|
-
| Code-index throughput | 4,781.27 files/sec |
|
|
46
|
-
| Incremental index time | 186.776ms |
|
|
47
|
-
| Full-to-incremental time reduction | 45.52% |
|
|
48
|
-
| Architecture report time | 251.175ms |
|
|
49
|
-
| Architecture report evidence tables | 6 |
|
|
50
|
-
| Architecture report routes | 24 |
|
|
51
|
-
| Sample repos | 3 |
|
|
52
|
-
| Benchmark runs | 5 |
|
|
53
|
-
| Warmup runs | 1 |
|
|
54
|
-
| Timing status | stable |
|
|
55
|
-
| Unstable metrics | none |
|
|
56
|
-
|
|
57
|
-
Scenario summary:
|
|
58
|
-
|
|
59
|
-
| Scenario | Scale | Result |
|
|
60
|
-
| --- | ---: | --- |
|
|
61
|
-
| Docs-heavy wiki | 500 pages | 99.74% estimated Markdown context avoidance, 99.47% read reduction, 43.83ms query |
|
|
62
|
-
| Monorepo wiki | 320 pages | 99.43% estimated Markdown context avoidance, 99.26% read reduction, 81.12ms doctor |
|
|
63
|
-
| Scoped router wiki | 720 pages | 99.61% estimated Markdown context avoidance, 99.55% read reduction, 67.684ms refresh |
|
|
64
|
-
| Code-heavy mixed index | 1,608 files | 336.312ms full index, 186.776ms incremental, 251.175ms report, 626.969ms Tree-sitter index |
|
|
65
|
-
| Sample repo validation | 3 repos, 16 files | 132.363ms median code index, 135.694ms median architecture report |
|
|
66
|
-
|
|
67
|
-
Claim boundary: token estimates use `ceil(characters / 4)` as a Markdown context-size estimate. They are not model tokenizer output, API billing counters, or measured real LLM token consumption. The benchmark compares the wiki context read by targeted retrieval against a naive full-wiki scan that reads every wiki Markdown file in the fixture. Code-index metrics are local CLI subprocess timings over generated and sample repositories; sample repo values are observational evidence for those explicit fixtures.
|
|
35
|
+
Current local measured report: `benchmarks/reports/llm/current-local.json` and `benchmarks/reports/llm/current-local.md`, generated 2026-06-10 with ChatGPT/Codex auth, `gpt-5.5`, `decision_lookup`, 1 measured run per condition, no warmup. These values are real Codex JSONL usage and local wall-clock measurements. Positive deltas mean the Project Librarian condition used more than the no-Project-Librarian control.
|
|
36
|
+
|
|
37
|
+
| Scale | Without Project Librarian | With Project Librarian | Actual delta |
|
|
38
|
+
| --- | ---: | ---: | ---: |
|
|
39
|
+
| Small | 102,655 total tokens; 101,226 input; 37.15s; 9 command invocations | 176,104 total tokens; 173,733 input; 61.04s; 15 command invocations | +71.55% tokens; +64.33% time; +66.67% commands |
|
|
40
|
+
| Medium | 79,340 total tokens; 78,348 input; 44.28s; 5 command invocations | 165,840 total tokens; 163,856 input; 48.48s; 10 command invocations | +109.02% tokens; +9.5% time; +100% commands |
|
|
41
|
+
| Large | 197,097 total tokens; 195,278 input; 45.87s; 10 command invocations | 183,959 total tokens; 181,897 input; 49.42s; 13 command invocations | -6.67% tokens; +7.72% time; +30% commands |
|
|
42
|
+
|
|
43
|
+
Claim boundary: this approved local run passed the benchmark claim gate, but it is not a clean release baseline. It used a dirty worktree, one run per condition, and post-run fixture fingerprint validation needs a clean isolated rerun because runtime state files touched the generated fixture directories. Do not claim token or time improvement from Project Librarian until repeated clean actual-LLM runs show stable deltas.
|
|
68
44
|
|
|
69
45
|
## Install
|
|
70
46
|
|
|
71
47
|
Use `npx` only for initial skill installation:
|
|
72
48
|
|
|
73
49
|
```bash
|
|
74
|
-
npx project-librarian install-skill --scope user --agents
|
|
50
|
+
npx project-librarian install-skill --scope user --agents all
|
|
75
51
|
```
|
|
76
52
|
|
|
77
53
|
Install into the current repository instead:
|
|
78
54
|
|
|
79
55
|
```bash
|
|
80
|
-
npx project-librarian install-skill --scope project --agents
|
|
56
|
+
npx project-librarian install-skill --scope project --agents all
|
|
81
57
|
```
|
|
82
58
|
|
|
83
|
-
`install-skill` copies reusable skill files only. It does not create or update `AGENTS.md`, `CLAUDE.md`, `wiki/`, `.codex/hooks.json`, or `.claude/settings.json`.
|
|
59
|
+
`install-skill` copies reusable skill files only. It does not create or update `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `wiki/`, `.cursor/rules/`, `.cursor/hooks.json`, `.gemini/settings.json`, `.codex/hooks.json`, or `.claude/settings.json`.
|
|
84
60
|
|
|
85
61
|
| Situation | Command |
|
|
86
62
|
| --- | --- |
|
|
87
|
-
| Install globally for
|
|
88
|
-
| Install in the current repository | `npx project-librarian install-skill --scope project --agents
|
|
63
|
+
| Install globally for all supported agents | `npx project-librarian install-skill --scope user --agents all` |
|
|
64
|
+
| Install in the current repository | `npx project-librarian install-skill --scope project --agents all` |
|
|
89
65
|
| Install only Codex | `npx project-librarian install-skill --agents codex` |
|
|
90
66
|
| Install only Claude Code | `npx project-librarian install-skill --agents claude` |
|
|
91
|
-
|
|
|
67
|
+
| Install only Cursor | `npx project-librarian install-skill --agents cursor` |
|
|
68
|
+
| Install only Gemini CLI | `npx project-librarian install-skill --agents gemini` |
|
|
69
|
+
| Preview install output | `npx project-librarian install-skill --scope project --agents all --dry-run` |
|
|
92
70
|
|
|
93
|
-
`--agents` also accepts comma-separated values such as `codex,claude`. `--scope` accepts `user` or `project`.
|
|
71
|
+
`--agents` also accepts comma-separated values such as `codex,claude,cursor,gemini`. `all` targets every supported agent; `both` remains a Codex/Claude compatibility alias. `--scope` accepts `user` or `project`.
|
|
94
72
|
|
|
95
73
|
## Agent Runner
|
|
96
74
|
|
|
@@ -100,8 +78,12 @@ After installation, agents should run the installed local copy with `node`, not
|
|
|
100
78
|
| --- | --- |
|
|
101
79
|
| Project-scoped Codex skill | `node .codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
102
80
|
| Project-scoped Claude skill | `node .claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
81
|
+
| Project-scoped Cursor skill | `node .cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
82
|
+
| Project-scoped Gemini skill | `node .gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
103
83
|
| User-scoped Codex skill | `node ~/.codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
104
84
|
| User-scoped Claude skill | `node ~/.claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
85
|
+
| User-scoped Cursor skill | `node ~/.cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
86
|
+
| User-scoped Gemini skill | `node ~/.gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
105
87
|
|
|
106
88
|
The examples below use:
|
|
107
89
|
|
|
@@ -158,7 +140,9 @@ Project instruction files:
|
|
|
158
140
|
|
|
159
141
|
- `AGENTS.md`
|
|
160
142
|
- `CLAUDE.md`
|
|
143
|
+
- `GEMINI.md`
|
|
161
144
|
- `wiki/AGENTS.md`
|
|
145
|
+
- `.cursor/rules/project-librarian.mdc`
|
|
162
146
|
|
|
163
147
|
Startup hooks:
|
|
164
148
|
|
|
@@ -166,6 +150,10 @@ Startup hooks:
|
|
|
166
150
|
- `.codex/hooks/wiki-session-start.js`
|
|
167
151
|
- `.claude/settings.json`
|
|
168
152
|
- `.claude/hooks/wiki-session-start.js`
|
|
153
|
+
- `.cursor/hooks.json`
|
|
154
|
+
- `.cursor/hooks/wiki-session-start.js`
|
|
155
|
+
- `.gemini/settings.json`
|
|
156
|
+
- `.gemini/hooks/wiki-session-start.js`
|
|
169
157
|
|
|
170
158
|
Git hook files:
|
|
171
159
|
|
|
@@ -193,9 +181,9 @@ Disposable code evidence cache:
|
|
|
193
181
|
4. `--refresh-index` routes newly discovered wiki pages; large route sets are split into `wiki/indexes/auto-*.md` scoped routers.
|
|
194
182
|
5. `--code-index` creates a disposable SQLite evidence cache under `.project-wiki/`.
|
|
195
183
|
6. `--code-report`, `--code-impact`, `--code-search-symbol`, and `--code-query` expose code-backed evidence for planning updates.
|
|
196
|
-
7. Diagnostics report broken links, duplicate routes, orphan pages, stale pages, missing TL;DRs, evidence gaps, and migration
|
|
184
|
+
7. Diagnostics report broken links, duplicate routes, orphan pages, stale pages, missing TL;DRs, evidence gaps, and migration policy violations.
|
|
197
185
|
|
|
198
|
-
Migration is intentionally review-first. `--migrate` preserves an existing `wiki/` as `wiki_legacy*`, writes migration inboxes, and
|
|
186
|
+
Migration is intentionally review-first. `--migrate` preserves an existing `wiki/` as `wiki_legacy*`, writes migration inboxes and a unit-level coverage ledger, and restructures legacy meaning into the current wiki rules. Retained or copied legacy content is acceptable when it fits the new wiki policy and structure; the new wiki must not depend on citing `wiki_legacy*`.
|
|
199
187
|
|
|
200
188
|
## Language Support Matrix
|
|
201
189
|
|
|
@@ -224,7 +212,7 @@ Use the local runner for agent execution:
|
|
|
224
212
|
|
|
225
213
|
```bash
|
|
226
214
|
$PROJECT_LIBRARIAN [init] [options]
|
|
227
|
-
$PROJECT_LIBRARIAN install-skill [--scope user|project] [--agents codex|claude|both]
|
|
215
|
+
$PROJECT_LIBRARIAN install-skill [--scope user|project] [--agents codex|claude|cursor|gemini|all|both]
|
|
228
216
|
```
|
|
229
217
|
|
|
230
218
|
Important options:
|
|
@@ -237,6 +225,9 @@ Important options:
|
|
|
237
225
|
| `--quality-check` | Report stale, conflicting, and low-quality wiki document signals. |
|
|
238
226
|
| `--doctor` | Run lint, link-check, and quality-check together. |
|
|
239
227
|
| `--doctor --fix` | Safely refresh generated index routing before diagnostics. |
|
|
228
|
+
| `--migration-lint` | Validate migration review scaffolding separately from normal lint. |
|
|
229
|
+
| `--migration-quality-check` | Report migration policy/structure signals separately from normal quality-check. |
|
|
230
|
+
| `--migration-doctor` | Run migration-lint and migration-quality-check together. |
|
|
240
231
|
| `--query <terms>` | Search wiki paths, metadata, titles, and bodies. |
|
|
241
232
|
| `--refresh-index` | Update generated auto-discovered wiki routing. |
|
|
242
233
|
| `--capture-inbox --title <title> --content <content>` | Append a candidate note to the wiki inbox. |
|
|
@@ -273,7 +264,7 @@ Maintainer benchmark commands live in [benchmarks/README.md](benchmarks/README.m
|
|
|
273
264
|
|
|
274
265
|
This project is inspired by Andrej Karpathy's [LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) pattern: keep persistent markdown context close to the work instead of reconstructing project state from long chat history.
|
|
275
266
|
|
|
276
|
-
Project Librarian adapts that idea into an installable CLI and skill for Codex
|
|
267
|
+
Project Librarian adapts that idea into an installable CLI and skill for Codex, Claude Code, Cursor, and Gemini CLI, with repo-local instructions, compact startup hooks, migration helpers, diagnostics, and optional code evidence.
|
|
277
268
|
|
|
278
269
|
## License
|
|
279
270
|
|