Skip to content
Back to search

dsh-project-brain

Persistent project intelligence and memory plugin for DSH: architecture analysis, cross-session context, TODOs, and optional hybrid retrieval

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked yesterday
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/yj-liuzepeng--dsh-project-brain/badge.svg)](/listings/yj-liuzepeng--dsh-project-brain)

HTML

<a href="/listings/yj-liuzepeng--dsh-project-brain"><img src="/api/listings/yj-liuzepeng--dsh-project-brain/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install the tagged public beta into the DSH profile you use:

dsh plugin --profile web add github:yj-liuzepeng/dsh-project-brain#v0.7.0-beta.2

For example, use `--profile web` with `dsh web`, or `--profile desktop` when your Desktop distribution runs that profile. Restart the active DSH process after installation or upgrade; for DSH Desktop, quit and reopen the application completely. The package contains prebuilt Host and Client bundles, so users do not need Node.js or a local build.

Runtime compatibility

- The Host plugin provides workspace analysis, 13 `project_*` tools, persistent memory, context injection, TODOs, and architecture analysis to a compatible DSH profile. - The Dashboard and TodoStrip are a DSH Web client plugin (`platform: web`). They work in DSH Web and in Desktop distributions that host the DSH Web client. - A pure CLI/TUI client does not render the Dashboard. Core Host capabilities may still be used when that profile provides the plugin's required DSH services; non-Web profile coverage is still being validated during beta.

For source development, Node.js `22.19+` or `24+` is required:

git clone https://github.com/yj-liuzepeng/dsh-project-brain.git
cd dsh-project-brain
npm install
npm test
npm run build
npm run verify:release
npm run verify:install

Source contributors can link the repository into a target DSH profile workspace and enable `dsh-project-brain` in its bundle configuration.

After installation:

1. Open a repository as the current DSH workspace. 2. Open the **Project** tab. 3. Click **Start Project Brain**. 4. Review the Overview, Architecture, Work Activity, and Project Memory tabs. 5. Continue in a new conversation and verify that project context is restored.

