flex-fe/.claude/skills/cleanup-worktrees/SKILL.md
머지되었거나 취소된 브랜치의 worktree를 정리합니다. "/cleanup-worktrees", "worktree 정리", "clean up worktrees" 등으로 호출합니다.
npx skillsauth add flex-team/flex-oncall cleanup-worktreesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
워크스페이스 내 stale worktree를 찾아 정리합니다.
-- 패턴의 worktree 디렉토리를 탐색SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORKSPACE="$(cd "$SCRIPT_DIR/../../.." && pwd)"
echo "🔍 Scanning for stale worktrees..."
echo ""
STALE=()
for dir in "$WORKSPACE"/*--*/; do
[ -d "$dir" ] || continue
wt_name=$(basename "$dir")
# .git 파일에서 원본 레포 경로 추출
if [ ! -f "$dir/.git" ]; then
continue
fi
gitdir=$(cat "$dir/.git" | sed 's/gitdir: //')
# 원본 레포 경로 추출 (worktrees 상위)
main_repo=$(dirname "$(dirname "$gitdir")")
# 현재 브랜치 확인
branch=$(git -C "$dir" rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ -z "$branch" ]; then
STALE+=("$wt_name|unknown|orphan")
continue
fi
# remote에 브랜치가 있는지 확인
remote_exists=$(git -C "$dir" ls-remote --heads origin "$branch" 2>/dev/null)
if [ -z "$remote_exists" ]; then
# remote에서 삭제됨 — develop/main에 머지되었을 가능성
STALE+=("$wt_name|$branch|remote deleted")
fi
done
if [ ${#STALE[@]} -eq 0 ]; then
echo "✅ No stale worktrees found."
exit 0
fi
echo "Found ${#STALE[@]} potentially stale worktree(s):"
echo ""
echo "| Worktree | Branch | Reason |"
echo "|----------|--------|--------|"
for item in "${STALE[@]}"; do
IFS='|' read -r name branch reason <<< "$item"
echo "| $name | $branch | $reason |"
done
echo ""
echo "⚠️ Review the list above. To remove a worktree:"
echo " git -C $WORKSPACE/{main-repo} worktree remove $WORKSPACE/{worktree-name}"
위 스크립트 실행 후 사용자에게 삭제할 worktree를 확인합니다. 확인되면 각 worktree에 대해:
# 원본 레포에서 worktree 제거
git -C $WORKSPACE/{main-repo} worktree remove $WORKSPACE/{worktree-name}
# 로컬 브랜치도 삭제
git -C $WORKSPACE/{main-repo} branch -D {branch-name}
🔍 Scanning for stale worktrees...
Found 2 potentially stale worktree(s):
| Worktree | Branch | Reason |
|----------|--------|--------|
| flex-frontend--fe-2050 | feature/fe-2050 | remote deleted |
| flex-frontend-apps-people--ppd-180 | feature/ppd-180 | remote deleted |
⚠️ Review the list above.
development
티켓 ID나 Linear 이슈 URL을 받아 VSCode workspace를 열어줍니다. worktree가 있으면 바로 열고, 없으면 Linear 이슈 기반으로 worktree를 생성한 뒤 엽니다. 사용자가 "/vscode", "vscode 열어", "workspace 열어" 등을 요청할 때 사용합니다.
development
워크스페이스 내 모든 flex 레포를 동기화합니다. git fetch --all --prune 후 develop(없으면 main) 브랜치로 checkout합니다. "/sync-repos", "레포 동기화", "sync all repos" 등으로 호출합니다.
testing
온콜 이슈 분석 및 디버깅 스킬. CS팀이 슬랙에 올린 이슈나 QA가 보고한 버그의 원인을 체계적으로 분석하고, 슬랙 공유용 한글 요약을 생성한다. "온콜", "QA 이슈", "버그 분석", "이슈 분석", "원인 파악", "왜 안 되는지", "에러가 난다", "안 된다고 해", "CS 이슈" 등의 표현을 사용하거나, 특정 기능의 오류/장애 상황을 설명할 때 이 스킬을 사용한다. Linear 티켓이나 슬랙 메시지 URL을 공유하며 분석을 요청하는 경우에도 사용한다.
business
온콜 이슈 접수 및 Triage 스킬. Slack URL이나 Linear 티켓을 받아 맥락을 파악하고, 이슈 유형 분류(오류/데이터/성능/권한/스펙/화면형) 및 FE/BE 판별을 수행한다. "온콜", "triage", "이슈 분류", "FE야 BE야", "이거 봐줘" 등의 표현이나, Slack/Linear URL을 공유하며 분석을 요청할 때 사용한다.