JohnXu22786/worktree-mgr
DSH 插件:为任务自动创建隔离的 git 工作区,管理创建/同步/收尾全生命周期(面向 DeepSeek Harness 的任务隔离 git worktrees)
Project Overview项目介绍
worktree-mgr is a native plugin built exclusively for DeepSeek Harness (DSH), a plugin-based agent framework running on Cordis. It enables task-isolated git workspaces for DSH agents processing multiple tasks in parallel, so each task runs on its own dedicated branch without polluting the main repository’s working directory. To install, you can run the DSH CLI command dsh plugin --profile demo add github:JohnXu22786/worktree-mgr to pull it directly from GitHub, or install it from a local directory. It also supports running as a standalone CLI tool outside of DSH for manual use.
When you start a new task with worktree-mgr, it automatically generates a normalized branch name from your task name, creates the worktree in an isolated vault directory, and updates a persistent JSON ledger that maps tasks to their corresponding branches and file paths. When the task is finished, the plugin automatically commits any uncommitted changes, merges the branch back to the target base branch, cleans up the worktree and deletes the unused task branch. It is designed for developers who use DSH to handle multiple parallel development tasks, helping keep the main repository clean and avoid unexpected cross-task code conflicts.
worktree-mgr is pure Node ESM with zero third-party runtime dependencies, requiring only Node.js 21 or higher to run, with no build or compilation step needed to use it after installation. It is released under the permissive MIT open source license, so you can modify and redistribute it freely for personal or commercial use. There are important security caveats: the repository-level .wtm.json can run arbitrary shell commands, so you should only use this plugin in trusted repositories, and abandoned tasks cannot be recovered after deletion.
这是一个专为 DeepSeek Harness(DSH)打造的原生插件,基于 Cordis 插件框架开发,为 DSH 代理提供任务隔离的 git worktree 工作区能力。当模型并行处理多个任务时,每个任务都在独立分支的专属 git 工作区中运行,完全不会污染主项目的工作区。该插件也支持作为独立 CLI 工具,脱离 DSH 单独使用。
该插件覆盖任务工作区的全生命周期管理,包含创建、同步、查看状态、完成任务和批量清理等完整流程,提供了5个DSH工具和1个CLI入口,全程无需手动执行git操作。它面向使用DSH进行多任务并行开发的开发者,能够帮助保持主仓库干净整洁,避免不同任务的代码互相干扰或冲突。
本项目是纯 Node ESM 代码,零额外依赖,仅需 Node.js 21 及以上版本即可运行,无需编译构建步骤。项目采用 MIT 许可证开源,可免费使用和修改。需要注意安全提示:仓库级配置 .wtm.json 可执行任意 shell 命令,仅可在可信仓库中启用,放弃任务后修改无法恢复,操作前请务必确认。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:worktree-mgr(JohnXu22786/worktree-mgr)
仓库:https://github.com/JohnXu22786/worktree-mgr
本站详情页:https://www.yhbd.top/plugins/johnxu22786-worktree-mgr/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-10-03 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile demo add github:JohnXu22786/worktree-mgr
把 JohnXu22786/worktree-mgr 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
worktree-mgr
A plugin that provides task-isolated workspaces for dsh (DeepSeek Harness, a plugin-based harness running on the Cordis plugin framework).
When a model processes multiple tasks in parallel, each task is completed in its own git workspace (git worktree) on its own branch, without polluting the main workspace; when the task ends, the plugin commits, merges, and cleans up automatically. The full lifecycle — create / sync / overview / finish / batch cleanup — is covered by 5 tools + 1 CLI, with zero manual git operations throughout.
Core Concepts
| Concept | Description |
|---|---|
| Task | A single unit of work, e.g. add-search-box. Tools take the task name as entry point |
| Branch | Derived automatically from the task name: <prefix>/<task-slug>, default wtm/add-search-box, or explicitly specified |
| Workspace | Located under the vault directory (default platform data dir wtm/vaults/<repo-slug>/), isolated from the main repository |
| Ledger | index.json under the vault, persisting the "task ↔ branch ↔ path" mapping (JSON format, atomic writes + mutex lock) |
| Base branch | The branch a task merges into; defaults to the main workspace's current branch |
Features
- Task-driven: give the model a task name and the branch name, path, and ledger record are all generated automatically — no need to specify a branch
- Branch name safety: task name → slug normalization (illegal forms such as
..within a segment,.locksuffix, leading dots in a segment are fixed at the source), with dual ref-validity checks; creation is rejected when different tasks derive the same slug - Uncommitted change detection: merge is refused when the base branch is dirty (prevents mixing in unfinished work); uncommitted changes in the task workspace trigger an automatic snapshot commit by default
- Merge target consistency: before merging, the plugin validates "main workspace current branch == ledger base branch" and "task workspace current branch == ledger task branch"; any mismatch is refused — eliminating the silent error of reporting success while changes land on the wrong branch
- Sync and finish separated:
wtm_mergeonly merges without cleanup, whilewtm_finishcommits → merges → deletes workspace → deletes branch → clears the record; retry scenarios automatically skip already-completed merges (no duplicate empty merge commits) - Batch cleanup:
wtm_purgefinishes multiple tasks at once; a single task failure does not interrupt the rest, and any failure yields a non-zero exit code - Repository-level configuration:
<repo-root>/.wtm.jsonsupports branch prefixes, message templates, seed files (with path-escape protection), and lifecycle triggers (fixed working directory) - Concurrency safety: ledger writes hold a mutex — the lock contains a unique token with heartbeat refresh, stale locks are reclaimed only after a process crash, and release never mistakenly deletes a successor's lock
- Failure recovery: a failed create rolls back the created worktree and branch automatically; merge conflicts provide a
git merge --abortrecovery guide - Cross-platform: triggers execute on Windows (cmd) and POSIX (sh); path comparison normalizes case and separators
- Zero dependencies, no build: pure Node ESM,
node >= 21is enough — install and use
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
wloops/dsh-git-worktree
NEXTINDIE/DeepSeek-Harness-for-VS-Code
Kaiji-Z/dsh-plugin-stardeck
alpacachen/dsh-worktree
omdsh-dev/DSH-better-sidebar
LiPu-jpg/Openwrite