# Lab:autoresearch

Self-improving loop for plugin skills.

- Repository: https://github.com/oliver-kriska/claude-elixir-phoenix (572 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add oliver-kriska/claude-elixir-phoenix --skill lab:autoresearch -g -a claude-code -y`
Codex: `npx skills add oliver-kriska/claude-elixir-phoenix --skill lab:autoresearch -g -a codex -y`
Cursor: `npx skills add oliver-kriska/claude-elixir-phoenix --skill lab:autoresearch -g -a cursor -y`
Gemini CLI: `npx skills add oliver-kriska/claude-elixir-phoenix --skill lab:autoresearch -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add oliver-kriska/claude-elixir-phoenix`

## Description

Self-improving loop for plugin skills. Reads program.md, proposes one mutation per iteration, evaluates against deterministic scorer, keeps improvements via git, reverts failures. Targets weakest skill+dimension. Use with /loop for overnight runs.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Autoresearch, Plugin Skill Self-Improvement

Iteratively improve plugin skills via the autoresearch pattern:
propose one mutation -> eval -> keep/revert -> repeat.

## Usage

```
/lab:autoresearch                           # Targeted: attack weakest skill+dimension
/lab:autoresearch --skill review            # Focus on one skill
/lab:autoresearch --strategy sweep          # Process all skills alphabetically
/lab:autoresearch --dry-run                 # Show what would change, don't commit
```

For overnight runs:

```
/loop 5m /lab:autoresearch --strategy sweep --max-iterations 200
```

## Iron Laws

1. **ONE mutation per iteration**, if description needs "and", split into two
2. **NEVER mutate read-only files**, check program.md before every write
3. **EVAL is deterministic**, always use the wrapper script, never LLM-judge
4. **REVERT on regression OR checks failure**, no exceptions
5. **LOG every iteration**, use `keep` or `revert` command (never skip)
6. **CHECK ideas.md before proposing**, don't rediscover known optimizations

## Wrapper Script Commands

All eval/git/journal operations go through ONE script. Do NOT run these manually.

```bash
# Find the weakest skill+dimension
python3 lab/autoresearch/scripts/run-iteration.py target --strategy targeted

# Score a skill (before mutation, to get baseline)
python3 lab/autoresearch/scripts/run-iteration.py score <skill-name>

# After mutation: score + checks + compare → verdict (KEEP or REVERT)
python3 lab/autoresearch/scripts/run-iteration.py eval <skill-name>

# Act on verdict:
python3 lab/autoresearch/scripts/run-iteration.py keep <skill> <dim> <old> <new> \
  --desc "what changed" --asi '{"hypothesis": "why", "mechanism": "how"}'

python3 lab/autoresearch/scripts/run-iteration.py revert <skill> <dim> <old> <new> \
  --desc "what was attempted" --asi '{"hypothesis": "why", "regression": "what broke", "avoid": "do not retry this"}'

The rest: https://github.com/oliver-kriska/claude-elixir-phoenix/blob/HEAD/lab/autoresearch/SKILL.md
