pr-message-format — правило для Claude Code: формат PR
Правило pr-message-format задаёт формат заголовка и структурированного описания Pull Request. Оно пригодится, когда агент готовит PR по изменениям в коде.
MIT ★ 359 обновлён 2025-12-01
.claude/rules/pr-message-format.mdЧто делает pr-message-format
Заголовок PR должен начинаться с префикса вроде feat или fix, затем идти краткое резюме на английском без точки в конце. В описании нужны разделы Overview и Changes; Technical Details, Test Content и Related Issues можно сделать обязательными по правилам проекта.
Правило требует сверять заголовок и описание с фактическими diff и историей коммитов, а не угадывать изменения по названию задачи или ветки. Для Claude Code файл должен лежать в .claude/rules/pr-message-format.md. Тексты PR по этому правилу пишутся на английском; если проект использует другой язык, значение language нужно изменить.
Какие задачи решает
- сформировать заголовок PR с префиксом Conventional Commits
- разбить описание PR на обязательные разделы
- описать изменения по diff и истории коммитов
- добавить в PR сведения о проверках и связанных задачах
Примеры запросов агенту
- Подготовь заголовок и описание PR на английском по текущим diff и истории коммитов.
- Оформи описание PR с разделами
Overview,ChangesиTest Content. - Проверь, что заголовок PR начинается с подходящего префикса и кратко описывает изменения.
Как установить pr-message-format
Вручную: положить файлы
.claude/rules/pr-message-format.mdПоле paths во frontmatter ограничивает файлы
AGENTS.md
Codex читает AGENTS.md: вставьте текст правила туда
Вручную: положить файлы
.cursor/rules/pr-message-format.mdcВо frontmatter: description, globs, alwaysApply
Вручную: положить файлы
.github/instructions/pr-message-format.instructions.mdПоле applyTo задаёт, к каким файлам применять
Вручную: положить файлы
.devin/rules/pr-message-format.mdВручную: положить файлы
.clinerules/pr-message-format.mdПо шагам, с командами для каждой платформы: AGENTS.md и CLAUDE.md: что это, кто читает и какой выбрать
Вопросы о pr-message-format
Как установить pr-message-format в Claude Code?
Помести файл правила по пути .claude/rules/pr-message-format.md.
Что делает pr-message-format?
Задаёт формат заголовка PR с префиксом и кратким резюме, а также структуру описания с разделами. Требует основывать текст на diff и истории коммитов.
На каком языке правило предлагает писать PR?
В текущей настройке заголовок и описание PR пишутся на английском. Для другого языка нужно изменить значение language в файле правила.
Исходный текст
pr-message-format.md · MIT
--- trigger: model_decision description: Applied when creating Pull Requests. Format rules for Prefix + English summary + structured body (overview, changes, test content) globs: --- # PR Message Format Rules This rule is a guideline that applies to Pull Request (PR) titles and bodies. ## Position of This Rule - This rule defines the PR message format in a way that aligns with the commit message convention based on Conventional Commits (`commit-message-format.md`). - While recommending the same style for title `Prefix` and summary as commit messages, it requires structured descriptions in the PR body such as "Overview," "Changes," and "Test Content." - When reusing in other projects, adjust `language` and required sections (e.g., "Technical Details") according to each project's policy. ## Language Specification - In this rule file, `language` is used as a logical name representing the language used in PR messages. - `language = "en"` - Title and body should be written in the language specified by `language` as a rule. ## Title (First Line) ### Format (Required) ```text <Prefix>: <Summary (imperative/concise)> ``` - `Prefix` is recommended to use `type` from Conventional Commits, same as commit messages (e.g., `feat`, `fix`, `refactor`, `docs`, `chore`, etc.). - Write concisely in the language specified by `language`. No period at the end. - Briefly express what and why (if necessary), aiming for approximately 50 characters or less. ## Body (Structured Format) ### Recommended Template PR body is recommended to have the following structured sections. ```markdown ## Overview Summary of what was implemented/fixed in this PR ## Changes - Description of change 1 - Description of change 2 - Description of change 3 ## Technical Details (Optional) - Implementation details and design intentions as needed ## Test Content - Types of tests performed (unit tests, E2E tests, manual verification, etc.) - Results of main behavior verification ## Related Issues - Closes #123 - Refs #456 ``` - "Overview" and "Changes" are required in principle; "Technical Details," "Test Content," and "Related Issues" may be made required according to project operation rules. - Write bullet points with enough granularity to understand "what," "where," and "why" changes were made. ## Principles for Message Generation - PR title and body must always be generated from **actual diffs and commit history** (e.g., `git diff`, `git log`) after reviewing their content. - Do not guess from issue titles or branch names alone; clearly state change content, impact scope, and test content in the body. - Even for automatic generation by AI or scripts, use diffs, commit history, and related Issue information as input. - Determine Prefix and summary to align with the commit message convention (`commit-message-format.md`) (avoid semantic inconsistency between commits and PR). ## Prohibited - Writing title or body only in a language different from that specified by `language` - Ambiguous titles that don't convey meaning (e.g., abstract expressions like "update", "fix issue", "changes") - Body with only unstructured long text (without section headings or bullet points, making content hard to grasp) - Descriptions that differ from actual diffs or intentionally omit important changes, impacts, or test results
© kinopeee · MIT · kinopeee/windsurf-antigravity-rules