| name | asset-review |
| description | Bekleyen asset-browser upload'larini incele — her biri icin onay/red karari ver, onaylananlari post-process edip runtime asset dizinine tasi, commit+push. Triggers: asset review, asset incele, bekleyenleri incele, asset review workflow, waiting review. |
/asset-review — Bekleyen Asset'leri Incele
asset-browser kurulu bir projenin waiting-for-review listesini inceler. Her item icin:
- Upload edilen ham dosyayi ceker (GitHub'dan)
- Preview eder
- Onayla / Reddet (sebep) / Atla karari verir
- Onaylanirsa: post-process (animasyon ise strip + WebP), runtime dizine tasi, commit+push
- Reddedilirse:
denyReason ile status denied olur
- Status'u
/api/review ile günceller
Kullanim
/asset-review # CWD projesi
/asset-review /path/to/project # belirli proje
Akis
1. Proje tespiti
<project>/asset-browser/config.json okunur. Yoksa hata.
2. Bekleyen listesi
GitHub'dan taze missing.json ceker:
curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/$OWNER/$REPO/contents/asset-browser/data/missing.json?ref=main" \
| jq -r '.content' | base64 -d | jq '.items[] | select(.status=="waiting-for-review")'
3. Her bekleyen icin
- Dosya cek (GitHub blobs API — >1MB destekli):
node -e '... fetch blob by sha ...' > /tmp/review/<file>
- Preview:
open /tmp/review/<file> ve magick identify
- Karar: kullaniciya sor (veya otomatik mod varsa kurallara gore karar ver):
- Onayla → post-process + tasi
- Reddet → sebep iste, /api/review deny
- Atla → sonraki item
4a. Web-approved items (post-process eksik)
/api/review approve artik uploaded dosyayi ham halde runtime dir'e kopyaliyor. Ama bu animasyon icin DOGRU degil — post-process gerekli.
Bu durumu tespit et:
for name in $(curl -s ...missing.json | jq -r '.items[] | select(.status=="approved" and .type=="Animasyon") | .name'); do
magick identify $PROJECT/game/public/assets/$name.webp
done
Ham bulunanlari listele → kullaniciya sor "bunlari post-process edip yenileyeyim mi?" → evetse magick pipeline ile:
- Magenta transparent
- Uygun split (6x1 horizontal / 3x2 grid / etc. isme gore
_6f / _8f)
- Trim + center + extent 256x256 per frame
- Append horizontal strip
- WebP q90, overwrite runtime
- Commit + push
4b. Onay + post-process (tip bazli)
Animasyon (type=="Animasyon"):
- Raw input genelde horizontal veya grid layout + magenta separator
-fuzz 35% -transparent magenta → temizle
-crop NxM@ ile frame'lere bol (N = frame_count / 1 veya dosya adindan _Nf)
- Her frame aspect-preserving fit yap:
-background none -resize 256x256 -gravity center -extent 256x256. ASLA sadece -gravity south -extent 256x256 kullanma — kaynak 256'dan uzunsa tepeyi kirpar (blacksmith head-crop bug'i buradan cikti Apr 2026). Once -resize 256x256 ile aspect koruyarak kucult, sonra -extent 256x256 ile padding ekle.
+append ile strip birlestir (1536x256 6-frame vb.)
cwebp -q 90 -alpha_q 100 → WebP
- Hedef:
<project>/game/public/assets/<name>.webp veya config'de belirlenen runtime dizini
Resim (type=="Resim"):
- Raw genelde buyuk PNG
magick IN -resize '512x512>' → sinirla
cwebp -q 90 -alpha_q 100 → WebP
- Hedef runtime dizini
5. Status transition + commit
/api/review ile status approved yap:
curl -X POST https://<alias>/api/review -d '{"name":"X","action":"approve"}'
- Runtime dosyasini commit + push:
cd <project> && git add <runtime_path> && git commit -m "feat: approve <name>" && git push
6. Reddet akisi
curl -X POST https://<alias>/api/review -d '{"name":"X","action":"deny","reason":"..."}'
7. Ozet
━━ Asset Review Complete ━━━━━━━━━━━━━━━━
✓ fire_loop_6f — approved (6 frames 256x256 -> game/public/assets/fire_loop_6f.webp)
✗ cart_wheels_8f — denied (Reason: proportions drift between frames)
⊘ smoke_rise_6f — skipped (user undecided)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Runtime dizini tespiti
config.json sources'ta "category": "In Game" olan ilk entry'nin dir'i runtime dizini.
Yoksa: game/public/assets -> fallback.
Kurallar
- Proje ayarlarindan (config.json / AGENT.md) style kurallarini oku
- Kalite sinirlari: frame count, transparency, edge style esleme (bkz.
feedback_asset_quality_rigor.md)
- Dosya boyutu > 1MB icin GitHub blobs API kullan (contents API 1MB sinir)
- WebP 512px max, q90, alpha_q 100
- Ham PNG'yi de
01_assets/transparent_png/ varsa oraya sakla
Alias
Vercel stable alias config.json'daki title'dan turetilir:
asset-browser-<slug>.vercel.app (slug = title lowercase + non-alnum -> dash)
When NOT to Use
- Hic bekleyen yoksa — sessizce bitir
- asset-browser kurulu degilse
Red Flags
- Upload dosyasi bozuk / cok kucuk / yanlis format
- Proje kurallariyla celisen asset
Error Handling
- API 4xx/5xx → retry (1 kere) → kullaniciya sor
- Post-process fail → kullaniciya sebep goster, item'i atla
- Git push fail → rebase + retry