본문으로 건너뛰기
Skillpedia
일반 코딩71k · #3106

create-pull-request

하는 일

이 스킬은 브랜치 확인부터 설명 작성까지 GitHub 풀 리퀘스트를 여는 단계를 안내합니다. 변경 사항을 검토받고 싶은 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓풀 리퀘스트를 열거나 검토를 위해 변경 사항을 제출해 달라고 요청할 때.
  • ✓브랜치에 검토자를 위해 명확한 요약이 필요한 커밋이 있을 때.
  • ✓프로젝트에 따라야 할 풀 리퀘스트 템플릿이 있을 때.

스킬 링크

https://github.com/cline/cline/blob/main/.agents/skills/create-pull-request/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/cline/cline/blob/main/.agents/skills/create-pull-request/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 변경 사항이 브랜치에 있습니다. 명확한 설명과 함께 GitHub에 풀 리퀘스트를 열어 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 GitHub CLI가 설치되고 로그인되어 있는지 확인하고, 브랜치의 커밋을 검토한 뒤 프로젝트의 풀 리퀘스트 템플릿을 채웁니다. 그다음 gh 도구로 풀 리퀘스트를 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Create Pull Request

This skill guides you through creating a well-structured GitHub pull request that follows project conventions and best practices.

Prerequisites Check

Before proceeding, verify the following:

1. Check if gh CLI is installed

gh --version

If not installed, inform the user:

The GitHub CLI (gh) is required but not installed. Please install it:

2. Check if authenticated with GitHub

gh auth status

If not authenticated, guide the user to run gh auth login.

3. Verify clean working directory

git status

If there are uncommitted changes, ask the user whether to:

  • Commit them as part of this PR
  • Stash them temporarily
  • Discard them (with caution)

Gather Context

1. Identify the current branch

git branch --show-current

Ensure you're not on main or master. If so, ask the user to create or switch to a feature branch.

2. Find the base branch

git remote show origin | grep "HEAD branch"

This is typically main or master.

3. Analyze recent commits relevant to this PR

git log origin/main..HEAD --oneline --no-decorate

Review these commits to understand:

  • What changes are being introduced
  • The scope of the PR (single feature/fix or multiple changes)
  • Whether commits should be squashed or reorganized

4. Review the diff

git diff origin/main..HEAD --stat

This shows which files changed and helps identify the type of change.

Information Gathering

Before creating the PR, you need the following information. Check if it can be inferred from:

  • Commit messages
  • Branch name (e.g., fix/issue-123, feature/new-login)
  • Changed files and their content

If any critical information is missing, use ask_followup_question to ask the user:

Required Information

  1. Related Issue Number: Look for patterns like #123, fixes #123, or closes #123 in commit messages
  2. Description: What problem does this solve? Why were these changes made?
  3. Type of Change: Bug fix, new feature, breaking change, refactor, cosmetic, documentation, or workflow
  4. Test Procedure: How was this tested? What could break?

Example clarifying question

If the issue number is not found:

I couldn't find a related issue number in the commit messages or branch name. What GitHub issue does this PR address? (Enter the issue number, e.g., "123" or "N/A" for small fixes)

Git Best Practices

Before creating the PR, consider these best practices:

Commit Hygiene

  1. Atomic commits: Each commit should represent a single logical change
  2. Clear commit messages: Follow conventional commit format when possible
  3. No merge commits: Prefer rebasing over merging to keep history clean

Branch Management

  1. Rebase on latest main (if needed):

    git fetch origin
    git rebase origin/main
    
  2. Squash if appropriate: If there are many small "WIP" commits, consider interactive rebase:

    git rebase -i origin/main
    

    Only suggest this if commits appear messy and the user is comfortable with rebasing.

Push Changes

Ensure all commits are pushed:

git push origin HEAD

If the branch was rebased, you may need:

git push origin HEAD --force-with-lease

Create the Pull Request

IMPORTANT: Read and use the PR template at .github/pull_request_template.md. The PR body format must strictly match the template structure. Do not deviate from the template format.

When filling out the template:

  • Replace #XXXX with the actual issue number, or keep as #XXXX if no issue exists (for small fixes)
  • Fill in all sections with relevant information gathered from commits and context
  • Mark the appropriate "Type of Change" checkbox(es)
  • Complete the "Pre-flight Checklist" items that apply

Create PR with gh CLI

Use a temporary file for the PR body to avoid shell escaping issues, newline problems, and other command-line flakiness:

  1. Write the PR body to a temporary file:

    /tmp/pr-body.md
    
  2. Create the PR using the file:

    gh pr create --title "PR_TITLE" --body-file /tmp/pr-body.md --base main
    
  3. Clean up the temporary file:

    rm /tmp/pr-body.md
    

For draft PRs:

gh pr create --title "PR_TITLE" --body-file /tmp/pr-body.md --base main --draft

Why use a file?

자주 묻는 질문

먼저 무엇을 설정해야 하나요?

스킬은 GitHub CLI인 gh가 설치되어 있고 로그인되어 있어야 한다고 요구합니다.

커밋되지 않은 변경 사항이 있으면 어떻게 하나요?

스킬은 계속하기 전에 커밋할지, 스태시할지, 버릴지 물어보라고 말합니다.

main 브랜치에서 풀 리퀘스트를 열 수 있나요?

아닙니다. 스킬은 main에 있다면 먼저 기능 브랜치로 바꾸라고 말합니다.

상세 정보

작성자의 원본 설명

Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, PR template usage, and PR creation using the gh CLI tool.

repo: cline/cline

인기도

GitHub 스타
71k
순위
#3106
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