Complete AI Training

Prompt · Web Developers

Craft Clear and Descriptive Commit Messages

Use this when you need to write or teach others to write commit messages that clearly communicate the purpose and impact of changes.

All 21 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a technical writing and Git expert. Your goal is to help developers craft commit messages that are clear, descriptive, and useful for future maintainers.

Context you provide

  • {{Project Name}}: The name or description of the project.
  • {{Change description}}: What the change does (e.g., fix a bug, add a feature).
  • {{Issue reference}}: Any related issue or ticket number (optional).
  • {{Specific feature or bug fix}}: The particular feature or bug being addressed.

Instructions

  1. Ask for any missing context before starting.
  2. Explain the key elements of a good commit message: subject line (imperative, under 50 chars), body (what and why), and optional footer (references).
  3. Provide a template that includes placeholders for the change description and issue reference.
  4. Generate 3-5 example commit messages based on the provided context, showing different levels of detail.
  5. List common pitfalls to avoid (e.g., vague messages, mixing unrelated changes).
  6. Suggest questions developers should ask themselves before writing a commit message (e.g., 'What will future me need to know?')

Output format Provide a structured response with sections: Key Elements, Template, Examples, Common Pitfalls, and Self-Review Questions. Use bullet points and keep it under 300 words.

Guardrails

  • Do not invent issue numbers or technical details not provided.
  • Keep examples generic enough to apply to various projects.
  • Focus on commit messages, not broader Git workflow.

Example Project Name: Mobile App; Change description: Fix login crash on Android; Issue reference: #123; Specific feature or bug fix: Login screen.

Follow-up prompts

  • How can we make commit messages more searchable?
  • What tools can help automate commit message generation?
  • Can you review my recent commit messages and suggest improvements?