File contents PR 생성 스킬
현재 브랜치의 변경사항을 push하고 GitHub PR을 생성합니다.
사용법
/create-pr # main 브랜치로 PR
/create-pr --base develop # develop 브랜치로 PR
/create-pr --draft # 드래프트 PR 생성
/create-pr --title "제목" # 제목 지정
워크플로우
Step 0: 사전 점검
gh CLI 확인 : gh --version 실행
인증 확인 : gh auth status 실행
실패 시: "gh auth login 실행이 필요합니다" 안내 후 중단
작업 상태 확인 : git status --porcelain 실행
uncommitted changes 있으면: 경고 메시지 출력 (계속 진행)
Step 1: 브랜치 분석
현재 브랜치 : git branch --show-current
main/master면: "PR을 위한 별도 브랜치가 필요합니다" 안내 후 중단
커밋 분석 : git log {base}..HEAD --oneline
커밋 없으면: "{base} 브랜치와 차이가 없습니다" 안내 후 중단
변경 내역 : git diff --stat {base}...HEAD
Step 2: Push
origin push 시도 : git push -u origin {branch}
성공 시: Step 3으로
403 에러 시: fork 안내
Fork 안내 (push 실패 시):
origin에 push 권한이 없습니다.
1. GitHub에서 fork 생성: https://github.com/{owner}/{repo}/fork
2. fork remote 추가: git remote add fork {your-fork-url}
3. fork URL을 입력해주세요:
AskUserQuestion으로 fork URL 입력받기
git remote add fork {url} 실행
git push -u fork {branch} 실행
Step 3: PR 생성
제목 생성 (--title 미지정 시):
커밋이 1개: 첫 커밋 메시지 사용
커밋이 여러 개: 브랜치명 기반 (feature/xxx → "Feature: xxx")
본문 생성 :
## Summary
- {커밋 1 메시지}
- {커밋 2 메시지}
- ...
PR 생성 :
origin push 성공: gh pr create --base {base} --title "..." --body "..."
fork 사용: gh pr create --repo {upstream} --base {base} --head {user}:{branch} --title "..." --body "..."
--draft 옵션 있으면: --draft 플래그 추가
Step 4: 결과
PR URL 출력:
PR 생성 완료: https://github.com/{owner}/{repo}/pull/{number}
에러 처리
상황
메시지
gh 미설치
gh CLI를 설치해주세요: https://cli.github.com/
gh 미인증
gh auth login 실행이 필요합니다
main 브랜치
PR을 위한 별도 브랜치가 필요합니다
커밋 없음
{base} 브랜치와 차이가 없습니다
push 권한 없음
fork 안내 메시지
1 --- 2 name: create-pr 3 description: PR 생성 스킬 4 --- 5 6 # PR 생성 스킬 7 8 현재 브랜치의 변경사항을 push하고 GitHub PR을 생성합니다. 9 10 ## 사용법 11 12 ``` 13 /create-pr # main 브랜치로 PR 14 /create-pr --base develop # develop 브랜치로 PR 15 /create-pr --draft # 드래프트 PR 생성 16 /create-pr --title "제목" # 제목 지정 17 ``` 18 19 ## 워크플로우 20 21 ### Step 0: 사전 점검 22 23 1. **gh CLI 확인**: `gh --version` 실행 24 - 실패 시: "gh CLI를 설치해주세요: https://cli.github.com/" 안내 후 중단 25 26 2. **인증 확인**: `gh auth status` 실행 27 - 실패 시: "gh auth login 실행이 필요합니다" 안내 후 중단 28 29 3. **작업 상태 확인**: `git status --porcelain` 실행 30 - uncommitted changes 있으면: 경고 메시지 출력 (계속 진행) 31 32 ### Step 1: 브랜치 분석 33 34 1. **현재 브랜치**: `git branch --show-current` 35 - main/master면: "PR을 위한 별도 브랜치가 필요합니다" 안내 후 중단 36 37 2. **커밋 분석**: `git log {base}..HEAD --oneline` 38 - 커밋 없으면: "{base} 브랜치와 차이가 없습니다" 안내 후 중단 39 40 3. **변경 내역**: `git diff --stat {base}...HEAD` 41 42 ### Step 2: Push 43 44 1. **origin push 시도**: `git push -u origin {branch}` 45 - 성공 시: Step 3으로 46 - 403 에러 시: fork 안내 47 48 2. **Fork 안내** (push 실패 시): 49 ``` 50 origin에 push 권한이 없습니다. 51 52 1. GitHub에서 fork 생성: https://github.com/{owner}/{repo}/fork 53 2. fork remote 추가: git remote add fork {your-fork-url} 54 3. fork URL을 입력해주세요: 55 ``` 56 - AskUserQuestion으로 fork URL 입력받기 57 - `git remote add fork {url}` 실행 58 - `git push -u fork {branch}` 실행 59 60 ### Step 3: PR 생성 61 62 1. **제목 생성** (--title 미지정 시): 63 - 커밋이 1개: 첫 커밋 메시지 사용 64 - 커밋이 여러 개: 브랜치명 기반 (feature/xxx → "Feature: xxx") 65 66 2. **본문 생성**: 67 ```markdown 68 ## Summary 69 - {커밋 1 메시지} 70 - {커밋 2 메시지} 71 - ... 72 ``` 73 74 3. **PR 생성**: 75 - origin push 성공: `gh pr create --base {base} --title "..." --body "..."` 76 - fork 사용: `gh pr create --repo {upstream} --base {base} --head {user}:{branch} --title "..." --body "..."` 77 - --draft 옵션 있으면: `--draft` 플래그 추가 78 79 ### Step 4: 결과 80 81 PR URL 출력: 82 ``` 83 PR 생성 완료: https://github.com/{owner}/{repo}/pull/{number} 84 ``` 85 86 ## 에러 처리 87 88 | 상황 | 메시지 | 89 |------|--------| 90 | gh 미설치 | gh CLI를 설치해주세요: https://cli.github.com/ | 91 | gh 미인증 | `gh auth login` 실행이 필요합니다 | 92 | main 브랜치 | PR을 위한 별도 브랜치가 필요합니다 | 93 | 커밋 없음 | {base} 브랜치와 차이가 없습니다 | 94 | push 권한 없음 | fork 안내 메시지 |
team-attention/stanford-cs146s-kr/tree/main/.claude/skills/create-pr commit 448e49e437
Frequently asked questions How do I install the Create Pr skill? Run npx skillmds@latest add team-attention/create-pr in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Create Pr skill do? PR 생성 스킬 It is listed under Coding & Dev Tools on SkillMD.
Is Create Pr safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Create Pr? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Create Pr free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Create Pr? team-attention (@team-attention) published this skill. Their other Agent Skills are listed on their SkillMD profile.