advise
Critical thinking analysis - validates alignment, challenges assumptions, identifies risks
Autonomous experiment loop — hypothesize, modify, benchmark, commit or revert
$ npx -y skills add akaszubski/autonomous-dev --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/autoresearchContext preview
What this command does when you run it.
Autonomous experiment loop — hypothesize, modify, benchmark, commit or revert
name: autoresearch description: "Autonomous experiment loop — hypothesize, modify, benchmark, commit or revert" argument-hint: "--target <path> --metric <path> [--iterations N] [--min-improvement F] [--dry-run]" allowed-tools: [Bash, Read, Write, Edit, Glob, Grep] user-invocable: true user_facing: true
Run an autonomous hypothesis-test-measure loop on a single target file. Each iteration: hypothesize an improvement, apply it, run the benchmark, commit if improved or revert if not.
ARGUMENTS: {{ARGUMENTS}}
Parse these flags from ARGUMENTS:
Run the autoresearch engine validators:
REPO_ROOT="$(git rev-parse --show-toplevel)"
python3 -c "
import sys, os as _os
for _p in ('.claude/lib', 'plugins/autonomous-dev/lib', _os.path.expanduser('~/.claude/lib')):
if _os.path.isdir(_p):
sys.path.insert(0, _p)
break
from autoresearch_engine import validate_target, validate_metric
from pathlib import Path
valid, err = validate_target(Path('TARGET_PATH'), repo_root=Path('$REPO_ROOT'))
if not valid:
print(f'BLOCK: {err}')
sys.exit(1)
valid, err = validate_metric(Path('METRIC_PATH'))
if not valid:
print(f'BLOCK: {err}')
sys.exit(1)
print('Validation passed')
"If validation fails: STOP. Do not proceed.
1. **Create experiment branch** (skip if `--dry-run`):
2. **Run baseline benchmark**:
3. **Initialize experiment history**:
Repeat for each iteration (up to `--iterations`):
1. Read the current target file content. 2. Load the last 10 experiment history entries (if any). 3. Based on the file content, history of past attempts (what worked, what didn't), and the metric being optimized, generate ONE specific hypothesis about what change could improve the metric. 4. State the hypothesis clearly before proceeding.
1. Apply exactly ONE change to the target file using the Edit tool. 2. The change must be focused and testable — no multi-section rewrites. 3. Document what was changed and why.
**HARD GATE**: Only the target file may be modified. No other files.
Run the metric script and capture the new metric value:
REPO_ROOT="$(git rev-parse --show-toplevel)"
python3 -c "
import sys, os as _os
for _p in ('.claude/lib', 'plugins/autonomous-dev/lib', _os.path.expanduser('~/.claude/lib')):
if _os.path.isdir(_p):
sys.path.insert(0, _p)
break
from autoresearch_engine import run_metric
from pathlib import Path
value, output = run_metric(Path('METRIC_PATH'))
print(f'METRIC_VALUE: {value}')
"Record `metric_after` from the output.
Calculate: `delta = metric_after - metric_before`
**If improved** (`delta >= min_improvement`):
**If not improved** (`delta < min_improvement`):
Check if the experiment has stalled (too many consecutive failures):
REPO_ROOT="$(git rev-parse --show-toplevel)"
python3 -c "
import sys, os as _os
for _p in ('.claude/lib', 'plugins/autonomous-dev/lib', _os.path.expanduser('~/.claude/lib')):
if _os.path.isdir(_p):
sys.path.insert(0, _p)
break
from autoresearch_engine import ExperimentHistory, check_stall
from pathlib import Path
history = ExperimentHistory(Path('HISTORY_PATH'))
stalled = check_stall(history, max_consecutive=MAX_STALL)
print(f'STALLED: {stalled}')
"If stalled: HALT the loop. Display: "STALLED after N consecutive failures. Halting."
Otherwise: continue to next iteration (back to STEP 2).
After the loop completes (max iterations reached, stall detected, or all iterations done):
1. Load experiment history summary 2. Display report:
=== Autoresearch Summary === Target: <target path> Metric: <metric script> Baseline: <baseline_metric> Final: <final_metric> Total improvement: <final - baseline> Iterations: <total> Improved: <count> Reverted: <count> Errors: <count> Best single improvement: <best_delta> Branch: <branch_name> (or "dry-run, no branch")
A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.
Repo: akaszubski/autonomous-dev
Critical thinking analysis - validates alignment, challenges assumptions, identifies risks
Comprehensive quality audit - code quality, documentation, coverage, security
Create GitHub issue with automated research (--quick for fast mode)
Autonomous queue drainer — picks the top /triage cluster, applies safety gates, drains via /implement --issues, pushes, deploys.
Governance, Observability, Audit — autonomous infra-health observer for autonomous-dev itself. Subcommands: start | stop | status.