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

Commit Message Preparation — промпт для ChatGPT

Промпт помогает составлять сообщения коммитов по Conventional Commits: с типом, областью, телом и при необходимости футером. Подойдёт для разбора изменений перед коммитом.

Открыть на GitHub

Что делает Commit Message Preparation

Промпт просит описывать, что изменилось и зачем, а не пересказывать устройство кода. Он задаёт формат с типом, необязательной областью, короткой темой, обязательным телом и необязательным футером. В правилах есть императивный тон, лимит темы в 50 символов и перенос тела по 72 символам.

Он различает типы feat, fix, refactor, perf, style, test, docs, build, ci, chore и revert. Также предлагает разделять независимые изменения по коммитам, ссылаться на задачи и отмечать breaking changes. Отдельный блок отсекает расплывчатые и рекламные слова.

Для Claude Code указан файл .claude/commands/prompts.csv.md. Это повод проверить, как в проекте подключаются команды и где должен находиться этот путь.

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

  • составить сообщение коммита по Conventional Commits
  • выбрать тип и область изменения
  • описать причину и содержание правки в теле
  • разделить независимые изменения на коммиты
  • отсеять расплывчатые формулировки

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

  • Подготовь сообщение коммита по изменениям в текущем diff. Выбери тип и scope по правилам Conventional Commits, добавь обязательное тело и объясни, что изменилось и почему.
  • Разбери изменения в LoginView и предложи отдельные коммиты для независимых правок. Для каждого сообщения соблюдай формат и ограничения темы.
  • Составь commit message для исправления двойной отправки формы. Используй императивный тон, конкретную формулировку и тело минимум из одного предложения.

Как установить Commit Message Preparation

Как использовать

Вставьте текст в начало диалога или в инструкции проекта

Вопросы о Commit Message Preparation

Как установить Commit Message Preparation в Claude Code?

Для Claude Code используется путь .claude/commands/prompts.csv.md. Разместите промпт по этому пути, чтобы работать с ним как с командой проекта.

Что делает Commit Message Preparation?

Промпт формирует сообщения Git-коммитов по Conventional Commits. Он помогает выбрать тип и scope, написать короткую тему, обязательное тело и необязательный футер.

Какие ограничения есть у темы коммита?

Тема должна быть не длиннее 50 символов, начинаться со строчной буквы, не иметь точки в конце и использовать императивный тон. Для собственного имени действует исключение.

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

prompts.csv · CC0-1.0
# Git Commit Guidelines for AI Language Models

## Core Principles

