create-pull-request
Что он делает
Этот скилл описывает шаги открытия запроса на слияние в GitHub: от проверки ветки до написания описания. Он нужен разработчикам, которые хотят, чтобы их изменения проверили.
Когда использовать
- ✓Когда кто-то просит открыть запрос на слияние или отправить изменения на проверку.
- ✓Когда в ветке есть коммиты, которым нужна понятная сводка для рецензентов.
- ✓Когда в проекте есть шаблон запроса на слияние, которому нужно следовать.
Ссылка на скилл
https://github.com/cline/cline/blob/main/.agents/skills/create-pull-request/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Мои изменения лежат в ветке. Можешь открыть запрос на слияние в 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:
- macOS:
brew install gh- Other: https://cli.github.com/
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
- Related Issue Number: Look for patterns like
#123,fixes #123, orcloses #123in commit messages - Description: What problem does this solve? Why were these changes made?
- Type of Change: Bug fix, new feature, breaking change, refactor, cosmetic, documentation, or workflow
- 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
- Atomic commits: Each commit should represent a single logical change
- Clear commit messages: Follow conventional commit format when possible
- No merge commits: Prefer rebasing over merging to keep history clean
Branch Management
Rebase on latest main (if needed):
git fetch origin git rebase origin/mainSquash if appropriate: If there are many small "WIP" commits, consider interactive rebase:
git rebase -i origin/mainOnly 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
#XXXXwith the actual issue number, or keep as#XXXXif 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:
Write the PR body to a temporary file:
/tmp/pr-body.mdCreate the PR using the file:
gh pr create --title "PR_TITLE" --body-file /tmp/pr-body.md --base mainClean 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
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
cline-sdk
71kУчит агента создавать ИИ-агентов с помощью Cline SDK: инструменты, сессии, события, провайдеры моделей и команды из нескольких агентов.
opentui
71kПомогает агенту создавать текстовые интерфейсы терминала с OpenTUI: макет, обработка клавиатуры, компоненты, анимации и тестирование.
tuistory
71kУчит агента управлять программами терминала и тестировать их в фоновой сессии: вводить команды и читать экран, даже без монитора.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.