project-librarian 0.5.4 → 0.5.6
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 +57 -360
- package/README.md +56 -359
- package/dist/args.js +6 -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/modes.js +136 -32
- package/dist/code-index/native-helper-matrix.js +99 -0
- package/dist/code-index/native-helper.js +292 -0
- package/dist/code-index/ownership.js +8 -6
- package/dist/code-index/schema.js +72 -13
- package/dist/code-index/search.js +1 -1
- package/dist/code-index-db.js +20 -12
- package/dist/code-index-file-policy.js +17 -11
- package/dist/code-index.js +365 -13
- package/dist/hooks.js +5 -5
- package/dist/init-project-wiki.js +7 -1
- package/dist/install-skill.js +99 -6
- package/dist/mcp-server.js +4 -4
- package/dist/migration.js +27 -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/dist/templates.js +4 -3
- package/dist/workspace.js +137 -10
- package/docs/README.md +11 -0
- package/docs/benchmarks.md +64 -0
- package/docs/cli-reference.md +60 -0
- package/docs/code-evidence.md +87 -0
- package/docs/ko/README.md +13 -0
- package/docs/ko/benchmarks.md +64 -0
- package/docs/ko/cli-reference.md +60 -0
- package/docs/ko/code-evidence.md +87 -0
- package/docs/ko/maintainer.md +76 -0
- package/docs/ko/usage.md +167 -0
- package/docs/maintainer.md +76 -0
- package/docs/usage.md +175 -0
- package/package.json +13 -2
package/docs/usage.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
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 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`. `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. 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
|
+
| Use optional Tree-sitter backend | "Build Project Librarian code evidence with the Tree-sitter parser." | `--code-index --code-parser tree-sitter` |
|
|
89
|
+
| Inspect cache compatibility | "Inspect Project Librarian code evidence cache health." | `--code-index-health` |
|
|
90
|
+
| Show cache status | "Show Project Librarian code evidence status." | `--code-status` |
|
|
91
|
+
| List indexed files | "List files in the Project Librarian code evidence index." | `--code-files` |
|
|
92
|
+
| Print architecture and ownership report | "Show the Project Librarian code report." | `--code-report` |
|
|
93
|
+
| Print one report section | "Show the routes section of the Project Librarian code report." | `--code-report --code-report-section routes` |
|
|
94
|
+
| Inspect impact evidence | "Show Project Librarian impact evidence for `healthHandler`." | `--code-impact healthHandler` |
|
|
95
|
+
| Build a context pack | "Build a Project Librarian context pack for `healthHandler`." | `--code-context-pack healthHandler` |
|
|
96
|
+
| Search indexed symbols | "Search Project Librarian code evidence for symbol `Auth`." | `--code-search-symbol Auth` |
|
|
97
|
+
| 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"` |
|
|
98
|
+
|
|
99
|
+
Only one code evidence mode can run at a time. `--incremental`, `--code-index-full`, and `--code-parser` are valid only with `--code-index`.
|
|
100
|
+
|
|
101
|
+
## What Gets Installed
|
|
102
|
+
|
|
103
|
+
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.
|
|
104
|
+
|
|
105
|
+
Project instruction files:
|
|
106
|
+
|
|
107
|
+
- `AGENTS.md`
|
|
108
|
+
- `CLAUDE.md`
|
|
109
|
+
- `GEMINI.md`
|
|
110
|
+
- `wiki/AGENTS.md`
|
|
111
|
+
- `.cursor/rules/project-librarian.mdc`
|
|
112
|
+
|
|
113
|
+
Startup hooks:
|
|
114
|
+
|
|
115
|
+
- `.codex/hooks.json`
|
|
116
|
+
- `.codex/hooks/wiki-session-start.js`
|
|
117
|
+
- `.claude/settings.json`
|
|
118
|
+
- `.claude/hooks/wiki-session-start.js`
|
|
119
|
+
- `.cursor/hooks.json`
|
|
120
|
+
- `.cursor/hooks/wiki-session-start.js`
|
|
121
|
+
- `.gemini/settings.json`
|
|
122
|
+
- `.gemini/hooks/wiki-session-start.js`
|
|
123
|
+
|
|
124
|
+
Git hook files:
|
|
125
|
+
|
|
126
|
+
- `.githooks/prepare-commit-msg`
|
|
127
|
+
- `.githooks/wiki-commit-trailers.js`
|
|
128
|
+
|
|
129
|
+
Wiki directories:
|
|
130
|
+
|
|
131
|
+
- `wiki/canonical/`
|
|
132
|
+
- `wiki/roadmaps/`
|
|
133
|
+
- `wiki/plans/`
|
|
134
|
+
- `wiki/decisions/`
|
|
135
|
+
- `wiki/inbox/`
|
|
136
|
+
- `wiki/meta/`
|
|
137
|
+
- `wiki/sources/`
|
|
138
|
+
- `wiki/migration/`
|
|
139
|
+
|
|
140
|
+
Seed wiki pages and routers:
|
|
141
|
+
|
|
142
|
+
- `wiki/startup.md`
|
|
143
|
+
- `wiki/index.md`
|
|
144
|
+
- `wiki/meta/document-taxonomy.md`
|
|
145
|
+
|
|
146
|
+
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.
|
|
147
|
+
|
|
148
|
+
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`.
|
|
149
|
+
|
|
150
|
+
## How It Works
|
|
151
|
+
|
|
152
|
+
1. Bootstrap creates a preservation-first wiki structure and marker-bounded agent instruction sections.
|
|
153
|
+
2. Session-start hooks inject only `wiki/startup.md` and `wiki/index.md`, with character budgets.
|
|
154
|
+
3. Bootstrap avoids empty form-only project pages; focused canonical, decision, source, and meta pages are created when content actually exists.
|
|
155
|
+
4. Detailed planning truth stays in canonical, decision, source, and meta pages that agents read on demand.
|
|
156
|
+
5. New project-planning content is classified before it is written or consolidated, keeping upstream/downstream document relationships visible.
|
|
157
|
+
6. `--refresh-index` routes newly discovered wiki pages; large route sets are split into `wiki/indexes/auto-*.md` scoped routers.
|
|
158
|
+
7. `--code-index` creates a disposable SQLite evidence cache under `.project-wiki/`.
|
|
159
|
+
8. `--code-report`, `--code-impact`, `--code-context-pack`, `--code-search-symbol`, and `--code-query` expose code-backed evidence for planning updates.
|
|
160
|
+
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.
|
|
161
|
+
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.
|
|
162
|
+
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.
|
|
163
|
+
12. Diagnostics report broken links, duplicate routes, orphan pages, stale pages, missing TL;DRs, evidence gaps, and migration policy violations.
|
|
164
|
+
|
|
165
|
+
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/`:
|
|
166
|
+
|
|
167
|
+
- `inventory.md` records migratable legacy markdown files, file-level classification, and form-only/template files skipped from semantic migration.
|
|
168
|
+
- `unit-map.md` records each heading, paragraph, list item, table row, and code block with its suggested taxonomy area and target page.
|
|
169
|
+
- `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.
|
|
170
|
+
- `coverage.md` is the editable status ledger for each unit: pending, adopted, merged, superseded, rejected, resolved, or needs-human-review.
|
|
171
|
+
- `verification.md` and `review.md` summarize coverage and semantic completion after `--review-migration`.
|
|
172
|
+
|
|
173
|
+
`--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.
|
|
174
|
+
|
|
175
|
+
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.6",
|
|
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",
|
|
@@ -58,7 +60,16 @@
|
|
|
58
60
|
"benchmark:release": "npm run benchmark:llm -- --sanitized-pack --full-matrix --runs 3 --warmup-runs 1 --min-runs-for-claim 3 --require-clean --require-claimable --model gpt-5.5 --out benchmarks/reports/llm/current.json --markdown benchmarks/reports/llm/current.md",
|
|
59
61
|
"build": "tsc && chmod +x dist/init-project-wiki.js",
|
|
60
62
|
"check:dist": "node benchmarks/tools/release-readiness.js --only-dist-parity",
|
|
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",
|
|
61
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",
|
|
62
73
|
"release:check": "node benchmarks/tools/release-readiness.js",
|
|
63
74
|
"typecheck": "tsc --noEmit",
|
|
64
75
|
"typecheck:ts7": "npx --yes -p typescript@rc tsc --noEmit --project tsconfig.json",
|
|
@@ -86,6 +97,6 @@
|
|
|
86
97
|
"@sengac/tree-sitter-typescript": "^0.25.15"
|
|
87
98
|
},
|
|
88
99
|
"devDependencies": {
|
|
89
|
-
"@types/node": "^
|
|
100
|
+
"@types/node": "^22.20.0"
|
|
90
101
|
}
|
|
91
102
|
}
|