Skip to content

commit-push-pr

Manages git workflows: commits, pushes, and pull request creation.

Category: infra
Field: general
License: Other (see repo)
Updated: 2026
Stages:

Commit, Push, and Create PR

Automate the git workflow for completing a feature or fix.

Pre-computed Context

Before proceeding, gather this information: - Current branch: !git branch --show-current - Git status: !git status --short - Recent commits on this branch: !git log --oneline -5 - Diff summary: !git diff --stat

Workflow

  1. Review Changes
  2. Check git status for all modified/added files
  3. Review the diff to understand what's being committed
  4. Ensure no sensitive files are staged (.env, credentials, etc.)

  5. Run Pre-commit Checks

  6. Format code: ruff format . (if Python files changed)
  7. Lint code: ruff check . (if Python files changed)
  8. Run tests: pytest (if tests exist)

  9. Stage and Commit

  10. Stage relevant files: git add <files>
  11. Create a commit with Conventional Commits format:
    • feat: for new features
    • fix: for bug fixes
    • docs: for documentation
    • refactor: for refactoring
    • test: for tests
    • chore: for maintenance
  12. Write a clear, concise commit message focusing on "why"

  13. Push to Remote

  14. Push the branch: git push -u origin HEAD
  15. If branch doesn't exist on remote, create it

  16. Create Pull Request

  17. Use GitHub CLI: gh pr create
  18. Include:
    • Clear title summarizing the change
    • Description with summary and context
    • Reference any related issues
  19. Add appropriate labels if applicable

Arguments

Pass a commit message or leave empty for auto-generated message based on changes.

Usage: /commit-push-pr [optional commit message]

Example: /commit-push-pr feat: add user authentication

Output

Return the PR URL when complete.