Ponytail:让编码智能体先沿是否必要的梯子收敛,再写最少代码
开源技能 Ponytail 以技能文件形式约束编码智能体:写代码前按是否需要、仓库已有、标准库、原生能力、依赖、一行、最小实现梯子收敛;作者自测相对无技能可减少行数、输出 token、费用与耗时。
Ponytail 是一份给编码智能体用的技能提示:核心不是少生成 token,而是先逼智能体走完必要性梯子——这件事要不要做、仓库里有没有、标准库行不行、平台原生有没有、已装依赖够不够、能否一行解决,最后才写能用的最少实现,并在分支、循环、解析、金钱或安全相关逻辑处补一小段测试。信任边界校验、错误处理、安全与无障碍明确不在可砍范围内。
作者给出较完整的自测设定:三十九个任务、指定模型加无界面 Claude Code、每任务每臂五次共五百八十五次会话。相对无技能:行数约少一半多、输出 token 与费用、耗时同步下降;隐藏检查与安全任务表现接近或持平。测试行为上更常留下必要测试,但单测更短;盲评解释质量相对无技能无显著优势。作者也写明局限:厂商自测、单模型、单仓库族、禁用命令行故测的是写出什么而非调试过程。兼容多种主流编码智能体,一份技能文件即可接入。
对研发团队,这是用技能文件压制智能体过度工程的可复现尝试;是否搬到你的仓库,仍应用自己的工具链复测,并核对安全与无障碍是否被保留。
Ponytail: minimal-code skill ladder for coding agents
Your coding agent just wrote 335 lines to add a date picker.
The repo already had an Input component. Every browser already ships a native date picker. Ponytail is a single prompt that puts the laziest senior dev in the room inside your agent — the one who says nothing, then replaces your fifty lines with one.
Before it writes anything, it walks a ladder and stops at the first rung that holds:
- Does this need to exist?
- Is it already in this codebase?
- Does the standard library do it?
- Is there a native platform feature?
- Is there an installed dependency?
- Can it be one line?
- Only then: the minimum that works, plus one small test if it branches, loops, parses, handles money, or touches security.
The rule is not "fewest tokens." Trust-boundary validation, error handling, security, and accessibility are explicitly off the chopping block. Code gets small because it is necessary, not golfed.
The author's benchmark is unusually honest for a README: 39 tasks (12 feature tickets in a real FastAPI + React repo, 18 surgical tasks with hidden checks, 6 small apps, 3 examples), Opus 5.5 in headless Claude Code, 5 runs per task and arm, 585 sessions. Versus the same agent with no skill: 53% fewer lines, 45% fewer output tokens, 26% lower cost, 41% less time. Hidden checks passed 87/90 vs 86/90. All 30 runs across six security tasks passed.
The test result is the interesting part: it leaves a test where logic needs one 98% of the time (68% without), but its tests catch 66% of injected bugs vs 46% overall — fewer, smaller tests, and 69% vs 77% where a test exists. Less thorough per test, far less likely to ship none.
Caveats: vendor-run benchmark, one model, one repo family, Bash disabled so it measures what the agent writes, not how it debugs. And a blind judge found no significant reply-quality win over no skill (82:106). Ponytail beats its previous version, not the baseline, on explanation quality.
Works with Claude Code, Codex, Cursor, Copilot and about 20 agents; one SKILL.md or AGENTS.md. If your agent's diff is routinely bigger than the ticket, this is worth a look.