@mengyuly/dsh-ponytail 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +111 -4
- package/README.md +46 -7
- package/lib/index.js +106 -47
- package/lib/types/content.d.ts +2 -2
- package/lib/types/index.d.ts +3 -2
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,112 @@
|
|
|
3
3
|
All notable changes to `@mengyuly/dsh-ponytail` are documented here.
|
|
4
4
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## Unreleased
|
|
7
|
+
|
|
8
|
+
## [0.3.0] - 2026-08-26
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **最小正确端到端变更规则**(`instructions.ts` 新增共享 `E2E_RULES` 组,Full
|
|
13
|
+
与 Ultra 均包含):优先「与现有架构兼容的最小完整端到端变更」,而非单个
|
|
14
|
+
文件最少行数;创建组件/抽象/协议/迁移/传输格式/存储格式/依赖前先检查仓库
|
|
15
|
+
既有路径并保留现有契约;任务只要求局部 UI 或行为变化时不得重新设计传输、
|
|
16
|
+
存储、API 形态或持久化;局部更小但改变系统契约的实现并不更小;沿真实数据
|
|
17
|
+
流(input → state → validation → payload → API → persistence →
|
|
18
|
+
response/UI)取最小完整变更;不得仅为更小的 diff 留下 UI-only 字段、
|
|
19
|
+
未用状态、占位路径或断开的 payload。
|
|
20
|
+
- **Safety 边界扩充**:真实端到端数据流、非平凡改动的必要测试、根因修复
|
|
21
|
+
(全模式共享,不可删除)。
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Lite / Full / Ultra 规则边界重定义**(结构化组合保持,恢复旧的
|
|
26
|
+
Markdown 正则过滤):
|
|
27
|
+
- Lite:完成所有明确要求与验收标准;优先复用/标准库/原生/已装依赖;可
|
|
28
|
+
一句话提示更简方案但不挑战明确要求;**不得仅为减少行数改变现有架构**;
|
|
29
|
+
非平凡改动保留最小合理校验。
|
|
30
|
+
- Full:完整七级阶梯;默认最短正确实现并**优先最小完整端到端变更**;偏好
|
|
31
|
+
删除与复用,但不牺牲正确性、安全、测试、明确要求或现有系统契约。
|
|
32
|
+
- Ultra:先删后加;主动质疑投机性功能、缓存、抽象、配置、**迁移、传输
|
|
33
|
+
变化、存储变化**与新依赖;**取最小完整端到端变更而非最小局部 diff**;
|
|
34
|
+
不为减少行数改变现有契约;不是无脑拒绝(明确要求/安全/校验/无障碍/
|
|
35
|
+
数据保护/验收标准仍强制)。
|
|
36
|
+
- off 仍返回空字符串;同模式输出字节级稳定;三档体积仍远低于旧版 ~1.3k
|
|
37
|
+
tokens。
|
|
38
|
+
- **`/ponytail-gain` 口径重排**:固定顺序「1. Upstream agentic reference →
|
|
39
|
+
2. Upstream single-shot reference → 3. DSH adapter status → 4. Honesty
|
|
40
|
+
boundary」;节省条件补充为「Savings depend on model, workload, prompt
|
|
41
|
+
caching, tool usage, and execution path」;诚实边界明确「缺失的 cost
|
|
42
|
+
字段(null)不是 0 成本」。Skill 描述与 Help 表格中的
|
|
43
|
+
"less code, less cost, more speed" 改为
|
|
44
|
+
"less unnecessary work; token, cost, and latency effects depend on model
|
|
45
|
+
and workload"。
|
|
46
|
+
- README 顶部定位改为「极简编码原则与相关 Skill 的适配」,明确 DSH 的模型
|
|
47
|
+
循环、Prompt 组装、Skill 机制与工具调用不同。
|
|
48
|
+
|
|
49
|
+
### Tests
|
|
50
|
+
|
|
51
|
+
- instructions:Full/Ultra 含端到端规则组;Lite 含架构保护句;三档互异;
|
|
52
|
+
off 为空;安全边界含端到端数据流/必要测试/根因修复。
|
|
53
|
+
- gain:四段顺序、节省条件、null≠0、无 "less code, less cost, more speed"。
|
|
54
|
+
|
|
55
|
+
## [0.2.2] - 2026-08-26
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- **`/ponytail-gain` 数据口径修正**:收益数字明确标注为 **Upstream
|
|
60
|
+
reference**(Single-shot:5 任务 × 3 Claude 模型,代码 −80~94%、成本
|
|
61
|
+
−42~75%、延迟 3.1–5.8×;Agentic:真实 Claude Code 会话 × 12 功能任务,
|
|
62
|
+
LOC ~−54%、Token ~−22%、成本 ~−20%、时间 ~−27%、过度构建 −60~94%、
|
|
63
|
+
安全 100%),并注明「These are upstream Ponytail results, not measured
|
|
64
|
+
guarantees for this DSH adapter」「Savings depend on model and workload」
|
|
65
|
+
「Already-minimal tasks may show little or no savings」「Some reasoning
|
|
66
|
+
models may become more expensive」。新增 **DSH adapter status**:当前
|
|
67
|
+
smoke 只支持方向性有效,稳定 Token/成本/延迟节省尚未建立。Skill 描述
|
|
68
|
+
由 "less code, less cost, more speed" 改为 "upstream benchmark reference;
|
|
69
|
+
less unnecessary code, while token, cost, and latency effects depend on
|
|
70
|
+
model and workload"。
|
|
71
|
+
- **主 `ponytail` Skill 自动调用策略**:`invocation` 改为
|
|
72
|
+
`modelInvocable: false, userInvocable: true`——指针卡不再进入模型侧
|
|
73
|
+
Skill Catalog(普通编码任务不再重复加载),`/ponytail` 等命令与用户侧
|
|
74
|
+
入口不受影响(命令经 `ctx.skills.get` 加载,不被 modelInvocable 门控;
|
|
75
|
+
语义依据 `@deepseek-ai/dsh-skill` 的 `isModelInvocable`/`isUserInvocable`
|
|
76
|
+
与 `tool-skill` 的 Catalog 过滤源码核实)。whenToUse/描述缩小为
|
|
77
|
+
「仅在用户询问激活/模式/配置/帮助时使用」。
|
|
78
|
+
- **`/ponytail-help` 模式选择指导**:新增 Lite/Full/Ultra/Off 使用建议
|
|
79
|
+
(中英双语)与声明「Ponytail is not a guaranteed token-saving switch. It
|
|
80
|
+
trades a small fixed prompt cost for a chance to reduce unnecessary work.
|
|
81
|
+
Do not default every task to Ultra.」
|
|
82
|
+
- **README 效率说明改为条件性收益**:移除旧的 369/420/406 手工 Token 数字
|
|
83
|
+
与无出处的 A/B 行;改为实测 Prompt 大小(`npm run measure:prompt`)+
|
|
84
|
+
「收益有条件、非保证」说明 + 「上游数据不是本 DSH 适配版的保证」。
|
|
85
|
+
- **新增 `docs/dsh-smoke-summary.md`**:DSH Smoke Benchmark 摘要与证据
|
|
86
|
+
边界(环境、三轮结果、Token/成本口径、动态验证阻断、结论分级),
|
|
87
|
+
明确 directional smoke test;不把 runs 原始数据打进 npm 包。
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
|
|
91
|
+
- **`scripts/measure-prompt.mjs` + `npm run measure:prompt`**:从真实
|
|
92
|
+
`getPonytailInstructions()` 生成四档 Prompt,输出 chars/bytes 与
|
|
93
|
+
`estimated_tokens`(无统一 tokenizer 时为 null;off 恒为 0),明确
|
|
94
|
+
「rough estimate only; tokenizer and model dependent」,不冒充 Provider
|
|
95
|
+
Usage。Node ≥ 22.18(原生 type stripping)。
|
|
96
|
+
|
|
97
|
+
### Fixed
|
|
98
|
+
|
|
99
|
+
- `sync:dist` 成功提示文字补上 `src/`(状态检查列表早已覆盖,仅提示遗漏)。
|
|
100
|
+
- CHANGELOG 重复的 `## Unreleased` 标题清理;0.2.1 的 Security 内容归档归位。
|
|
101
|
+
- 模块顶部注释补齐完整优先级链(会话 override > env > Profile > 用户
|
|
102
|
+
config > full),与 modes.ts / content.ts / README / d.ts 一致。
|
|
103
|
+
|
|
104
|
+
### Tests
|
|
105
|
+
|
|
106
|
+
- Gain Skill:含 upstream reference、区分 single-shot/agentic、不声称
|
|
107
|
+
DSH 适配版保证节省、提示简单任务可能不省与模型差异。
|
|
108
|
+
- 主 `ponytail` Skill:仍为指针卡、不含旧 Full 规则;`modelInvocable:
|
|
109
|
+
false` / `userInvocable: true`;五个一次性 Skill 的 invocation 不变。
|
|
110
|
+
- Prompt:off 为空、三档互不相同、均含安全边界与明确验收项。
|
|
111
|
+
|
|
6
112
|
## [0.2.1] - 2026-08-25
|
|
7
113
|
|
|
8
114
|
### Fixed
|
|
@@ -27,10 +133,11 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
27
133
|
|
|
28
134
|
- ponytail 技能指针卡断言(不含旧 Full 规则)。
|
|
29
135
|
- `/ponytail default` 同值覆盖源提示测试。
|
|
30
|
-
- 62
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
136
|
+
- 62 tests passed in the authoritative deepseek-harness monorepo package
|
|
137
|
+
(`packages/community/ponytail/tests/`: instructions.spec.ts + ponytail.spec.ts;
|
|
138
|
+
本机实测 62 passed;CI 矩阵见 `.github/workflows/ci.yml`,Ubuntu/Windows ×
|
|
139
|
+
Node 22/24)。此数字来自权威 monorepo 包测试,不是发行镜像
|
|
140
|
+
`verify:dist` / `verify:pack` / `test:consumer` / `test:regressions` 的合计。
|
|
34
141
|
|
|
35
142
|
### Security
|
|
36
143
|
|
package/README.md
CHANGED
|
@@ -5,7 +5,25 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@mengyuly/dsh-ponytail)
|
|
6
6
|
[](https://www.dsh.so/artifact/dsh-ponytail-4/)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
将 [DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail) 的极简编码原则和相关 Skill 适配到 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness),提供 YAGNI 决策阶梯、Lite / Full / Ultra / Off 会话级模式,以及一组用于代码精简、审查、审计和技术债追踪的 Skill。
|
|
9
|
+
|
|
10
|
+
本项目对齐上游核心理念和主要工作流,但 DSH 的模型循环、Prompt 组装、Skill 机制和工具调用不同。**上游 Benchmark 仅作参考,不代表本适配版具有相同的 Token、成本或延迟收益**(详见「效率(条件性收益,非保证)」)。
|
|
11
|
+
|
|
12
|
+
## GitHub Release 下载
|
|
13
|
+
|
|
14
|
+
- **稳定 latest 下载**(资产名固定,每次 Release 不变):
|
|
15
|
+
`https://github.com/MengYuil/dsh-ponytail/releases/latest/download/mengyuly-dsh-ponytail.tgz`
|
|
16
|
+
- **固定版本下载**(按 Tag 不可变):
|
|
17
|
+
`https://github.com/MengYuil/dsh-ponytail/releases/download/v0.2.2/mengyuly-dsh-ponytail-0.2.2.tgz`
|
|
18
|
+
|
|
19
|
+
说明:
|
|
20
|
+
|
|
21
|
+
- `latest` 指向最新 GitHub Release;固定资产名 `mengyuly-dsh-ponytail.tgz`
|
|
22
|
+
在每个 Release 中保持不变,因此该 URL 不会因版本号变化而失效。
|
|
23
|
+
- 需要完全可复现的构建时,请使用**固定版本 Release 链接**(按 Tag 下载)。
|
|
24
|
+
- npm 安装仍走 npm Registry 或 `dsh plugin` 命令;latest Tarball 适合快速
|
|
25
|
+
安装体验,**不适合作为不可变依赖**。
|
|
26
|
+
- 固定资产名由 `scripts/release-assets.mjs` 生成并验证(`npm run release:assets`)。
|
|
9
27
|
|
|
10
28
|
## 安装
|
|
11
29
|
|
|
@@ -49,7 +67,7 @@ dsh plugin --profile web add @mengyuly/dsh-ponytail
|
|
|
49
67
|
- `/ponytail-review` — 针对最近改动找过度工程,一行一条:位置 + 删什么 + 替代。
|
|
50
68
|
- `/ponytail-audit` — 全仓库过度工程审计,排序清单。
|
|
51
69
|
- `/ponytail-debt` — 收割所有 `ponytail:` 注释成债务账本。
|
|
52
|
-
- `/ponytail-gain` —
|
|
70
|
+
- `/ponytail-gain` — 上游 Benchmark 参考计分板(代码减少;Token/成本/延迟效果取决于模型与任务,**非本适配版保证**)。
|
|
53
71
|
- `/ponytail-help` — 参考卡。
|
|
54
72
|
- **停用**:说 `stop ponytail` 或 `normal mode`(兼容中英文句末标点);随时 `/ponytail` 恢复。
|
|
55
73
|
- **默认值优先级**(代码/测试/文档一致):
|
|
@@ -70,15 +88,36 @@ dsh plugin --profile web add @mengyuly/dsh-ponytail
|
|
|
70
88
|
- **子代理(如实边界)**:DSH 内置 `subagent` 工具是**隔离派生**,默认**不继承**本插件的 system-prompt;`PONYTAIL_SUBAGENT_MATCHER`(匹配子代理 `agentPreset` 的正则)**只用于筛选能进入本 Prompt 管线的子代理**,不是继承开关;DSH 当前没有公开的子代理派生/可继承 Prompt API,因此**未实现、也不宣称父子 Prompt 继承**(有官方 API 后再考虑只读快照传播)。非法正则告警一次并 fail-open。
|
|
71
89
|
- **配置错误**:非法 JSON / 非法 `defaultMode` / 读取失败 / 非法正则只告警一次(不刷屏);配置文件不存在属正常、不告警。
|
|
72
90
|
|
|
73
|
-
##
|
|
91
|
+
## 效率(条件性收益,非保证)
|
|
92
|
+
|
|
93
|
+
Ponytail 会给每次模型请求增加一小段固定规则。它的收益是**有条件的**:
|
|
94
|
+
当 Agent 容易过度设计时,减少的代码、工具调用和返工可能抵消甚至超过
|
|
95
|
+
这部分开销;当任务本来已经很简单时,收益可能接近零,甚至出现额外输入
|
|
96
|
+
开销。它不是"省 Token 开关",也不保证跨模型省钱——某些推理模型可能因
|
|
97
|
+
prompt 与推理开销变得更贵。
|
|
98
|
+
|
|
99
|
+
本 DSH 适配版当前 Prompt 段实测大小(`npm run measure:prompt`,从真实
|
|
100
|
+
`getPonytailInstructions()` 生成):
|
|
101
|
+
|
|
102
|
+
| 档位 | 字符数 | UTF-8 字节 | 说明 |
|
|
103
|
+
|------|--------|-----------|------|
|
|
104
|
+
| lite | 1474 | 1476 | 实测生成 |
|
|
105
|
+
| full | 1678 | 1682 | 实测生成 |
|
|
106
|
+
| ultra | 1625 | 1629 | 实测生成 |
|
|
107
|
+
| off | 0 | 0 | 不注入 |
|
|
108
|
+
|
|
109
|
+
这些是 **Prompt 体积测量,不是账单金额,也不是对所有模型成立的节省
|
|
110
|
+
比例**(无统一 tokenizer,`measure:prompt` 输出中 `estimated_tokens` 为
|
|
111
|
+
null;字符数/4 只是粗略估算)。同模式字节级稳定,KV-cache 前缀命中。
|
|
74
112
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
113
|
+
**上游数据不是本 DSH 适配版的保证**:上游 Ponytail 的 single-shot
|
|
114
|
+
(代码 −80~94%、成本 −42~75%、延迟 3.1–5.8×)与 agentic(LOC −54% 等)
|
|
115
|
+
结果仅作参考;DSH 适配版**未建立**稳定的 Token/成本/延迟节省率。DSH
|
|
116
|
+
Smoke Benchmark 只提供方向性证据(见 `docs/dsh-smoke-summary.md`)。
|
|
78
117
|
|
|
79
118
|
## 已知限制
|
|
80
119
|
|
|
81
|
-
-
|
|
120
|
+
- 档位差异在**规则语义**上(见上),三者 Prompt 体积相近(实测见上表)。
|
|
82
121
|
- 上游 Claude 专属的 statusline 徽标无 DSH 对应物,MCP 服务器因 DSH 有一等 system-prompt 注入点而弃用。
|
|
83
122
|
- 用户 `config.json` 热更新;`PONYTAIL_DEFAULT_MODE` 与 Profile config 需重启生效。
|
|
84
123
|
- 发行 `lib/` 是预编译产物;改源码请回主仓重建后同步。
|
package/lib/index.js
CHANGED
|
@@ -941,7 +941,7 @@ else — the section is the single source of truth and it is mode-aware.
|
|
|
941
941
|
\`/ponytail-gain\`, \`/ponytail-help\`
|
|
942
942
|
- Reference: https://github.com/DietrichGebert/ponytail
|
|
943
943
|
`;
|
|
944
|
-
const PONYTAIL_DESCRIPTION = "
|
|
944
|
+
const PONYTAIL_DESCRIPTION = "Ponytail activation, modes, configuration, and help reference. The active ruleset is injected every turn by the system prompt; this skill is a pointer card. Use only when the user asks about Ponytail activation, modes, configuration, or help. Coding tasks already receive the active ruleset from the system prompt.";
|
|
945
945
|
const REVIEW_SKILL_BODY = `
|
|
946
946
|
Review diffs for unnecessary complexity. One line per finding: location, what
|
|
947
947
|
to cut, what replaces it. The diff's best outcome is getting shorter.
|
|
@@ -1064,43 +1064,59 @@ const GAIN_SKILL_BODY = `
|
|
|
1064
1064
|
Display this scoreboard when invoked. One-shot: do NOT change mode, write flag
|
|
1065
1065
|
files, or persist anything.
|
|
1066
1066
|
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
Haiku, Sonnet, Opus). They are measured, not computed from the current repo.
|
|
1070
|
-
Source: the upstream \`benchmarks/\` directory and README.
|
|
1067
|
+
These are upstream Ponytail results, not measured guarantees for this DSH
|
|
1068
|
+
adapter.
|
|
1071
1069
|
|
|
1072
|
-
|
|
1070
|
+
Savings depend on model, workload, prompt caching, tool usage, and execution
|
|
1071
|
+
path. Already-minimal tasks may show little or no savings. Some reasoning
|
|
1072
|
+
models may become more expensive because prompt and reasoning overhead can
|
|
1073
|
+
exceed the saved output.
|
|
1073
1074
|
|
|
1074
|
-
|
|
1075
|
-
carries the exact figure:
|
|
1075
|
+
## 1. Upstream agentic reference
|
|
1076
1076
|
|
|
1077
|
-
|
|
1078
|
-
ponytail gain benchmark median · 5 tasks · 3 models
|
|
1077
|
+
Real Claude Code sessions on real repositories; 12 feature tasks:
|
|
1079
1078
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1079
|
+
- Source LOC: ~\u221254%
|
|
1080
|
+
- Tokens: ~\u221222%
|
|
1081
|
+
- Cost: ~\u221220%
|
|
1082
|
+
- Time: ~\u221227%
|
|
1083
|
+
- Over-build tasks: \u221260\u201394%
|
|
1084
|
+
- Safety tests: 100%
|
|
1085
1085
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1086
|
+
## 2. Upstream single-shot reference
|
|
1087
|
+
|
|
1088
|
+
5 everyday tasks (email validator, debounce, CSV sum, countdown timer, rate
|
|
1089
|
+
limiter); 3 Claude models; single generation per task:
|
|
1090
|
+
|
|
1091
|
+
- Lines of code: \u221280\u201394%
|
|
1092
|
+
- Cost (Claude): \u221242\u201375%
|
|
1093
|
+
- Latency: ~3.1\u20135.8\u00d7 faster
|
|
1094
|
+
|
|
1095
|
+
## 3. DSH adapter status
|
|
1096
|
+
|
|
1097
|
+
Current DSH smoke tests provide directional evidence only. Stable token,
|
|
1098
|
+
cost, and latency savings have not been established.
|
|
1099
|
+
|
|
1100
|
+
See the repository's DSH smoke reports for limited, non-statistical
|
|
1101
|
+
directional evidence (docs/dsh-smoke-summary.md).
|
|
1089
1102
|
|
|
1090
|
-
## Honesty boundary
|
|
1103
|
+
## 4. Honesty boundary
|
|
1091
1104
|
|
|
1092
|
-
These are benchmark medians, not this repo
|
|
1093
|
-
number ("you saved X lines/tokens
|
|
1094
|
-
written, so there is no real baseline
|
|
1095
|
-
only real per-repo figures come from
|
|
1096
|
-
this card points there instead of
|
|
1105
|
+
These are upstream benchmark medians, not this repo and not this DSH
|
|
1106
|
+
adapter. NEVER print a per-repo savings number ("you saved X lines/tokens
|
|
1107
|
+
here"): the unbuilt version was never written, so there is no real baseline
|
|
1108
|
+
to subtract from in a live repo. The only real per-repo figures come from
|
|
1109
|
+
\`/ponytail-debt\` (a counted ledger), and this card points there instead of
|
|
1110
|
+
inventing one. Never claim "Ponytail always saves tokens/cost" or that this
|
|
1111
|
+
adapter reproduces the upstream percentages. A missing cost figure (null) is
|
|
1112
|
+
not a zero cost.
|
|
1097
1113
|
|
|
1098
1114
|
## Boundaries
|
|
1099
1115
|
|
|
1100
1116
|
One-shot display. Edits nothing, changes no mode.
|
|
1101
1117
|
"stop ponytail" or "normal mode": revert.
|
|
1102
1118
|
`;
|
|
1103
|
-
const GAIN_DESCRIPTION = "
|
|
1119
|
+
const GAIN_DESCRIPTION = "Less unnecessary work; token, cost, and latency effects depend on model and workload. Upstream benchmark reference, not a DSH-adapter guarantee. One-shot display, not a persistent mode, and not a per-repo number. Trigger: /ponytail-gain, \"ponytail gain\", \"what does ponytail save\", \"show ponytail impact\", \"ponytail scoreboard\".";
|
|
1104
1120
|
const HELP_SKILL_BODY = `
|
|
1105
1121
|
Display this reference card when invoked. One-shot, do NOT change mode,
|
|
1106
1122
|
write flag files, or persist anything.
|
|
@@ -1116,6 +1132,28 @@ write flag files, or persist anything.
|
|
|
1116
1132
|
|
|
1117
1133
|
Level is session-scoped until changed.
|
|
1118
1134
|
|
|
1135
|
+
## Choosing a level
|
|
1136
|
+
|
|
1137
|
+
- **Lite**: Use for small, explicit changes or when the implementation is
|
|
1138
|
+
already clear. Completes explicit requirements without actively
|
|
1139
|
+
challenging them.
|
|
1140
|
+
Lite:小改动、需求明确时使用。
|
|
1141
|
+
- **Full**: Use for new features, refactors, root-cause bug fixes, or tasks
|
|
1142
|
+
likely to invite unnecessary abstractions, dependencies, or custom
|
|
1143
|
+
components.
|
|
1144
|
+
Full:新功能、重构、根因修复、容易过度设计时使用。
|
|
1145
|
+
- **Ultra**: Use for deliberate code cleanup and over-engineering removal.
|
|
1146
|
+
It questions speculative scope, but never removes explicit requirements,
|
|
1147
|
+
security, validation, accessibility, or data-loss protection.
|
|
1148
|
+
Ultra:专门清理冗余和过度抽象时使用。
|
|
1149
|
+
- **Off**: Use when the task is non-coding, already fully specified, or when
|
|
1150
|
+
the fixed prompt overhead is not worthwhile.
|
|
1151
|
+
Off:非编码任务或已经明确到无需额外编码判断的任务。
|
|
1152
|
+
|
|
1153
|
+
Ponytail is not a guaranteed token-saving switch. It trades a small fixed
|
|
1154
|
+
prompt cost for a chance to reduce unnecessary work. Do not default every
|
|
1155
|
+
task to Ultra.
|
|
1156
|
+
|
|
1119
1157
|
## Skills
|
|
1120
1158
|
|
|
1121
1159
|
| Skill | Trigger | What it does |
|
|
@@ -1124,7 +1162,7 @@ Level is session-scoped until changed.
|
|
|
1124
1162
|
| **ponytail-review** | \`/ponytail-review\` | Over-engineering review: \`L42: yagni: factory, one product. Inline.\` |
|
|
1125
1163
|
| **ponytail-audit** | \`/ponytail-audit\` | Whole-repo over-engineering audit: ranked list of what to delete. |
|
|
1126
1164
|
| **ponytail-debt** | \`/ponytail-debt\` | Harvest \`ponytail:\` shortcut comments into a tracked ledger. |
|
|
1127
|
-
| **ponytail-gain** | \`/ponytail-gain\` |
|
|
1165
|
+
| **ponytail-gain** | \`/ponytail-gain\` | Upstream benchmark reference: less unnecessary work; token/cost/latency effects depend on model and workload. |
|
|
1128
1166
|
| **ponytail-help** | \`/ponytail-help\` | This card. |
|
|
1129
1167
|
|
|
1130
1168
|
You can also load any of these with the \`skill\` tool.
|
|
@@ -1181,10 +1219,10 @@ function ponytailSkills() {
|
|
|
1181
1219
|
name: "ponytail",
|
|
1182
1220
|
source: "runtime",
|
|
1183
1221
|
description: PONYTAIL_DESCRIPTION,
|
|
1184
|
-
whenToUse: "
|
|
1222
|
+
whenToUse: "Use only when the user asks about Ponytail activation, modes, configuration, or help. Coding tasks already receive the active ruleset from the system prompt.",
|
|
1185
1223
|
content: PONYTAIL_SKILL_BODY,
|
|
1186
1224
|
invocation: {
|
|
1187
|
-
modelInvocable:
|
|
1225
|
+
modelInvocable: false,
|
|
1188
1226
|
userInvocable: true
|
|
1189
1227
|
}
|
|
1190
1228
|
},
|
|
@@ -1490,34 +1528,54 @@ const SAFETY_BOUNDARIES = [
|
|
|
1490
1528
|
"- Accessibility basics.",
|
|
1491
1529
|
"- Explicit acceptance criteria the user asked for.",
|
|
1492
1530
|
"- Understanding the problem and tracing the real flow first.",
|
|
1531
|
+
"- The real end-to-end data flow: no UI-only field, unused state, placeholder path, or disconnected payload.",
|
|
1532
|
+
"- Necessary tests for non-trivial changes.",
|
|
1533
|
+
"- Root-cause fixes over symptom patches.",
|
|
1493
1534
|
"- \"Minimal diff\" is not a substitute for \"correct fix\"."
|
|
1494
1535
|
].join("\n");
|
|
1536
|
+
/** Lite: complete the explicit ask; reuse; suggest, do not challenge. */
|
|
1537
|
+
const LITE_RULES = [
|
|
1538
|
+
"Complete everything explicitly requested, including every acceptance criterion.",
|
|
1539
|
+
"Prefer existing code, standard-library features, native platform features, and already-installed dependencies.",
|
|
1540
|
+
"You may mention a simpler alternative briefly, but do not challenge or reject an explicit requirement.",
|
|
1541
|
+
"Do not change the existing architecture merely to reduce line count.",
|
|
1542
|
+
"Keep the smallest reasonable validation for non-trivial changes."
|
|
1543
|
+
].join("\n");
|
|
1544
|
+
/** Smallest complete end-to-end change: shared by Full and Ultra. */
|
|
1545
|
+
const E2E_RULES = [
|
|
1546
|
+
"Smallest complete end-to-end change:",
|
|
1547
|
+
"- Prefer the smallest complete end-to-end change compatible with the existing architecture, not merely the fewest lines in one file.",
|
|
1548
|
+
"- Before creating a component, abstraction, protocol, migration, transport format, storage format, or dependency, inspect the repository’s existing path and preserve its current contract.",
|
|
1549
|
+
"- Do not redesign transport, storage, API shape, or persistence when the task only asks for a local UI or behavior change.",
|
|
1550
|
+
"- A locally smaller implementation that changes the system contract is not smaller overall.",
|
|
1551
|
+
"- Prefer the smallest complete change across the real data flow: input → state → validation → payload → API → persistence → response/UI.",
|
|
1552
|
+
"- Do not leave a UI-only field, unused state, placeholder path, or disconnected payload merely because it produces a smaller diff."
|
|
1553
|
+
].join("\n");
|
|
1495
1554
|
const MODE_RULES = {
|
|
1496
|
-
lite:
|
|
1497
|
-
"Complete what is explicitly asked, including every acceptance criterion.",
|
|
1498
|
-
"Prefer reuse, the standard library, native features, and installed dependencies.",
|
|
1499
|
-
"You may name a simpler alternative in one line, but do not challenge or reject an explicit requirement.",
|
|
1500
|
-
"Output may be a little more complete than full; never cut an acceptance item to save lines."
|
|
1501
|
-
].join("\n"),
|
|
1555
|
+
lite: LITE_RULES,
|
|
1502
1556
|
full: [
|
|
1503
|
-
"
|
|
1557
|
+
"Use the complete ladder — stop at the first rung that holds:",
|
|
1504
1558
|
"1. Does this need to exist at all? (YAGNI)",
|
|
1505
1559
|
"2. Does it already exist in this codebase? Reuse it.",
|
|
1506
1560
|
"3. Does the standard library do it? Use it.",
|
|
1507
1561
|
"4. Does a native platform feature cover it? Use it.",
|
|
1508
1562
|
"5. Does an already-installed dependency solve it? Use it.",
|
|
1509
|
-
"6. Can
|
|
1510
|
-
"7. Only then: the minimum
|
|
1511
|
-
"Default to the shortest correct implementation; prefer deletion and reuse.",
|
|
1512
|
-
"Fix root causes, not symptoms: one guard in the shared function beats a guard in every caller."
|
|
1563
|
+
"6. Can the solution be reduced to a small expression? Make it that small.",
|
|
1564
|
+
"7. Only then: write the minimum new implementation.",
|
|
1565
|
+
"Default to the shortest correct implementation; prefer deletion and reuse, but do not trade away correctness, security, tests, explicit requirements, or the existing system contract.",
|
|
1566
|
+
"Fix root causes, not symptoms: one guard in the shared function beats a guard in every caller.",
|
|
1567
|
+
"",
|
|
1568
|
+
E2E_RULES
|
|
1513
1569
|
].join("\n"),
|
|
1514
1570
|
ultra: [
|
|
1515
|
-
"
|
|
1516
|
-
"Actively question speculative features, caches, abstractions, configuration, and new dependencies.",
|
|
1517
|
-
"Prefer
|
|
1518
|
-
"
|
|
1519
|
-
"For
|
|
1520
|
-
"Ultra is not
|
|
1571
|
+
"Delete before adding.",
|
|
1572
|
+
"Actively question speculative features, caches, abstractions, configuration, migrations, transport changes, storage changes, and new dependencies.",
|
|
1573
|
+
"Prefer the smallest complete end-to-end change, not the smallest local diff.",
|
|
1574
|
+
"Do not change an existing contract merely to reduce lines.",
|
|
1575
|
+
"For complex requests, ship the smallest correct complete version and state what would justify a larger version.",
|
|
1576
|
+
"Ultra is not refusal: explicit requirements, safety, validation, accessibility, data protection, and acceptance criteria remain mandatory.",
|
|
1577
|
+
"",
|
|
1578
|
+
E2E_RULES
|
|
1521
1579
|
].join("\n")
|
|
1522
1580
|
};
|
|
1523
1581
|
const MODE_LABELS = {
|
|
@@ -1570,8 +1628,9 @@ const instructionCache = /* @__PURE__ */ new Map();
|
|
|
1570
1628
|
* `agent/pre-step` listener honors the plain-text deactivation phrases.
|
|
1571
1629
|
*
|
|
1572
1630
|
* Mode is session-scoped and held in memory; the configured default resolves
|
|
1573
|
-
* from `PONYTAIL_DEFAULT_MODE
|
|
1574
|
-
* {@link readDefaultMode})
|
|
1631
|
+
* from `PONYTAIL_DEFAULT_MODE`, then the Cordis profile `defaultMode`, then
|
|
1632
|
+
* `~/.config/ponytail/config.json` (see {@link readDefaultMode}), then
|
|
1633
|
+
* `full`. A session override via `/ponytail` outranks all of them.
|
|
1575
1634
|
*
|
|
1576
1635
|
* @module @deepseek-ai/dsh-ponytail
|
|
1577
1636
|
*/
|
package/lib/types/content.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ export declare const AUDIT_SKILL_BODY = "\nponytail-review, repo-wide. Scan the
|
|
|
18
18
|
export declare const AUDIT_DESCRIPTION: string;
|
|
19
19
|
export declare const DEBT_SKILL_BODY = "\nEvery deliberate ponytail shortcut is marked with a `ponytail:` comment naming\nits ceiling and upgrade path. This collects them into one ledger so a deferral\ncan't quietly become permanent.\n\n## Scan\n\nGrep the repo for comment markers, skipping `node_modules`, `.git`, and build\noutput:\n\n`grep -rnE '(#|//) ?ponytail:' .` (add other comment prefixes if your stack uses them)\n\nEach hit is one ledger row. The comment prefix keeps prose that merely mentions\nthe convention out of the ledger.\n\n## Output\n\nOne row per marker, grouped by file:\n\n`<file>:<line>, <what was simplified>. ceiling: <the limit named>. upgrade: <the trigger to revisit>.`\n\nThe convention is `ponytail: <ceiling>, <upgrade path>`, so pull the ceiling\nand the trigger straight from the comment. Want an owner per row too? add\n`git blame -L<line>,<line>`.\n\nFlag the rot risk: any `ponytail:` comment that names no upgrade path or\ntrigger gets a `no-trigger` tag, those are the ones that silently rot.\n\nEnd with `<N> markers, <M> with no trigger.` Nothing found: `No ponytail: debt. Clean ledger.`\n\n## Boundaries\n\nReads and reports only, changes nothing. To persist it, ask and it writes the\nledger to a file (e.g. `PONYTAIL-DEBT.md`). One-shot. \"stop ponytail-debt\" or\n\"normal mode\" to revert.\n";
|
|
20
20
|
export declare const DEBT_DESCRIPTION: string;
|
|
21
|
-
export declare const GAIN_SKILL_BODY = "\nDisplay this scoreboard when invoked. One-shot: do NOT change mode, write flag\nfiles, or persist anything.\n\
|
|
21
|
+
export declare const GAIN_SKILL_BODY = "\nDisplay this scoreboard when invoked. One-shot: do NOT change mode, write flag\nfiles, or persist anything.\n\nThese are upstream Ponytail results, not measured guarantees for this DSH\nadapter.\n\nSavings depend on model, workload, prompt caching, tool usage, and execution\npath. Already-minimal tasks may show little or no savings. Some reasoning\nmodels may become more expensive because prompt and reasoning overhead can\nexceed the saved output.\n\n## 1. Upstream agentic reference\n\nReal Claude Code sessions on real repositories; 12 feature tasks:\n\n- Source LOC: ~\u221254%\n- Tokens: ~\u221222%\n- Cost: ~\u221220%\n- Time: ~\u221227%\n- Over-build tasks: \u221260\u201394%\n- Safety tests: 100%\n\n## 2. Upstream single-shot reference\n\n5 everyday tasks (email validator, debounce, CSV sum, countdown timer, rate\nlimiter); 3 Claude models; single generation per task:\n\n- Lines of code: \u221280\u201394%\n- Cost (Claude): \u221242\u201375%\n- Latency: ~3.1\u20135.8\u00D7 faster\n\n## 3. DSH adapter status\n\nCurrent DSH smoke tests provide directional evidence only. Stable token,\ncost, and latency savings have not been established.\n\nSee the repository's DSH smoke reports for limited, non-statistical\ndirectional evidence (docs/dsh-smoke-summary.md).\n\n## 4. Honesty boundary\n\nThese are upstream benchmark medians, not this repo and not this DSH\nadapter. NEVER print a per-repo savings number (\"you saved X lines/tokens\nhere\"): the unbuilt version was never written, so there is no real baseline\nto subtract from in a live repo. The only real per-repo figures come from\n`/ponytail-debt` (a counted ledger), and this card points there instead of\ninventing one. Never claim \"Ponytail always saves tokens/cost\" or that this\nadapter reproduces the upstream percentages. A missing cost figure (null) is\nnot a zero cost.\n\n## Boundaries\n\nOne-shot display. Edits nothing, changes no mode.\n\"stop ponytail\" or \"normal mode\": revert.\n";
|
|
22
22
|
export declare const GAIN_DESCRIPTION: string;
|
|
23
|
-
export declare const HELP_SKILL_BODY = "\nDisplay this reference card when invoked. One-shot, do NOT change mode,\nwrite flag files, or persist anything.\n\n## Levels\n\n| Level | Trigger | What change |\n|-------|---------|-------------|\n| **Lite** | `/ponytail lite` | Build what's asked, name the lazier alternative in one line. |\n| **Full** | `/ponytail` | The ladder enforced: YAGNI \u2192 stdlib \u2192 native \u2192 one line \u2192 minimum. Default. |\n| **Ultra** | `/ponytail ultra` | YAGNI extremist: deletion first, questions speculation \u2014 never cuts explicit requirements. |\n| **Off** | `/ponytail off` | Ponytail stops injecting its ruleset for this session. |\n\nLevel is session-scoped until changed.\n\n## Skills\n\n| Skill | Trigger | What it does |\n|-------|---------|--------------|\n| **ponytail** | `/ponytail` | Lazy mode itself. Simplest solution that works. |\n| **ponytail-review** | `/ponytail-review` | Over-engineering review: `L42: yagni: factory, one product. Inline.` |\n| **ponytail-audit** | `/ponytail-audit` | Whole-repo over-engineering audit: ranked list of what to delete. |\n| **ponytail-debt** | `/ponytail-debt` | Harvest `ponytail:` shortcut comments into a tracked ledger. |\n| **ponytail-gain** | `/ponytail-gain` |
|
|
23
|
+
export declare const HELP_SKILL_BODY = "\nDisplay this reference card when invoked. One-shot, do NOT change mode,\nwrite flag files, or persist anything.\n\n## Levels\n\n| Level | Trigger | What change |\n|-------|---------|-------------|\n| **Lite** | `/ponytail lite` | Build what's asked, name the lazier alternative in one line. |\n| **Full** | `/ponytail` | The ladder enforced: YAGNI \u2192 stdlib \u2192 native \u2192 one line \u2192 minimum. Default. |\n| **Ultra** | `/ponytail ultra` | YAGNI extremist: deletion first, questions speculation \u2014 never cuts explicit requirements. |\n| **Off** | `/ponytail off` | Ponytail stops injecting its ruleset for this session. |\n\nLevel is session-scoped until changed.\n\n## Choosing a level\n\n- **Lite**: Use for small, explicit changes or when the implementation is\n already clear. Completes explicit requirements without actively\n challenging them.\n Lite\uFF1A\u5C0F\u6539\u52A8\u3001\u9700\u6C42\u660E\u786E\u65F6\u4F7F\u7528\u3002\n- **Full**: Use for new features, refactors, root-cause bug fixes, or tasks\n likely to invite unnecessary abstractions, dependencies, or custom\n components.\n Full\uFF1A\u65B0\u529F\u80FD\u3001\u91CD\u6784\u3001\u6839\u56E0\u4FEE\u590D\u3001\u5BB9\u6613\u8FC7\u5EA6\u8BBE\u8BA1\u65F6\u4F7F\u7528\u3002\n- **Ultra**: Use for deliberate code cleanup and over-engineering removal.\n It questions speculative scope, but never removes explicit requirements,\n security, validation, accessibility, or data-loss protection.\n Ultra\uFF1A\u4E13\u95E8\u6E05\u7406\u5197\u4F59\u548C\u8FC7\u5EA6\u62BD\u8C61\u65F6\u4F7F\u7528\u3002\n- **Off**: Use when the task is non-coding, already fully specified, or when\n the fixed prompt overhead is not worthwhile.\n Off\uFF1A\u975E\u7F16\u7801\u4EFB\u52A1\u6216\u5DF2\u7ECF\u660E\u786E\u5230\u65E0\u9700\u989D\u5916\u7F16\u7801\u5224\u65AD\u7684\u4EFB\u52A1\u3002\n\nPonytail is not a guaranteed token-saving switch. It trades a small fixed\nprompt cost for a chance to reduce unnecessary work. Do not default every\ntask to Ultra.\n\n## Skills\n\n| Skill | Trigger | What it does |\n|-------|---------|--------------|\n| **ponytail** | `/ponytail` | Lazy mode itself. Simplest solution that works. |\n| **ponytail-review** | `/ponytail-review` | Over-engineering review: `L42: yagni: factory, one product. Inline.` |\n| **ponytail-audit** | `/ponytail-audit` | Whole-repo over-engineering audit: ranked list of what to delete. |\n| **ponytail-debt** | `/ponytail-debt` | Harvest `ponytail:` shortcut comments into a tracked ledger. |\n| **ponytail-gain** | `/ponytail-gain` | Upstream benchmark reference: less unnecessary work; token/cost/latency effects depend on model and workload. |\n| **ponytail-help** | `/ponytail-help` | This card. |\n\nYou can also load any of these with the `skill` tool.\n\n## Deactivate\n\nSay \"stop ponytail\" or \"normal mode\". Resume anytime with `/ponytail` \u2014\nit re-enables at the effective default (or `full` when that is off too).\n`/ponytail status` only shows the current level, never changes it.\n`/ponytail off` also works. Level is session-scoped; a new session starts\nfrom the configured default.\n\n## Configure Default Mode\n\nDefault mode = `full`, auto-active every session. Change it:\n\n**Environment variable** (highest priority):\n```bash\nexport PONYTAIL_DEFAULT_MODE=ultra\n```\n\n**Config file** (`~/.config/ponytail/config.json`, Windows: `%APPDATA%\\ponytail\\config.json`):\n```json\n{ \"defaultMode\": \"lite\" }\n```\n\n**Profile config** (per DSH profile, via the bundle row's `config` \u2014 e.g.\n`tui` \u2192 lite):\n\n```yaml\n- insert:\n - id: ponytail\n name: '@mengyuly/dsh-ponytail'\n config:\n defaultMode: lite\n```\n\nSet `\"off\"` to disable auto-activation on session start, activate manually\nwith `/ponytail` when wanted. `/ponytail default <mode>` persists a new\ndefault to the user config file; an exported `PONYTAIL_DEFAULT_MODE` or a\nprofile `defaultMode` still outranks the saved value for new sessions.\n\nResolution: session override > env var > profile config > config file > `full`.\n\n## More\n\nFull docs + examples: https://github.com/DietrichGebert/ponytail\n";
|
|
24
24
|
export declare const HELP_DESCRIPTION: string;
|
|
25
25
|
/** Ordered set of runtime skills surfaced to the model catalog and `/` menu. */
|
|
26
26
|
export declare function ponytailSkills(): readonly SkillRegistration[];
|
package/lib/types/index.d.ts
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
* `agent/pre-step` listener honors the plain-text deactivation phrases.
|
|
8
8
|
*
|
|
9
9
|
* Mode is session-scoped and held in memory; the configured default resolves
|
|
10
|
-
* from `PONYTAIL_DEFAULT_MODE
|
|
11
|
-
* {@link readDefaultMode})
|
|
10
|
+
* from `PONYTAIL_DEFAULT_MODE`, then the Cordis profile `defaultMode`, then
|
|
11
|
+
* `~/.config/ponytail/config.json` (see {@link readDefaultMode}), then
|
|
12
|
+
* `full`. A session override via `/ponytail` outranks all of them.
|
|
12
13
|
*
|
|
13
14
|
* @module @deepseek-ai/dsh-ponytail
|
|
14
15
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mengyuly/dsh-ponytail",
|
|
3
3
|
"description": "Lazy senior dev mode for DeepSeek Harness: always-on minimal-code ruleset, intensity switching, and short review/audit/debt/gain/help skills",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
"verify:dist": "node scripts/verify-dist.mjs",
|
|
53
53
|
"verify:pack": "node scripts/verify-pack.mjs",
|
|
54
54
|
"test:consumer": "node scripts/test-consumer.mjs",
|
|
55
|
-
"test:regressions": "node scripts/test-regressions.mjs"
|
|
55
|
+
"test:regressions": "node scripts/test-regressions.mjs",
|
|
56
|
+
"measure:prompt": "node scripts/measure-prompt.mjs",
|
|
57
|
+
"release:assets": "node scripts/release-assets.mjs",
|
|
58
|
+
"check:release-links": "node scripts/check-release-links.mjs"
|
|
56
59
|
}
|
|
57
60
|
}
|