Skip to main content
Prompts Conventional Git Commit Creator

agent tool_use tool_instruction risk: medium

Conventional Git Commit Creator

Reviews current git status, diff, branch, and recent commits, then creates one or more git commits in conventional commit format using allowed Bash git tools.

  • External action: high

PROMPT

---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
description: Create a git commit
---

## Context

- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`

## Your task

Review the existing changes and then create a git commit following the conventional commit format. If you think there are more than one distinct change you can create multiple commits.

INPUTS

git_status REQUIRED

Output of `git status`

git_diff REQUIRED

Output of `git diff HEAD`

git_branch REQUIRED

Output of `git branch --show-current`

git_log REQUIRED

Output of `git log --oneline -10`

REQUIRED CONTEXT

  • Current git status
  • Current git diff (staged and unstaged changes)
  • Current branch
  • Recent commits

TOOLS REQUIRED

  • Bash(git add:*)
  • Bash(git status:*)
  • Bash(git commit:*

ROLES & RULES

  1. Review the existing changes and then create a git commit following the conventional commit format.
  2. If you think there are more than one distinct change you can create multiple commits.

EXPECTED OUTPUT

Format
unknown

SUCCESS CRITERIA

  • Review the existing changes
  • Create a git commit following the conventional commit format
  • Create multiple commits if there are more than one distinct change

FAILURE MODES

  • Not following conventional commit format
  • Creating single commit for multiple distinct changes
  • Not using allowed git tools

CAVEATS

Dependencies
  • Current git status
  • Current git diff (staged and unstaged changes)
  • Current branch
  • Recent commits
  • Allowed tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*
Missing context
  • Actual output of `git status`, `git diff HEAD`, `git branch --show-current`, and `git log --oneline -10` to replace placeholders.
Ambiguities
  • Exact rules for 'conventional commit format' not defined (e.g., types like feat:, fix:).

QUALITY

OVERALL
0.90
CLARITY
0.90
SPECIFICITY
0.90
REUSABILITY
0.95
COMPLETENESS
0.85

IMPROVEMENT SUGGESTIONS

  • Explicitly define conventional commit format (e.g., '<type>[optional scope]: <description>').
  • Add instruction for handling no changes (e.g., 'If no changes, respond with 'No changes to commit'.').
  • Specify if only certain changes should be committed or all.

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR AGENT