commit-push-pr

A workflow for committing code to Git, sending it to a remote repository, and creating or merging a pull request. Git is a system for tracking code changes, and a pull request is a proposed change for review.

In plain words
What is it for?
Use it to inspect changes, choose a commit type, check for sensitive files, simplify modified code, create a commit, push it, and handle the pull request.
Why use it?
It organizes the checks and review steps needed to turn local changes into a shared, reviewable update.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/sumulige/sumulige-claude/commit-push-pr
Clone the repo
git clone --depth 1 https://github.com/sumulige/sumulige-claude

Made for: Claude Code.

Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 566 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.00566
Opus 5 $0.00007 $0.00283
Sonnet 5 $0.00003 $0.00113
Haiku 4.5 $0.00001 $0.00057

Measured yesterday against content hash f730a6babc3a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

commit-push-pr scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/commit-push-pr.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are tasked with creating a git commit, pushing to remote, and handling the pull request workflow.

Step 1: Gather Information

First, run these commands in parallel to understand the current state:

git status
git diff --staged
git log -3 --oneline
git diff HEAD~3..HEAD --stat

Step 2: Analyze and Plan

Analyze the changes and:

  1. Determine what type of change this is (feat, fix, docs, refactor, test, chore)
  2. Identify the main purpose of the changes
  3. Check if there are any sensitive files that shouldn't be committed

Step 3: Code Simplification (Before Commit)

IMPORTANT: Before creating the commit, simplify and refine the code changes:

  1. Review the recently modified code sections
  2. Apply code simplification focusing on:
    • Code clarity and consistency
    • Reducing unnecessary complexity and nesting
    • Eliminating redundant code and abstractions
    • Following project standards (if CLAUDE.md exists)
    • Preserving exact functionality
  3. Use explicit, readable code over overly compact solutions

Trigger phrases to apply simplification:

  • "简化此代码" (Simplify this code)
  • "使这更清晰" (Make this clearer)
  • "优化此实现" (Optimize this implementation)

Ask the user: "是否需要简化代码?(Need code simplification?)" - if yes, apply code-simplifier agent before proceeding.

Step 4: Stage and Commit

If there are unstaged changes that should be included, ask the user first.

Then create a commit with a clear message following this format:

<type>: <brief description>

<optional detailed explanation>

Co-Authored-By: Claude Opus 4.5 <[email protected]>

Step 5: Push and Create PR

  1. Push the changes to remote
  2. Check if there's an open PR for this branch using:
    gh pr list --head $(git branch --show-current)
    
  3. If PR exists, ask if user wants to update it
  4. If no PR, create one using gh pr create with:
    • A clear title based on the commit message
    • A body with:
      • Summary of changes (2-3 bullet points)
      • Test plan (checklist)
      • Link to any related issues

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 80 lines · 14 tokens per session scan A f730a6babc3a

Subscribe to this mod's changes

commit-push-pr is a command published in the GitHub repository sumulige/sumulige-claude (2 stars, last pushed 6mo ago), licensed MIT. It adds 14 tokens to every session and 566 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.