feat(autotune): add skill for generating and tuning skills

The skill generates new skills and optimizes existing ones for token
usage, error rate, focus and persisted learnings. Every decision is
confirmed through single-select (radio button) questions, and the skill
only runs on an explicit operator trigger.

A UserPromptSubmit hook reminds the operator at most once an hour that
/autotune exists; the reminder is a hint for the operator, never a
trigger for the agent. The install-time settings patch registers it
alongside the caveman and ponytail plugins.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-Birkenbach
2026-07-25 18:24:53 +02:00
parent a42d6b76f4
commit 27aaabf305
5 changed files with 232 additions and 5 deletions

View File

@@ -1,11 +1,12 @@
#!/usr/bin/env node
// Enable the caveman and ponytail plugins in a Claude Code settings.json so
// their SessionStart hooks auto-activate both modes. Merges non-destructively:
// existing marketplaces and enabled plugins are preserved, unparseable files
// are left untouched.
// their SessionStart hooks auto-activate both modes, and register the autotune
// reminder hook. Merges non-destructively: existing marketplaces, plugins and
// hooks are preserved, unparseable files are left untouched.
"use strict";
const fs = require("fs");
const path = require("path");
const settingsPath = process.argv[2];
if (!settingsPath) {
@@ -38,5 +39,15 @@ for (const [name, entry] of Object.entries(MARKETPLACES)) {
}
data.enabledPlugins = Object.assign(data.enabledPlugins || {}, PLUGINS);
const reminder = path.join(path.dirname(settingsPath), "skills", "autotune", "hooks", "reminder.sh");
data.hooks = data.hooks || {};
data.hooks.UserPromptSubmit = data.hooks.UserPromptSubmit || [];
const registered = JSON.stringify(data.hooks.UserPromptSubmit).includes("autotune/hooks/reminder.sh");
if (!registered) {
data.hooks.UserPromptSubmit.push({
hooks: [{ type: "command", command: `bash ${JSON.stringify(reminder)}` }],
});
}
fs.writeFileSync(settingsPath, JSON.stringify(data, null, 2) + "\n");
console.log(`skills: enabled caveman + ponytail plugins in ${settingsPath}`);
console.log(`skills: enabled caveman + ponytail plugins and the autotune reminder in ${settingsPath}`);