Get the FREE Ultimate OpenClaw Setup Guide →

commit-push-pr

npx machina-cli add skill dceoy/ai-coding-agent-skills/commit-push-pr --openclaw
Files (1)
SKILL.md
1.6 KB

Commit, Push, and PR Skill

Create a commit from current changes, push to a remote branch, and open a pull request in a single workflow.

When to Use

  • After completing a feature or fix and wanting to open a PR in one step.
  • When all changes are ready to commit, push, and submit for review.

Agent Compatibility

This skill is tool-agnostic and can be executed by Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, or Gemini CLI.

Inputs

  • Current repository with uncommitted changes (staged or unstaged).

If there are no changes to commit, report that and stop.

Workflow

  1. Gather context by running these commands in parallel:

    git status
    git diff HEAD
    git branch --show-current
    
  2. Create a new branch if currently on main (or the repository's default branch). Use an appropriate branch name based on the changes.

  3. Stage and commit all relevant changes with a concise, descriptive commit message summarizing the changes.

  4. Push the branch to origin:

    git push -u origin <branch-name>
    
  5. Create a pull request using the GitHub CLI:

    gh pr create --title "<title>" --body "<description>"
    

    Include a clear title and summary of changes in the PR body.

All steps should be executed as efficiently as possible, combining independent operations.

Outputs

  • A new git commit on the current or newly created branch.
  • The branch pushed to origin.
  • A pull request created on GitHub (URL printed to console).

Source

git clone https://github.com/dceoy/ai-coding-agent-skills/blob/main/skills/commit-push-pr/SKILL.mdView on GitHub

Overview

This skill automates a complete git workflow: commit all changes (staged and unstaged), push the branch to origin, and create a pull request using the GitHub CLI. It streamlines the path from local changes to a review-ready PR, saving time and reducing context switching.

How This Skill Works

The skill inspects the repo context with git status, git diff HEAD, and the current branch. If you're on the default branch, it creates a new feature branch, then stages and commits changes with a concise message. Finally, it pushes the branch to origin and invokes gh pr create with a title and body to publish a PR.

When to Use It

  • After finishing a feature or fix and want a PR in one step.
  • When changes are ready to commit, push, and submit for review.
  • When you want to minimize manual steps and speed up code review.
  • When starting from the default branch and needing a new feature branch.
  • When using a tool-agnostic CLI workflow to create a PR quickly.

Quick Start

  1. Step 1: Gather context with git status, git diff HEAD, and git branch --show-current.
  2. Step 2: If on main, create a new feature branch; stage and commit changes with a concise message.
  3. Step 3: Push to origin and create the PR: gh pr create --title <title> --body <description>.

Best Practices

  • Ensure there are meaningful, concise commit messages that summarize the changes.
  • Create a feature branch off the default branch when working from main.
  • Verify there are changes to commit before proceeding; otherwise report and halt.
  • Provide a clear PR title and a descriptive body to aid reviewers.
  • Validate the PR URL prints to the console and monitor CI status after creation.

Example Use Cases

  • Finish a bug fix across several files, commit, push to origin, and open a PR in one step.
  • Implement a UI tweak on a new feature branch and automatically create a PR with a summary.
  • Refactor module structure, push the branch, and generate a PR with a descriptive title.
  • Update documentation alongside code changes and open a PR for review.
  • Apply a hotfix, push to origin, and create a PR using the GitHub CLI.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers