@sanqianx/project-knowledge 4.6.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.
Files changed (218) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +17 -0
  3. package/CHANGELOG.md +780 -0
  4. package/LICENSE +201 -0
  5. package/NOTICE +5 -0
  6. package/README.md +266 -0
  7. package/_site/README.md +30 -0
  8. package/_site/_test/ai-profile-resolver-test.js +137 -0
  9. package/_site/_test/ai-profile-test.js +75 -0
  10. package/_site/_test/ai-vendor-presets-test.js +91 -0
  11. package/_site/_test/automation-queue-test.js +14 -0
  12. package/_site/_test/automation-ui-test.js +40 -0
  13. package/_site/_test/background-task-registry-test.js +43 -0
  14. package/_site/_test/baseline-schema-test.js +91 -0
  15. package/_site/_test/bin-cli-test.js +218 -0
  16. package/_site/_test/bridge-adapter-test.js +95 -0
  17. package/_site/_test/bridge-consumer-service-test.js +310 -0
  18. package/_site/_test/cdp-browser-failure-test.js +100 -0
  19. package/_site/_test/chat-claudecodeui-match-test.js +92 -0
  20. package/_site/_test/claude-executable-discovery-test.js +90 -0
  21. package/_site/_test/claude-session-lifecycle-sweep-test.js +252 -0
  22. package/_site/_test/claude-workbench-test.js +170 -0
  23. package/_site/_test/client-capture-restart-e2e-test.js +189 -0
  24. package/_site/_test/codex-conversation-projection-test.js +59 -0
  25. package/_site/_test/codex-notify-fanout-test.js +45 -0
  26. package/_site/_test/commit-boundary-freeze-test.js +147 -0
  27. package/_site/_test/commit-conversation-binding-test.js +99 -0
  28. package/_site/_test/commit-evidence-test.js +110 -0
  29. package/_site/_test/context-pack-test.js +198 -0
  30. package/_site/_test/conversation-api-test.js +119 -0
  31. package/_site/_test/conversation-store-test.js +136 -0
  32. package/_site/_test/cross-repo-isolation-e2e-test.js +187 -0
  33. package/_site/_test/data-dir-migration-test.js +77 -0
  34. package/_site/_test/desktop-browser-compat-test.js +28 -0
  35. package/_site/_test/desktop-hook-runtime-regression-test.js +204 -0
  36. package/_site/_test/embedding-config-test.js +32 -0
  37. package/_site/_test/explicit-commit-processor-test.js +37 -0
  38. package/_site/_test/fixtures/fake-browser-exit.js +10 -0
  39. package/_site/_test/fixtures/fake-browser-hang.js +10 -0
  40. package/_site/_test/fixtures/make-git-repos.js +89 -0
  41. package/_site/_test/folder-picker-output-test.js +19 -0
  42. package/_site/_test/full-integration-e2e-test.js +165 -0
  43. package/_site/_test/git-validation-test.js +81 -0
  44. package/_site/_test/hook-runtime-endpoint-test.js +88 -0
  45. package/_site/_test/hook-status-repair-api-test.js +152 -0
  46. package/_site/_test/hook-trigger-test.js +85 -0
  47. package/_site/_test/hook-worktree-test.js +42 -0
  48. package/_site/_test/import-preflight-api-test.js +233 -0
  49. package/_site/_test/import-ui-flow-test.js +171 -0
  50. package/_site/_test/index-builder-test.js +41 -0
  51. package/_site/_test/index-writer-concurrency-test.js +135 -0
  52. package/_site/_test/integration-adapters-test.js +243 -0
  53. package/_site/_test/integration-capture-setup-test.js +108 -0
  54. package/_site/_test/integration-surface-coverage-test.js +165 -0
  55. package/_site/_test/kb-framework-test.js +57 -0
  56. package/_site/_test/kbpath-follow-test.js +63 -0
  57. package/_site/_test/knowledge-db-test.js +144 -0
  58. package/_site/_test/knowledge-language-control-test.js +170 -0
  59. package/_site/_test/knowledge-maintenance-test.js +40 -0
  60. package/_site/_test/knowledge-migration-test.js +75 -0
  61. package/_site/_test/knowledge-promotion-recovery-test.js +260 -0
  62. package/_site/_test/knowledge-query-test.js +54 -0
  63. package/_site/_test/knowledge-retrieval-service-test.js +77 -0
  64. package/_site/_test/knowledge-scopes-test.js +37 -0
  65. package/_site/_test/knowledge-storage-location-test.js +28 -0
  66. package/_site/_test/knowledge-storage-startup-test.js +52 -0
  67. package/_site/_test/knowledge-store-logs-supervision-test.js +89 -0
  68. package/_site/_test/legacy-claude-session-alias-test.js +106 -0
  69. package/_site/_test/legacy-forward-compat-test.js +257 -0
  70. package/_site/_test/legacy-project-upgrade-e2e-test.js +363 -0
  71. package/_site/_test/legacy-routes-removed-test.js +47 -0
  72. package/_site/_test/legacy-workbench-exclusion-test.js +92 -0
  73. package/_site/_test/log-redaction-test.js +58 -0
  74. package/_site/_test/logging-api-test.js +89 -0
  75. package/_site/_test/logging-sse-no-gap-test.js +88 -0
  76. package/_site/_test/logging-ui-test.js +104 -0
  77. package/_site/_test/markdown-delta-overlay-test.js +85 -0
  78. package/_site/_test/markdown-maintenance-api-test.js +75 -0
  79. package/_site/_test/markdown-maintenance-test.js +11 -0
  80. package/_site/_test/mcp-server-test.js +149 -0
  81. package/_site/_test/model-context-windows-test.js +89 -0
  82. package/_site/_test/module-bridge-eventbridge-test.js +193 -0
  83. package/_site/_test/non-release-ci-test.js +34 -0
  84. package/_site/_test/offline-boundary-isolation-test.js +32 -0
  85. package/_site/_test/orphaned-claim-recovery-test.js +80 -0
  86. package/_site/_test/p0-data-migration-characterization-test.js +37 -0
  87. package/_site/_test/p0-e2e-gate-test.js +347 -0
  88. package/_site/_test/package-boundary-test.js +42 -0
  89. package/_site/_test/package-startup-test.js +56 -0
  90. package/_site/_test/packaged-ui-smoke-test.js +79 -0
  91. package/_site/_test/path-consistency-test.js +151 -0
  92. package/_site/_test/pending-sweep-test.js +9 -0
  93. package/_site/_test/post-commit-automation-test.js +87 -0
  94. package/_site/_test/pr-consumer-contract-test.js +55 -0
  95. package/_site/_test/project-control-panel-task14-test.js +63 -0
  96. package/_site/_test/project-delete-recovery-test.js +64 -0
  97. package/_site/_test/project-goal-editor-test.js +145 -0
  98. package/_site/_test/project-layout-v2-migration-test.js +127 -0
  99. package/_site/_test/project-lifecycle-transaction-test.js +106 -0
  100. package/_site/_test/project-remove-running-guard-test.js +79 -0
  101. package/_site/_test/project-store-test.js +90 -0
  102. package/_site/_test/prompt-settings-test.js +115 -0
  103. package/_site/_test/protected-architecture-gate-test.js +123 -0
  104. package/_site/_test/refactor-characterization-test.js +36 -0
  105. package/_site/_test/release-version-sync-test.js +98 -0
  106. package/_site/_test/requirement-binding-test.js +113 -0
  107. package/_site/_test/requirement-recorder-test.js +173 -0
  108. package/_site/_test/run-all-tests.js +156 -0
  109. package/_site/_test/runtime-endpoint-test.js +64 -0
  110. package/_site/_test/scanner-test.js +83 -0
  111. package/_site/_test/server-runtime-migration-safety-test.js +27 -0
  112. package/_site/_test/server-security-test.js +96 -0
  113. package/_site/_test/sessions-stream-test.js +92 -0
  114. package/_site/_test/shared-contracts-test.js +58 -0
  115. package/_site/_test/simple-import-test.js +97 -0
  116. package/_site/_test/startup-analysis-disabled-test.js +16 -0
  117. package/_site/_test/storage-foundation-test.js +78 -0
  118. package/_site/_test/structured-logger-test.js +101 -0
  119. package/_site/_test/task15-20-ui-flow-test.js +148 -0
  120. package/_site/_test/team-knowledge-store-sparse-checkout-test.js +196 -0
  121. package/_site/_test/team-knowledge-store-test.js +131 -0
  122. package/_site/_test/tracking-start-test.js +143 -0
  123. package/_site/_test/ui-i18n-toggle-test.js +114 -0
  124. package/_site/_test/ui-smoke-test.js +73 -0
  125. package/_site/_test/v4122-upgrade-data-contract-test.js +56 -0
  126. package/_site/_test/workbench-permission-test.js +118 -0
  127. package/_site/_test/workspace-ui-contract-test.js +43 -0
  128. package/_site/lib/ai-profile-resolver.js +78 -0
  129. package/_site/lib/ai-vendor-presets.js +83 -0
  130. package/_site/lib/ai-workspace.js +104 -0
  131. package/_site/lib/atomic-file.js +204 -0
  132. package/_site/lib/automation-config.js +140 -0
  133. package/_site/lib/bridge-adapter.js +256 -0
  134. package/_site/lib/bridge-consumer-service.js +402 -0
  135. package/_site/lib/claude-cli-runner.js +1599 -0
  136. package/_site/lib/commit-conversation-binder.js +246 -0
  137. package/_site/lib/commit-processing-ledger.js +27 -0
  138. package/_site/lib/commit-prompt.js +202 -0
  139. package/_site/lib/commit-reconciler.js +444 -0
  140. package/_site/lib/context-pack-builder.js +299 -0
  141. package/_site/lib/contracts.js +279 -0
  142. package/_site/lib/conversation-exclusions.js +204 -0
  143. package/_site/lib/conversation-query-service.js +161 -0
  144. package/_site/lib/conversation-store.js +385 -0
  145. package/_site/lib/data-dir.js +81 -0
  146. package/_site/lib/data-state-classifier.js +40 -0
  147. package/_site/lib/embedding-service.js +85 -0
  148. package/_site/lib/evidence-bundle.js +228 -0
  149. package/_site/lib/folder-picker-output.js +24 -0
  150. package/_site/lib/git-runner.js +62 -0
  151. package/_site/lib/github-team-store.js +1175 -0
  152. package/_site/lib/hook-manager.js +202 -0
  153. package/_site/lib/index-builder.js +157 -0
  154. package/_site/lib/index-service.js +173 -0
  155. package/_site/lib/integration-installer.js +907 -0
  156. package/_site/lib/kb-framework.js +191 -0
  157. package/_site/lib/kb-validator.js +124 -0
  158. package/_site/lib/knowledge-db.js +363 -0
  159. package/_site/lib/knowledge-promotion.js +435 -0
  160. package/_site/lib/knowledge-retrieval-service.js +401 -0
  161. package/_site/lib/knowledge-schema.js +121 -0
  162. package/_site/lib/knowledge-tool-runtime.js +359 -0
  163. package/_site/lib/legacy-data-manifest.js +26 -0
  164. package/_site/lib/llm-client.js +173 -0
  165. package/_site/lib/markdown-knowledge-indexer.js +230 -0
  166. package/_site/lib/migration-service.js +442 -0
  167. package/_site/lib/model-context-windows.js +82 -0
  168. package/_site/lib/module-bridge.js +496 -0
  169. package/_site/lib/post-commit-automation.js +141 -0
  170. package/_site/lib/project-lifecycle-service.js +511 -0
  171. package/_site/lib/project-registry-store.js +129 -0
  172. package/_site/lib/project-store.js +262 -0
  173. package/_site/lib/prompt-registry.js +148 -0
  174. package/_site/lib/requirement-adapters.js +10 -0
  175. package/_site/lib/requirement-binder.js +112 -0
  176. package/_site/lib/requirement-recorder.js +278 -0
  177. package/_site/lib/runtime-endpoint.js +160 -0
  178. package/_site/lib/scanner.js +298 -0
  179. package/_site/lib/server-app.js +1520 -0
  180. package/_site/lib/settings-store.js +113 -0
  181. package/_site/lib/storage-layout.js +162 -0
  182. package/_site/lib/structured-logger.js +574 -0
  183. package/_site/scripts/codex-notify-fanout.cjs +51 -0
  184. package/_site/scripts/folder-picker.ps1 +156 -0
  185. package/_site/scripts/hook-trigger.js +156 -0
  186. package/_site/scripts/sync-release-version.js +158 -0
  187. package/_site/server.js +12 -0
  188. package/_site/start.bat +26 -0
  189. package/_site/stop.bat +11 -0
  190. package/bin/project-knowledge-integrations.js +241 -0
  191. package/bin/project-knowledge-kb.js +65 -0
  192. package/bin/project-knowledge-mcp.js +195 -0
  193. package/bin/project-knowledge.js +439 -0
  194. package/claude-prompts.json +21 -0
  195. package/docs/README.zh-CN.md +175 -0
  196. package/docs/assets/architecture.svg +182 -0
  197. package/docs/assets/dashboard.png +0 -0
  198. package/docs/assets/draft-review.png +0 -0
  199. package/docs/assets/logo.svg +50 -0
  200. package/docs/assets/runs-drafts.png +0 -0
  201. package/docs/assets/settings.png +0 -0
  202. package/docs/project-registry-schema.md +33 -0
  203. package/docs/team-knowledge-mode-a-plan.md +73 -0
  204. package/docs/testing-strategy.md +33 -0
  205. package/package.json +100 -0
  206. package/plugins/project-knowledge/.claude-plugin/plugin.json +19 -0
  207. package/plugins/project-knowledge/.codex-plugin/plugin.json +38 -0
  208. package/plugins/project-knowledge/.mcp.json +14 -0
  209. package/plugins/project-knowledge/opencode/project-knowledge.md +3 -0
  210. package/plugins/project-knowledge/skills/project-knowledge/SKILL.md +28 -0
  211. package/plugins/project-knowledge/skills/project-knowledge/agents/openai.yaml +11 -0
  212. package/templates/change.md +30 -0
  213. package/templates/project-readme.md +52 -0
  214. package/ui/app.css +58 -0
  215. package/ui/app.js +607 -0
  216. package/ui/favicon.svg +38 -0
  217. package/ui/i18n.js +146 -0
  218. package/ui/index.html +162 -0
