Skip to content
Back to skills

Experiment Charter

ASecurity

Use when the user invokes /experiment design to set up an experiment from a goal and start its loop.

  • 19 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 9, 2026
ai-agentsgoshellgit

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 6, 2026

npx -y skills add wsauret/flywheel --skill experiment-charter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Experiment Charter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Experiment Charter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wsauret-experiment-charter/badge)](https://www.skillsdirectory.com/skills/wsauret-experiment-charter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Use when the user invokes /experiment design to set up an experiment from a goal and start its loop.
attended: true
direct-output: Write a report only when setup is blocked or the loop stops. Then report directly in chat the charter path, the sections the person reviewed, the observed baseline METRIC line, the commit that holds exactly the three .experiment files, and the blocker or why the loop stopped. While the loop runs, write no report and do not end the turn.
---

# Experiment Charter

Autonomous experiment loop: try ideas, keep what works, discard what doesn't, never stop.

`ARGUMENTS` is the person's goal in one sentence. This method turns it into `.experiment/charter.md`, `.experiment/measure.sh`, and `.experiment/checks.sh`, asks the person one question, commits the three files, and starts the loop. `/experiment dashboard` shows the loop.

Two references travel with this package; read each with the skill tool's resource action when you reach the step it serves. `references/scripts.md` is the authoring guide for `./.experiment/measure.sh` and `./.experiment/checks.sh`. `references/loop-rules.md` holds the operating rules that the Search strategy section copies into the charter, so a fresh agent can run the loop from the charter alone.

## Setup

1. Flywheel created the experiment's worktree on its own local branch from the person's current commit; the text after `ARGUMENTS` names its path. Before you read or write anything, call `change_directory` with that path, alone in its message. Everything below happens there. Never touch the person's checkout, and never push the experiment branch.
2. Infer from the goal and the code: **Command**, **Metric** (+ direction), **Files in scope**, **Constraints**. The **Goal** is `ARGUMENTS`. Do not ask the person for any of them; the one question in step 6 is the only question.
3. Read the source files. Understand the workload deeply before writing anything.
4. `mkdir -p .experiment`, then write `.experiment/measure.sh` and `.experiment/checks.sh` following `references/scripts.md`, and make them executable. Prove the metrics (see Baseline evidence).
5. Draft every section of `.experiment/charter.md` (see Charter layout). Decide the defaults yourself (see Defaults).
6. Ask the one question (see Review), and revise the sections that the person selects. When an approved edit changes the workload, the metrics, or the checks, also update `.experiment/measure.sh` or `.experiment/checks.sh` and the Commands section to match, prove the metrics again (see Baseline evidence), and replace the Baseline section with the new observed lines. Ask no question for this.
7. Write the charter, then `git add .experiment/charter.md .experiment/measure.sh .experiment/checks.sh` and `git commit -m "chore(experiment): add <name> charter"`. The commit holds only these three paths; confirm a clean tree afterward.
8. Call `init_experiment` with the charter's values. It starts experiment mode in this worktree and measures the unchanged code to set the baseline and the noise floor. Then make your first change, call `run_experiment`, log it with `log_experiment`, and start looping immediately. Do not ask for another confirmation. Call `run_experiment` exactly once before each `log_experiment`, and never run the measure or checks commands yourself during the loop.

Working memory (candidate levers, open questions, rejected drafts) goes to the session checkpoint through `checkpoint_replace`, never into the charter.

## Baseline evidence

Run `./.experiment/measure.sh` once on the unchanged tree. Its stdout must contain `METRIC <metric_name>=<finite number>` for the primary metric and every secondary metric that the Metrics section names; if not, fix the script and run it again. The observed lines are the evidence; never infer them. Run `./.experiment/checks.sh` once and confirm that it exits 0. The Baseline section copies the observed lines verbatim.

## Defaults

Decide these without a question and add no charter key for them:

- Noise: `init_experiment` measures the unchanged code three times. Set a lower `baseline_runs` only for a slow measurement.
- Proxy: you may screen changes with your own fast proxy, as `references/loop-rules.md` states.
- Iteration cap: none. Omit `max_iterations`.
- Protected paths: the tests, fixtures, referees, and evaluation data that you find. The loop protects the three `.experiment` files itself.
- Sealed paths: none, unless you find a path that the loop must not read.

## Charter layout

`charter.md` is a title, exactly one strict TOML block, `## Goal`, the ten drafted `##` sections in the order of the content model below (Objective through Search strategy), and `## Reviewed sections` last. `/experiment start` and `init_experiment` require every drafted heading present and non-empty, and refuse any unknown key, missing required key, or type mismatch in the block:

```toml
name = "<snake_case session name>"
metric_name = "<primary METRIC name emitted by measure.sh>"
metric_unit = "<unit, may be empty>"
direction = "lower"            # or "higher"
measure_command = "./.experiment/measure.sh"
checks_command = "./.experiment/checks.sh"
work_dir = "."
max_iterations = 200           # optional positive integer; omit for no cap
protected_paths = ["<glob>", "<glob>"]
sealed_paths = ["<glob>"]
```

`protected_paths` and `sealed_paths` are globs relative to `work_dir`. The loop cannot read sealed paths and runs no shell commands while any exist, so seal only what must stay confidential.

`## Goal` holds `ARGUMENTS` word for word and nothing else. `## Reviewed sections` holds one `- <section>` line for each section that the person reviewed, with its exact heading, or exactly `None.`. The finalize audit reads both: it checks that no section the person did not review loosens the goal.

## Content model

Draft each section from the goal and the code. A section never narrows or loosens the goal: the workload, tolerances, and checks are at least as strict as the goal implies.

### Objective

What is optimized and on which workload: the primary target, how secondary targets trade off, and the exact formula with weights for a composite primary. Name each corpus and its role, what the current solution replaces, and what may not serve as a fallback or oracle.

### Metrics

The primary `<metric_name>` (`<unit>`, lower or higher is better) and one line per secondary `METRIC` with what it monitors. For a composite primary, write the formula in a fenced block with every weight, floor, and ratchet named, and why the weights make the intended path the path of least resistance.

### Hard gates

Conditions that force `discard`, `checks_failed`, or `crash` regardless of score; a higher objective never rescues a candidate that trips one. Typical: net test regression, crashes, branching on dataset, path, or test index, literal evaluation examples in code, edits to harness files, latency beyond budget.

### Anti-gaming rules

The rules specific to this workload. The finalize audit always checks every kept change against Flywheel's built-in gaming list as well (hardcoded outputs, lookup tables keyed by input, timer manipulation, benchmark detection, skipped cases, loosened tolerances or weakened checks, special-cased inputs, new outside dependencies), so add only what that list does not cover. Green checks are not proof a candidate is clean.

### Files in scope

Every file the loop may modify, one bullet each with what it does and which lever family it carries; name files that must stay thin wrappers.

### Protected paths

Paths the loop can never write, one bullet each with the reason (tests and fixtures, referees, evaluation data, hooks, the charter and its scripts). The human-readable form of `protected_paths`; the two must agree.

### Sealed paths

Paths the loop can never read, one bullet each with the reason, or one sentence stating nothing is sealed. Must agree with `sealed_paths`.

### Commands

What `./.experiment/measure.sh` and `./.experiment/checks.sh` run, how long each takes, and every `METRIC` line the measure script emits. The harness runs both; the loop never edits them.

### Baseline

The observed `METRIC` lines verbatim from one run on the unchanged tree (see Baseline evidence) and the run date. The charter is refused without the primary `METRIC <metric_name>=<value>` line.

### Search strategy

`###` subsections: Recommended order (lever families from cheapest to most invasive, starting with baseline and error mining), Portfolio management (each lever family is a theme; a new theme gets one reconnaissance experiment, a kept one earns at most two adjacent follow-ups, two consecutive failures park it, and rotation is mandatory when momentum fades; the theme ledger lives in the session checkpoint), Lever menu (concrete actions grouped by lever family and the files each may touch), Experiment loop (the per-iteration cycle), ASI shape (the `asi` object fields), and Keep/discard policy. Copy the operating rules from `references/loop-rules.md` into this section verbatim.

## Review

After the whole draft exists and the metrics are proven, ask the person exactly one multiple-choice question that accepts several answers: "Which sections do you want to review? I will decide the rest." Give one option per drafted section in charter order, labeled with its heading, with a one-line summary of your draft as its description. Mark Objective and Metrics as recommended, so that they start selected: they carry the workload and the metric. Put the option "None, start now", which accepts the whole draft, first, before the sections. Any selected section is reviewed; "None, start now" counts only when it is the only answer. Ask no other question; the only follow-ups are the approvals of the selected sections.

Then show each selected section in full, one at a time, and revise it until the person approves it. Do not show the sections that the person did not select; your draft stands for them. When the person selects no section, continue with step 7 at once. Record the selected sections in `## Reviewed sections`.

The method is complete only when the measure script produced the primary metric on the unchanged tree, one commit holds exactly the three `.experiment` files on a clean tree, `init_experiment` started the loop, and the first `run_experiment` and `log_experiment` pair finished after it. Missing any of these, report the blocker instead of completing.

Files in this skill

  • SKILL.md7.6 KB
  • references/loop-rules.md2.1 KB
  • references/scripts.md2.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.