1. **Follow Conventional Commits** (https://www.conventionalcommits.org/)
2. **Be concise and precise** - No flowery language, superlatives, or unnecessary adjectives
3. **Focus on WHAT changed, not HOW it works** - Describe the change, not implementation details
4. **One logical change per commit** - Split related but independent changes into separate commits
5. **Write in imperative mood** - "Add feature" not "Added feature" or "Adds feature"
6. **Always include body text** - Never use subject-only commits

## Commit Message Structure

```
<type>(<scope>): <subject>

<body>

<footer>
```

### Type (Required)

- `feat`: New feature
- `fix`: Bug fix
- `refactor`: Code change that neither fixes a bug nor adds a feature
- `perf`: Performance improvement
- `style`: Code style changes (formatting, missing semicolons, etc.)
- `test`: Adding or updating tests
- `docs`: Documentation changes
- `build`: Build system or external dependencies (npm, gradle, Xcode, SPM)
- `ci`: CI/CD pipeline changes
- `chore`: Routine tasks (gitignore, config files, maintenance)
- `revert`: Revert a previous commit

### Scope (Optional but Recommended)

Indicates the area of change: `auth`, `ui`, `api`, `db`, `i18n`, `analytics`, etc.

### Subject (Required)

- **Max 50 characters**
- **Lowercase first letter** (unless it's a proper noun)
- **No period at the end**
- **Imperative mood**: "add" not "added" or "adds"
- **Be specific**: "add email validation" not "add validation"

### Body (Required)

- **Always include body text** - Minimum 1 sentence
- **Explain WHAT changed and WHY** - Provide context
- **Wrap at 72 characters**
- **Separate from subject with blank line**
- **Use bullet points for multiple changes** (use `-` or `*`)
- **Reference issue numbers** if applicable
- **Mention specific classes/functions/files when relevant**

### Footer (Optional)

- **Breaking changes**: `BREAKING CHANGE: <description>`
- **Issue references**: `Closes #123`, `Fixes #456`
- **Co-authors**: `Co-Authored-By: Name <email>`

## Banned Words & Phrases

**NEVER use these words** (they're vague, subjective, or exaggerated):

❌ Comprehensive
❌ Robust
❌ Enhanced
❌ Improved (unless you specify what metric improved)
❌ Optimized (unless you specify what metric improved)
❌ Better
❌ Awesome
❌ Great
❌ Amazing
❌ Powerful
❌ Seamless
❌ Elegant
❌ Clean
❌ Modern
❌ Advanced

## Good vs Bad Examples

### ❌ BAD (No body)
```
feat(auth): add email/password login
```

**Problems:**
- No body text
- Doesn't explain what was actually implemented

### ❌ BAD (Vague body)
```
feat: Add awesome new login feature

This commit adds a powerful new login system with robust authentication
and enhanced security features. The implementation is clean and modern.
```

**Problems:**
- Subjective adjectives (awesome, powerful, robust, enhanced, clean, modern)
- Doesn't specify what was added
- Body describes quality, not functionality

### ✅ GOOD
```
feat(auth): add email/password login with Firebase

Implement login flow using Firebase Authentication. Users can now sign in
with email and password. Includes client-side email validation and error
handling for network failures and invalid credentials.
```

**Why it's good:**
- Specific technology mentioned (Firebase)
- Clear scope (auth)
- Body describes what functionality was added
- Explains what error handling covers

---

### ❌ BAD (No body)
```
fix(auth): prevent login button double-tap
```

**Problems:**
- No body text explaining the fix

### ✅ GOOD
```
fix(auth): prevent login button double-tap

Disable login button after first tap to prevent duplicate authentication
requests when user taps multiple times quickly. Button re-enables after
authentication completes or fails.
```

**Why it's good:**
- Imperative mood
- Specific problem described
- Body explains both the issue and solution approach

---

### ❌ BAD
```
refactor(auth): extract helper functions

Make code better and more maintainable by extracting functions.
```

**Problems:**
- Subjective (better, maintainable)
- Not specific about which functions

### ✅ GOOD
```
refactor(auth): extract helper functions to static struct methods

Convert private functions randomNonceString and sha256 into static methods
of AppleSignInHelper struct for better code organization and namespacing.
```

**Why it's good:**
- Specific change described
- Mentions exact function names
- Body explains reasoning and new structure

---

### ❌ BAD
```
feat(i18n): add localization
```

**Problems:**
- No body
- Too vague

### ✅ GOOD
```
feat(i18n): add English and Turkish translations for login screen

Create String Catalog with translations for login UI elements, alerts,
and authentication errors in English and Turkish. Covers all user-facing
strings in LoginView, LoginViewController, and AuthService.
```

**Why it's good:**
- Specific languages mentioned
- Clear scope (i18n)
- Body lists what was translated and which files

---

## Multi-File Commit Guidelines

### When to Split Commits

Split changes into separate commits when:

1. **Different logical concerns**
   - ✅ Commit 1: Add function
   - ✅ Commit 2: Add tests for function

2. **Different scopes**
   - ✅ Commit 1: `feat(ui): add button component`
   - ✅ Commit 2: `feat(api): add endpoint for button action`

3. **Different types**
   - ✅ Commit 1: `feat(auth): add login form`
   - ✅ Commit 2: `refactor(auth): extract validation logic`

### When to Combine Commits

Combine changes in one commit when:

1. **Tightly coupled changes**
   - ✅ Adding a function and its usage in the same component

2. **Atomic change**
   - ✅ Refactoring function name across multiple files

3. **Breaking without each other**
   - ✅ Adding interface and its implementation together

## File-Level Commit Strategy

### Example: LoginView Changes

If LoginView has 2 independent changes:

**Change 1:** Refactor stack view structure
**Change 2:** Add loading indicator

**Split into 2 commits:**

```
refactor(ui): extract content stack view as property in login view

Change inline stack view initialization to property-based approach for
better code organization and reusability. Moves stack view definition
from setupUI method to lazy property.
```

```
feat(ui): add loading state with activity indicator to login view

Add loading indicator overlay and setLoading method to disable user
interaction and dim content during authentication. Content alpha reduces
to 0.5 when loading.
```

## Localization-Specific Guidelines

### ✅ GOOD
```
feat(i18n): add English and Turkish translations

Create String Catalog (Localizable.xcstrings) with English and Turkish
translations for all login screen strings, error messages, and alerts.
```

```
build(i18n): add Turkish localization support

Add Turkish language to project localizations and enable String Catalog
generation (SWIFT_EMIT_LOC_STRINGS) in build settings for Debug and
Release configurations.
```

```
feat(i18n): localize login view UI elements

Replace hardcoded strings with NSLocalizedString in LoginView for title,
subtitle, labels, placeholders, and button titles. All user-facing text
now supports localization.
```

### ❌ BAD
```
feat: Add comprehensive multi-language support

Add awesome localization system to the app.
```

```
feat: Add translations
```

## Breaking Changes

When introducing breaking changes:

```
feat(api): change authentication response structure

Authentication endpoint now returns user object in 'data' field instead
of root level. This allows for additional metadata in the response.

BREAKING CHANGE: Update all API consumers to access response.data.user
instead of response.user.

Migration guide:
- Before: const user = response.user
- After: const user = response.data.user
```

## Commit Ordering

When preparing multiple commits, order them logically:

1. **Dependencies first**: Add libraries/configs before usage
2. **Foundation before features**: Models before views
3. **Build before source**: Build configs before code changes
4. **Utilities before consumers**: Helpers before components that use them

### Example Order:

```
1. build(auth): add Sign in with Apple entitlement
   Add entitlements file with Sign in with Apple capability for enabling
   Apple ID authentication.

2. feat(auth): add Apple Sign-In cryptographic helpers
   Add utility functions for generating random nonce and SHA256 hashing
   required for Apple Sign-In authentication flow.

3. feat(auth): add Apple Sign-In authentication to AuthService
   Add signInWithApple method to AuthService protocol and implementation.
   Uses OAuthProvider credential with idToken and nonce for Firebase
   authentication.

4. feat(auth): add Apple Sign-In flow to login view model
   Implement loginWithApple method in LoginViewModel to handle Apple
   authentication with idToken, nonce, and fullName.

5. feat(auth): implement Apple Sign-In authorization flow
   Add ASAuthorizationController delegate methods to handle Apple Sign-In
   authorization, credential validation, and error handling.
```

## Special Cases

### Configuration Files

```
chore: ignore GoogleService-Info.plist from version control

Add GoogleService-Info.plist to .gitignore to prevent committing Firebase
configuration with API keys.
```

```
build: update iOS deployment target to 15.0

Change minimum iOS version from 14.0 to 15.0 to support async/await syntax
in authentication flows.
```

```
ci: add GitHub Actions workflow for testing

Add workflow to run unit tests on pull requests. Runs on macOS latest
with Xcode 15.
```

### Documentation

```
docs: add API authentication guide

Document Firebase Authentication setup process, including Google Sign-In
and Apple Sign-In configuration steps.
```

```
docs: update README with installation steps

Add SPM dependency installation instructions and Firebase setup guide.
```

### Refactoring

```
refactor(auth): convert helper functions to static struct methods

Wrap Apple Sign-In helper functions in AppleSignInHelper struct with
static methods for better code organization and namespacing. Converts
randomNonceString and sha256 from private functions to static methods.
```

```
refactor(ui): extract email validation to separate method

Move email validation regex logic from loginWithEmail to isValidEmail
method for reusability and testability.
```

### Performance

**Specify the improvement:**

❌ `perf: optimize login`

✅
```
perf(auth): reduce login request time from 2s to 500ms

Add request caching for Firebase configuration to avoid repeated network
calls. Configuration is now cached after first retrieval.
```

## Body Text Requirements

**Minimum requirements for body text:**

1. **At least 1-2 complete sentences**
2. **Describe WHAT was changed specifically**
3. **Explain WHY the change was needed (when not obvious)**
4. **Mention affected components/files when relevant**
5. **Include technical details that aren't obvious from subject**

### Good Body Examples:

```
Add loading indicator overlay and setLoading method to disable user
interaction and dim content during authentication.
```

```
Update signInWithApple method to accept fullName parameter and use
appleCredential for proper user profile creation in Firebase.
```

```
Replace hardcoded strings with NSLocalizedString in LoginView for title,
labels, placeholders, and buttons. All UI text now supports English and
Turkish translations.
```

### Bad Body Examples:

❌ `Add feature.` (too vague)
❌ `Updated files.` (doesn't explain what)
❌ `Bug fix.` (doesn't explain which bug)
❌ `Refactoring.` (doesn't explain what was refactored)

## Template for AI Models

When an AI model is asked to create commits:

```
1. Read git diff to understand ALL changes
2. Group changes by logical concern
3. Order commits by dependency
4. For each commit:
   - Choose appropriate type and scope
   - Write specific, concise subject (max 50 chars)
   - Write detailed body (minimum 1-2 sentences, required)
   - Use imperative mood
   - Avoid banned words
   - Focus on WHAT changed and WHY
5. Output format:
   ## Commit [N]

   **Title:**
   ```
   type(scope): subject
   ```

   **Description:**
   ```
   Body text explaining what changed and why. Mention specific
   components, classes, or methods affected. Provide context.
   ```

   **Files to add:**
   ```bash
   git add path/to/file
   ```
```

## Final Checklist

Before suggesting a commit, verify:

- [ ] Type is correct (feat/fix/refactor/etc.)
- [ ] Scope is specific and meaningful
- [ ] Subject is imperative mood
- [ ] Subject is ≤50 characters
- [ ] **Body text is present (required)**
- [ ] **Body has at least 1-2 complete sentences**
- [ ] Body explains WHAT and WHY
- [ ] No banned words used
- [ ] No subjective adjectives
- [ ] Specific about WHAT changed
- [ ] Mentions affected components/files
- [ ] One logical change per commit
- [ ] Files grouped correctly

---

## Example Commit Message (Complete)

```
feat(auth): add email validation to login form

Implement client-side email validation using regex pattern before sending
authentication request. Validates format matches standard email pattern
([email protected]) and displays error message for invalid inputs. Prevents
unnecessary Firebase API calls for malformed emails.
```

**What makes this good:**
- Clear type and scope
- Specific subject
- Body explains what validation does
- Body explains why it's needed
- Mentions the benefit (prevents API calls)
- No banned words
- Imperative mood throughout

---

**Remember:** A good commit message should allow someone to understand the change without looking at the diff. Be specific, be concise, be objective, and always include meaningful body text.

© [email protected] · CC0-1.0 · f/prompts.chat

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

Все промпты по теме «Git и GitHub» →

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

Весь набор →
Hallucination Vulnerability Prompt Checker Разбирает ваш промпт на структурные дыры, из-за которых модель начинает выдумывать факты или теряет формат после обновлений. GP ChatGPT ★ 174 597звёзд репо Code Recon Промпт для разбора чужого или своего кода: объясняет логику, оценивает зрелость, ищет уязвимости и выдаёт план правок. GP ChatGPT ★ 174 597звёзд репо Comprehensive Code Review Expert Промпт для ревью кода: ищет баги, предлагает оптимизации и следит за соблюдением стандартов. Пригодится, когда нужно быстро пройтись по чужому коду. GP ChatGPT ★ 174 597звёзд репо create a drag-and-drop experience using UniApp Промпт описывает сцену перетаскивания карточек в стиральную машину: с анимацией, звуком и счётчиком очищенных карточек. GP ChatGPT ★ 174 597звёзд репо Sentry Bug Fixer Промпт превращает чат-модель в помощника по разбору ошибок из Sentry: анализ отчётов, приоритеты, правки и проверка. GP ChatGPT ★ 174 597звёзд репо Code Review Specialist 2 Промпт превращает чат-модель в ревьюера кода: разбирает читаемость, баги, уязвимости и производительность. Пригодится, когда нужно второе мнение по свежему коммиту. GP ChatGPT ★ 174 597звёзд репо File Analysis API with Node.js and Express Промпт для разбора загруженных файлов в API на Express: добавляет логику анализа, не ломая формат ответа. GP ChatGPT ★ 174 597звёзд репо Code Review Expert Промпт превращает чат в ревьюера: разбирает код по качеству, производительности, безопасности и практикам. Пригодится, когда нужен второй взгляд до коммита. GP ChatGPT ★ 174 597звёзд репо

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

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