Skip to main content
rule CX Codex

pr-message-format — Claude Code rule for PRs

The pr-message-format rule shapes PR titles and bodies, keeping summaries concise and descriptions structured. It helps when an agent drafts a pull request from code changes.

MIT ★ 359 updated 2025-12-01

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/pr-message-format.md
Open on GitHub

What pr-message-format does

A PR title starts with a prefix such as feat or fix, followed by a brief English summary with no final period. The body uses Overview and Changes as its core sections. Projects can also require Technical Details, Test Content, or Related Issues.

The rule says to review actual diffs and commit history before writing PR text; issue titles and branch names alone are not enough. For Claude Code, place the rule at .claude/rules/pr-message-format.md. PR text is set to English, so projects using another language need to change language in the rule file.

What it helps with

  • write a PR title with a Conventional Commits prefix
  • organize the PR body into named sections
  • describe changes using diffs and commit history
  • include test results and related issue references

Example prompts for the agent

  • Draft an English PR title and body from the current diffs and commit history.
  • Structure this PR description with Overview, Changes, and Test Content.
  • Check that the PR title has a suitable prefix and summarizes the actual changes.

How to install pr-message-format

Manually: put the files in place

.claude/rules/pr-message-format.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about pr-message-format

How do I install pr-message-format in Claude Code?

Place the rule file at .claude/rules/pr-message-format.md.

What does pr-message-format do?

It sets a prefixed, concise PR title format and organizes the body into sections. It also directs the agent to base the text on diffs and commit history.

Can I write PRs in a language other than English?

The current rule sets PR titles and bodies to English. Change language in the rule file to use another language.

Source text

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

Similar IDE rules

All IDE rules for Git and GitHub →

From the same set7

Project sponsors

Companies that keep this analytics open