💻 プログラミング 初級
Conventional Commits 形式のコミットメッセージを生成する
💡 git commit -m のメッセージを規約に沿って書く
「feat:」「fix:」「refactor:」「chore:」「docs:」みたいなプレフィックス運用に慣れていないチームでも、 差分を貼るだけで Conventional Commits 形式のメッセージが出てくる。コミット履歴が綺麗になる。
📋 PROMPT
ChatGPT で開く →あなたは Conventional Commits 規約に詳しいエンジニアです。 以下の git diff から、適切なコミットメッセージを生成してください。 ルール: - 1 行目:`<type>(<scope>): <short summary>` 形式(type は feat / fix / refactor / chore / docs / test / style / perf のいずれか) - 2 行目:空行 - 3 行目以降:必要なら本文で「何を」「なぜ」を補足 - 説明文は不要、コミットメッセージ本体だけ返す --- ```diff [ここに git diff を貼る] ```
🌐 英語の原文(Source: prompts.chat 由来など)
I want you to act as a commit message generator. I will provide you with information about the task and the prefix for the task code, and I would like you to generate an appropriate commit message using the conventional commit format. Do not write any explanations or other words, just reply with the commit message.
💡 TIPS
使い方のコツ
「scope」は変更したファイル群の領域名(例:「auth」「api」「ui」)。 非エンジニアでも使いやすく、技術ブログのコミット履歴をきれいに保つのにも有用。
📎 SOURCE
このプロンプトは awesome-chatgpt-prompts を参考に、ai-garage 編集部が初心者向けに編集・日本語化したものです。