Skip to main content
Prompts Git Commit Push PR Automator

agent tool_use tool_instruction risk: high

Git Commit Push PR Automator

Review git changes from provided status, diff, branch, and log; create one or more conventional commits if changes exist; push commits; then open a PR to main using allowed Bash to…

  • Policy sensitive
  • Human review
  • External action: high

PROMPT

---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*), Bash(git push:*), Bash(gh pr create:*)
description: Commit and push everything then open a PR request to main
---

## 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

1. 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. If there are no outstanding changes proceed to 2.
2. Push all commits.
3. Open a PR to main following the conventional formats.

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:*)
  • Bash(git push:*)
  • Bash(gh pr create:*

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.
  3. If there are no outstanding changes proceed to 2.
  4. Push all commits.
  5. Open a PR to main following the conventional formats.

EXPECTED OUTPUT

Format
plain_text

SUCCESS CRITERIA

  • Review existing changes
  • Create git commit(s) following conventional commit format
  • Push all commits
  • Open a PR to main following conventional formats

FAILURE MODES

  • May not properly review changes from git status and diff
  • May create non-conventional commits
  • May push without staging all changes
  • May open PR to wrong branch

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:*), Bash(git push:*), Bash(gh pr create:*)
Missing context
  • Definition or examples of conventional commit format.
  • Guidelines for PR title and body.
  • Assumptions about gh CLI setup and authentication.
Ambiguities
  • Does not explicitly define 'conventional commit format'.
  • Unclear what 'conventional formats' means for the PR (title, body, etc.).

QUALITY

OVERALL
0.85
CLARITY
0.90
SPECIFICITY
0.85
REUSABILITY
0.90
COMPLETENESS
0.80

IMPROVEMENT SUGGESTIONS

  • Add a brief description or link to conventional commits spec.
  • Specify PR format, e.g., 'Use the commit message as PR title and add a description summarizing changes.'
  • Include instruction to verify git status before committing and handle no-changes case explicitly.

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