project-librarian 0.5.5 → 0.5.7
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/CONTRIBUTING.md +36 -0
- package/README.ko.md +58 -365
- package/README.md +56 -363
- package/SKILL.md +7 -0
- package/dist/args.js +9 -1
- package/dist/code-index/extractors/light-languages.js +285 -0
- package/dist/code-index/extractors/registry.js +12 -0
- package/dist/code-index/extractors/shared.js +18 -1
- package/dist/code-index/extractors/typescript.js +30 -16
- package/dist/code-index/index-health.js +4 -3
- package/dist/code-index/modes.js +193 -33
- package/dist/code-index/native-helper-matrix.js +99 -0
- package/dist/code-index/native-helper.js +292 -0
- package/dist/code-index/schema.js +72 -13
- package/dist/code-index/search.js +1 -1
- package/dist/code-index-file-policy.js +9 -1
- package/dist/code-index.js +363 -12
- package/dist/init-project-wiki.js +14 -0
- package/dist/install-skill.js +22 -2
- package/dist/native/darwin-arm64/project-librarian-indexer +0 -0
- package/dist/native/darwin-x64/project-librarian-indexer +0 -0
- package/dist/native/linux-arm64/project-librarian-indexer +0 -0
- package/dist/native/linux-arm64-musl/project-librarian-indexer +0 -0
- package/dist/native/linux-x64/project-librarian-indexer +0 -0
- package/dist/native/linux-x64-musl/project-librarian-indexer +0 -0
- package/dist/native/project-librarian-indexer-manifest.json +70 -0
- package/dist/native/win32-arm64/project-librarian-indexer.exe +0 -0
- package/dist/native/win32-x64/project-librarian-indexer.exe +0 -0
- package/docs/README.md +11 -0
- package/docs/benchmarks.md +64 -0
- package/docs/cli-reference.md +61 -0
- package/docs/code-evidence.md +93 -0
- package/docs/ko/README.md +13 -0
- package/docs/ko/benchmarks.md +64 -0
- package/docs/ko/cli-reference.md +61 -0
- package/docs/ko/code-evidence.md +93 -0
- package/docs/ko/maintainer.md +76 -0
- package/docs/ko/usage.md +168 -0
- package/docs/maintainer.md +76 -0
- package/docs/usage.md +176 -0
- package/package.json +11 -1
package/docs/ko/usage.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# 사용 가이드
|
|
2
|
+
|
|
3
|
+
README 빠른 시작 이후에 보는 문서입니다. 설치 범위, 실행 경로, 생성 파일, 마이그레이션 동작, 에이전트 요청 예시를 다룹니다.
|
|
4
|
+
|
|
5
|
+
## 설치 범위
|
|
6
|
+
|
|
7
|
+
초기 스킬 설치나 특정 레지스트리 버전으로 프로젝트를 갱신할 때는 `npx`를 사용합니다.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx project-librarian@latest install --scope user --agents all
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
현재 저장소 안에 설치하려면 다음을 사용합니다.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx project-librarian@latest install --scope project --agents all
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`install`은 재사용 가능한 스킬 파일과 로컬 실행기에 필요한 필수 런타임 의존성을 복사합니다. `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `wiki/`, `.cursor/rules/`, `.cursor/hooks.json`, `.gemini/settings.json`, `.codex/hooks.json`, `.claude/settings.json`은 만들거나 갱신하지 않습니다. `install-skill`은 호환성 별칭으로 계속 지원됩니다.
|
|
20
|
+
|
|
21
|
+
| 상황 | 명령 |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| 지원하는 모든 에이전트에 전역 설치 | `npx project-librarian@latest install --scope user --agents all` |
|
|
24
|
+
| 현재 저장소에 설치 | `npx project-librarian@latest install --scope project --agents all` |
|
|
25
|
+
| Codex만 설치 | `npx project-librarian@latest install --agents codex` |
|
|
26
|
+
| Claude Code만 설치 | `npx project-librarian@latest install --agents claude` |
|
|
27
|
+
| Cursor만 설치 | `npx project-librarian@latest install --agents cursor` |
|
|
28
|
+
| Gemini CLI만 설치 | `npx project-librarian@latest install --agents gemini` |
|
|
29
|
+
| 설치 결과 미리 보기 | `npx project-librarian@latest install --scope project --agents all --dry-run` |
|
|
30
|
+
|
|
31
|
+
`--agents`는 `codex,claude,cursor,gemini` 같은 쉼표 구분 값도 받습니다. `all`은 지원하는 모든 에이전트를 대상으로 합니다. `--scope`는 `user` 또는 `project`를 받습니다.
|
|
32
|
+
|
|
33
|
+
프로젝트 설정/갱신 실행기도 `--agents`를 받습니다. 새 설정은 프로젝트 범위 Project Librarian 스킬 설치가 없을 때만 지원하는 모든 에이전트 표면을 기본으로 만듭니다. 저장소에 이미 `.codex/skills/project-librarian/`, `.claude/skills/project-librarian/` 같은 프로젝트 범위 스킬이 있으면 첫 설정도 그 설치된 에이전트 집합을 기본값으로 사용합니다.
|
|
34
|
+
|
|
35
|
+
마이그레이션 없는 기존 설정 갱신은 저장소에 이미 있는 에이전트 표면만 보존해서 갱신합니다. 따라서 Codex와 Claude 파일만 있던 저장소는 일반 갱신만으로 Cursor나 Gemini 파일이 새로 생기지 않습니다. 새 표면을 의도적으로 추가하려면 `project-librarian update --agents cursor` 또는 `project-librarian update --agents all`처럼 명시합니다. 목록에 없는 표면을 삭제하지는 않습니다.
|
|
36
|
+
|
|
37
|
+
`project-librarian update`는 선택된 표면에 이미 프로젝트 범위 Project Librarian 스킬 설치가 있으면 현재 실행 중인 패키지의 재사용 가능한 스킬 파일과 프로젝트 로컬 실행기에 필요한 런타임 의존성을 그 프로젝트 스킬 디렉터리로 동기화합니다. 기본적으로 새 프로젝트 범위 스킬 설치를 만들지는 않고, 사용자 범위 스킬 설치도 갱신하지 않습니다. 사용자 범위 스킬은 `install --scope user`로 명시적으로 갱신합니다.
|
|
38
|
+
|
|
39
|
+
## 실행 경로
|
|
40
|
+
|
|
41
|
+
이 경로들은 주로 에이전트와 자동화를 위한 참조입니다. 설치 후 에이전트는 `npx`가 아니라 설치된 로컬 복사본을 `node`로 실행해야 합니다. 제한된 에이전트 환경에서 네트워크 접근과 버전이 고정되지 않은 패키지 실행을 피하기 위해서입니다.
|
|
42
|
+
|
|
43
|
+
| 설치 위치 | 실행 경로 |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| 프로젝트 범위 Codex 스킬 | `node .codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
46
|
+
| 프로젝트 범위 Claude 스킬 | `node .claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
47
|
+
| 프로젝트 범위 Cursor 스킬 | `node .cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
48
|
+
| 프로젝트 범위 Gemini 스킬 | `node .gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
49
|
+
| 사용자 범위 Codex 스킬 | `node ~/.codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
50
|
+
| 사용자 범위 Claude 스킬 | `node ~/.claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
51
|
+
| 사용자 범위 Cursor 스킬 | `node ~/.cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
52
|
+
| 사용자 범위 Gemini 스킬 | `node ~/.gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
53
|
+
|
|
54
|
+
## 일반 에이전트 요청
|
|
55
|
+
|
|
56
|
+
원하는 결과를 에이전트에게 말하면, 스킬이 요청을 로컬 실행 명령으로 연결합니다.
|
|
57
|
+
|
|
58
|
+
위키 설정과 유지보수:
|
|
59
|
+
|
|
60
|
+
| 목표 | 에이전트에게 요청 | 내부 동작 |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| 위키 생성 또는 갱신 | "Project Librarian으로 이 저장소의 계획 위키를 설정하거나 갱신해줘." | `[init]` |
|
|
63
|
+
| 마이그레이션 없는 기존 설정 갱신 | "이 저장소의 Project Librarian 설정을 위키 마이그레이션 없이 갱신해줘." | `update` |
|
|
64
|
+
| npm 최신 패키지로 마이그레이션 없이 갱신 | "이 저장소를 최신 Project Librarian으로 위키 마이그레이션 없이 갱신해줘." | `npx project-librarian@latest update` |
|
|
65
|
+
| 특정 에이전트 표면 추가 | "위키 마이그레이션 없이 Cursor Project Librarian 표면을 추가해줘." | `update --agents cursor` |
|
|
66
|
+
| 기존 문서/위키 마이그레이션 | "Project Librarian으로 기존 docs/wiki 내용을 마이그레이션해줘." | `--migrate` |
|
|
67
|
+
| 생성된 설정 검증 | "Project Librarian 검증을 실행해줘." | `--lint` |
|
|
68
|
+
| 링크와 문서 품질 점검 | "Project Librarian 진단을 실행해줘." | `--doctor` |
|
|
69
|
+
| 진단 전 라우팅 갱신 | "Project Librarian 라우팅을 갱신한 뒤 진단을 실행해줘." | `--doctor --fix` |
|
|
70
|
+
| 위키 내용 검색 | "Project Librarian 위키에서 authentication decisions를 찾아줘." | `--query "authentication decisions"` |
|
|
71
|
+
| 페이지 영향도 확인 | "decisions/release-policy의 Project Librarian 위키 영향도를 보여줘." | `--wiki-impact "decisions/release-policy"` |
|
|
72
|
+
| 위키 그래프 생성 | "Project Librarian 위키 그래프 시각화를 생성해줘." | `--wiki-visualize` |
|
|
73
|
+
| 후보 메모 저장 | "이 내용을 Project Librarian 후보 메모로 저장해줘: <내용>." | `--capture-inbox --title "Candidate" --content "Details"` |
|
|
74
|
+
| 세션 핸드오프 저장 | "현재 작업을 Project Librarian 세션 핸드오프로 저장해줘." | `--handoff-save --goal "..." --state "..." --next "..."` |
|
|
75
|
+
| 핸드오프 보기 | "마지막 Project Librarian 세션 핸드오프를 보여줘." | `--handoff-show` |
|
|
76
|
+
| 핸드오프 후보 승격 | "마지막 Project Librarian 핸드오프를 위키 수신함 후보로 승격해줘." | `--handoff-promote-inbox` |
|
|
77
|
+
| 전체 핸드오프 주입 실험 켜기 | "Project Librarian 전체 핸드오프 주입 실험을 켜줘." | `--handoff-injection-enable` |
|
|
78
|
+
| 오래되었거나 미해결인 페이지 보고 | "Project Librarian에서 오래되었거나 미해결인 페이지를 확인해줘." | `--prune-check` |
|
|
79
|
+
| 엄격한 기준으로 stale/unresolved 보고 | "Project Librarian에서 엄격한 기준으로 오래되었거나 미해결인 페이지를 확인해줘." | `--prune-check --prune-check-strict` |
|
|
80
|
+
| git 설정 변경 없이 훅 파일 설치 | "git 설정은 바꾸지 말고 Project Librarian 훅 파일만 설정해줘." | `--no-git-config` |
|
|
81
|
+
|
|
82
|
+
코드 근거:
|
|
83
|
+
|
|
84
|
+
| 목표 | 에이전트에게 요청 | 내부 동작 |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| 기본 근거 캐시 생성 | "`src`에 대해 Project Librarian 코드 근거를 만들어줘." | `--code-index --code-scope src` |
|
|
87
|
+
| 여러 범위 빌드 | "`src`와 `packages/api`에 대해 Project Librarian 코드 근거를 만들어줘." | `--code-index --code-scope src --code-scope packages/api` |
|
|
88
|
+
| 증분 갱신 요구 | "Project Librarian 코드 근거 인덱스를 증분 갱신해줘." | `--code-index --incremental` |
|
|
89
|
+
| 전체 재생성 강제 | "Project Librarian 코드 근거 인덱스를 전체 재생성해줘." | `--code-index --code-index-full` |
|
|
90
|
+
| 스키마 마이그레이션 승인 | "Project Librarian 코드 근거 인덱스 스키마를 마이그레이션해줘." | `--code-index --code-index-migrate` |
|
|
91
|
+
| 선택적 Tree-sitter 백엔드 사용 | "Tree-sitter 파서로 Project Librarian 코드 근거를 만들어줘." | `--code-index --code-parser tree-sitter` |
|
|
92
|
+
| 캐시 호환성 진단 | "Project Librarian 코드 근거 캐시 상태와 호환성을 진단해줘." | `--code-index-health` |
|
|
93
|
+
| 캐시 상태 확인 | "Project Librarian 코드 근거 상태를 보여줘." | `--code-status` |
|
|
94
|
+
| 인덱싱된 파일 목록 | "Project Librarian 코드 근거 인덱스의 파일 목록을 보여줘." | `--code-files` |
|
|
95
|
+
| 구조/소유권 보고서 | "Project Librarian 코드 보고서를 보여줘." | `--code-report` |
|
|
96
|
+
| 특정 보고서 섹션 | "Project Librarian 코드 보고서의 routes 섹션을 보여줘." | `--code-report --code-report-section routes` |
|
|
97
|
+
| 영향 근거 확인 | "`healthHandler`의 Project Librarian 영향 근거를 보여줘." | `--code-impact healthHandler` |
|
|
98
|
+
| 컨텍스트 팩 생성 | "`healthHandler`의 Project Librarian 컨텍스트 팩을 만들어줘." | `--code-context-pack healthHandler` |
|
|
99
|
+
| 심볼 검색 | "`Auth` 심볼을 Project Librarian 코드 근거에서 찾아줘." | `--code-search-symbol Auth` |
|
|
100
|
+
| 보수적 읽기 전용 SQL | "파일 경로를 위한 읽기 전용 Project Librarian 코드 근거 쿼리를 실행해줘." | `--code-query "select path from files order by path"` |
|
|
101
|
+
|
|
102
|
+
한 번에 하나의 코드 근거 모드만 실행할 수 있습니다. `--incremental`, `--code-index-full`, `--code-index-migrate`, `--code-parser`는 `--code-index`와 함께 사용할 때만 유효합니다. `--code-index-migrate`는 기존 폐기형 인덱스의 스키마 버전이 현재 패키지와 다를 때 교체를 승인한다는 명시적 표시입니다.
|
|
103
|
+
|
|
104
|
+
## 설치되는 파일
|
|
105
|
+
|
|
106
|
+
새 설정은 `--agents`를 지정하지 않았고 저장소에 더 좁은 에이전트 집합의 프로젝트 범위 Project Librarian 스킬이 없으면 지원하는 에이전트 표면을 설치합니다. 기존 마이그레이션 없는 업데이트는 감지된 표면만 보존해서 갱신합니다.
|
|
107
|
+
|
|
108
|
+
프로젝트 지침 파일:
|
|
109
|
+
|
|
110
|
+
- `AGENTS.md`
|
|
111
|
+
- `CLAUDE.md`
|
|
112
|
+
- `GEMINI.md`
|
|
113
|
+
- `wiki/AGENTS.md`
|
|
114
|
+
- `.cursor/rules/project-librarian.mdc`
|
|
115
|
+
|
|
116
|
+
시작 훅:
|
|
117
|
+
|
|
118
|
+
- `.codex/hooks.json`
|
|
119
|
+
- `.codex/hooks/wiki-session-start.js`
|
|
120
|
+
- `.claude/settings.json`
|
|
121
|
+
- `.claude/hooks/wiki-session-start.js`
|
|
122
|
+
- `.cursor/hooks.json`
|
|
123
|
+
- `.cursor/hooks/wiki-session-start.js`
|
|
124
|
+
- `.gemini/settings.json`
|
|
125
|
+
- `.gemini/hooks/wiki-session-start.js`
|
|
126
|
+
|
|
127
|
+
git 훅 파일:
|
|
128
|
+
|
|
129
|
+
- `.githooks/prepare-commit-msg`
|
|
130
|
+
- `.githooks/wiki-commit-trailers.js`
|
|
131
|
+
|
|
132
|
+
위키 디렉터리:
|
|
133
|
+
|
|
134
|
+
- `wiki/canonical/`
|
|
135
|
+
- `wiki/roadmaps/`
|
|
136
|
+
- `wiki/plans/`
|
|
137
|
+
- `wiki/decisions/`
|
|
138
|
+
- `wiki/inbox/`
|
|
139
|
+
- `wiki/meta/`
|
|
140
|
+
- `wiki/sources/`
|
|
141
|
+
- `wiki/migration/`
|
|
142
|
+
|
|
143
|
+
시드 위키 페이지와 라우터:
|
|
144
|
+
|
|
145
|
+
- `wiki/startup.md`
|
|
146
|
+
- `wiki/index.md`
|
|
147
|
+
- `wiki/meta/document-taxonomy.md`
|
|
148
|
+
|
|
149
|
+
실제 내용이 없는 빈 프로젝트 문서나 ADR 템플릿은 기본 생성하지 않습니다. 나중에 실제 내용이 생기면 문서를 만들고 `--refresh-index`로 라우팅할 수 있습니다.
|
|
150
|
+
|
|
151
|
+
MCP 서버 등록은 Claude Code(`.mcp.json`), Cursor(`.cursor/mcp.json`), Gemini CLI(`.gemini/settings.json`)의 `mcpServers`에 기존 값을 보존하며 병합합니다. 폐기 가능한 코드 근거 캐시는 `.project-wiki/code-evidence.sqlite`입니다.
|
|
152
|
+
|
|
153
|
+
## 작동 방식
|
|
154
|
+
|
|
155
|
+
1. 부트스트랩은 기존 내용을 보존하는 위키 구조와 marker-bounded 에이전트 지침 섹션을 만듭니다.
|
|
156
|
+
2. 세션 시작 훅은 문자 예산이 적용된 `wiki/startup.md`와 `wiki/index.md`만 주입합니다.
|
|
157
|
+
3. 실제 내용이 없는 양식 전용 페이지는 만들지 않습니다.
|
|
158
|
+
4. 자세한 계획 정본은 에이전트가 필요할 때 읽는 canonical, decision, source, meta 페이지에 둡니다.
|
|
159
|
+
5. 새 프로젝트 계획 내용은 작성하거나 취합하기 전에 분류해 상위/하위 문서 관계가 보이도록 유지합니다.
|
|
160
|
+
6. `--refresh-index`는 새로 발견한 위키 페이지를 라우팅합니다. route가 많으면 `wiki/indexes/auto-*.md` 범위별 라우터로 나눕니다.
|
|
161
|
+
7. `--code-index`는 `.project-wiki/` 아래 폐기 가능한 SQLite 근거 캐시를 만듭니다.
|
|
162
|
+
8. `--code-report`, `--code-impact`, `--code-context-pack`, `--code-search-symbol`, `--code-query`는 계획 업데이트에 쓸 코드 기반 근거를 노출합니다.
|
|
163
|
+
9. 읽기 전용 위키 소비자는 경로와 frontmatter에서 사용자-facing page type을 파생하는 concept read model을 공유합니다.
|
|
164
|
+
10. 위키 생산자는 canonical markdown/YAML 스키마를 계속 쓰고, 진단/MCP/시각화 같은 읽기 전용 소비자는 파생 projection을 사용합니다.
|
|
165
|
+
11. `--wiki-visualize`는 데이터베이스나 서버 없이 `.project-wiki/` 아래 정적 그래프 산출물을 작성합니다.
|
|
166
|
+
12. 진단은 깨진 링크, 중복 route, orphan page, stale page, TL;DR 누락, 근거 공백, 마이그레이션 정책 위반을 보고합니다.
|
|
167
|
+
|
|
168
|
+
마이그레이션은 검토 우선입니다. `--migrate`는 기존 `wiki/`를 `wiki_legacy*`로 보존하고, 양식 전용 파일은 건너뛰며, 여러 성격이 섞인 기존 페이지를 의미 단위로 나눕니다. 이후 각 단위를 분류해 `wiki/migration/` 아래 검토 파일을 작성합니다.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Maintainer Guide
|
|
2
|
+
|
|
3
|
+
This page collects development and release-operation details that are too deep for the README first screen.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
The source is TypeScript. The committed `dist/` directory is the compiled JavaScript used by the npm binary and installed skill copies.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
npm run typecheck
|
|
12
|
+
npm run build
|
|
13
|
+
npm run check:dist
|
|
14
|
+
npm test
|
|
15
|
+
npm run test:coverage
|
|
16
|
+
npm run benchmark:llm:raw-audit
|
|
17
|
+
npm run benchmark:llm:delta-analysis
|
|
18
|
+
npm run benchmark:claim-ledger
|
|
19
|
+
npm run release:check
|
|
20
|
+
npm pack --dry-run
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
When editing TypeScript under `src/`, rebuild before committing so `dist/` stays current. `npm run check:dist` verifies that the checked-in generated files still match the latest build output.
|
|
24
|
+
|
|
25
|
+
`npm run test:coverage` uses Node's native test coverage with conservative line, branch, and function thresholds so coverage is a regression gate, not only a report.
|
|
26
|
+
|
|
27
|
+
The supported runtime floor is Node.js 22.13+. Development type definitions should stay aligned with the Node 22 support contract or be backed by a Node 22 compatibility check so TypeScript does not admit APIs unavailable to supported users.
|
|
28
|
+
|
|
29
|
+
## Release Readiness
|
|
30
|
+
|
|
31
|
+
`npm run release:check` is a local-only maintainer gate. It runs tests, native Node coverage, benchmark parser smoke, the real-corpus offline demo, benchmark release preview, benchmark claim-ledger classification, raw hygiene audit, package dry-run inspection, native helper package-matrix, binary-format, and SHA-256 provenance-manifest inspection, dist executable/parity checks, README benchmark-claim boundary checks, documentation CLI reference coverage, README/README.ko code-evidence freshness/scale-gate documentation checks, and trusted-publishing workflow checks.
|
|
32
|
+
|
|
33
|
+
It never publishes, never deletes raw benchmark artifacts, and never launches a measured Codex benchmark.
|
|
34
|
+
|
|
35
|
+
Treat a green `release:check` as a reproducible release-readiness bundle, not a runtime guarantee. It proves those local gates on the current checkout, including that the package dry run stays inside the expected publish boundary, excludes source files, tests, repo-local wiki/workflow state, raw benchmark output, and local caches, and does not contain a partial, mislabeled, unmanifested, stale-manifest, or checksum-mismatched `dist/native/` helper matrix.
|
|
36
|
+
|
|
37
|
+
## Publishing
|
|
38
|
+
|
|
39
|
+
Publishing is handled by `.github/workflows/publish.yml` after a GitHub Release is published. Non-OIDC jobs verify the source package, build each supported native helper, assemble `dist/native/`, generate the helper manifest, and run `release:check` against the helper-including package.
|
|
40
|
+
|
|
41
|
+
The final publish job targets the protected `npm-publish` GitHub Environment, uses npm trusted publishing through GitHub OIDC (`id-token: write`) and `npm publish --access public`, and generates npm provenance automatically. It must not use `NODE_AUTH_TOKEN` or npm token secrets, and release-critical first-party GitHub Actions are pinned to full commit SHAs. `release:check` verifies this workflow contract locally.
|
|
42
|
+
|
|
43
|
+
Trusted publishing and npm provenance prove the package was published through that GitHub OIDC workflow. They do not prove benchmark correctness, code-evidence freshness in an end-user repository, or a security audit; those remain separate evidence tracks.
|
|
44
|
+
|
|
45
|
+
## Code-Evidence Runtime Checks
|
|
46
|
+
|
|
47
|
+
For code-evidence runtime/storage checks, `npm run perf:code-efficiency` generates 3k/10k/50k fixtures and writes `benchmarks/reports/code-performance-efficiency/current.json` plus `.md`. Command timings include CLI startup and freshness checks; the `query_groups` section reports direct DB timings for representative file/symbol/route/import/edge queries.
|
|
48
|
+
|
|
49
|
+
The report also measures checked-in `mixed-monorepo`, `web-service`, `python-cli`, and `docs-heavy` corpora separately from synthetic scale fixtures. Add repeated `--actual-repo <path>` options with `--compare-native` to include local real repositories in the same TypeScript/Rust timing and row-delta report without modifying the source directories.
|
|
50
|
+
|
|
51
|
+
For actual-repository native policy checks:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm run perf:code-full-rebuild -- --source-root <dir> --helper <helper>
|
|
55
|
+
npm run perf:code-incremental -- --source-root <dir> --helper <helper>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The first command compares forced TypeScript and Rust full rebuilds on fresh repo copies. The second compares TypeScript incremental updates against the Rust incremental writer after controlled file mutations.
|
|
59
|
+
|
|
60
|
+
## Benchmark Raw Output
|
|
61
|
+
|
|
62
|
+
Measured LLM benchmark runs automatically prune stale prior raw run directories and isolated Codex homes older than 1 day, then prune the current run's homes even on claimable-run failure. Raw JSONL, stderr, reports, and manifests remain for runs inside the retention window.
|
|
63
|
+
|
|
64
|
+
Old ignored raw output can still be audited with the dry-run-first helper before deleting retained isolated Codex homes:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run benchmark:llm:raw-audit -- --older-than-days 14
|
|
68
|
+
npm run benchmark:llm:prune-raw -- --older-than-days 14
|
|
69
|
+
npm run benchmark:llm:prune-raw -- --older-than-days 14 --execute
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`npm run benchmark:llm:delta-analysis` reads the checked-in measured LLM report and ranks cost-weighted regressions without launching Codex. Add `-- --include-traces` to include representative raw JSONL command traces and classify broad-search/router-read drivers. It is the first diagnostic stop for weak cells such as small-scale aggregation before adding new benchmark claims.
|
|
73
|
+
|
|
74
|
+
Measured LLM runs default to `--scenario-order run-major-balanced`: each measured run index executes all selected scenarios, reversing the order on alternating repetitions so with/without pairs are not grouped by condition across repeated runs. Use `--scenario-order scenario-major` only when reproducing older scenario-grouped diagnostics.
|
|
75
|
+
|
|
76
|
+
`npm run typecheck:ts7` is an opt-in TypeScript 7 RC compatibility probe. It uses `npx` and is intentionally outside `test`, `release:check`, and CI gates until the compiler API and this project's TypeScript extractor have a measured parity record.
|
package/docs/usage.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Usage
|
|
2
|
+
|
|
3
|
+
Use this guide after the README quick start. It covers install scope, runner paths, generated files, migration behavior, and agent-facing requests.
|
|
4
|
+
|
|
5
|
+
## Install Scopes
|
|
6
|
+
|
|
7
|
+
Use `npx` for initial skill installation or for an explicit registry-version project update:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx project-librarian@latest install --scope user --agents all
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Install into the current repository instead:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx project-librarian@latest install --scope project --agents all
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`install` copies reusable skill files and required local-runner runtime dependencies. 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`. `install-skill` remains supported as a compatibility alias.
|
|
20
|
+
|
|
21
|
+
| Situation | Command |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Install globally for all supported agents | `npx project-librarian@latest install --scope user --agents all` |
|
|
24
|
+
| Install in the current repository | `npx project-librarian@latest install --scope project --agents all` |
|
|
25
|
+
| Install only Codex | `npx project-librarian@latest install --agents codex` |
|
|
26
|
+
| Install only Claude Code | `npx project-librarian@latest install --agents claude` |
|
|
27
|
+
| Install only Cursor | `npx project-librarian@latest install --agents cursor` |
|
|
28
|
+
| Install only Gemini CLI | `npx project-librarian@latest install --agents gemini` |
|
|
29
|
+
| Preview install output | `npx project-librarian@latest install --scope project --agents all --dry-run` |
|
|
30
|
+
|
|
31
|
+
`--agents` accepts comma-separated values such as `codex,claude,cursor,gemini`. `all` targets every supported agent. `--scope` accepts `user` or `project`.
|
|
32
|
+
|
|
33
|
+
The project setup/update runner also accepts `--agents`. Fresh setup defaults to all supported agent surfaces only when no project-scoped Project Librarian skill install is present. If the repository already has project-scoped skills such as `.codex/skills/project-librarian/` and `.claude/skills/project-librarian/`, the first setup uses that installed agent set by default. Existing non-migration updates preserve the agent surfaces already present in the repository, so a repo that has only Codex and Claude files will not gain Cursor or Gemini files on a plain update. Use `project-librarian update --agents cursor` or `project-librarian update --agents all` when you intentionally want to add newly supported surfaces; unlisted surfaces are not deleted.
|
|
34
|
+
|
|
35
|
+
`project-librarian update` also syncs any project-scoped Project Librarian skill installs that already exist for the selected surfaces from the currently running package, including the runtime dependencies needed by the project-local runner. This means `npx project-librarian@latest update` can refresh the repository's managed setup, hooks, wiki meta files, and existing project-scoped skill copies without migration. It does not create new project-scoped skill installs by default and does not update user-scoped skill installs; use `install --scope user` for that.
|
|
36
|
+
|
|
37
|
+
## Runner Paths
|
|
38
|
+
|
|
39
|
+
These paths are mainly for agents and automation. After installation, agents should run the installed local copy with `node`, not `npx`. This avoids network access and unpinned package execution in restricted agent environments.
|
|
40
|
+
|
|
41
|
+
| Installation | Runner |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| Project-scoped Codex skill | `node .codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
44
|
+
| Project-scoped Claude skill | `node .claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
45
|
+
| Project-scoped Cursor skill | `node .cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
46
|
+
| Project-scoped Gemini skill | `node .gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
47
|
+
| User-scoped Codex skill | `node ~/.codex/skills/project-librarian/dist/init-project-wiki.js` |
|
|
48
|
+
| User-scoped Claude skill | `node ~/.claude/skills/project-librarian/dist/init-project-wiki.js` |
|
|
49
|
+
| User-scoped Cursor skill | `node ~/.cursor/skills/project-librarian/dist/init-project-wiki.js` |
|
|
50
|
+
| User-scoped Gemini skill | `node ~/.gemini/skills/project-librarian/dist/init-project-wiki.js` |
|
|
51
|
+
|
|
52
|
+
## Common Agent Requests
|
|
53
|
+
|
|
54
|
+
Ask your agent for the outcome you want; the skill maps the request to the local runner internally.
|
|
55
|
+
|
|
56
|
+
Wiki setup and maintenance:
|
|
57
|
+
|
|
58
|
+
| Goal | Ask The Agent | Internal Action |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| Create or update the wiki | "Use Project Librarian to set up or update this repository's planning wiki." | `[init]` |
|
|
61
|
+
| Update existing setup without migration | "Update this repository's Project Librarian setup without migrating the wiki." | `update` |
|
|
62
|
+
| Update from the npm latest package without migration | "Run the latest Project Librarian update for this repository without migrating the wiki." | `npx project-librarian@latest update` |
|
|
63
|
+
| Add a specific agent surface to an existing setup | "Add the Cursor Project Librarian surface without migrating the wiki." | `update --agents cursor` |
|
|
64
|
+
| Migrate existing docs/wiki content | "Use Project Librarian to migrate the existing docs/wiki content." | `--migrate` |
|
|
65
|
+
| Validate generated setup | "Run Project Librarian validation." | `--lint` |
|
|
66
|
+
| Check links and document quality | "Run Project Librarian diagnostics." | `--doctor` |
|
|
67
|
+
| Refresh generated routing before diagnostics | "Refresh Project Librarian routing and then run diagnostics." | `--doctor --fix` |
|
|
68
|
+
| Search project wiki content | "Search the Project Librarian wiki for authentication decisions." | `--query "authentication decisions"` |
|
|
69
|
+
| Show backlinks and decision citations for a page | "Show Project Librarian wiki impact for decisions/release-policy." | `--wiki-impact "decisions/release-policy"` |
|
|
70
|
+
| Generate a wiki graph visualizer | "Generate the Project Librarian wiki graph visualizer." | `--wiki-visualize` |
|
|
71
|
+
| Capture a candidate note | "Capture this as a Project Librarian candidate note: <details>." | `--capture-inbox --title "Candidate" --content "Details"` |
|
|
72
|
+
| Save a session handoff | "Save a Project Librarian session handoff for the current work." | `--handoff-save --goal "..." --state "..." --next "..."` |
|
|
73
|
+
| Resume from a handoff | "Show the last Project Librarian session handoff." | `--handoff-show` |
|
|
74
|
+
| Promote handoff candidates | "Promote the last Project Librarian handoff to the wiki inbox." | `--handoff-promote-inbox` |
|
|
75
|
+
| Opt in to full handoff injection | "Enable the Project Librarian full handoff injection experiment." | `--handoff-injection-enable` |
|
|
76
|
+
| Report stale or unresolved wiki pages | "Check Project Librarian for stale or unresolved pages." | `--prune-check` |
|
|
77
|
+
| Report only higher-signal stale or unresolved wiki pages | "Check Project Librarian for strict stale or unresolved pages." | `--prune-check --prune-check-strict` |
|
|
78
|
+
| Install hook files without changing git config | "Set up Project Librarian hook files without changing git config." | `--no-git-config` |
|
|
79
|
+
|
|
80
|
+
Code evidence:
|
|
81
|
+
|
|
82
|
+
| Goal | Ask The Agent | Internal Action |
|
|
83
|
+
| --- | --- | --- |
|
|
84
|
+
| Build the default evidence cache | "Build Project Librarian code evidence for `src`." | `--code-index --code-scope src` |
|
|
85
|
+
| Build multiple scopes | "Build Project Librarian code evidence for `src` and `packages/api`." | `--code-index --code-scope src --code-scope packages/api` |
|
|
86
|
+
| Require incremental update | "Update the Project Librarian code evidence index incrementally." | `--code-index --incremental` |
|
|
87
|
+
| Force a full rebuild | "Fully rebuild the Project Librarian code evidence index." | `--code-index --code-index-full` |
|
|
88
|
+
| Approve a schema migration | "Migrate the Project Librarian code evidence index schema." | `--code-index --code-index-migrate` |
|
|
89
|
+
| Use optional Tree-sitter backend | "Build Project Librarian code evidence with the Tree-sitter parser." | `--code-index --code-parser tree-sitter` |
|
|
90
|
+
| Inspect cache compatibility | "Inspect Project Librarian code evidence cache health." | `--code-index-health` |
|
|
91
|
+
| Show cache status | "Show Project Librarian code evidence status." | `--code-status` |
|
|
92
|
+
| List indexed files | "List files in the Project Librarian code evidence index." | `--code-files` |
|
|
93
|
+
| Print architecture and ownership report | "Show the Project Librarian code report." | `--code-report` |
|
|
94
|
+
| Print one report section | "Show the routes section of the Project Librarian code report." | `--code-report --code-report-section routes` |
|
|
95
|
+
| Inspect impact evidence | "Show Project Librarian impact evidence for `healthHandler`." | `--code-impact healthHandler` |
|
|
96
|
+
| Build a context pack | "Build a Project Librarian context pack for `healthHandler`." | `--code-context-pack healthHandler` |
|
|
97
|
+
| Search indexed symbols | "Search Project Librarian code evidence for symbol `Auth`." | `--code-search-symbol Auth` |
|
|
98
|
+
| Run conservative read-only SQL | "Run a read-only Project Librarian code evidence query for file paths." | `--code-query "select path from files order by path"` |
|
|
99
|
+
|
|
100
|
+
Only one code evidence mode can run at a time. `--incremental`, `--code-index-full`, `--code-index-migrate`, and `--code-parser` are valid only with `--code-index`. `--code-index-migrate` is explicit approval to replace an existing disposable index when its schema version differs from the current package.
|
|
101
|
+
|
|
102
|
+
## What Gets Installed
|
|
103
|
+
|
|
104
|
+
Fresh setup installs the supported agent surfaces below unless you pass `--agents` or the repository already has project-scoped Project Librarian skills for a narrower agent set. Existing non-migration updates preserve the detected surface set by default and update only those selected surfaces plus the common wiki/git-hook files.
|
|
105
|
+
|
|
106
|
+
Project instruction files:
|
|
107
|
+
|
|
108
|
+
- `AGENTS.md`
|
|
109
|
+
- `CLAUDE.md`
|
|
110
|
+
- `GEMINI.md`
|
|
111
|
+
- `wiki/AGENTS.md`
|
|
112
|
+
- `.cursor/rules/project-librarian.mdc`
|
|
113
|
+
|
|
114
|
+
Startup hooks:
|
|
115
|
+
|
|
116
|
+
- `.codex/hooks.json`
|
|
117
|
+
- `.codex/hooks/wiki-session-start.js`
|
|
118
|
+
- `.claude/settings.json`
|
|
119
|
+
- `.claude/hooks/wiki-session-start.js`
|
|
120
|
+
- `.cursor/hooks.json`
|
|
121
|
+
- `.cursor/hooks/wiki-session-start.js`
|
|
122
|
+
- `.gemini/settings.json`
|
|
123
|
+
- `.gemini/hooks/wiki-session-start.js`
|
|
124
|
+
|
|
125
|
+
Git hook files:
|
|
126
|
+
|
|
127
|
+
- `.githooks/prepare-commit-msg`
|
|
128
|
+
- `.githooks/wiki-commit-trailers.js`
|
|
129
|
+
|
|
130
|
+
Wiki directories:
|
|
131
|
+
|
|
132
|
+
- `wiki/canonical/`
|
|
133
|
+
- `wiki/roadmaps/`
|
|
134
|
+
- `wiki/plans/`
|
|
135
|
+
- `wiki/decisions/`
|
|
136
|
+
- `wiki/inbox/`
|
|
137
|
+
- `wiki/meta/`
|
|
138
|
+
- `wiki/sources/`
|
|
139
|
+
- `wiki/migration/`
|
|
140
|
+
|
|
141
|
+
Seed wiki pages and routers:
|
|
142
|
+
|
|
143
|
+
- `wiki/startup.md`
|
|
144
|
+
- `wiki/index.md`
|
|
145
|
+
- `wiki/meta/document-taxonomy.md`
|
|
146
|
+
|
|
147
|
+
Empty project pages such as `canonical/project-brief.md`, `canonical/open-questions.md`, `canonical/assumptions.md`, `canonical/risks.md`, and ADR templates are not created until there is real content to store. The router can discover them later with `--refresh-index`. During migration, form-only legacy templates are recorded as skipped in `wiki/migration/inventory.md` instead of becoming review rows or new wiki pages.
|
|
148
|
+
|
|
149
|
+
MCP server registration is a preservation-first merge into `mcpServers` for Claude Code (`.mcp.json`), Cursor (`.cursor/mcp.json`), and Gemini CLI (`.gemini/settings.json`). The disposable code-evidence cache is `.project-wiki/code-evidence.sqlite`.
|
|
150
|
+
|
|
151
|
+
## How It Works
|
|
152
|
+
|
|
153
|
+
1. Bootstrap creates a preservation-first wiki structure and marker-bounded agent instruction sections.
|
|
154
|
+
2. Session-start hooks inject only `wiki/startup.md` and `wiki/index.md`, with character budgets.
|
|
155
|
+
3. Bootstrap avoids empty form-only project pages; focused canonical, decision, source, and meta pages are created when content actually exists.
|
|
156
|
+
4. Detailed planning truth stays in canonical, decision, source, and meta pages that agents read on demand.
|
|
157
|
+
5. New project-planning content is classified before it is written or consolidated, keeping upstream/downstream document relationships visible.
|
|
158
|
+
6. `--refresh-index` routes newly discovered wiki pages; large route sets are split into `wiki/indexes/auto-*.md` scoped routers.
|
|
159
|
+
7. `--code-index` creates a disposable SQLite evidence cache under `.project-wiki/`.
|
|
160
|
+
8. `--code-report`, `--code-impact`, `--code-context-pack`, `--code-search-symbol`, and `--code-query` expose code-backed evidence for planning updates.
|
|
161
|
+
9. Read-only wiki consumers share a concept read model that derives user-facing page types from paths and frontmatter without rewriting the canonical wiki schema.
|
|
162
|
+
10. Wiki producers keep writing the canonical markdown/YAML schema, while read-only consumers such as diagnostics, MCP, and the visualizer use derived projections instead of mutating source documents.
|
|
163
|
+
11. `--wiki-visualize` writes a static graph artifact to `.project-wiki/`, reusing the wiki graph and concept read model instead of introducing a database or server.
|
|
164
|
+
12. Diagnostics report broken links, duplicate routes, orphan pages, stale pages, missing TL;DRs, evidence gaps, and migration policy violations.
|
|
165
|
+
|
|
166
|
+
Migration is intentionally review-first. `--migrate` preserves an existing `wiki/` as `wiki_legacy*`, skips form-only/template legacy files, splits mixed legacy pages into meaning units, classifies each unit through the document taxonomy, and writes review files under `wiki/migration/`:
|
|
167
|
+
|
|
168
|
+
- `inventory.md` records migratable legacy markdown files, file-level classification, and form-only/template files skipped from semantic migration.
|
|
169
|
+
- `unit-map.md` records each heading, paragraph, list item, table row, and code block with its suggested taxonomy area and target page.
|
|
170
|
+
- `split-plan.md` groups those units by suggested new wiki target, so one legacy page that mixes API specs, features, UX, QA, policy, or operations can be rewritten into separate files.
|
|
171
|
+
- `coverage.md` is the editable status ledger for each unit: pending, adopted, merged, superseded, rejected, resolved, or needs-human-review.
|
|
172
|
+
- `verification.md` and `review.md` summarize coverage and semantic completion after `--review-migration`.
|
|
173
|
+
|
|
174
|
+
`--migration-lint` validates that `coverage.md`, `unit-map.md`, and `split-plan.md` still account for the current migration batch, including duplicate/stale unit IDs, invalid storage/confidence/status values, split count drift, target drift, and old coverage-table schemas. When a legacy page has units that point to multiple targets, `--review-migration` will not let a file-level inbox status complete every unit; unit-level coverage must be resolved instead.
|
|
175
|
+
|
|
176
|
+
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*`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-librarian",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Create and maintain compact project context for humans and LLM coding agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"homepage": "https://github.com/kkjk1176/project-librarian#readme",
|
|
25
25
|
"files": [
|
|
26
26
|
"agents/",
|
|
27
|
+
"CONTRIBUTING.md",
|
|
28
|
+
"docs/",
|
|
27
29
|
"dist/",
|
|
28
30
|
"LICENSE",
|
|
29
31
|
"README.md",
|
|
@@ -59,7 +61,15 @@
|
|
|
59
61
|
"build": "tsc && chmod +x dist/init-project-wiki.js",
|
|
60
62
|
"check:dist": "node benchmarks/tools/release-readiness.js --only-dist-parity",
|
|
61
63
|
"audit:supply-chain": "npm audit --omit=dev",
|
|
64
|
+
"native:build": "cargo build --release --locked --manifest-path native/indexer-rs/Cargo.toml",
|
|
65
|
+
"native:package-audit": "node benchmarks/tools/native-indexer-package-audit.js",
|
|
66
|
+
"native:package-audit:matrix": "node benchmarks/tools/native-indexer-package-audit.js --require-packaged-helper-matrix --require-packaged-helper-provenance",
|
|
67
|
+
"native:package-manifest": "node benchmarks/tools/native-indexer-package-audit.js --write-packaged-helper-manifest --require-packaged-helper-matrix --require-packaged-helper-provenance",
|
|
68
|
+
"native:stage": "npm run build && npm run native:build && node benchmarks/tools/native-indexer-package-audit.js --stage-packaged-helper --require-packaged-helper",
|
|
62
69
|
"perf:code-efficiency": "node benchmarks/tools/code-performance-efficiency.js --full",
|
|
70
|
+
"perf:code-efficiency:native": "node benchmarks/tools/code-performance-efficiency.js --full --compare-native",
|
|
71
|
+
"perf:code-full-rebuild": "node benchmarks/tools/code-full-rebuild-performance.js",
|
|
72
|
+
"perf:code-incremental": "node benchmarks/tools/code-incremental-performance.js",
|
|
63
73
|
"release:check": "node benchmarks/tools/release-readiness.js",
|
|
64
74
|
"typecheck": "tsc --noEmit",
|
|
65
75
|
"typecheck:ts7": "npx --yes -p typescript@rc tsc --noEmit --project tsconfig.json",
|