Skill

upstream-sync

Fetch, analyze, and selectively apply changes from the upstream oh-my-claudecode repository

From pepcode
Install
1
Run in your terminal
$
npx claudepluginhub leejaedus/pepcode --plugin pepcode
Tool Access

This skill uses the workspace's default tool permissions.

Skill Content

Upstream Sync Skill

oh-my-claudecode 원본 레포의 변경사항을 가져와 분석하고, 선택적으로 pepcode에 적용한다.

Usage

/pepcode:upstream-sync [options]

Examples:

  • /pepcode:upstream-sync - 최근 변경사항 확인 및 선택 적용
  • /pepcode:upstream-sync --since 7d - 최근 7일간 변경사항
  • /pepcode:upstream-sync --files-only - 변경된 파일 목록만 확인
  • /pepcode:upstream-sync --auto - 자동 분석 후 권장사항 제시

Configuration

  • Upstream repo: https://github.com/Yeachan-Heo/oh-my-claudecode.git
  • Remote name: upstream
  • Default branch: main

Workflow

다음 단계를 순서대로 수행한다:

1. Upstream Remote 설정

upstream remote가 없으면 추가한다:

if ! git remote get-url upstream >/dev/null 2>&1; then
  git remote add upstream https://github.com/Yeachan-Heo/oh-my-claudecode.git
  echo "Added upstream remote"
fi
git fetch upstream --no-tags

2. 변경사항 분석

pepcode의 마지막 upstream 동기화 시점 이후의 변경사항을 분석한다.

# 마지막 동기화 마커 확인 (없으면 최근 50개 커밋)
SYNC_MARKER_FILE=".pep/upstream-sync-marker"
if [ -f "$SYNC_MARKER_FILE" ]; then
  LAST_SYNC=$(cat "$SYNC_MARKER_FILE")
  echo "Last sync: $LAST_SYNC"
else
  LAST_SYNC=$(git log upstream/main --format='%H' -1 --before="30 days ago" 2>/dev/null || git log upstream/main --format='%H' -50 | tail -1)
  echo "No sync marker found, using: $LAST_SYNC"
fi

변경된 커밋 목록을 가져온다:

git log "${LAST_SYNC}..upstream/main" --oneline --no-merges

변경된 파일 목록을 가져온다:

git diff "${LAST_SYNC}..upstream/main" --stat

3. 변경사항 분류

변경사항을 다음 카테고리로 분류한다:

  • Core: 핵심 로직 변경 (src/, bridge/)
  • Skills: 스킬 추가/수정 (skills/, commands/)
  • Agents: 에이전트 정의 변경 (agents/)
  • Config: 설정 파일 변경 (.mcp.json, hooks/, .claude-plugin/)
  • Docs: 문서 변경 (docs/, *.md)
  • Tests: 테스트 변경 (tests/, *.test.ts)
  • Build: 빌드/스크립트 변경 (scripts/, tsconfig.json, package.json)

각 카테고리별로 변경 파일 수와 영향도를 요약한다.

4. 사용자에게 선택지 제시

AskUserQuestion을 사용하여 적용할 변경사항을 선택받는다:

  • 카테고리별 일괄 적용
  • 파일별 개별 적용
  • 특정 커밋 체리픽

중요: pepcode에서 의도적으로 제거한 기능(oh-my-claudecode 전용 기능)은 명확히 표시하고 기본적으로 제외한다.

5. 선택적 적용

선택된 변경사항을 적용한다:

# 파일 단위 적용 (가장 안전)
git checkout upstream/main -- path/to/file

# 또는 패치 적용
git diff "${LAST_SYNC}..upstream/main" -- path/to/file | git apply --3way

적용 후 충돌이 있으면 사용자에게 알리고 수동 해결을 안내한다.

6. 적용 후 검증

# TypeScript 빌드 확인
npm run build 2>&1 | tail -20

# 테스트 실행
npm run test:run 2>&1 | tail -20

7. 동기화 마커 업데이트

mkdir -p .pep
git rev-parse upstream/main > .pep/upstream-sync-marker
echo "Sync marker updated to $(cat .pep/upstream-sync-marker)"

8. Rename 매핑

oh-my-claudecode에서 pepcode로의 이름 변경 매핑을 자동 적용한다:

oh-my-claudecodepepcode
omcpep
oh-my-claudecodepepcode
OMCPEP
OMC:STARTPEPCODE:START
OMC:ENDPEPCODE:END
OMC:VERSIONPEPCODE:VERSION

가져온 파일에서 위 매핑을 자동으로 적용한다. 단, 바이너리 파일과 외부 URL은 제외한다.

Notes

  • 이 스킬은 pepcode 레포의 worktree root에서 실행해야 한다
  • upstream fetch는 네트워크 접근이 필요하다
  • 충돌 시 3-way merge를 시도하며, 실패하면 수동 해결을 안내한다
  • 적용 후 반드시 빌드/테스트 검증을 수행한다
Stats
Stars0
Forks0
Last CommitFeb 15, 2026