git-smart-commit

git-smart-commit is a skill for Claude Code, Codex from hmj1026/dhpk. It costs 104 tokens per session (3,277 once invoked), scanned A, original, MIT.

A Git workflow that groups a messy set of staged and unstaged changes into logically related commits. A commit is a recorded set of changes in Git, and the workflow provides commands for creating each group.

In plain words
What is it for?
Use it to inspect current changes, divide them by purpose, and prepare separate add-and-commit commands. It supports limiting the review to a path and selecting a commit type.
Why use it?
It prevents unrelated work from being bundled into one confusing commit. It also avoids use when there is only one small change or when merge or rebase conflicts are still unresolved.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present. Also seen: mentions CLAUDE.md; mentions Gemini CLI.

Part of the dhpk plugin — 42 skills, 32 agents, 2 hooks shipped together

Good fit Use it to inspect current changes, divide them by purpose, and prepare separate add-and-commit commands. It supports limiting the review to a path and selecting a commit type.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hmj1026/dhpk/git-smart-commit
View source ↗ hmj1026/dhpk
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 hmj1026/dhpk --skill git-smart-commit
Clone the repo
git clone --depth 1 https://github.com/hmj1026/dhpk

Made for: Claude Code, Codex.

Or install dhpk, the plugin that ships this one along with the rest of its 42 skills, 32 agents, 2 hooks.

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-smart-commit

README.md
[![agentmods](https://agentmods.dev/badge/skills/hmj1026/dhpk/git-smart-commit/github.svg)](https://agentmods.dev/skills/hmj1026/dhpk/git-smart-commit)
Your own site
<a href="https://agentmods.dev/skills/hmj1026/dhpk/git-smart-commit"><img src="https://agentmods.dev/badge/skills/hmj1026/dhpk/git-smart-commit/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-smart-commit

Your own site · 80×15
<a href="https://agentmods.dev/skills/hmj1026/dhpk/git-smart-commit"><img src="https://agentmods.dev/badge/skills/hmj1026/dhpk/git-smart-commit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,277 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.00104 $0.03277
Opus 5.5 $0.00042 $0.01311
Sonnet 5.5 $0.00021 $0.00655
Haiku 4.5 $0.00010 $0.00328

Measured 13d ago against content hash 15768823f70b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-smart-commit 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 13d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/collect-changes.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/dhpk/skills/git-smart-commit/SKILL.md · 192 lines

How it starts

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

Git Smart Commit — 智慧拆分提交

Run this skill only on an explicit user request; otherwise stop and ask before any stage or side effect.

將目前所有 staged / unstaged 變更,依功能邏輯分群後,逐批 git add + git commit。

When NOT to Use

  • 只有單一檔案、單一目的且預期只需要 1 個 commit。
  • 目前在 merge/rebase 衝突中,尚未完成衝突解決。
  • 使用者要求「只生成一筆 commit」或「僅提供訊息模板」。

Public options and execution guard

--scope <path> limits collection; --type <type> selects the commit type; --ai-co-author opts into the approved trailer. $SKILL_DIR is the installed directory containing this file.

Commit only within explicit user authorization. Reuse existing authorization for the same scope; plans and successful checks do not grant commit authority. Run the consumer project's required precommit checks before committing code. Preserve the existing index, partial staging, unrelated work and normal Git hooks. Inspect each staged diff and exclude secrets, credentials and unreviewed files. Do not bypass hooks or use destructive Git operations to force completion. Report failed checks and stop dependent commits.

流程

1. 收集摘要並閱讀相關變更

從 consumer 專案根目錄或子目錄執行唯讀收集器(若 $SKILL_DIR/scripts/collect-changes.js 不存在或無法執行,例如純指引 Directory Plugin 環境,請依 manual procedure 執行對應階段並標記 mode: manual):

node "$SKILL_DIR/scripts/collect-changes.js" [--scope <path>]

$SKILL_DIR 是已安裝技能目錄。收集器原始碼見 scripts/collect-changes.js。--scope 是 repo-relative literal path;它限制檔案清單,但仍會回報範圍外的 staged 內容。收集器只讀取 Git 狀態與統計,不輸出 diff 或檔案內容,也不執行 hooks。

摘要提供 repoRoot、起始 head、files、safety 與 hooks;hook 資訊不代表已執行或通過。解讀欄位或處理收集失敗時,閱讀 collector contract。

若收集器不存在、退出非零、JSON 無效或輸出不完整,回報摘要未完成並停止提交流程,不推斷「沒有變更」或「沒有 hook」。若 files 沒有範圍內變更,先檢查 safety,尤其範圍外 staged;確認沒有待處理安全狀態後,再回報目前範圍無需提交。

摘要只用來選出待檢查的功能群。將 shell 工作目錄切換到輸出中的 repoRoot,依功能群建立完整且可複製的 literal pathspec 清單,再批次閱讀該群的 staged 與 unstaged diff;新增的未追蹤檔案要閱讀檔案內容。rename 必須同時列出來源與目的路徑,並保留每個查詢的完整 stdout 供審查:

git --literal-pathspecs diff -- <group-path-1> <group-path-2>
git --literal-pathspecs diff --cached -- <group-path-1> <group-path-2>

Read the full file on GitHub · 192 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 13d ago Changed · -10 lines · +18 tokens per session 15768823f70b
  2. 15d ago Changed · +3 lines b1f70ca400f3
  3. 1mo ago Changed · +2 lines 652a5ca5dd78
  4. 1mo ago Changed 0a8b5b2304f1
  5. 1mo ago Changed · +8 lines 27914fb053a1
  6. 1mo ago Changed · -1 lines 0db779db1995
  7. 2mo ago First seen · 190 lines · 86 tokens per session scan A d8e9eed8596b

Subscribe to this mod's changes

git-smart-commit is a skill published in the GitHub repository hmj1026/dhpk (2 stars, last pushed yesterday), licensed MIT. It adds 104 tokens to every session and 3,277 once invoked, about $0.0004 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-09-24.

Related

git-smart-commit compared with skills from other repositories

git-smart-commit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-smart-commithmj1026/dhpkSkill2yesterdayMITA104Claude Code, Codex
avatar-contribution-prkhromov/codebaySkill167d agoMITA0Claude Code
unslop-commitMohamedAbdallah-14/unslopSkill20310d agoMITA139Claude Code
evolve-lite:unpublishAgentToolkit/altk-evolveSkill1432d agoApache-2.0A23Claude Code, Codex
commitnitinjain999/platform-skillsSkill743d agoApache-2.0A74Claude Code
doneendlessblink/master-planSkill262d agoMITA52Claude Code
codex-adapterwrg32786/aigent-osSkill26yesterdayMITA38Claude Code