@@ -0,0 +1,182 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1180 620" role="img" aria-label="Architecture">
2
+ <defs>
3
+ <linearGradient id="card" x1="0" y1="0" x2="0" y2="1">
4
+ <stop offset="0" stop-color="#1a2330"/>
5
+ <stop offset="1" stop-color="#141c26"/>
6
+ </linearGradient>
7
+ <linearGradient id="cardHover" x1="0" y1="0" x2="0" y2="1">
8
+ <stop offset="0" stop-color="#1f2a3a"/>
9
+ <stop offset="1" stop-color="#192331"/>
10
+ </linearGradient>
11
+ <marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
12
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#7492a5"/>
13
+ </marker>
14
+ </defs>
15
+
16
+ <rect width="1180" height="620" fill="#0c1118"/>
17
+
18
+ <!-- Title -->
19
+ <text x="590" y="42" text-anchor="middle" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" font-size="17" font-weight="600" fill="#e3ebf5" letter-spacing="-0.2">How project-knowledge works</text>
20
+ <text x="590" y="62" text-anchor="middle" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" font-size="11.5" fill="#94a3b8">Local-first pipeline · every byte stays under your home directory</text>
21
+
22
+ <!-- Layer labels -->
23
+ <g font-family="ui-monospace, Consolas, monospace" font-size="9.5" fill="#64748b" letter-spacing="1.5" font-weight="600">
24
+ <text x="28" y="150">USER · UI</text>
25
+ <text x="28" y="282">SERVER</text>
26
+ <text x="28" y="438">DATA · GIT</text>
27
+ <text x="28" y="582">EXTERNAL</text>
28
+ </g>
29
+
30
+ <!-- Layer 1: User-facing -->
31
+ <g transform="translate(120,86)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
32
+ <g>
33
+ <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
34
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Browser Dashboard</text>
35
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">127.0.0.1:5757</text>
36
+ <g font-size="10.5" fill="#94a3b8">
37
+ <text x="16" y="60">· Project sidebar</text>
38
+ <text x="16" y="76">· Supervision cards</text>
39
+ <text x="16" y="92">· Runs / Drafts review</text>
40
+ <text x="16" y="108">· Claude workbench</text>
41
+ </g>
42
+ </g>
43
+
44
+ <g transform="translate(264,0)">
45
+ <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
46
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">CLI daemon</text>
47
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">start · stop · status · --fg</text>
48
+ <g font-size="10.5" fill="#94a3b8">
49
+ <text x="16" y="60">· Port fallback 5757–5776</text>
50
+ <text x="16" y="76">· PID file in os.tmpdir()</text>
51
+ <text x="16" y="92">· Auto-open browser</text>
52
+ <text x="16" y="108">· Survives terminal close</text>
53
+ </g>
54
+ </g>
55
+
56
+ <g transform="translate(528,0)">
57
+ <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
58
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Post-commit hook</text>
59
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">.git/hooks/post-commit</text>
60
+ <g font-size="10.5" fill="#94a3b8">
61
+ <text x="16" y="60">· Fires on git commit</text>
62
+ <text x="16" y="76">· Triggers scan + analysis</text>
63
+ <text x="16" y="92">· Injects KB reading rule</text>
64
+ <text x="16" y="108"> into project's CLAUDE.md</text>
65
+ </g>
66
+ </g>
67
+
68
+ <g transform="translate(792,0)">
69
+ <rect width="252" height="116" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
70
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Claude Code / agents</text>
71
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">reads KB indexes first</text>
72
+ <g font-size="10.5" fill="#94a3b8">
73
+ <text x="16" y="60">· Reads GOAL.md</text>
74
+ <text x="16" y="76">· Reads modules/00-index.md</text>
75
+ <text x="16" y="92">· Reads changes/00-index.md</text>
76
+ <text x="16" y="108">· Opens only top-matched files</text>
77
+ </g>
78
+ </g>
79
+ </g>
80
+
81
+ <!-- Layer 2: Server -->
82
+ <g transform="translate(120,220)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
83
+ <rect width="1044" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
84
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Local HTTP server · Node.js · 127.0.0.1 only</text>
85
+
86
+ <g font-size="10">
87
+ <g transform="translate(16,40)">
88
+ <rect width="148" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
89
+ <text x="74" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">scanner.js</text>
90
+ <text x="74" y="26" font-size="9" fill="#64748b" text-anchor="middle">git state walker</text>
91
+ </g>
92
+ <g transform="translate(176,40)">
93
+ <rect width="170" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
94
+ <text x="85" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">analysis-orchestrator</text>
95
+ <text x="85" y="26" font-size="9" fill="#64748b" text-anchor="middle">commit / initial</text>
96
+ </g>
97
+ <g transform="translate(358,40)">
98
+ <rect width="160" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
99
+ <text x="80" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">context-pack-builder</text>
100
+ <text x="80" y="26" font-size="9" fill="#64748b" text-anchor="middle">prompt assembly</text>
101
+ </g>
102
+ <g transform="translate(530,40)">
103
+ <rect width="132" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
104
+ <text x="66" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">kb-framework</text>
105
+ <text x="66" y="26" font-size="9" fill="#64748b" text-anchor="middle">layout / validate</text>
106
+ </g>
107
+ <g transform="translate(674,40)">
108
+ <rect width="120" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
109
+ <text x="60" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">draft-apply</text>
110
+ <text x="60" y="26" font-size="9" fill="#64748b" text-anchor="middle">review / merge</text>
111
+ </g>
112
+ <g transform="translate(806,40)">
113
+ <rect width="222" height="32" rx="6" fill="rgba(125,211,252,0.08)" stroke="rgba(125,211,252,0.25)"/>
114
+ <text x="111" y="14" font-size="10.5" fill="#7dd3fc" text-anchor="middle" font-weight="600">github-team-store</text>
115
+ <text x="111" y="26" font-size="9" fill="#64748b" text-anchor="middle">Gitea OAuth · sparse checkout</text>
116
+ </g>
117
+ </g>
118
+ <text x="16" y="100" font-size="10" font-family="ui-monospace, Consolas, monospace" fill="#64748b">REST + WebSocket on a single port · SPA shell from _site/index.html</text>
119
+ </g>
120
+
121
+ <!-- Layer 3: Data + git -->
122
+ <g transform="translate(120,376)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
123
+ <g>
124
+ <rect width="252" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
125
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">~/.project-knowledge/</text>
126
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">or $KB_DATA_DIR</text>
127
+ <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
128
+ <text x="16" y="62">projects.json</text>
129
+ <text x="16" y="78">ai-profiles.json</text>
130
+ <text x="16" y="94">knowledge-store.json</text>
131
+ <text x="16" y="110">logs/ · _ai/ · projects/</text>
132
+ </g>
133
+ </g>
134
+ <g transform="translate(264,0)">
135
+ <rect width="252" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
136
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Your Git projects</text>
137
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">local paths · local repos</text>
138
+ <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
139
+ <text x="16" y="62">git status / log / branch</text>
140
+ <text x="16" y="78">HEAD metadata</text>
141
+ <text x="16" y="94">.git/hooks/post-commit</text>
142
+ <text x="16" y="110">CLAUDE.md (managed block)</text>
143
+ </g>
144
+ </g>
145
+ <g transform="translate(528,0)">
146
+ <rect width="636" height="124" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
147
+ <text x="16" y="22" font-size="12" font-weight="600" fill="#cbd5e1">Generated knowledge base (per project)</text>
148
+ <text x="16" y="38" font-size="10" fill="#64748b" font-family="ui-monospace, Consolas, monospace">bilingual · module + change docs · reviewed drafts only</text>
149
+ <g font-size="10.5" font-family="ui-monospace, Consolas, monospace" fill="#94a3b8">
150
+ <text x="16" y="62"> &lt;kbPath&gt;/GOAL.md</text>
151
+ <text x="16" y="78"> modules/00-index.md · changes/00-index.md</text>
152
+ <text x="16" y="94"> modules/&lt;area&gt;.md · changes/release-v*.md</text>
153
+ <text x="16" y="110"> drafts/&lt;pending&gt;.md (reviewable before apply)</text>
154
+ </g>
155
+ </g>
156
+ </g>
157
+
158
+ <!-- Layer 4: External -->
159
+ <g transform="translate(120,520)" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif">
160
+ <rect width="1044" height="44" rx="9" fill="url(#card)" stroke="rgba(255,255,255,0.08)"/>
161
+ <text x="16" y="20" font-size="12" font-weight="600" fill="#cbd5e1">Anthropic-compatible LLM API</text>
162
+ <text x="200" y="20" font-size="10.5" fill="#94a3b8" font-family="ui-monospace, Consolas, monospace">Claude · GLM · DeepSeek · Kimi · self-hosted — any provider exposing the Anthropic Messages API shape</text>
163
+ <text x="200" y="36" font-size="9.5" fill="#64748b">Keys stored locally in ai-profiles.json · never leave your machine except in the request body itself</text>
164
+ </g>
165
+
166
+ <!-- Connectors -->
167
+ <g stroke="#7492a5" stroke-width="1.2" fill="none" marker-end="url(#arrow)" opacity="0.55">
168
+ <!-- User -> Server -->
169
+ <line x1="246" y1="202" x2="246" y2="216"/>
170
+ <line x1="510" y1="202" x2="510" y2="216"/>
171
+ <line x1="774" y1="202" x2="774" y2="216"/>
172
+ <!-- Server -> Data -->
173
+ <line x1="246" y1="344" x2="246" y2="372"/>
174
+ <line x1="510" y1="344" x2="510" y2="372"/>
175
+ <line x1="774" y1="344" x2="774" y2="372"/>
176
+ <!-- Server -> External -->
177
+ <line x1="640" y1="344" x2="640" y2="516"/>
178
+ <!-- User agents <-> Server (read KB) -->
179
+ <line x1="918" y1="202" x2="918" y2="216"/>
180
+ <line x1="918" y1="468" x2="918" y2="496" stroke-dasharray="3,3" opacity="0.4"/>
181
+ </g>
182
+ </svg>
Binary file
Binary file
@@ -0,0 +1,50 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 160" role="img" aria-label="project-knowledge logo">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="560" y2="160" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#0c1118"/>
5
+ <stop offset="1" stop-color="#141c26"/>
6
+ </linearGradient>
7
+ <linearGradient id="core" x1="80" y1="40" x2="120" y2="120" gradientUnits="userSpaceOnUse">
8
+ <stop offset="0" stop-color="#dff8ff"/>
9
+ <stop offset=".55" stop-color="#7dd3fc"/>
10
+ <stop offset="1" stop-color="#2f7d64"/>
11
+ </linearGradient>
12
+ <linearGradient id="book" x1="78" y1="92" x2="148" y2="128" gradientUnits="userSpaceOnUse">
13
+ <stop offset="0" stop-color="#f8fafc"/>
14
+ <stop offset="1" stop-color="#b8c6d8"/>
15
+ </linearGradient>
16
+ <filter id="glow" x="-40%" y="-40%" width="180%" height="180%">
17
+ <feGaussianBlur stdDeviation="3.5"/>
18
+ </filter>
19
+ </defs>
20
+ <rect width="560" height="160" rx="18" fill="url(#bg)"/>
21
+ <!-- Logo mark -->
22
+ <g transform="translate(36,28)">
23
+ <!-- Glow halo -->
24
+ <circle cx="60" cy="52" r="42" fill="#7492a5" opacity="0.18" filter="url(#glow)"/>
25
+ <!-- Book base -->
26
+ <path d="M22 78 L98 78 L98 118 Q60 110 22 118 Z" fill="url(#book)" opacity="0.92"/>
27
+ <path d="M60 84 L60 116" stroke="#7492a5" stroke-width="1.2" opacity="0.55"/>
28
+ <!-- Core orb -->
29
+ <circle cx="60" cy="52" r="26" fill="url(#core)"/>
30
+ <!-- Orbiting nodes -->
31
+ <circle cx="60" cy="14" r="4.5" fill="#7dd3fc"/>
32
+ <circle cx="100" cy="36" r="4.5" fill="#75b798"/>
33
+ <circle cx="100" cy="68" r="4.5" fill="#c5a15d"/>
34
+ <circle cx="20" cy="36" r="4.5" fill="#60a5fa"/>
35
+ <circle cx="20" cy="68" r="4.5" fill="#d36d6d"/>
36
+ <!-- Connectors -->
37
+ <g stroke="#7492a5" stroke-width="1.1" opacity="0.55" fill="none">
38
+ <line x1="60" y1="14" x2="60" y2="26"/>
39
+ <line x1="100" y1="36" x2="84" y2="46"/>
40
+ <line x1="100" y1="68" x2="84" y2="58"/>
41
+ <line x1="20" y1="36" x2="36" y2="46"/>
42
+ <line x1="20" y1="68" x2="36" y2="58"/>
43
+ </g>
44
+ </g>
45
+ <!-- Wordmark -->
46
+ <g transform="translate(184,52)" fill="#e3ebf5" font-family="-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif">
47
+ <text x="0" y="28" font-size="34" font-weight="700" letter-spacing="-0.5">project-knowledge</text>
48
+ <text x="2" y="58" font-size="15" font-weight="500" fill="#7492a5" letter-spacing="0.5">Local KB · Git-aware · AI-reviewed</text>
49
+ </g>
50
+ </svg>
Binary file
Binary file
@@ -0,0 +1,33 @@
1
+ # Project Registry Schema
2
+
3
+ Status: current
4
+ Date: 2026-06-21
5
+
6
+ `projects.json` stores local project configuration. The current KB layout marker is:
7
+
8
+ ```json
9
+ {
10
+ "kbSchemaVersion": "minimal"
11
+ }
12
+ ```
13
+
14
+ ## Relevant Fields
15
+
16
+ | Field | Default | Notes |
17
+ |---|---|---|
18
+ | `slug` | required | Registry key and project identifier |
19
+ | `displayName` | slug | UI label |
20
+ | `gitPath` | required | Source repository path |
21
+ | `kbPath` | generated from knowledge-store root | Final minimal KB location |
22
+ | `kbSchemaVersion` | `"minimal"` | Current KB framework marker |
23
+ | `goalStatus` | `"not-created"` | Review state of `GOAL.md` |
24
+ | `trackingStartCommit` | current `HEAD` on first import | Baseline commit for incremental KB tracking; commits before it are not analyzed |
25
+ | `trackingStartedAt` | current timestamp on first import | Time the tracking baseline was established |
26
+ | `lastAnalyzedCommit` | `null` | Advanced only after accepted apply |
27
+ | `knowledgeLanguage` | `"zh-CN"` | Human-readable output language |
28
+
29
+ Old values may exist in local runtime files, but initialization and migration now target the final minimal framework.
30
+
31
+ Soft-removed projects are remembered in runtime state so re-importing the same
32
+ repository can restore the original `trackingStartCommit`, `lastAnalyzedCommit`,
33
+ and `kbPath`. Hard removal with KB deletion starts fresh.
@@ -0,0 +1,73 @@
1
+ # Team Knowledge Mode A Plan
2
+
3
+ ## Goal
4
+
5
+ Support a team knowledge base without a project-knowledge cloud server by using GitHub as the identity, permission, discovery, and Git transport layer.
6
+
7
+ Mode A assumes one GitHub repository stores multiple project knowledge bases:
8
+
9
+ ```text
10
+ knowledge.git
11
+ .project-knowledge/team-store.json
12
+ acc/
13
+ project-knowledge-pro/
14
+ devtask-radar/
15
+ ```
16
+
17
+ Each developer may name their local source project differently. The local project slug no longer determines the shared knowledge-base directory.
18
+
19
+ ## Manifest
20
+
21
+ The GitHub knowledge repository should contain `.project-knowledge/team-store.json`:
22
+
23
+ ```json
24
+ {
25
+ "schema": "project-knowledge/team-store/v1",
26
+ "storeId": "team-store-sanqian",
27
+ "displayName": "SanQian Knowledge",
28
+ "knowledgeBases": [
29
+ {
30
+ "kbId": "kb-acc",
31
+ "slug": "acc",
32
+ "path": "acc",
33
+ "displayName": "ACC"
34
+ }
35
+ ]
36
+ }
37
+ ```
38
+
39
+ ## User Flow
40
+
41
+ 1. Owner pushes the shared `knowledge` repository to GitHub.
42
+ 2. Owner grants a teammate access to that repository through GitHub.
43
+ 3. Teammate opens Project Knowledge locally.
44
+ 4. Teammate saves a GitHub token in the import view.
45
+ 5. The app lists accessible GitHub repositories that contain a team-store manifest.
46
+ 6. Teammate selects `knowledge.git`, syncs it to a local path, and selects `acc`.
47
+ 7. Teammate imports their local source project, for example `BCC`, and binds it to `knowledge/acc`.
48
+
49
+ The resulting project config persists:
50
+
51
+ ```json
52
+ {
53
+ "knowledgeMode": "team",
54
+ "teamProvider": "github",
55
+ "kbStoreRemoteUrl": "https://github.com/org/knowledge.git",
56
+ "kbStorePath": "D:/SanQian.Xu/knowledge",
57
+ "kbSubdir": "acc",
58
+ "kbId": "kb-acc",
59
+ "kbPath": "D:/SanQian.Xu/knowledge/acc"
60
+ }
61
+ ```
62
+
63
+ ## Permission Boundary
64
+
65
+ GitHub repository permissions are repository-level. If a teammate can access `knowledge.git`, they can technically access every subdirectory in that repository. The UI can present only selected knowledge bases, but strict per-project isolation requires separate GitHub repositories per knowledge base.
66
+
67
+ ## Implemented Scope
68
+
69
+ - Store GitHub auth locally in the user data directory.
70
+ - Discover accessible GitHub repositories that contain a team-store manifest.
71
+ - Clone or pull a selected knowledge repository to a local path.
72
+ - Import a local project while binding it to a selected knowledge-base subdirectory.
73
+ - Preserve personal-mode import behavior when no team binding is selected.
@@ -0,0 +1,33 @@
1
+ # Testing Strategy
2
+
3
+ Status: current
4
+ Date: 2026-07-23
5
+
6
+ ## Framework Tests
7
+
8
+ - New initialization creates the minimal KB structure.
9
+ - Generated `00-index.md` files remain protected from AI writes.
10
+ - Validation rejects legacy framework artifacts and KB-local AI workspaces.
11
+
12
+ ## Commit Automation Tests
13
+
14
+ - One source Git commit renders one exact prompt.
15
+ - A project processes commits oldest-to-newest through a FIFO queue.
16
+ - Repeated Hook and startup reconciliation cannot create duplicate tasks.
17
+ - A completed commit is never automatically dispatched again.
18
+ - `queued` and `running` records recover after a restart.
19
+ - Failed tasks remain retryable and do not become silently completed.
20
+ - Different projects may run independently.
21
+
22
+ ## Write-boundary Tests
23
+
24
+ - Automation can write only inside the selected project's KB.
25
+ - The source repository and other project KBs remain read-only.
26
+ - Bash is restricted to the read-only allowlist.
27
+ - There is no draft apply/reject or human-review API.
28
+
29
+ ## Consumer Tests
30
+
31
+ - `buildPrContextPack` reads the final KB layout directly.
32
+ - The pack includes goal, architecture, indexes, and trusted Markdown files.
33
+ - The pack never includes AI workspace state.
package/package.json ADDED
@@ -0,0 +1,100 @@
1
+ {
2
+ "name": "@sanqianx/project-knowledge",
3
+ "version": "4.6.1",
4
+ "description": "Knowledge base manager with Git integration, AI-driven analysis, and bilingual (zh-CN/en-US) knowledge output",
5
+ "main": "_site/server.js",
6
+ "scripts": {
7
+ "start": "node _site/server.js",
8
+ "test": "node _site/_test/run-all-tests.js",
9
+ "release:sync": "node _site/scripts/sync-release-version.js",
10
+ "release:verify": "node _site/scripts/sync-release-version.js --check && node _site/_test/integration-adapters-test.js",
11
+ "preversion": "npm run release:verify",
12
+ "version": "node _site/scripts/sync-release-version.js --stage",
13
+ "postversion": "npm run release:verify"
14
+ },
15
+ "bin": {
16
+ "project-knowledge": "bin/project-knowledge.js",
17
+ "project-knowledge-kb": "bin/project-knowledge-kb.js",
18
+ "project-knowledge-mcp": "bin/project-knowledge-mcp.js",
19
+ "project-knowledge-integrations": "bin/project-knowledge-integrations.js"
20
+ },
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
24
+ "files": [
25
+ "_site/server.js",
26
+ "ui/index.html",
27
+ "ui/app.css",
28
+ "ui/app.js",
29
+ "ui/i18n.js",
30
+ "ui/favicon.svg",
31
+ "_site/lib/",
32
+ "_site/scripts/",
33
+ "_site/_test/*.js",
34
+ "_site/_test/fixtures/",
35
+ "_site/start.bat",
36
+ "_site/stop.bat",
37
+ "claude-prompts.json",
38
+ "bin/",
39
+ "plugins/",
40
+ ".claude-plugin/",
41
+ ".agents/plugins/",
42
+ "templates/",
43
+ "docs/assets/",
44
+ "docs/README.zh-CN.md",
45
+ "docs/project-registry-schema.md",
46
+ "docs/team-knowledge-mode-a-plan.md",
47
+ "docs/testing-strategy.md",
48
+ "README.md",
49
+ "NOTICE",
50
+ "CHANGELOG.md"
51
+ ],
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/SanQianX/project-knowledge-base.git"
55
+ },
56
+ "keywords": [
57
+ "knowledge-base",
58
+ "git",
59
+ "ai",
60
+ "claude",
61
+ "codex",
62
+ "opencode",
63
+ "mcp",
64
+ "documentation",
65
+ "scanner",
66
+ "context-pack",
67
+ "post-commit-hook"
68
+ ],
69
+ "author": "SanQianX",
70
+ "license": "Apache-2.0",
71
+ "dependencies": {
72
+ "@anthropic-ai/claude-agent-sdk": "^0.2.141",
73
+ "@grpc/grpc-js": "^1.14.5",
74
+ "@grpc/proto-loader": "^0.8.1",
75
+ "@huggingface/transformers": "3.8.1",
76
+ "@lancedb/lancedb": "0.31.0",
77
+ "@modelcontextprotocol/sdk": "1.29.0",
78
+ "@sanqianx/ai-coding-event-bridge": "^0.1.2",
79
+ "@sanqianx/ai-coding-event-bridge-console": "0.4.0",
80
+ "@sanqianx/vector-hub": "^1.0.2",
81
+ "buffer": "^6.0.3",
82
+ "cheerio": "^1.2.0",
83
+ "claude-ai-workbench": "0.4.1",
84
+ "cross-spawn": "7.0.6",
85
+ "dotenv": "^17.4.2",
86
+ "gpt-tokenizer": "^3.4.0",
87
+ "http-proxy-agent": "7.0.2",
88
+ "https-proxy-agent": "7.0.6",
89
+ "json-colorizer": "^3.0.1",
90
+ "jsonc-parser": "3.3.1",
91
+ "openai": "^6.49.0",
92
+ "socks-proxy-agent": "8.0.5",
93
+ "turndown": "^7.2.4",
94
+ "uuid": "^13.0.2",
95
+ "wink-bm25-text-search": "^3.1.2",
96
+ "wink-nlp": "^2.4.0",
97
+ "ws": "^8.21.0",
98
+ "yargs": "^18.1.0"
99
+ }
100
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3
+ "name": "project-knowledge",
4
+ "version": "4.6.1",
5
+ "description": "Read durable project decisions and implementation history from Project Knowledge.",
6
+ "author": {
7
+ "name": "SanQianX",
8
+ "url": "https://github.com/SanQianX"
9
+ },
10
+ "homepage": "https://github.com/SanQianX/project-knowledge-base#readme",
11
+ "repository": "https://github.com/SanQianX/project-knowledge-base",
12
+ "license": "Apache-2.0",
13
+ "keywords": [
14
+ "knowledge-base",
15
+ "claude-code",
16
+ "mcp",
17
+ "project-history"
18
+ ]
19
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "project-knowledge",
3
+ "version": "4.6.1",
4
+ "description": "Read durable project decisions and implementation history from Project Knowledge.",
5
+ "author": {
6
+ "name": "SanQianX",
7
+ "url": "https://github.com/SanQianX"
8
+ },
9
+ "homepage": "https://github.com/SanQianX/project-knowledge-base#readme",
10
+ "repository": "https://github.com/SanQianX/project-knowledge-base",
11
+ "license": "Apache-2.0",
12
+ "keywords": [
13
+ "knowledge-base",
14
+ "codex",
15
+ "mcp",
16
+ "project-history"
17
+ ],
18
+ "skills": "./skills/",
19
+ "mcpServers": "./.mcp.json",
20
+ "interface": {
21
+ "displayName": "Project Knowledge",
22
+ "shortDescription": "Query durable knowledge from registered projects.",
23
+ "longDescription": "Resolve the current repository, search prior decisions and implementation history, and retrieve focused knowledge before making non-trivial changes.",
24
+ "developerName": "SanQianX",
25
+ "category": "Productivity",
26
+ "capabilities": [
27
+ "Interactive",
28
+ "Read"
29
+ ],
30
+ "websiteURL": "https://github.com/SanQianX/project-knowledge-base",
31
+ "defaultPrompt": [
32
+ "Find prior decisions relevant to the task I am about to start.",
33
+ "Search the project knowledge base before changing this implementation.",
34
+ "Show the recent history for the current registered project."
35
+ ],
36
+ "brandColor": "#2563EB"
37
+ }
38
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "mcpServers": {
3
+ "project-knowledge": {
4
+ "type": "stdio",
5
+ "command": "npx",
6
+ "args": [
7
+ "-y",
8
+ "--package",
9
+ "project-knowledge@4.6.1",
10
+ "project-knowledge-mcp"
11
+ ]
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ # Project Knowledge
2
+
3
+ For non-trivial work in a Git repository, load the `project-knowledge` Skill and resolve the current repository before relying on prior project decisions or implementation history. Treat knowledge search/get/history results as read-only, retrieve full entries only after focused search, and verify older knowledge against the current code. Automatic OpenCode capture is the primary conversation truth. Call `project_knowledge_record_requirement` only for an explicitly requested supplement or when automatic capture is known to be unavailable; it appends one user Prompt to the same ConversationStore and never starts analysis.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: project-knowledge
3
+ description: Query durable Project Knowledge records for prior decisions, implementation history, known constraints, and related-project context. Use when starting non-trivial work in a registered repository, investigating why code was designed a certain way, checking whether a problem was solved before, or answering questions about earlier commits and project history.
4
+ ---
5
+
6
+ # Project Knowledge
7
+
8
+ Use Project Knowledge as a read-only source of durable project context. Automatic client capture is the primary conversation truth. Its one write-capable tool only supplements that truth with an explicit user Prompt event and never starts knowledge analysis. Verify returned knowledge against the current source whenever the repository may have changed since the knowledge entry was produced.
9
+
10
+ ## Workflow
11
+
12
+ 1. Call `project_knowledge_resolve` with the current Git root before substantial implementation, diagnosis, or design work. Do not guess the project slug.
13
+ 2. Call `project_knowledge_search` for focused matching records, or `project_knowledge_ask` when a compact cited synthesis is more useful.
14
+ 3. Review titles and summaries before loading complete entries.
15
+ 4. Call `project_knowledge_get` only for the most relevant entries. Call `project_knowledge_history` when sequence or recent change history matters.
16
+ 5. Cite the returned project, entry, and commit information when it materially supports an answer or decision.
17
+ 6. Call `project_knowledge_record_requirement` only when the user explicitly requests supplemental capture or automatic client capture is known to be unavailable. Supply the exact user request, resolved project, client, and stable session identifier; never record assistant output, system prompts, credentials, or tool transcripts.
18
+
19
+ Client integrations may prefix MCP tool names with the server name. Match the tools by their final names: `project_knowledge_resolve`, `project_knowledge_record_requirement`, `project_knowledge_search`, `project_knowledge_ask`, `project_knowledge_get`, and `project_knowledge_history`.
20
+
21
+ ## Boundaries
22
+
23
+ - Treat knowledge search/get/history results as read-only. The explicit adapter may only append a user Prompt event to ConversationStore.
24
+ - Do not write directly to the knowledge database or knowledge files.
25
+ - Recording a requirement must not be used as a signal that analysis already ran or succeeded.
26
+ - Do not substitute remembered conversation context for a knowledge lookup when prior project work is relevant.
27
+ - Do not treat old knowledge as stronger evidence than current code, tests, or explicit user direction.
28
+ - If the repository is not registered, continue using the source tree and tell the user that no matching Project Knowledge project was found.
@@ -0,0 +1,11 @@
1
+ interface:
2
+ display_name: "Project Knowledge"
3
+ short_description: "Query durable knowledge from registered projects"
4
+ default_prompt: "Use $project-knowledge to find prior decisions relevant to this task."
5
+ dependencies:
6
+ tools:
7
+ - type: "mcp"
8
+ value: "project-knowledge"
9
+ description: "Read-only project knowledge search and history tools"
10
+ policy:
11
+ allow_implicit_invocation: true
@@ -0,0 +1,30 @@
1
+ ---
2
+ schema: minimal-kb/v1
3
+ title: __SHORTCOMMIT__ __SUBJECT__
4
+ change: __SHORTCOMMIT__
5
+ commit: __COMMIT__
6
+ classification: __CLASSIFICATION__
7
+ tags: [__CLASSIFICATION__]
8
+ affectedModules: []
9
+ developmentIntent: __DEVELOPMENT_INTENT__
10
+ updatedAt: __DATE__
11
+ ---
12
+
13
+ # __SHORTCOMMIT__ __SUBJECT__
14
+
15
+ ## Development Intent
16
+
17
+ __DEVELOPMENT_INTENT__
18
+
19
+ ## Implementation Result
20
+
21
+ - Classification: __CLASSIFICATION__
22
+ - Goal impact: __GOAL_IMPACT__
23
+
24
+ ## Evidence
25
+
26
+ __EVIDENCE__
27
+
28
+ ## Proposed Knowledge Updates
29
+
30
+ __PROPOSED_OPERATIONS__