experiment
Automated optimization loop with scalar fitness function.
Skill by special-place-administrator
Chalk Labs
Need help deploying experiment?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/special-place-administrator-experiment
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
experiment- Description
- Automated optimization loop with scalar fitness function. Proposes changes in isolated worktrees, measures with a metric command, keeps improvements, discards failures. Supports convergence detection and diminishing returns.
- License
- MIT
- Instructions
- 121 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# experiment — Metric-Driven Optimization Loop
## Identity
`experiment` is an automated optimization loop with a scalar fitness function.
It takes a hypothesis, runs isolated experiments in git worktrees, measures results
with a metric command, and keeps improvements or discards failures. Think of it as
automated A/B testing for code changes.
## Inputs
The user provides three things:
1. **scope**: Files to modify (glob pattern, e.g., "src/api/**/*.ts")
2. **metric**: Shell command that outputs a single number (e.g., `npm run build 2>&1 | tail -1 | grep -oP '\d+'`)
3. **budget**: Iteration cap (default: 5) or time cap (e.g., "10 minutes")
If any input is missing, ask for it. The metric MUST output a single number to stdout.
## Protocol
### Step 1: BASELINE
1. Stash any uncommitted changes (restore on exit)
2. Run the metric command. Record the baseline value.
3. Determine direction: does lower = better (bundle size, error count) or higher = better (FPS, test count)?
Ask the user if ambiguous.
4. Log: `Baseline: {value} ({metric command})`
### Step 2: ITERATE
For each iteration (up to budget):
1. **Create isolation**: Spawn a sub-agent in a worktree (`isolation: "worktree"`)
2. **Propose change**: The agent modifies files within scope to improve the metric.
Provide context: baseline value, metric direction, scope, what previous iterations tried.
3. **Measure**: Run the metric command in the worktree
4. **Gate**: Run typecheck. If it fails, discard immediately.
5. **Evaluate**:
- Improved? → KEEP. Merge the worktree branch. New baseline = new value.
- Same or worse? → DISCARD. Delete the worktree.
6. **Log iteration**:
```
Iteration {N}: {value} ({delta from baseline}) → {KEEP|DISCARD}
Change: {one-line description of what was tried}
```
### Step 3: CONVERGENCE CHECK
After each iteration, check:
- **Local optimum**: Last 3 iterations all discarded → stop ("no more improvements found")
- **Diminishing returns**: Last kept improvement was < 0.5% → stop ("diminishing returns")
- **Budget exhausted**: Iteration count or time exceeded → stop
### Step 4: REPORT
Write results to `.citadel/research/experiment-{slug}.md`:
```
# Experiment: {Description}
> Metric: `{command}`
> Direction: {lower|higher} is better
> Scope: {glob pattern}
> Budget: {N iterations}
> Date: {ISO date}
## Results
| Iteration | Value | Delta | Verdict | Change |
|-----------|-------|-------|---------|--------|
| baseline | {N} | — | — | — |
| 1 | {N} | {+/-} | KEEP | {desc} |
| 2 | {N} | {+/-} | DISCARD | {desc} |
## Outcome
- **Start**: {baseline}
- **End**: {final value}
- **Improvement**: {percentage}
- **Iterations**: {kept}/{total}
- **Stop reason**: {convergence|diminishing|budget}
## Kept Changes
{List of changes that were kept, with commit hashes}
```
Also log to `.citadel/telemetry/agent-runs.jsonl`:
```json
{"event":"experiment-complete","slug":"{slug}","baseline":0,"final":0,"improvement":"0%","kept":0,"total":0,"timestamp":"ISO"}
```
## Common Metrics
| Goal | Metric Command |
|------|---------------|
| Reduce bundle size | `npm run build 2>&1 \| grep -oP 'Total size: \K\d+'` |
| Reduce type errors | `npx tsc --noEmit 2>&1 \| grep -c 'error TS'` |
| Increase test pass rate | `npm test 2>&1 \| grep -oP '\d+ passing'` |
| Reduce file count | `find src -name '*.ts' \| wc -l` |
| Reduce line count | `wc -l src/**/*.ts \| tail -1 \| awk '{print $1}'` |
## Safety Rules
- NEVER modify files outside scope
- ALWAYS use worktree isolation for changes
- ALWAYS run typecheck before keeping a change
- Restore stashed changes on exit (even on error)
- If the metric command fails, treat as DISCARD (not crash)
## Exit Protocol
```
---HANDOFF---
- Experiment: {description}
- Result: {baseline} → {final} ({improvement}%)
- Kept: {N}/{total} iterations
- Stop reason: {reason}
- Report: .citadel/research/experiment-{slug}.md
---
```From special-place-administrator/citadel_codex, MIT.
More from special-place-administrator/citadel_codex
- 0.409score
create-skill
special-place-administrator
Creates new skills from the user's repeating patterns.
SkillDFreshness: DClaude Code +9 - 0.406score
archon
special-place-administrator
Multi-session campaign orchestrator.
SkillDFreshness: DClaude Code +9 - 0.406score
autopilot
special-place-administrator
Intake-to-delivery pipeline.
SkillDFreshness: DClaude Code +9 - 0.406score
do
special-place-administrator
Unified router that auto-routes user intent to the right orchestrator or skill.
SkillDFreshness: DClaude Code +9 - 0.406score
fleet
special-place-administrator
Parallel campaign coordinator.
SkillDFreshness: DClaude Code +9 - 0.406score
live-preview
special-place-administrator
Mid-build visual verification loop.
SkillDFreshness: DClaude Code +9 - 0.406score
marshal
special-place-administrator
Meta-orchestrator that takes any direction — broad, specific, or vague — and autonomously chains skills and context into actionable work.
SkillDFreshness: DClaude Code +9 - 0.406score
postmortem
special-place-administrator
Auto-generates a structured postmortem from a completed campaign.
SkillDFreshness: DClaude Code +9 - 0.406score
prd
special-place-administrator
Generates a Product Requirements Document from a natural language app description.
SkillDFreshness: DClaude Code +9 - 0.406score
qa
special-place-administrator
Browser-based QA verification.
SkillDFreshness: DClaude Code +9 - 0.406score
refactor
special-place-administrator
Safe multi-file refactoring with automatic rollback.
SkillDFreshness: DClaude Code +9 - 0.406score
research
special-place-administrator
Focused research investigations.
SkillDFreshness: DClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Mar 27, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from special-place-administrator
- 0.409score
create-skill
special-place-administrator
Creates new skills from the user's repeating patterns.
SkillDFreshness: DClaude Code +9 - 0.406score
autopilot
special-place-administrator
Intake-to-delivery pipeline.
SkillDFreshness: DClaude Code +9 - 0.406score
archon
special-place-administrator
Multi-session campaign orchestrator.
SkillDFreshness: DClaude Code +9 - 0.406score
do
special-place-administrator
Unified router that auto-routes user intent to the right orchestrator or skill.
SkillDFreshness: DClaude Code +9 - 0.406score
fleet
special-place-administrator
Parallel campaign coordinator.
SkillDFreshness: DClaude Code +9 - 0.406score
architect
special-place-administrator
Given a PRD, produces an implementation architecture: file tree, component breakdown, data model, and a phased build plan with end conditions that a campaign…
SkillDFreshness: DClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get experiment running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
experiment skill. Agent Mart. https://agentmart.dev/skills/special-place-administrator-experiment (last updated 2026-10-24)