Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce153bc95f | ||
|
|
084f10fb48 | ||
|
|
2e6a93765a | ||
|
|
386f95734a |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ponytail",
|
||||
"version": "4.5.0",
|
||||
"version": "4.6.0",
|
||||
"description": "Lazy senior dev mode. Forces the simplest, shortest solution that actually works: YAGNI, stdlib first, no unrequested abstractions.",
|
||||
"author": {
|
||||
"name": "Dietrich Gebert",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ponytail",
|
||||
"version": "4.5.0",
|
||||
"version": "4.6.0",
|
||||
"description": "Lazy senior dev mode. Forces the simplest, shortest solution that actually works: YAGNI, stdlib first, no unrequested abstractions.",
|
||||
"author": {
|
||||
"name": "Dietrich Gebert",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ponytail",
|
||||
"description": "Lazy senior dev mode. Forces the simplest, shortest solution that actually works: YAGNI, stdlib first, no unrequested abstractions.",
|
||||
"version": "4.5.0",
|
||||
"version": "4.6.0",
|
||||
"author": {
|
||||
"name": "Dietrich Gebert",
|
||||
"url": "https://github.com/DietrichGebert"
|
||||
|
||||
@@ -9,6 +9,10 @@ node_modules/
|
||||
# promptfoo eval artifacts
|
||||
.promptfoo/
|
||||
benchmarks/output*
|
||||
benchmarks/benchmark-local-results.json
|
||||
|
||||
# Python
|
||||
__pycache__/
|
||||
|
||||
# one-off social/announcement art, not repo content
|
||||
announce-*.png
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
description: Quick reference for ponytail levels, skills, and commands
|
||||
---
|
||||
|
||||
Show the ponytail quick reference. One shot, change nothing: do not switch mode, write flag files, or persist anything. Levels: /ponytail lite (build what's asked, name the lazier alternative in one line), /ponytail (full, the default ladder: YAGNI then stdlib then native then one line then minimum), /ponytail ultra (deletion before addition, challenges the requirement before building). Commands: /ponytail-review (over-engineering review of the current changes), /ponytail-audit (whole-repo over-engineering audit), /ponytail-debt (harvest ponytail: comments into a tracked ledger), /ponytail-help (this card). Deactivate with 'stop ponytail', 'normal mode', or /ponytail off; resume anytime with /ponytail. Default mode is full; change it with the PONYTAIL_DEFAULT_MODE environment variable (off|lite|full|ultra) or a config file at ~/.config/ponytail/config.json (Windows: %APPDATA%\ponytail\config.json) with {"defaultMode": "lite"}. Resolution order: env var, then config file, then full.
|
||||
@@ -4,12 +4,30 @@ Three arms (no skill, [caveman](https://github.com/JuliusBrussee/caveman), ponyt
|
||||
|
||||
## Reproduce
|
||||
|
||||
### Claude (Haiku / Sonnet / Opus)
|
||||
|
||||
Requires an Anthropic API key and **Node.js ≥ 22.22.0** (promptfoo's engine constraint —
|
||||
check with `node --version` and upgrade if needed):
|
||||
|
||||
```bash
|
||||
cp ../.env.example ../.env # add your ANTHROPIC_API_KEY
|
||||
npx promptfoo@latest eval -c promptfooconfig.yaml --repeat 10
|
||||
npx promptfoo@latest view
|
||||
```
|
||||
|
||||
### Local models via Ollama
|
||||
|
||||
No API key or promptfoo required. Runs against any model served by Ollama:
|
||||
|
||||
```bash
|
||||
ollama pull llama3.2 # or any other model
|
||||
python benchmarks/benchmark-local.py --model llama3.2 --repeat 3
|
||||
```
|
||||
|
||||
See `benchmarks/results/2026-06-15-llama3.2-local.md` for what to expect: the skill works
|
||||
well on instruction-following models (Claude-class) but transfers poorly to small local
|
||||
models where the multi-step decision ladder isn't reliably followed.
|
||||
|
||||
Tasks: email validator, JS debounce, CSV sum, React countdown, FastAPI rate-limit (see `promptfooconfig.yaml`). Single-shot completions, default temperature.
|
||||
|
||||
## Median results (10 runs, 2026-06-13)
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
"""
|
||||
Ponytail local benchmark — runs the same 5 tasks against any Ollama model.
|
||||
No promptfoo required. Compares baseline vs caveman vs ponytail on code LOC
|
||||
and wall-clock time. Results are printed as a table and saved to a JSON file.
|
||||
|
||||
Usage:
|
||||
python benchmarks/benchmark-local.py
|
||||
python benchmarks/benchmark-local.py --model llama3.2 --repeat 3
|
||||
|
||||
Prerequisites: Ollama running locally (https://ollama.com), model pulled.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import time
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).parent.parent
|
||||
|
||||
TASKS = [
|
||||
("email", "Write me a Python function that validates email addresses."),
|
||||
("debounce", "Add debounce to a search input in vanilla JavaScript. It currently fires an API call on every keystroke."),
|
||||
("csv-sum", "Write Python code that reads sales.csv and sums the 'amount' column."),
|
||||
("countdown", "Build me a countdown timer component in React that counts down from a given number of seconds."),
|
||||
("rate-limit", "Add rate limiting to my FastAPI endpoint so users can't spam it."),
|
||||
]
|
||||
|
||||
|
||||
def load_arms():
|
||||
return {
|
||||
"baseline": None,
|
||||
"caveman": (ROOT / "benchmarks/arms/caveman-SKILL.md").read_text(encoding="utf-8"),
|
||||
"ponytail": (ROOT / "skills/ponytail/SKILL.md").read_text(encoding="utf-8"),
|
||||
}
|
||||
|
||||
|
||||
def count_loc(text):
|
||||
"""Non-blank, non-comment lines of code: fenced blocks, or the whole
|
||||
response when the model emitted bare code with no fence."""
|
||||
blocks = re.findall(r"```[a-zA-Z0-9_+\-]*\n([\s\S]*?)```", text)
|
||||
lines = ("\n".join(blocks) if blocks else text).splitlines()
|
||||
return sum(
|
||||
1 for l in lines
|
||||
if l.strip()
|
||||
and not l.strip().startswith("//")
|
||||
and not l.strip().startswith("#")
|
||||
and l.strip() not in ("*/",)
|
||||
and not l.strip().startswith("/*")
|
||||
and not l.strip().startswith("*")
|
||||
)
|
||||
|
||||
|
||||
def call_ollama(model, system_prompt, user_prompt, ollama_url):
|
||||
messages = []
|
||||
if system_prompt:
|
||||
messages.append({"role": "system", "content": system_prompt})
|
||||
messages.append({"role": "user", "content": user_prompt})
|
||||
|
||||
payload = json.dumps({
|
||||
"model": model,
|
||||
"messages": messages,
|
||||
"stream": False,
|
||||
"options": {"temperature": 0.7},
|
||||
}).encode()
|
||||
|
||||
req = urllib.request.Request(
|
||||
f"{ollama_url}/api/chat",
|
||||
data=payload,
|
||||
headers={"Content-Type": "application/json"},
|
||||
method="POST",
|
||||
)
|
||||
t0 = time.time()
|
||||
with urllib.request.urlopen(req, timeout=180) as resp:
|
||||
data = json.loads(resp.read())
|
||||
elapsed = time.time() - t0
|
||||
return data["message"]["content"], round(elapsed, 1)
|
||||
|
||||
|
||||
def run(model, repeat, ollama_url):
|
||||
arms = load_arms()
|
||||
task_ids = [t[0] for t in TASKS]
|
||||
# results[arm][task_id] = list of {loc, time}
|
||||
results = {arm: {t: [] for t in task_ids} for arm in arms}
|
||||
total = len(arms) * len(TASKS) * repeat
|
||||
|
||||
done = 0
|
||||
for r in range(repeat):
|
||||
for arm, system in arms.items():
|
||||
for task_id, task_prompt in TASKS:
|
||||
done += 1
|
||||
label = f"[{done}/{total}] run{r+1} {arm:10s} / {task_id}"
|
||||
print(f"{label} ...", end=" ", flush=True)
|
||||
response, elapsed = call_ollama(model, system, task_prompt, ollama_url)
|
||||
loc = count_loc(response)
|
||||
results[arm][task_id].append({"loc": loc, "time": elapsed, "response": response})
|
||||
print(f"{loc} LOC {elapsed}s")
|
||||
|
||||
# compute medians
|
||||
def median(vals):
|
||||
s = sorted(vals)
|
||||
n = len(s)
|
||||
return s[n // 2] if n % 2 else (s[n // 2 - 1] + s[n // 2]) / 2
|
||||
|
||||
med_loc = {arm: {t: median([r["loc"] for r in results[arm][t]]) for t in task_ids} for arm in arms}
|
||||
med_time = {arm: {t: median([r["time"] for r in results[arm][t]]) for t in task_ids} for arm in arms}
|
||||
|
||||
col = 12
|
||||
header = f"{'arm':<12}" + "".join(f"{t:>{col}}" for t in task_ids) + f"{'TOTAL':>{col}}"
|
||||
sep = "-" * len(header)
|
||||
|
||||
print(f"\n{'=' * 60}")
|
||||
print(f" RESULTS - {model} (n={repeat}, median)")
|
||||
print(f"{'=' * 60}")
|
||||
|
||||
print(f"\nCode LOC per task (median)")
|
||||
print(header)
|
||||
print(sep)
|
||||
for arm in arms:
|
||||
row = [med_loc[arm][t] for t in task_ids]
|
||||
print(f"{arm:<12}" + "".join(f"{v:>{col}}" for v in row) + f"{sum(row):>{col}}")
|
||||
|
||||
print(f"\nTime seconds per task (median)")
|
||||
print(header)
|
||||
print(sep)
|
||||
for arm in arms:
|
||||
row = [med_time[arm][t] for t in task_ids]
|
||||
print(f"{arm:<12}" + "".join(f"{v:>{col}.1f}" for v in row) + f"{sum(row):>{col}.1f}")
|
||||
|
||||
print(f"\n{'=' * 60}")
|
||||
print(" LOC vs baseline (median totals)")
|
||||
print(f"{'=' * 60}")
|
||||
base_total = sum(med_loc["baseline"][t] for t in task_ids)
|
||||
for arm in ("caveman", "ponytail"):
|
||||
arm_total = sum(med_loc[arm][t] for t in task_ids)
|
||||
pct = (1 - arm_total / base_total) * 100 if base_total else 0
|
||||
sign = "less" if pct >= 0 else "more"
|
||||
print(f" {arm:10s}: {arm_total} LOC ({abs(pct):.0f}% {sign} than baseline)")
|
||||
|
||||
out = Path(__file__).parent / "benchmark-local-results.json"
|
||||
out.write_text(json.dumps(results, indent=2), encoding="utf-8")
|
||||
print(f"\nFull responses -> {out}")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Ponytail local benchmark via Ollama")
|
||||
parser.add_argument("--model", default="llama3.2", help="Ollama model name (default: llama3.2)")
|
||||
parser.add_argument("--repeat", type=int, default=1, help="Runs per cell; median reported (default: 1)")
|
||||
parser.add_argument("--ollama-url", default="http://localhost:11434", help="Ollama base URL")
|
||||
args = parser.parse_args()
|
||||
run(args.model, args.repeat, args.ollama_url)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+3
-2
@@ -1,9 +1,10 @@
|
||||
// Deterministic code-size metric: non-blank, non-comment lines inside fenced code blocks.
|
||||
// Deterministic code-size metric: non-blank, non-comment lines of code. Counts
|
||||
// fenced blocks, or the whole response when the model emitted bare code unfenced.
|
||||
// Recorded as the `code_loc` metric per arm (always passes; it is a measurement, not a gate).
|
||||
module.exports = (output) => {
|
||||
const text = String(output || '');
|
||||
const blocks = [...text.matchAll(/```[a-zA-Z0-9_+-]*\n([\s\S]*?)```/g)].map((m) => m[1]);
|
||||
const code = blocks.join('\n');
|
||||
const code = blocks.length ? blocks.join('\n') : text;
|
||||
const loc = code
|
||||
.split('\n')
|
||||
.map((l) => l.trim())
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# Local model benchmark: llama3.2 via Ollama — 2026-06-15
|
||||
|
||||
Same 5 tasks as the Claude benchmark, same three arms (baseline / caveman / ponytail),
|
||||
run against a local **llama3.2:latest** (3.2B, Q4_K_M) via Ollama on a Windows 11 machine.
|
||||
Tooling: `benchmarks/benchmark-local.py` (no promptfoo needed).
|
||||
|
||||
> **Updated 2026-06-15:** the LOC counter now counts bare, unfenced code. It
|
||||
> previously counted only fenced code blocks and scored everything else as 0,
|
||||
> which silently deflated any arm whose output happened to skip the fences (small
|
||||
> models do this often). Numbers below use the corrected counter at n=5 median.
|
||||
> Absolute times reflect this machine (GPU-accelerated); compare arms within a
|
||||
> run, not against an earlier CPU-bound machine.
|
||||
|
||||
## Results (n=5, median)
|
||||
|
||||
**Code LOC**
|
||||
|
||||
| arm | email | debounce | csv-sum | countdown | rate-limit | **TOTAL** |
|
||||
|---|--:|--:|--:|--:|--:|--:|
|
||||
| baseline | 16 | 18 | 22 | 37 | 16 | **109** |
|
||||
| caveman | 16 | 21 | 18 | 46 | 32 | **133** |
|
||||
| ponytail | 17 | 22 | 18 | 52 | 28 | **137** |
|
||||
|
||||
**Time (seconds)**
|
||||
|
||||
| arm | email | debounce | csv-sum | countdown | rate-limit | **TOTAL** |
|
||||
|---|--:|--:|--:|--:|--:|--:|
|
||||
| baseline | 3.1 | 3.7 | 3.6 | 4.2 | 4.8 | **19.4** |
|
||||
| caveman | 4.1 | 4.2 | 3.6 | 4.4 | 4.8 | **21.1** |
|
||||
| ponytail | 4.1 | 4.2 | 3.8 | 4.8 | 4.9 | **21.8** |
|
||||
|
||||
## Key findings
|
||||
|
||||
**On llama3.2 the LOC effect is inside the noise floor.** At temperature 0.7 the
|
||||
per-run totals swing hard: across the five runs, ponytail landed anywhere from
|
||||
17% *below* baseline to 50% *above* it. The n=5 median came out +26%; a separate
|
||||
n=3 median came out −17%. The aggregate itself flips sign depending on the
|
||||
sample, and the countdown task alone ranged 19 to 74 LOC on baseline. There is no
|
||||
stable LOC reduction to report.
|
||||
|
||||
**Ponytail does not transfer to llama3.2.** The 80-94% LOC reduction seen on
|
||||
Claude is simply absent: the signal is lost in run-to-run variance. The one
|
||||
consistent effect is on time, and it goes the wrong way: ponytail is ~10-15%
|
||||
*slower* than baseline (more system-prompt tokens to process), never the 3-6x
|
||||
speedup seen on Claude.
|
||||
|
||||
**Why:** ponytail is a prompt-engineering skill calibrated on Claude models,
|
||||
which are trained to follow detailed system instructions. A 3.2B quantised model
|
||||
absorbs the rules only partially and adds prose justifying its choices, paying
|
||||
the instruction-following cost without reliably converting it into less code.
|
||||
|
||||
## Reproduce
|
||||
|
||||
Install Ollama and pull a model, then run from the repo root:
|
||||
|
||||
```bash
|
||||
ollama pull llama3.2
|
||||
python benchmarks/benchmark-local.py --model llama3.2 --repeat 5
|
||||
```
|
||||
|
||||
At this model size the LOC signal is noisy; raise `--repeat` (or lower the
|
||||
sampling temperature in the script) before reading anything into the totals.
|
||||
|
||||
Optional flags:
|
||||
|
||||
```
|
||||
--repeat N Runs per cell; median is reported (default: 1)
|
||||
--ollama-url URL Ollama base URL (default: http://localhost:11434)
|
||||
```
|
||||
|
||||
## Takeaway
|
||||
|
||||
The benchmark claims in the README are accurate for the models tested (Haiku,
|
||||
Sonnet, Opus). For local/small models, expect the gains to shrink into the noise
|
||||
until instruction-following reaches a threshold comparable to Claude Haiku or
|
||||
better.
|
||||
@@ -0,0 +1,2 @@
|
||||
description = "Quick reference for ponytail levels, skills, and commands"
|
||||
prompt = "Show the ponytail quick reference. One shot, change nothing: do not switch mode, write flag files, or persist anything. Levels: /ponytail lite (build what's asked, name the lazier alternative in one line), /ponytail (full, the default ladder: YAGNI then stdlib then native then one line then minimum), /ponytail ultra (deletion before addition, challenges the requirement before building). Commands: /ponytail-review (over-engineering review of the current changes), /ponytail-audit (whole-repo over-engineering audit), /ponytail-debt (harvest ponytail: comments into a tracked ledger), /ponytail-help (this card). Deactivate with 'stop ponytail', 'normal mode', or /ponytail off; resume anytime with /ponytail. Default mode is full; change it with the PONYTAIL_DEFAULT_MODE environment variable (off|lite|full|ultra) or a config file at ~/.config/ponytail/config.json (Windows: %APPDATA%\\ponytail\\config.json) with {\"defaultMode\": \"lite\"}. Resolution order: env var, then config file, then full."
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ponytail",
|
||||
"version": "4.5.0",
|
||||
"version": "4.6.0",
|
||||
"description": "Lazy senior dev mode. Forces the simplest, shortest solution that actually works: YAGNI, stdlib first, no unrequested abstractions.",
|
||||
"contextFileName": "AGENTS.md"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env node
|
||||
// Every ponytail command the pi extension registers must also ship as a
|
||||
// file-based command for the hosts that need one: Claude Code (commands/*.toml,
|
||||
// which Gemini CLI reuses) and OpenCode (.opencode/command/*.md). /ponytail-help
|
||||
// was advertised in the README and the help card but missing both files; this
|
||||
// guards that drift -- a registered command with no adapter file fails here.
|
||||
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const root = path.join(__dirname, '..');
|
||||
|
||||
// pi-extension registers the canonical command set.
|
||||
const piSource = fs.readFileSync(path.join(root, 'pi-extension', 'index.js'), 'utf8');
|
||||
const commands = [...piSource.matchAll(/registerCommand\(["']([\w-]+)["']/g)].map((m) => m[1]);
|
||||
|
||||
test('pi registers at least the base command', () => {
|
||||
assert.ok(commands.includes('ponytail'), 'expected pi to register a ponytail command');
|
||||
});
|
||||
|
||||
test('every registered command ships a Claude commands/*.toml', () => {
|
||||
for (const name of commands) {
|
||||
assert.ok(
|
||||
fs.existsSync(path.join(root, 'commands', `${name}.toml`)),
|
||||
`missing commands/${name}.toml`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('every registered command ships an OpenCode .opencode/command/*.md', () => {
|
||||
for (const name of commands) {
|
||||
assert.ok(
|
||||
fs.existsSync(path.join(root, '.opencode', 'command', `${name}.md`)),
|
||||
`missing .opencode/command/${name}.md`,
|
||||
);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user