dsh-ponytail
Agent 与会话 活跃维护

dsh-ponytail

Wenaixi/dsh-ponytail

完整移植版本,完整还原 DietrichGebert/ponytail 核心能力,通过 hook 注入实现懒 Senior 模式,部署无冗余配置,可直接集成到对应开发流程中使用。

4
Stars 标星
0
Forks 分支
4
Watchers 关注
0
Open Issues
TypeScript
主要语言
MIT
开源协议
1.7 MB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:Wenaixi/dsh-ponytail
git clone https://github.com/Wenaixi/dsh-ponytail.git
git clone git@github.com:Wenaixi/dsh-ponytail.git
README.md main

dsh-ponytail

Ponytail

懒惰的资深工程师 · 移植到 DeepSeek Harness
The best code is the code you never wrote.

MIT npm DSH skills

Changelog · 上游 · npm

--- > [DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail) 的 DSH 完整移植版 — always-on 注入 + 6 个中文 Skill,无空 tool。 ## 🚀 安装(默认装到 `web`) > `web` 即日常的 DSH Web UI(3080)。示例中的 `demo` 可换成任意 `--profile `。 ```bash # 方式一:npm dsh plugin --profile web add @wenaixi/dsh-ponytail # 方式二:GitHub 直装(lib 已提交,无需构建) dsh plugin --profile web add github:Wenaixi/dsh-ponytail # 方式三:本地 / tarball pnpm install && pnpm build && dsh plugin --profile web add ./ pnpm pack && dsh plugin --profile web add ./wenaixi-dsh-ponytail-*.tgz # 卸载 dsh plugin --profile web remove @wenaixi/dsh-ponytail # 验证 dsh --profile web --dump-config | grep -A2 ponytail ``` > `WARN missing peer @deepseek-ai/...` 属正常,peer 由 DSH 运行时提供;`Packages: +2 Done` 即成功。 ## ✨ 特性 - **梯子 7 阶**:YAGNI → 复用 → 标准库 → 平台原生 → 已有依赖 → 一行 → 最小实现,`off` 时静默 - **6 个中文 Skill**(`rank: 550`):`ponytail` / `ponytail-review` / `ponytail-audit` / `ponytail-debt` / `ponytail-gain` / `ponytail-help` - **三档强度**:`lite` / `full`(默认)/ `ultra` - **无空 tool**:全部能力经 `ctx.skills` 暴露 | 能力 | 说明 | |---|---| | `ponytail` | 7 阶梯子,触发词兼容中英文 | | `ponytail-review` | diff 评审,`delete/stdlib/native/yagni/shrink` | | `ponytail-audit` | 全仓审计,按可删收益排序 | | `ponytail-debt` | 收割 `ponytail:` 注释 | | `ponytail-gain` | 收益看板(benchmark 中位数) | | `ponytail-help` | 速查卡 | ## 🪝 Hook 注入 > 上游 `hooks/` 的 4 个生命周期 Hook 已合并进单一 DSH 插件,无需宿主配置。 | 上游 | DSH 侧 | |---|---| | `ponytail-config.js` | `src/ponytail-config.ts`(`env > 文件 > full`,`review` 不可默认) | | `ponytail-instructions.js` | `src/ponytail-instructions.ts`(按 `lite/full/ultra` 裁剪 + 中文 fallback) | | `ponytail-runtime.js` | `src/ponytail-runtime.ts`(`.ponytail-active` + 三平台识别) | | `ponytail-activate.js` + `mode-tracker.js` + `subagent.js` | `src/ponytail.ts` 统一合并 | ``` 启动: env PONYTAIL_DEFAULT_MODE → cordis defaultMode → ~/.config/ponytail/config.json → full → setMode(flag 文件) 每轮请求前: agent/pre-step (waterfall, 必须 return next()) → 解析 /ponytail 族 / stop ponytail → 切 currentMode + 写 flag → next() 注入: systemPrompt:section { name: ponytail, order: 50 } order 50 在 persona(0) 之后、工具(100) 之前;同步读 SKILL.md 按 currentMode 裁剪 off → 空,review → 指向技能,读盘失败 → 中文 fallback,assembly 前以 readMode() 对齐 持久化: /ponytail default → 写入 config.json 子智能体: PONYTAIL_SUBAGENT_MATCHER 正则(非法 warn 回退),共享同一 section HMR: 全部走 ctx,热重载逆序自动清理 ``` `systemPrompt` 而非 `agent.inject`:落入日志可重建,`order: 50` 优先级高,每次 `assemble` 动态求值,`off` 零成本。Flag 兼容 `CLAUDE_PLUGIN_ROOT` / `PLUGIN_DATA` / `QODER_SESSION_ID`。 ## ⚙️ 配置 ```yaml - insert: - id: ponytail name: "@wenaixi/dsh-ponytail" config: providerName: ponytail defaultMode: full # off|lite|full|ultra ``` 优先级:`PONYTAIL_DEFAULT_MODE` env > `cordis.defaultMode` > `~/.config/ponytail/config.json` > `full`。持久化:`/ponytail default ` 写入文件,`review` 不可作默认。 ## 🎮 使用 - 自动生效,无需手动触发 - `/ponytail [lite|full|ultra|off]` / `/ponytail default ` / `/ponytail-review` / `/ponytail-audit` / `/ponytail-debt` / `/ponytail-gain` / `/ponytail-help` - 退出:`stop ponytail` / `normal mode`(整句)或 `/ponytail off` ## 🛠️ 开发 ```bash pnpm typecheck && pnpm build && node scripts/verify.mjs dsh --profile web --patch ./cordis.patch.yml --dump-config pnpm dsh web --patch ./cordis.patch.yml # 热重载 # 发版:pnpm run bump:dsh && pnpm build && npm publish --provenance --access public # 或 push tag v* 触发 GitHub Actions publish.yml ``` - 版本:每个版本固定带 `-dsh.N`(初始 `4.9.0-dsh.0`),`pnpm run bump:dsh` 递增,上游发新版时 `pnpm run bump:dsh -- 4.10.0` 重置 --- ## 🔗 上游 原仓 https://github.com/DietrichGebert/ponytail(MIT) ## 📄 许可 [MIT](https://github.com/Wenaixi/dsh-ponytail/blob/main/LICENSE) © DietrichGebert / Wenaixi