ponytail
Ponytail是一款AI编程代理增强插件,引导AI遵循极简开发原则优先复用现有能力,在保障安全的前提下大幅减少冗余代码产出。
这个项目值得继续研究吗?
Ponytail是一款AI编程代理增强插件,引导AI遵循极简开发原则优先复用现有能力,在保障安全的前提下大幅减少冗余代码产出。
- 解决什么问题
- 业务团队使用AI编程工具时,常遇到AI过度开发、产出大量冗余代码、引入不必要依赖的问题,既拉高AI调用成本、拉长开发周期,还提升了后续代码维护难度,甚至可能出现安全疏漏。
- 适合什么团队
- 适合已经在使用AI编程代理开展日常开发,希望降低代码冗余、控制AI调用成本和后续代码维护成本的企业技术团队。
- 使用前注意
- 安装前需确认环境已配置Node.js且将其加入非交互式shell的PATH;仅支持官方明确列出的AI编程代理,未适配代理无法使用。
本页用于缩短初步筛选时间,不构成技术、采购或法律结论。 正式使用前请在真实业务数据上验证,并以官方说明与许可证为准。
从官方资料看清能力、部署与采用边界
以下内容依据项目公开 README 或模型卡翻译整理,代码、命令和产品名保持原样。
Ponytail 项目导读
1. 项目定位
Ponytail是面向AI编程代理的增强插件,核心理念是“最好的代码是你从未写过的代码”,引导AI代理像经验丰富的极简主义资深开发一样产出代码,避免无意义的过度开发,在不降低代码安全性的前提下简化开发流程。
2. 实测效果
基于真实业务场景的测试(使用Claude Code编辑FastAPI+React开源项目,覆盖12个常见功能需求),对比未使用插件的基线AI代理,Ponytail可实现:
- 平均减少54%的代码产出,在存在过度开发陷阱的场景(如日期选择器、颜色选择器开发)中最高可减少94%的代码量
- 降低20%的AI调用成本
- 缩短27%的开发耗时
- 安全合规性保持100%
对比其他简化代码的方案(如单纯要求AI写单行代码的提示词),Ponytail是唯一可同时降低代码量、成本、耗时,且不会牺牲安全性的方案,不会为了减少代码砍掉必要的输入校验、错误处理、安全防护和可访问性适配。
举个常见场景的对比:要求AI开发日期选择器时,未使用Ponytail的代理会安装第三方组件库、编写封装组件、引入样式文件甚至讨论时区适配逻辑,使用Ponytail后,代理会直接调用浏览器原生能力,仅输出一行代码:
<!-- ponytail: browser has one -->
<input type="date">3. 核心设计逻辑
Ponytail的核心逻辑是引导AI代理在理解需求、梳理完现有代码逻辑后,遵循7层阶梯判断规则选择最优解决方案,仅在必要时编写新代码:
- 确认该功能是否真的需要,不需要则直接跳过(YAGNI,全称You Aren't Gonna Need It,指不开发当前业务不需要的功能)
- 检查当前代码库中是否已有可复用的实现,有则复用不重写
- 检查编程语言标准库是否可实现该需求,是则直接调用
- 检查运行平台是否有原生功能可实现,是则直接使用
- 检查项目已安装的依赖是否可实现,是则直接调用
- 确认是否可以一行代码实现,是则只写一行
- 以上都不满足时,才编写最少的可运行代码
该规则仅简化最终实现方案,不会减少AI理解需求、梳理现有代码逻辑的步骤,同时明确要求安全边界校验、数据丢失防护、安全防护、可访问性适配等要求永远不能被省略。
4. 部署要求与安装方式
部署前提
Ponytail的插件依赖两个轻量Node.js生命周期钩子,运行环境需要提前安装Node.js,且将其配置到非交互式shell的PATH中;如果未满足该要求,插件的核心功能仍可正常使用,只是不会自动激活,也不会每次触发提示报错。
支持的AI代理与安装方法
Ponytail目前支持多款主流AI编程代理,常见代理的安装方式如下:
Claude Code
在对话窗口依次输入两条命令(需分两次发送):
/plugin marketplace add DietrichGebert/ponytail/plugin install ponytail@ponytail桌面端也可通过界面操作:点击输入框旁的+按钮,选择Plugins → Add plugin,从配置的市场中选择安装。
Codex
依次执行命令:
codex plugin marketplace add DietrichGebert/ponytail
codex plugin add ponytail@ponytail安装后打开/hooks页面确认信任两个生命周期钩子,重启会话即可使用,桌面端重启应用即可自动识别插件。
GitHub Copilot CLI
依次执行命令:
copilot plugin marketplace add DietrichGebert/ponytail
copilot plugin install ponytail@ponytail交互式会话中可通过/ponytail:ponytail等命令调用对应功能。
其他支持的代理包括Pi agent harness、OpenCode、Gemini CLI、Qoder、Antigravity CLI,具体安装方法可参考官方文档。
5. 许可证与采用建议
Ponytail采用MIT许可证,企业可自由使用、修改、分发,无商用限制。项目目前处于活跃维护状态,未归档,支持提交Issue反馈问题。
建议已经在使用对应AI编程代理,且遇到AI产出代码冗余度过高、过度开发问题的技术团队,先在非核心项目中测试适配,确认符合团队开发规范后再逐步推广。
官方资料与来源
- agent-skills
- ai-agents
- claude
- claude-code
- claude-code-plugin
- cursor-rules
- developer-tools
- llm
- prompt-engineering
- yagni
## Install The most effort ponytail will ever ask of you: The Claude Code and Codex plugins run two tiny Node.js lifecycle hooks, so `node` needs to be on your PATH (note for Nix/nvm users: it must be on the non-interactive shell's PATH). If it isn't, the skills still work, the always-on activation just stays quiet instead of erroring on every prompt. ### Claude Code ``` /plugin marketplace add DietrichGebert/ponytail ``` ``` /plugin install ponytail@ponytail ``` (You have to send two separate prompts for the install to work) Same steps in the Claude Code Desktop app's Code tab: type the two `/plugin` commands above into the prompt box, or click the **+** button next to it, choose **Plugins** → **Add plugin** to browse your configured marketplaces, and manage marketplaces from **Customize** in the sidebar. ### Codex ```bash codex plugin marketplace add DietrichGebert/ponytail cod
该片段来自项目 README,仅用于初步判断;实际部署请以官方文档为准。


核对上游原始说明节选
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Ponytail
He says nothing. He writes one line. It works.
54% less code (up to 94%) · 20% cheaper · 27% faster · 100% safe Measured on real Claude Code sessions editing a real open-source repo (FastAPI + React), against the same agent with no skill. 54% is the mean across 12 feature tasks (Haiku 4.5, n=4); it reaches 94% where an agent over-builds (a date picker) and is near zero where the code is already minimal. ponytail keeps every safety guard while a bare "write one-liners" prompt drops one. (The earlier single-shot benchmark reported 80-94% as a flat figure; against a fair agentic baseline that is the per-task ceiling, not the average.) Full writeup · reproduce it.
Español · 한국어
---
You know him. Long ponytail. Oval glasses. Has been at the company longer than the version control. You show him fifty lines; he looks at them, says nothing, and replaces them with one.
Ponytail puts him inside your AI agent.
Before / after
You ask for a date picker. Your agent installs flatpickr, writes a wrapper component, adds a stylesheet, and starts a discussion about timezones.
With ponytail:
<!-- ponytail: browser has one -->
<input type="date">More survivors in examples/.
Numbers
The honest measurement is a real agent doing real work: a headless Claude Code session editing tiangolo's full-stack-fastapi-template (a real FastAPI + React repo), scored on the git diff it leaves behind. Twelve feature tickets, the same agent with and without the skill, n=4, Haiku 4.5.
| vs no-skill baseline | LOC | tokens | cost | time | safe | |---|--:|--:|--:|--:|--:| | ponytail | -54% | -22% | -20% | -27% | 100% | | caveman (terse-prose control) | -20% | +7% | +3% | +2% | 100% | | "YAGNI + one-liners" prompt | -33% | -14% | -21% | -30% | 95% |
ponytail is the only arm that cuts every metric, and the only one that stays fully safe while doing it. The cut is biggest where there is a real over-build trap (date picker 404 to 23 lines, color picker 287 to 23, because it reaches for a native `` instead of a component) and near zero on code that is already minimal. Full method, per-task tables, and limitations: benchmarks/results/2026-06-18-agentic.md.
Older single-shot numbers (isolated generation)
Five everyday tasks, three models, three arms (no skill, caveman, ponytail), ten runs, median reported. One prompt, one completion, counting lines of the answer:
This showed 80-94% less code. #126 fairly pointed out that the bare-model baseline pads its answer with prose and options, so that gap is partly a conversational-baseline artifact. The agentic numbers above are the corrected, defensible version. Reproduce the single-shot run with npx promptfoo eval -c benchmarks/promptfooconfig.yaml.
The rule was never "fewest tokens." It is: write only what the task needs, and never cut validation, error handling, security, or accessibility. The code ends up small because it is necessary, not golfed. Lower cost and latency are a side effect on the models that follow the ladder; a terse reasoning model that spends thinking tokens deliberating the rungs can go the other way (on GPT-5.5 it does).
How it works
Before writing code, the agent stops at the first rung that holds:
1. Does this need to exist? → no: skip it (YAGNI)
2. Already in this codebase? → reuse it, don't rewrite
3. Stdlib does it? → use it
4. Native platform feature? → use it
5. Installed dependency? → use it
6. One line? → one line
7. Only then: the minimum that worksThe ladder runs after it understands the problem, not instead of it: it reads the code the change touches and traces the real flow before picking a rung. Lazy about the solution, never about reading.
Lazy, not negligent: trust-boundary validation, data-loss handling, security, and accessibility are never on the chopping block.
Install
The most effort ponytail will ever ask of you:
The Claude Code and Codex plugins run two tiny Node.js lifecycle hooks, so node needs to be on your PATH (note for Nix/nvm users: it must be on the non-interactive shell's PATH). If it isn't, the skills still work, the always-on activation just stays quiet instead of erroring on every prompt.
Claude Code
/plugin marketplace add DietrichGebert/ponytail/plugin install ponytail@ponytail(You have to send two separate prompts for the install to work)
Same steps in the Claude Code Desktop app's Code tab: type the two /plugin commands above into the prompt box, or click the + button next to it, choose Plugins → Add plugin to browse your configured marketplaces, and manage marketplaces from Customize in the sidebar.
Codex
codex plugin marketplace add DietrichGebert/ponytail
codex plugin add ponytail@ponytailRun codex and open /hooks, review and trust its two lifecycle hooks, and start a new thread.
This same install also covers the Codex desktop app: restart the app after installing and it picks up the plugin.
GitHub Copilot CLI
copilot plugin marketplace add DietrichGebert/ponytail
copilot plugin install ponytail@ponytailIn an interactive Copilot CLI session, use the slash equivalents:
/plugin marketplace add DietrichGebert/ponytail
/plugin install ponytail@ponytailCopilot CLI namespaces plugin commands by plugin name. For example:
/ponytail:ponytail ultra
/ponytail:ponytail-reviewPi agent harness
pi install git:github.com/DietrichGebert/ponytailOpenCode
Add to opencode.json:
{ "plugin": ["@dietrichgebert/ponytail"] }Run from a checkout instead (the plugin reuses hooks/ and skills/):
{ "plugin": ["./.opencode/plugins/ponytail.mjs"] }Injects the ruleset every turn at the active level; adds the /ponytail commands (see Commands). OpenCode also auto-loads this repo's AGENTS.md, so the rules hold even without the plugin. The plugin adds the lite/full/ultra/off levels.
The ./ path resolves against your project's opencode.json; to share one checkout across projects, point it at the absolute path of the .mjs instead (it finds its hooks/ and skills/ relative to its own file).
Gemini CLI
gemini extensions install https://github.com/DietrichGebert/ponytailLoads the ruleset as always-on context every session and registers the /ponytail commands; the skills/ ship too, activated when a task needs them. The Gemini adapter intentionally does not ship a root hooks/hooks.json: Gemini auto-loads that path, while Ponytail's lifecycle hooks use Claude/Codex event names.
Qoder
Qoder auto-loads AGENTS.md from the repo root as always-on context, so running ponytail from a checkout works with zero setup. For per-project rules, copy .qoder/rules/ponytail.md into your project's .qoder/rules/. The six ponytail skills (/ponytail, /ponytail-review, /ponytail-audit, /ponytail-debt, /ponytail-gain, /ponytail-help) are available via Qoder's Skill system; the plugin manifest at .qoder-plugin/plugin.json points at the skills/ directory.
For full plugin-tier support (automatic mode activation + ruleset injection on every prompt), add the hooks from hooks/qoder-hooks.json to your .qoder/settings.json. Replace PONYTAILDIR with the path to your ponytail checkout. Qoder's UserPromptSubmit hook activates the default mode on first prompt and injects the ruleset every turn; PreToolUse with task|Task matcher injects the ruleset into subagents. Level switches (/ponytail lite|full|ultra|off) work automatically.
Antigravity CLI
Google is renaming Gemini CLI to Antigravity CLI (the agy binary); the same extension installs there:
agy plugin install https://github.com/Dietri上游文档较长,此处为节选。完整内容见官方项目。