See [INSTALL.md](./INSTALL.md) for detailed setup and troubleshooting.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 270 lines
  1. # dsh-project-brain
  2. **English** · [简体中文](./README.zh-CN.md)
  3. [![Version](https://img.shields.io/badge/version-1.4.0-blue)](./CHANGELOG.md)
  4. [![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
  5. [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22.19-339933)](./package.json)
  6. [![Status](https://img.shields.io/badge/status-stable-success)](./RELEASE_CHECKLIST.md)
  7. **A persistent project intelligence and memory plugin for DSH.** It analyzes the active workspace, explains the architecture, preserves decisions and development history, and restores the right context in future sessions.
  8. Instead of making every new conversation rediscover the repository, dsh-project-brain stores structured knowledge inside the project itself and keeps getting more useful as the project evolves.
  9. > Current release: `1.4.0` — the release that makes project memory actually usable: deictic references are resolved before a memory is stored, memories can be edited / pinned / archived / deleted from the dashboard, concurrent writes no longer silently drop rows, and Core has configurable capacity with pinning. Data format stays backward-compatible with v1.3.x.
  10. **v1.3.1 新特性**:📦 **导入导出 / 备份恢复**
  11. - Dashboard 顶部新增 **💾 备份 / 📥 恢复 / ↶ 回滚** 三个按钮(与项目名 + techStack chip 同一行)
  12. - 一键把整个项目脑打成 zip(含 timeline + cache + manifest + sha256 校验)→ 跨机器传文件 → 在另一台机器一键还原
  13. - 导入前自动预览影响清单(即将覆盖的脑 / 旧脑备份路径 / rootPath 改写);主按钮文案「覆盖并恢复」明确提醒
  14. - 每次导入/回滚前自动备份当前脑到 `.project-brain.backup-<ts>/`;可随时回滚到任一历史备份
  15. - 4 个新 Tool:`project_export` / `project_import` / `project_rollback_backup` / `project_cleanup_backups`
  16. [GitHub release](https://github.com/yj-liuzepeng/dsh-project-brain/releases/tag/v1.3.1) · [DSH community showcase](https://github.com/deepseek-ai/deepseek-harness/discussions/5121) · [MyDSH listing](https://mydsh.dev/plugin?repo=yj-liuzepeng%2Fdsh-project-brain)
  17. ## Preview
  18. ### Project Brain activation entry (before first scan)
  19. ![Initial activation screen showing the three core capabilities (read project / remember across sessions / continue from where you left off) and the Start Project Brain button on the current workspace path](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/01.png)
  20. ### Project card with detected stack and live status
  21. ![Project card showing project name, detected stack chips (GitHub Actions / Monorepo), description, last-updated timestamp, and a three-stat summary (pending TODOs / project memories / completed) with phase progress bar](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/02.png)
  22. ### Dashboard overview with SuggestionCard and Quick Actions
  23. ![Dashboard header (Dashboard · project overview), SuggestionCard with AI recommendation and confidence score, four Quick Actions (rescan / organize TODOs / organize memories / project overview), and the Overview tab showing detected tech stack / language usage / dev entry points](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/03.png)
  24. ### Architecture tab — lane-based layered overview
  25. ![Architecture tab with project positioning, architectural style tags, plugin-style layered architecture, and DSH LLM enhancement badge; layers shown as left-label + right-component lanes (interface / tools / storage / memory / build)](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/04.png)
  26. ### Architecture tab — expanded runtime path for a single layer
  27. ![Selecting the session-extraction-and-hybrid-retrieval layer reveals its runtime path: a horizontal numbered flow (memory subsystem → embedding → hybrid retrieval → config-gated vector lookup → Brain storage) with a step-by-step description, files, and risks](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/05.png)
  28. ### TODOs and development timeline
  29. ![Activity tab: completed TODOs on the left (real-time memory, session summary, cross-session continuation), and the timeline on the right showing memory-organize events, project_rescan events, and recent memory-add entries with timestamps](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/06.png)
  30. ### Project memories with type badges and importance stars
  31. ![Memories tab: Current Core (per-round injection) section with type chips (decision / bug / architecture / lesson / note), importance stars, summary line, date, and View Details button per card; dormant memories collapsible at the bottom](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/07.png)
  32. ### Settings — vector retrieval and Embedding config
  33. ![Settings tab · Retrieval and Embedding section: hybrid retrieval mode, enable vector switch, Embedding URL / model / API key input fields, vector dimension; top green banner reminds users that unsaved changes do not take effect](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/08.png)
  34. ### Settings — retrieval weights and probe button
  35. ![Settings tab · Retrieval weights section: keyword / vector / importance / confidence / recency weight inputs (0.15 / 0.25 / 0.3 / 0.1 / 0.2), each with a one-line hint describing what it does; small light-blue Test Vector Connection button probes the live embedding endpoint](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/09.png)
  36. ### Git history tab (VSCode-style)
  37. ![Git history tab: branch switcher (main, 32 commits, 1 other branch), HEAD hash, auto-refresh 30s toggle; commit timeline with graph dots, commit subject, short hash, author, relative time, and changed-file summary; branch chips on the right](https://raw.githubusercontent.com/yj-liuzepeng/dsh-project-brain/v1.3.0/docs/screenshots/10.png)
  38. ## Why use it?
  39. AI coding sessions are usually short-lived, while real software projects are not. Important context gets scattered across conversations: why an architectural choice was made, which workaround fixed a production bug, what is currently in progress, and which files form the critical path.
  40. dsh-project-brain turns that context into a local, workspace-scoped knowledge layer:
  41. - **Understand a repository quickly** — detects languages, frameworks, tooling, entry points, manifests, README metadata, symbols, and imports.
  42. - **Explain architecture, not just folders** — produces a report covering project purpose, architectural style, conceptual layers, component responsibilities, relationships, runtime flows, key files, reading order, and risks.
  43. - **Reuse the active DSH model** — architecture analysis uses the provider/model already selected for the current DSH Session; no separate chat-model key is required.
  44. - **Remember across conversations** — decisions, requirements, architecture notes, bugs, lessons, changes, TODOs, and timeline events persist in the workspace.
  45. - **Restore context automatically** — a new Session receives high-value memories, active TODOs, and recent activity through the DSH system prompt.
  46. - **Keep workspaces isolated** — the Host resolves the live Session workspace; one project's memory is never guessed from another project.
  47. - **Work without embeddings** — local BM25 retrieval is the zero-configuration default. OpenAI-compatible embeddings are an optional semantic upgrade.
  48. - **Stay usable when AI is unavailable** — architecture generation and memory retrieval have local fallback paths.
  49. ## How it works
  50. ```text
  51. Active DSH Session
  52. │ trusted live Session cwd
  53. ▼
  54. Workspace scanner ───────► project facts and source evidence
  55. │
  56. ├──► current DSH LLM ───► semantic architecture report
  57. │ │ unavailable / timeout / invalid output
  58. │ └────────────► local architecture fallback
  59. │
  60. ├──► .project-brain/ ───► memory, TODOs, timeline, architecture
  61. │
  62. ├──► context injector ──► next Session system prompt
  63. │
  64. └──► Connection RPC ────► Dashboard and TodoStrip
  65. ```
  66. The browser-side UI cannot choose arbitrary filesystem paths. Runtime actions are resolved by the Host against the active DSH Session.
  67. ## Local project data
  68. Each workspace owns its data:
  69. ```text
  70. .project-brain/
  71. ├── project.json # project metadata, stack, languages, and entry points
  72. ├── architecture.json # purpose, layers, components, flows, and evidence
  73. ├── memory.jsonl # long-term structured project memories
  74. ├── todo.jsonl # project tasks and status
  75. ├── timeline.jsonl # scans, memory events, TODO events, and sessions
  76. ├── codegraph.json # optional legacy AST graph
  77. └── cache/
  78. └── embeddings.jsonl # optional, derived, and safe to rebuild
  79. ```
  80. Project data survives plugin upgrades and conversation changes. Uninstalling the plugin does not delete `.project-brain/`.
  81. ## Memory model
  82. Memories can represent `decision`, `requirement`, `architecture`, `change`, `bug`, `lesson`, `issue`, or `context`.
  83. Every new V2 memory includes importance, confidence, lifecycle status, source, timestamps, optional tags, and related files. Archived, superseded, and deleted memories are excluded from normal retrieval, automatic prompt injection, status counts, and the Dashboard.
  84. The plugin writes memories through three paths:
  85. 1. The Agent records durable decisions and lessons with `project_memory_add`.
  86. 2. Session shutdown records a deduplicated Git change summary and uses the active DSH model to extract a small set of durable, evidence-based project facts. Credentials and non-text/tool output are excluded; unavailable or invalid model output degrades safely to Git-only memory.
  87. 3. Architecture-diff analysis can generate architecture/change memories.
  88. The **Organize Memory** action first previews merge and archive candidates. It only writes changes after confirmation.
  89. Session extraction is configurable with `sessionSemanticMemoryEnabled`, `sessionSemanticMaxChars`, `sessionSemanticMaxItems`, and `sessionSemanticTimeoutMs`. Disable it to keep Session summarization Git-only.
  90. ## Retrieval
  91. The default local retriever uses BM25 over titles, content, tags, related files, and types. Ranking also considers importance, confidence, recency, stable memory types, and result diversity.
  92. Optional hybrid retrieval combines keyword and vector scores. Enable it in the plugin settings:
  93. ```yaml
  94. retrievalMode: hybrid
  95. vectorEnabled: true
  96. embeddingBaseURL: https://your-provider.example/v1
  97. embeddingModel: your-embedding-model
  98. embeddingApiKeyEnv: PROJECT_BRAIN_EMBEDDING_API_KEY
  99. ```
  100. Embedding indexes are updated lazily by content hash. Missing credentials, network errors, invalid vectors, or dimension mismatches automatically fall back to local keyword retrieval.
  101. > Enabling a remote embedding service sends memory titles, content, tags, and related file names to that service. Use a local model or a trusted provider for confidential repositories.
  102. ## Architecture analysis
  103. Initialization and rescans first collect deterministic local facts. When the current DSH Session has an available model route, the plugin sends bounded project evidence—README content, manifests, relative paths, symbols/imports, and selected source excerpts—to generate a conceptual architecture report.
  104. Safety and reliability controls include:
  105. - no absolute paths in the architecture prompt;
  106. - configurable source inclusion and file/node limits;
  107. - strict JSON extraction, repair, and schema normalization;
  108. - validation of evidence paths and component relationships;
  109. - no model-generated HTML rendering;
  110. - automatic local fallback on missing routes, timeout, or invalid output;
  111. - architecture fingerprints to avoid unnecessary repeated analysis.
  112. Set `architectureLlmIncludeSource: false` to send structure only, or `architectureLlmEnabled: false` for fully local analysis.
  113. ## Quick start
  114. Install the tagged public beta into the DSH profile you use:
  115. ```bash
  116. dsh plugin --profile web add github:yj-liuzepeng/dsh-project-brain#v0.7.0-beta.2
  117. ```
  118. For example, use `--profile web` with `dsh web`, or `--profile desktop` when your Desktop distribution runs that profile. Restart the active DSH process after installation or upgrade; for DSH Desktop, quit and reopen the application completely. The package contains prebuilt Host and Client bundles, so users do not need Node.js or a local build.
  119. ### Runtime compatibility
  120. - The Host plugin provides workspace analysis, 13 `project_*` tools, persistent memory, context injection, TODOs, and architecture analysis to a compatible DSH profile.
  121. - The Dashboard and TodoStrip are a DSH Web client plugin (`platform: web`). They work in DSH Web and in Desktop distributions that host the DSH Web client.
  122. - A pure CLI/TUI client does not render the Dashboard. Core Host capabilities may still be used when that profile provides the plugin's required DSH services; non-Web profile coverage is still being validated during beta.
  123. For source development, Node.js `22.19+` or `24+` is required:
  124. ```bash
  125. git clone https://github.com/yj-liuzepeng/dsh-project-brain.git
  126. cd dsh-project-brain
  127. npm install
  128. npm test
  129. npm run build
  130. npm run verify:release
  131. npm run verify:install
  132. ```
  133. Source contributors can link the repository into a target DSH profile workspace and enable `dsh-project-brain` in its bundle configuration.
  134. After installation:
  135. 1. Open a repository as the current DSH workspace.
  136. 2. Open the **Project** tab.
  137. 3. Click **Start Project Brain**.
  138. 4. Review the Overview, Architecture, Work Activity, and Project Memory tabs.
  139. 5. Continue in a new conversation and verify that project context is restored.
  140. See [INSTALL.md](./INSTALL.md) for detailed setup and troubleshooting.
  141. ## Tools
  142. | Capability | Tool |
  143. |---|---|
  144. | Initialize or rescan | `project_init`, `project_rescan` |
  145. | Status and continuation | `project_status`, `project_continue` |
  146. | Long-term memory | `project_memory_add`, `project_memory_list` |
  147. | TODO management | `project_todo_add`, `project_todo_list`, `project_todo_update`, `project_todo_done` |
  148. | Query and maintenance | `project_ask`, `project_dream` |
  149. | Git + LLM architecture diff | `project_diff` |
  150. Dashboard quick actions run these workflows in the background and provide loading, confirmation, success, error, and retry states.
  151. ## Privacy and security
  152. - Project knowledge stays under `<workspace>/.project-brain/` unless an explicitly enabled model capability sends bounded content to its configured provider.
  153. - Session semantic memory sends bounded user/assistant text to the provider already selected by DSH; tool output, system messages, and recognizable credentials are removed first. Set `sessionSemanticMemoryEnabled: false` to disable it.
  154. - Client RPC cannot provide a filesystem path; the Host uses the live Session workspace.
  155. - Tool execution prioritizes the trusted live Session path over model-provided arguments.
  156. - Uninitialized projects are not silently populated by the Session summarizer.
  157. - Vector retrieval is disabled by default.
  158. - Embedding credentials are resolved through DSH Credentials or an environment-variable reference and are not written into memory files or Client RPC responses.
  159. - Release builds do not embed the developer's workspace, Session IDs, project memories, credentials, or local filesystem paths.
  160. - `.project-brain/` may contain internal decisions and bug history. Review it before committing it to Git.
  161. ## Development and release verification
  162. ```bash
  163. npm test
  164. npm run build
  165. npm run verify:release
  166. npm run verify:install
  167. npm audit
  168. ```
  169. The automated suite covers runtime workspace resolution, cross-workspace isolation, cross-Session memory, architecture local/LLM paths, Memory V2, BM25/hybrid retrieval, Session deduplication, scanner behavior, Dashboard/TodoStrip contracts, theme tokens, Git pack/delta handling, and LLM protocols.
  170. `verify:release` validates package metadata, entry points, the npm file allowlist, and scans release files for local paths, Session IDs, credentials, private keys, logs, archives, and project-brain data. `verify:install` then packs the exact release artifact and installs it in a clean temporary project to catch peer-dependency or missing-build failures before users do.
  171. ## Current limitations
  172. - Session semantic extraction is intentionally bounded and only records a few durable facts. Explicit memory/TODO tools remain the most reliable way to preserve critical intent.
  173. - The current DSH model route may not exist before the Session makes its first normal model request. If so, chat once and rescan.
  174. - `project_diff` uses its own OpenAI/Anthropic-compatible configuration; architecture initialization uses the current DSH Session model.
  175. - Git multi-pack-index (MIDX) support is not yet complete.
  176. - Host bundle upgrades require restarting the active DSH process; Desktop users should quit and reopen the application.
  177. ## Documentation
  178. - [中文说明](./README.zh-CN.md)
  179. - [Installation](./INSTALL.md)
  180. - [Release checklist](./RELEASE_CHECKLIST.md)
  181. - [Changelog](./CHANGELOG.md)
  182. - [Design](./DESIGN.md)
  183. - [Specification](./SPEC.md)
  184. - [Store listing](./STORE_LISTING.md)
  185. ## License
  186. [MIT](./LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.