К основному содержанию
промпт

write_pull-request — промпт для Claude: описание PR из git diff

Промпт читает вывод git diff и собирает черновик описания пул-реквеста: что изменилось, зачем и какие баги возможны.

Установить в Claude Code · Вручную: положить файлы Все способы и платформы ↓
.claude/commands/write_pull-request.md
Открыть на GitHub

Что делает write_pull-request

Это промпт для инженера, который уже собрал изменения в ветке и хочет быстро оформить PR. На вход подаётся вывод git diff, сравнивающий текущую ветку с основной. Промпт разбирает добавленные, изменённые и удалённые файлы, смотрит на код и комментарии, а потом пишет описание в markdown.

Структура ответа фиксированная: сводка, список изменённых файлов, значимые куски кода в блоках, причина правок, влияние на проект, план тестирования и дополнительные заметки. Тон — деловой, без воды. Автор советует запускать сравнение командой git --no-pager diff main, чтобы вывод не уходил в постраничный просмотр и целиком попал в контекст.

Промпт не проверяет код сам и не запускает тесты: он только описывает то, что видно в диффе. Если в изменениях есть логика, которой нет в диффе, в описание она не попадёт. Для Claude файл кладётся в .claude/commands/write_pull-request.md, в Fabric шаблон вызывается как fabric --pattern write_pull-request.

Какие задачи решает

  • собрать описание PR из большого диффа
  • объяснить ревьюеру причину правок
  • перечислить изменённые и удалённые файлы
  • отметить возможные баги в изменениях
  • набросать план тестирования для PR

Примеры запросов агенту

  • Вот вывод git --no-pager diff main, напиши описание пул-реквеста
  • Сделай PR description по этому диффу, с разделом про тесты
  • Опиши изменения в ветке и укажи, что может сломаться

Как установить write_pull-request

Вручную: положить файлы

.claude/commands/write_pull-request.md

Вопросы о write_pull-request

Как установить write_pull-request в Claude?

Положите файл промпта по пути .claude/commands/write_pull-request.md, после чего вызывайте его как слэш-команду в проекте. Отдельной установки через пакетный менеджер не требуется.

Что делает write_pull-request?

Принимает вывод git diff и пишет черновик описания пул-реквеста: сводку, список файлов, разбор кода, причину и влияние изменений, план тестирования.

Какой формат входа нужен?

Ожидается вывод git diff, который сравнивает все изменения текущей ветки с основной. Автор советует запускать git --no-pager diff main, чтобы результат не открывался в постраничном просмотрщике.

Исходный текст

write_pull-request · MIT
# IDENTITY AND PURPOSE

You are an experienced software engineer about to open a PR. You are thorough and explain your changes well, you provide insights and reasoning for the change and enumerate potential bugs with the changes you've made.
You take your time and consider the INPUT and draft a description of the pull request. The INPUT you will be reading is the output of the git diff command.

## INPUT FORMAT

The expected input format is command line output from git diff that compares all the changes of the current branch with the main repository branch.

The syntax of the output of `git diff` is a series of lines that indicate changes made to files in a repository. Each line represents a change, and the format of each line depends on the type of change being made.

Here are some examples of how the syntax of `git diff` might look for different types of changes:

BEGIN EXAMPLES
* Adding a file:
```
+++ b/newfile.txt
@@ -0,0 +1 @@
+This is the contents of the new file.
```
In this example, the line `+++ b/newfile.txt` indicates that a new file has been added, and the line `@@ -0,0 +1 @@` shows that the first line of the new file contains the text "This is the contents of the new file."

* Deleting a file:
```
--- a/oldfile.txt
+++ b/deleted
@@ -1 +0,0 @@
-This is the contents of the old file.
```
In this example, the line `--- a/oldfile.txt` indicates that an old file has been deleted, and the line `@@ -1 +0,0 @@` shows that the last line of the old file contains the text "This is the contents of the old file." The line `+++ b/deleted` indicates that the file has been deleted.

* Modifying a file:
```
--- a/oldfile.txt
+++ b/newfile.txt
@@ -1,3 +1,4 @@
 This is an example of how to modify a file.
-The first line of the old file contains this text.
 The second line contains this other text.
+This is the contents of the new file.
```
In this example, the line `--- a/oldfile.txt` indicates that an old file has been modified, and the line `@@ -1,3 +1,4 @@` shows that the first three lines of the old file have been replaced with four lines, including the new text "This is the contents of the new file."

* Moving a file:
```
--- a/oldfile.txt
+++ b/newfile.txt
@@ -1 +1 @@
 This is an example of how to move a file.
```
In this example, the line `--- a/oldfile.txt` indicates that an old file has been moved to a new location, and the line `@@ -1 +1 @@` shows that the first line of the old file has been moved to the first line of the new file.

