Bundle
dsh-plan-first-dev
开发前自动进入 plan mode:任务先出方案、用户批准后再动手(plan-first development workflow)
- Source
- asd176916847
- stars
- 2 stars
- License
- MIT
- Updated
- Updated yesterday
Readme
# dsh-plan-first-dev
开发前自动进入 **plan mode** 的 DeepSeek Harness (DSH) 插件:任何代码开发任务都会先产出完整方案、经用户批准后才开始实现(plan-first development workflow)。
## 功能
- **自动开启**:新会话创建时自动进入 plan mode(监听 `agent/created`,调用 `planMode.set(agent, true)`);
- 会话从未出现过 `plan/mode` 事件 → 自动开启;
- 用户曾主动 `/plan off` 或切换过模式的会话 → 尊重现状,resume 不覆盖用户选择;
- 可用 `config.defaultOn: false` 完全关闭自动开启(保留指令层强化)。
- **plan-mode 指导强化**:覆盖 plan-mode 的 `section`,强制"开发任务必须先提交完整实现方案(架构、改动文件、API/schema 变更、边界情况、测试与验收标准),`exit_plan_mode` 批准后才能写代码";
- **persona 指令**:追加 plan-first 开发工作流说明(非开发任务可 `/plan off` 正常对话);
- **非开发任务自动退出**:插件注册 `no_plan_required` 工具——模型(依据 section/persona 的豁免条款)判断请求不是代码开发任务(写作、PPT、数据分析、问答等)时调用该工具,**插件收到调用自动退出 plan mode**,任务直接执行、无需方案与审核。任务类型由**模型判断**(非关键词匹配),豁免行为通过工具调用被插件识别。
工作闭环:新会话 → 自动进入 plan mode → 模型先出方案 → `exit_plan_mode` 提交用户审核 → **批准后才开始实施**。
## 安装
```sh
dsh plugin --profile web add "github:<owner>/dsh-plan-first-dev"
```
或本地路径安装:
```sh
dsh plugin --profile web add /path/to/dsh-plan-first-dev
```
> 安装后需重启 dsh web(或重启桌面端并让其重新拉起服务)才会生效。
> 验证:`dsh web --dump-config` 查看组合配置树中 `plan-mode`、`system-prompt` 与 `plan-first-dev` 行。
## 插件结构
```
dsh-plan-first-dev/
├── package.json # 声明 dsh.bundle.patch → 成为 profile 层
├── cordis.patch.yml # 配置层:plan-mode section / persona / 插入插件行
└── lib/index.js # 代码层:agent/created 自动开启 plan mode
```
## 配置
| 配置项 | 默认 | 说明 |
| --- | --- | --- |
| `defaultOn` | `true` | 新会话是否自动开启 plan mode |
示例(patch 覆盖):
```yaml
- id: plan-first-dev
config:
defaultOn: false
```
## 说明
- 依赖 DSH 内置的 [`@deepseek-ai/dsh-plan-mode`](https://github.com/deepseek-ai/deepseek-harness)(官方插件,随 dsh 安装,无需额外安装);
- 依赖 DSH 官方 `dsh.bundle.patch` 插件机制(`dsh plugin` 自动识别为 profile 层)。
## License
MIT
Install
dsh plugin --profile web add github:asd176916847/dsh-plan-first-dev
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-plan-first-dev from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.