| name | experiment-engine |
| description | Otonom deney dongusu. Kod degisikligi yap, olc, karsilastir, kabul et veya geri al. Metrik bazli karar verme ile performans, boyut veya kalite optimizasyonu. Tek basina veya agent ile kullan. |
Not / Overlap: Bu skill experiment-loop ile ayni otonom deney dongusu kavramini kapsar (bu dosya TR, experiment-loop EN). Yeni isler icin experiment-loop tercih edilir; v4.0 da birlestirilecek.
Experiment Engine
Bir hedef belirle, sistematik olarak deneyler yap, sadece iyilestirenleri tut.
Core Loop
HEDEF BELIRLE
└─ "API response time'i %20 dusur"
└─ "Bundle size'i 500KB'nin altina getir"
└─ "Test coverage'i %90'a cikar"
BASELINE OLC
└─ Mevcut metrigi kaydet (ornek: 340ms, 720KB, %78)
DENEY DONGUSU (N kez tekrarla):
┌─────────────────────────────────────┐
│ 1. MODIFY - Tek degisiklik yap │
│ 2. VERIFY - Metrigi olc │
│ 3. COMPARE - Baseline ile kiyasla │
│ 4. DECIDE - Kabul / Reddet │
│ ├─ Iyilesti → COMMIT + yeni │
│ │ baseline │
│ └─ Kotulesti → ROLLBACK │
└─────────────────────────────────────┘
RAPOR OLUSTUR
└─ N deney, X kabul, Y red, final metrik
Kullanim Alanlari
Performans Optimizasyonu
git stash
curl -w "%{time_total}" http://localhost:3000/api/users
curl -w "%{time_total}" http://localhost:3000/api/users
curl -w "%{time_total}" http://localhost:3000/api/users
Bundle Size Azaltma
BASELINE=$(npx next build 2>&1 | grep "First Load JS" | awk '{print $4}')
experiments=(
"lodash yerine lodash-es"
"moment yerine dayjs"
"tree-shaking acik mi kontrol"
"dynamic import lazy component'ler"
"image optimize (next/image)"
)
for exp in "${experiments[@]}"; do
echo "=== Deney: $exp ==="
NEW=$(npx next build 2>&1 | grep "First Load JS" | awk '{print $4}')
if [ "$NEW" -lt "$BASELINE" ]; then
echo "KABUL: $BASELINE -> $NEW"
BASELINE=$NEW
git add -A && git stash
else
echo "RED: $NEW >= $BASELINE"
git checkout .
fi
done
Test Coverage Artirma
BASELINE=$(npx jest --coverage --silent 2>&1 | grep "All files" | awk '{print $4}')
for file in $(find src -name "*.ts" -not -name "*.test.*"); do
echo "=== Test: $file ==="
NEW=$(npx jest --coverage --silent 2>&1 | grep "All files" | awk '{print $4}')
if (( $(echo "$NEW > $BASELINE" | bc -l) )); then
echo "KABUL: %$BASELINE -> %$NEW"
BASELINE=$NEW
fi
done
Deney Protokolu
Tek Degisiklik Kurali
YANLIS: Ayni anda 3 sey degistirip "daha hizli oldu" demek
→ Hangi degisiklik etkili oldugunu bilemezsin
DOGRU: Her seferinde TEK degisiklik yap
→ Neyin ise yaradigini kesin bilirsin
Rollback Stratejisi
git stash
git stash pop
git worktree add /tmp/experiment-1 -b exp/perf-test
cd /tmp/experiment-1
git add -A && git commit -m "checkpoint: pre-experiment"
Metrik Toplama
interface ExperimentResult {
id: string
description: string
baseline: number
result: number
improvement: number
accepted: boolean
duration: number
timestamp: string
}
interface ExperimentReport {
goal: string
metric: string
baselineValue: number
finalValue: number
totalExperiments: number
accepted: number
rejected: number
totalImprovement: number
experiments: ExperimentResult[]
}
Deney Sablonu
# Deney Raporu: [Hedef]
## Ozet
- Hedef: [metrik] < [esik]
- Baseline: [baslangic degeri]
- Final: [son deger]
- Iyilesme: [yuzde]
- Deneyler: [kabul]/[toplam]
## Deneyler
| # | Aciklama | Onceki | Sonraki | Degisim | Karar |
|---|----------|-------:|--------:|--------:|-------|
| 1 | Index ekle | 340ms | 280ms | -18% | KABUL |
| 2 | Redis cache | 280ms | 45ms | -84% | KABUL |
| 3 | JSON serializer | 45ms | 42ms | -7% | RED |
## Ogrenim
- En etkili: Redis cache (-84%)
- Degmez: JSON serializer degisimi (karmasiklik > kazanim)
Otomatik Deney Modu
METRIC=$1
TARGET=$2
UNIT=$3
MAX_ROUNDS=$4
ROUND=0
BASELINE=$(measure_$METRIC)
while [ $ROUND -lt $MAX_ROUNDS ]; do
ROUND=$((ROUND + 1))
claude -p "Optimize $METRIC. Current: ${BASELINE}${UNIT}. Target: <${TARGET}${UNIT}. Make ONE small change." --no-input
NEW=$(measure_$METRIC)
if [ "$NEW" -lt "$BASELINE" ]; then
echo "Round $ROUND: KABUL ($BASELINE -> $NEW)"
BASELINE=$NEW
git add -A && git commit -m "experiment: $METRIC improved to ${NEW}${UNIT}"
else
echo "Round $ROUND: RED ($NEW >= $BASELINE)"
git checkout .
fi
if [ "$BASELINE" -le "$TARGET" ]; then
echo "HEDEF ULASILDI: ${BASELINE}${UNIT} <= ${TARGET}${UNIT}"
break
fi
done
vibecosystem Entegrasyonu
- profiler agent: Performans deneylerinde metrik toplama
- nitro agent: Optimization deneylerini yonetme
- tdd-guide agent: Coverage deneylerinde test yazma
- verifier agent: Her deney sonrasi build/test dogrulama
- self-learner agent: Basarili deneyleri pattern olarak kaydet
- experiment-loop skill: Bu skill'in mevcut complementary'si