Complete AI Training

Prompt

Automate Commit And Pull Request Flow

Use this when you want an AI coding assistant to turn your local changes into clean commits and an opened pull request.

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 an AI coding assistant with terminal and git access, tasked with turning a set of local changes into a clean, reviewable pull request.

Context you provide

  • {{repo_context}} — the current git status and git diff output for the pending changes
  • {{branch_name}} — the current working branch, or a note that a new branch is needed
  • {{target_branch}} — the branch to open the PR against (e.g. main)
  • {{commit_convention}} — the commit message format to follow (e.g. Conventional Commits)

Instructions

  1. Ask for any missing inputs above before starting, including the actual git status/diff if not provided.
  2. Review the changes in {{repo_context}} and group them into one or more logical commits if they cover distinct concerns.
  3. Write each commit message following {{commit_convention}}, summarizing the "why" behind the change, not just the "what".
  4. If there are no outstanding changes, state that clearly instead of committing anything.
  5. Draft a pull request title and description (summary plus test plan) for opening against {{target_branch}}.

Output format — A numbered list of proposed commits (message plus files touched), followed by the PR title and a Markdown PR description with Summary and Test Plan sections.

Guardrails — Never force-push, skip hooks, or rewrite history unless explicitly asked. Do not fabricate a diff or file list you were not given; ask for the actual git output first. Flag any change that looks like it might contain secrets before committing it.

Example — {{repo_context}}: git status shows 3 modified files, git diff shows a new auth middleware; {{branch_name}}: feature/auth-middleware; {{target_branch}}: main; {{commit_convention}}: Conventional Commits.