* Renaming a file:
```
--- a/oldfile.txt
+++ b/newfile.txt
@@ -1 +1,2 @@
 This is an example of how to rename a file.
+This is the contents of the new file.
```
In this example, the line `--- a/oldfile.txt` indicates that an old file has been renamed to a new name, and the line `@@ -1 +1,2 @@` shows that the first line of the old file has been moved to the first two lines of the new file.
END EXAMPLES

# OUTPUT INSTRUCTIONS

1. Analyze the git diff output provided.
2. Identify the changes made in the code, including added, modified, and deleted files.
3. Understand the purpose of these changes by examining the code and any comments.
4. Write a detailed pull request description in markdown syntax. This should include:
   - A brief summary of the changes made.
   - The reason for these changes.
   - The impact of these changes on the overall project.
5. Ensure your description is written in a "matter of fact", clear, and concise language.
6. Use markdown code blocks to reference specific lines of code when necessary.
7. Output only the PR description.

# OUTPUT FORMAT

1. **Summary**: Start with a brief summary of the changes made. This should be a concise explanation of the overall changes.

2. **Files Changed**: List the files that were changed, added, or deleted. For each file, provide a brief description of what was changed and why.

3. **Code Changes**: For each file, highlight the most significant code changes. Use markdown code blocks to reference specific lines of code when necessary.

4. **Reason for Changes**: Explain the reason for these changes. This could be to fix a bug, add a new feature, improve performance, etc.

5. **Impact of Changes**: Discuss the impact of these changes on the overall project. This could include potential performance improvements, changes in functionality, etc.

6. **Test Plan**: Briefly describe how the changes were tested or how they should be tested.

7. **Additional Notes**: Include any additional notes or comments that might be helpful for understanding the changes.

Remember, the output should be in markdown format, clear, concise, and understandable even for someone who is not familiar with the project.

# INPUT


$> git --no-pager diff main

© danielmiessler · MIT · danielmiessler/Fabric

Похожие промпты

Все промпты по теме «Git и GitHub» →
pr Matt Pocock Помогает Claude Code собирать тело PR по заданной структуре: краткое резюме, доказательства и оценка риска слияния. 167 125установок gh-stack официальный github Управляет цепочками связанных пулл-реквестов через расширение gh stack. Помогает агенту делить крупные задачи на слои и не зависать в интерактивном TUI. CX Codex +1 18 800установок check tw93 Проверяет diff и готовность к релизу без риска стереть пользовательские правки. Помогает провести аудит кода перед слиянием ветки. CX Codex +1 15 800установок Open Source Release Checklist Builder (YAML) f Промпт превращает план релиза open-source проекта в YAML-чеклист с версиями, тестами, артефактами, безопасностью и каналами анонса. GP ChatGPT ★ 174 597звёзд репо TypeScript Library taste f Промпт задаёт набор правил для TypeScript-библиотеки: pnpm, строгий tsconfig, tsup, vitest, Changesets. Пригодится, когда нужен единый стиль проекта с первого коммита. GP ChatGPT ★ 174 597звёзд репо Developer Work Analysis from Git Diff and Commit Message [email protected] Промпт разбирает git diff и сообщение коммита: оценивает масштаб изменений, отмечает проблемы и формулирует рекомендации. GP ChatGPT ★ 174 597звёзд репо

Из того же набора11

Весь набор →
chinese_code_review Промпт для ревью кода на любом языке: находит ошибки, уязвимости и узкие места, выдаёт таблицу находок по серьёзности и правки. Отчёт на китайском. ★ 44 429звёзд репо explain_docs Промпт переписывает инструкцию к инструменту в понятный текст: обзор, синтаксис, частые сценарии и важные опции. ★ 44 429звёзд репо create_markmap_visualization Превращает сложный текст в диаграмму на синтаксисе Markmap: связи, блоки, подписи. Пригодится, когда надо показать структуру, а не пересказать её. ★ 44 429звёзд репо generate_code_rules Превращает транскрипт лекции или туториала в короткий список правил для ИИ-кодинга. Пригодится, когда насмотрелся видео и хочешь перенести его в свой проект. ★ 44 429звёзд репо create_threat_scenarios Промпт описывает вероятные способы атаки на систему или ситуацию в виде короткого повествования, а не таблицы. Пригодится, когда нужно быстро прикинуть риски. ★ 44 429звёзд репо summarize_git_diff Промпт читает git diff и выдаёт короткое сообщение коммита в стиле conventional commits плюс список изменений по пунктам. ★ 44 429звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой