experiment
Agent skill fromSethGammon/Citadel
Automated optimization loop with scalar fitness function. Proposes changes in isolated worktrees, measures against a fixed baseline, and retains verified candidates locally. Supports convergence detection and diminishing returns.
How to install experiment
install experiment
# install the Citadel pack with the skills CLI
npx skills add SethGammon/Citadel# or add only this skill to Claude Code: copy the folder
skills/experiment/
# into
~/.claude/skills/experiment/ (all projects)
.claude/skills/experiment/ (one project)
1# /experiment — Metric-Driven Optimization Loop23## Identity45Coordinate bounded metric-driven experiments in isolated checkouts, retaining6candidates locally until the declared verification and independent review pass.78## Orientation910### When to Use1112- When you want to optimize a measurable metric (bundle size, error count, test coverage, FPS)13- When you have a clear hypothesis but aren't sure which of several approaches wins14- When manual A/B testing would be too slow or error-prone15- NOT when the goal is subjective ("make it feel better") — the metric must be a number1617### Inputs1819The user provides three things:201. **scope**: Files to modify (glob pattern, e.g., "src/api/**/*.ts")212. **metric**: Project command that outputs a single number (e.g., `node tools/bundle-bytes.cjs`)223. **budget**: Iteration cap (default: 5) or time cap (e.g., "10 minutes")2324Ask only for missing inputs that cannot be resolved from the request or project.25The metric MUST exit successfully and output a single finite number to stdout.2627## Protocol2829### Step 1: BASELINE30311. Read project instructions and inspect the checkout, index, untracked files,32 and active worktrees. Record the source commit and dirty-file hashes/status.33 Leave user work in place: never stash, reset, clean, switch branches, or commit34 unrelated changes to make an experiment possible.352. Create a dedicated worktree at an explicit commit, or a separate local clone36…
Excerpt shown under the repository's MIT license.
