git-commit-pr

git-commit-pr is a skill for Claude Code from SummerSec/SumSec-Skills. It costs 48 tokens per session (4,475 once invoked), scanned A, original, Apache-2.0.

A Git workflow assistant for safely creating commits, pushing branches to a remote repository, and opening pull or merge requests. A commit records changes, while a pull or merge request asks others to review them.

In plain words
What is it for?
Use it when you explicitly need to commit code, push a branch, create a pull or merge request, or complete all three steps.
Why use it?
It checks the repository and branch state first, helps avoid committing sensitive files or unrelated changes, and handles common submission problems.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dev-tools plugin — 10 skills shipped together

Good fit Use it when you explicitly need to commit code, push a branch, create a pull or merge request, or complete all three steps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/summersec/sumsec-skills/git-commit-pr
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.

Any agent
npx skills add SummerSec/SumSec-Skills --skill git-commit-pr
Clone the repo
git clone --depth 1 https://github.com/SummerSec/SumSec-Skills

Made for: Claude Code.

Or install dev-tools, the plugin that ships this one along with the rest of its 10 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-commit-pr

README.md
[![agentmods](https://agentmods.dev/badge/skills/summersec/sumsec-skills/git-commit-pr/github.svg)](https://agentmods.dev/skills/summersec/sumsec-skills/git-commit-pr)
Your own site
<a href="https://agentmods.dev/skills/summersec/sumsec-skills/git-commit-pr"><img src="https://agentmods.dev/badge/skills/summersec/sumsec-skills/git-commit-pr/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-commit-pr

Your own site · 80×15
<a href="https://agentmods.dev/skills/summersec/sumsec-skills/git-commit-pr"><img src="https://agentmods.dev/badge/skills/summersec/sumsec-skills/git-commit-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,475 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00048 $0.04475
Opus 5.5 $0.00019 $0.01790
Sonnet 5.5 $0.00010 $0.00895
Haiku 4.5 $0.00005 $0.00447

Measured 3mo ago against content hash 8abb25959e7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-commit-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 3mo ago.

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.

dev-tools/skills/git-commit-pr/SKILL.md · 372 lines

How it starts

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

Git Commit & PR 自动化助手

用于在真实仓库里安全地完成 commit、push、PR/MR。
目标不是“机械跑命令”,而是先识别仓库状态、分支状态、远程状态和平台能力,再选择合适路径执行。

核心能力

  • 识别用户目标:仅提交、仅创建 PR/MR、提交并创建 PR/MR
  • 识别仓库状态:工作区脏/净、当前分支、是否跟踪远程、默认基线分支
  • 基于仓库历史生成更贴近本仓库风格的 commit message
  • 先处理分支,再提交,再推送,再创建 PR/MR,避免顺序错误
  • 优先使用 gh CLI 自动创建 PR,失败时降级为平台链接
  • 覆盖常见失败路径:未登录、无远程、远程拒绝、分支冲突、hook 失败、无可创建 PR 的提交

操作边界

  • 只在用户明确要求“提交 / 推送 / 创建 PR/MR”时执行这些动作。
  • 不要默认 git add .;先列出变更,再确认是“全部提交”还是“指定文件提交”。
  • 不要提交疑似敏感文件,如 .env、密钥、凭证、tokens、私钥导出文件;若用户坚持,先明确提醒风险。
  • 不要擅自改 git config。
  • 不要默认使用 --force / --force-with-lease / --amend / --no-verify;只有用户明确同意后才能使用。
  • 若当前在 master / main 且要新增本地提交,优先新建分支,不要直接在主干上开发式提交。
  • 若工作区有与本次目标无关的脏改动,先让用户决定是只暂存相关文件,还是拆分处理。

入口判断

先确认用户属于哪一种目标,再走对应路径:

  1. 仅提交
    • 用户要求“帮我 commit / 提交代码”,但没有要求创建 PR/MR。
  2. 仅创建 PR/MR
    • 工作区已经干净,且当前分支已有本地提交,用户只想发 PR/MR。
  3. 提交并创建 PR/MR
    • 用户希望从本地修改一路完成到远程 PR/MR。

若用户描述不清,先问一句:
“你是要我只提交 commit,还是要连 push 和 PR 一起做?”

执行前快照

开始前至少检查以下信息:

  • git status --short --branch
  • git diff --stat
  • git diff --cached --stat
  • git log --pretty=format:"%s" -n 20
  • git branch --show-current
  • git remote -v

若要创建 PR,再补:

  • git remote show origin 或等价命令,确认默认基线分支
  • gh auth status
  • 当前分支是否已跟踪远程
  • git diff <base-branch>...HEAD --stat,确认确实有 PR 内容

工作流程

1. 环境前置检查

  • 执行 git status,确保当前目录是 git 仓库。
  • 检查 git remote -v,确认至少存在一个远程。
  • 若存在多个远程(如 origin、upstream),在推送和建 PR 前确认使用哪个远程。
  • 若用户要创建 GitHub PR,检查 gh auth status;未登录则提示用户先登录,或降级为创建链接。

2. 变更状态分析

  • 列出未暂存、已暂存、未跟踪文件,区分:
    • unstaged
    • staged
    • untracked
  • 若工作区干净:
    • 且当前分支相对基线已有提交:可直接进入 push / PR。
    • 且没有新增提交:提示“没有可提交或可建 PR 的内容”。
  • 若工作区不干净:
    • 先确认提交范围,而不是默认整仓提交。
  • 若检测到疑似敏感文件:
    • 中断自动提交,先向用户确认。

3. 暂存策略

  • 默认顺序:
    1. 展示改动文件清单
    2. 让用户确认“全部提交”还是“指定文件提交”
    3. 再执行 git add <files>
  • 只有当用户明确表示“全部一起提交”时,才可使用整批暂存。
  • 若仓库中已有用户自己的脏改动,优先只暂存本次相关文件,避免误提交。

4. 分支管理

  • 获取当前分支名 git branch --show-current。
  • 若当前分支为 master 或 main:
    • 若用户只是补一个历史 commit 且明确要求直接在当前分支提交,再按用户意图执行。
    • 否则优先创建新分支再提交。
  • 推荐分支命名:
    • feat/<description>
    • fix/<description>
    • docs/<description>
    • refactor/<description>
    • chore/<description>
  • 分支检查点:
    • 名称合法
    • 本地是否已存在
    • 远程是否已存在
    • 是否需要切换到已有分支而不是新建
  • 若当前已经在功能分支上,则沿用当前分支。

Read the full file on GitHub · 372 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. 3mo ago First seen · 372 lines · 48 tokens per session scan A 8abb25959e7b

Subscribe to this mod's changes

git-commit-pr is a skill published in the GitHub repository SummerSec/SumSec-Skills (8 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 48 tokens to every session and 4,475 once invoked, about $0.0002 per session on Opus 5.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.

Related

git-commit-pr compared with skills from other repositories

git-commit-pr next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-commit-prSummerSec/SumSec-SkillsSkill81mo agoApache-2.0A48Claude Code
github-publish-changesDevin-AXIS/iPolloWorkSkill7.5kyesterdaynoneA41Claude Code
code-review-zhgongyijie85/mattpocock-skills-dsh-zhSkill812d agoMITA109Claude Code, Codex
gh-publishStarfie1d1272/dsh-github-skillsSkill52d agoApache-2.0A47Claude Code, Codex
~commithellowind777/helloagentsSkill7112mo agononeA21Claude Code
git-workflowgongyijie85/dsh-eccSkill1312d agoMITA54Claude Code, Codex
commitzprolab/WhaleKitSkill23mo agononeA23Claude Code, Codex