# @wm-coders/dsh-custom-first-control-prompt [English](README.md) | 中文 部署方配置的提示词前缀。有序的系统提示词段渲染在部署 persona 之前,配置的 user/assistant 参考对话被注入到**每一个普通对话请求**中——作为真实的交替 user/assistant 消息前置在请求路径上(`llm/stream` 请求拦截,会话日志零写入)。静态内容在每次请求中逐字节一致地渲染,从而保持前缀缓存复用。 ## 安装 ```bash # 从 GitHub 安装(推荐 — 构建产物已提交,无需构建审批) dsh plugin --profile web add github:WM-CODER/custom-first-control-prompt # 从 npm 安装 dsh plugin --profile web add @wm-coders/dsh-custom-first-control-prompt # 从本地目录安装(开发用) dsh plugin --profile web add ./path/to/custom-first-control-prompt ``` 安装后重启 web 应用(`dsh --profile web` 或运行 `restart-web.ps1` / `restart-web.sh`)。 卸载: ```bash dsh plugin --profile web remove @wm-coders/dsh-custom-first-control-prompt ``` > 安装 / 部署 / 调试中遇到过的阻碍与测试方法见 > [DEBUG-NOTES.zh.md](DEBUG-NOTES.zh.md)(web fail-loud 根因、同 id 重复 insert、 > API 验证链路等,路径全部脱敏);一键安装见 [INSTALL.md](INSTALL.md); > 跨机完整实测流程见 [INSTALL-FULL.zh.md](INSTALL-FULL.zh.md)。 ## 配置 ```yaml - id: custom-first-control-prompt name: '@wm-coders/dsh-custom-first-control-prompt' config: sections: - name: house-rules order: -50 text: | …stable system text… history: - user: … assistant: … includeSubagents: false ``` | 键 | 默认值 | 含义 | |---|---|---| | `sections` | — | 有序的系统提示词片段。缺省或为空时不注册任何内容。 | | `sections[].name` | 必填 | 条目名;注册表所见为 `custom-first-control-prompt:`。 | | `sections[].order` | 必填 | 在全部段中的渲染位置。出厂约定:harness identity 为 −100,persona 为 0,工具指导为 100–199;小于 0 的值前置到 persona 之前。 | | `sections[].enabled` | `true` | `false` 时条目保留在配置中但不注册。 | | `sections[].text` | 必填 | 静态段文本。不要放入时间戳等易变值:任何变化都会从首个变化的 token 起破坏前缀复用。 | | `history` | — | 注入到每个普通对话请求的有序 `user`/`assistant` 参考对话;两者文本都必须非空,且不得包含保留标签(大小写不敏感:``、``、``、`