optimizelisted
Install: claude install-skill joris887/exosuit
______________________________________________________________________
## optimize
Optimizing: **$ARGUMENTS**
## Argument Parsing
| Argument | Required | Default | Description |
|----------|----------|---------|-------------|
| `<goal>` | Yes | - | What to optimize (e.g., "increase test coverage", "reduce bundle size") |
| `--metric "<command>"` | Yes | - | Shell command that outputs the metric value. Pipe through grep if needed to isolate the number |
| `--target <N>` | Yes | - | Target value to reach |
| `--direction min\|max` | No | `max` | Whether to minimize or maximize the metric |
| `--max <N>` | No | 20 | Maximum experiments before stopping |
**Examples:**
```
/optimize "increase test coverage" --metric "npm test -- --coverage 2>&1 | grep 'All files' | awk '{print $10}'" --target 90 --direction max
/optimize "reduce bundle size" --metric "npm run build 2>&1 | grep 'gzipped' | awk '{print $3}'" --target 150 --direction min --max 30
/optimize "eliminate lint warnings" --metric "npm run lint 2>&1 | tail -1 | grep -oE '[0-9]+ problems'" --target 0 --direction min
```
## Failure State Persistence
At loop entry, write `docs/sessions/.failure-state.md`:
```yaml
---
status: active
skill: optimize
phase: "baseline"
phase_name: "Baseline Measurement"
started_at: "[ISO-8601 timestamp]"
story: "[goal from $ARGUMENTS]"
branch: "[from git branch --show-current]"
next_action: "Measure baseline metric"
files_modified: []
---
## Context
Goal: [goal]
Metric command: [command]