From forge-game
게임/앱 UI 스크린샷에서 배경·버튼·컴포넌트를 게임 사용 가능한 투명 PNG로 추출. 배경은 nanobanana edit_image(AI inpainting), 버튼/컴포넌트는 /clip 템플릿 매칭으로 bbox를 찾고 SAM2로 pixel-accurate 세그멘테이션하여 투명 배경 PNG로 추출. 트리거: 배경 뽑아줘, 버튼 추출해줘, 컴포넌트 분리해줘, 전부 다 추출해줘, 이미지 경로와 함께 추출 요청 시.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge-game:asset-extractThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
스크린샷에서 게임에 바로 사용 가능한 에셋 PNG를 추출한다.
스크린샷에서 게임에 바로 사용 가능한 에셋 PNG를 추출한다.
| 대상 | 도구 | 결과 |
|---|---|---|
| 배경 | mcp__nano-banana__edit_image (inpainting) | UI 제거 후 자연스러운 배경 PNG |
| 버튼/컴포넌트 | /clip 템플릿 매칭 → SAM2 세그멘테이션 | 투명 배경 PNG (pixel-accurate) |
버튼 추출에 nanobanana 사용 금지 — AI가 색상/형태를 재생성하여 원본과 달라짐.
pip install rembg (SAM 모델 내장)IMAGE_PATH : 이미지 절대 경로
TARGET : 배경 | 버튼 | 전체 (기본: 전체)
OUTPUT_DIR : {IMAGE_PATH 부모}/{파일명}-components/ (기본)
Windows 경로 자동 변환:
z:/home/damools/... → /home/damools/...C:/Users/... → /mnt/c/Users/...사용자에게 안내:
"추출할 요소를 화면에서 스크린샷 찍어
/clip으로 올려주세요."
사용자가 /clip 실행하면 → /tmp/clip.png 저장됨.
python3 ~/.claude/skills/asset-extract/scripts/match_bbox.py \
--original "{IMAGE_PATH}" \
--clip /tmp/clip.png
출력:
left,top,right,bottom
score:{SAD점수}
score > 20 이면 매칭 품질 경고 → 사용자에게 안내 후 계속 진행.
bbox 확장: match_bbox 결과에 상하좌우 10px씩 여유 추가 (SAM2가 전체 오브젝트를 포착하도록).
python3 ~/.claude/skills/asset-extract/scripts/segment_button.py \
--image "{IMAGE_PATH}" \
--bbox {left} {top} {right} {bottom} \
--output "{OUTPUT_DIR}/buttons/{name}.png"
imagePath : {IMAGE_PATH}
prompt : "Remove all UI elements, buttons, cards, text, icons, and navigation
bars from this screenshot. Keep only the background. Fill removed
areas with the natural background color/gradient.
Result: clean background with no UI elements."
aspectRatio: 원본 비율에 맞게 선택
resolution : 2K
결과를 {OUTPUT_DIR}/backgrounds/bg_nano.png로 복사.
✅ 추출 완료
📁 {OUTPUT_DIR}
배경: backgrounds/bg_nano.png
버튼: {N}개 (투명 PNG — 게임 합성 가능)
- buttons/{name}.png ({w}×{h}px, IoU: {score})
독립 Evaluator subagent가 산출물 품질을 검증합니다.
Evaluator 역할: 산출물 독립 검증
모델: claude-haiku-4-5 (경량, 편향 최소화)
격리: 메인 컨텍스트 오염 방지
판정 기준:
eval_cases.jsonl에 결과 자동 누적.
npx claudepluginhub moongci38-oss/forge-plugins --plugin forge-gameMines projects and conversations into a searchable memory palace. Activates on queries about MemPalace, memory palace, mining, searching, palace setup, wings, rooms, drawers, or recalling past work.
Whole-repo audit for over-engineering: finds dead code, unnecessary abstractions, stdlib-replaceable dependencies. Outputs ranked findings and net line/dep savings.