git-operations

git-operations is a skill for Claude Code, Codex from zhuanggenhua/BoardGame. It costs 43 tokens per session (3,223 once invoked), scanned A, original, MIT.

A set of rules for carrying out Git tasks in a specific project, such as reviewing changes, committing, pushing, merging, or using worktrees. Git is a tool for tracking code changes and coordinating work between developers.

In plain words
What is it for?
Use it when reviewing a worktree, preparing a commit, pushing code, syncing a main branch, handling a failed pre-push check, or working with branches, forks, pull requests, merges, and worktrees.
Why use it?
It reduces accidental changes to unrelated work and prevents risky Git actions from being taken without clear permission. It also sets boundaries for what belongs in a commit and what should be checked first.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it when reviewing a worktree, preparing a commit, pushing code, syncing a main branch, handling a failed pre-push check, or working with branches, forks, pull requests, merges, and worktrees.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhuanggenhua/boardgame/git-operations
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 zhuanggenhua/BoardGame --skill git-operations
Clone the repo
git clone --depth 1 https://github.com/zhuanggenhua/BoardGame

Made for: Claude Code, Codex.

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-operations

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhuanggenhua/boardgame/git-operations"><img src="https://agentmods.dev/badge/skills/zhuanggenhua/boardgame/git-operations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,223 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00043 $0.03223
Opus 5.5 $0.00017 $0.01289
Sonnet 5.5 $0.00009 $0.00645
Haiku 4.5 $0.00004 $0.00322

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

Security

Grade A, and why

git-operations 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 28d 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.

.spec/skills/git-operations/SKILL.md · 208 lines

How it starts

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

Git 操作 Skill

本 skill 只规定本项目里的 Git 操作边界。根 AGENTS.md 保留不可越过的红线;复杂提交、推送、PR、worktree 和 merge 细则以本文为准。

触发

用户要求以下动作时使用:

  • git status、diff、commit、push。
  • “检查一下没问题就提交 / 看下再推”。
  • 同步 main、处理 pre-push、远端失败。
  • PR、merge、fork、worktree、跨仓库写回。

基本原则

  • 默认工作区可能是脏的,陌生改动先判断影响;无关就绕开,不顺手清。
  • 不擅自 stash、restore、checkout --、clean、reset、rebase、revert。
  • 不擅自创建、切换、删除分支或 worktree。
  • Git 操作只处理用户当前授权目标,不自动升级成同步主线、修 bug、跑专项验证或整理全仓。
  • 需要用户判断时先说现实含义,再给代码证据;不要只甩测试名、字段名或错误码。

看改动

日常审查顺序:

  1. git status --short --branch
  2. git diff --stat
  3. 按目标读取关键文件 diff

审查时先把改动分类:用户可见行为、业务规则、测试/mock/fixture、生成物/evidence、文档规范、纯格式。拿不准、会恢复旧行为、触及用户刚修链路、改生产逻辑、改测试期望、影响 E2E 证据或合并裁定时,先上报现实含义和风险,不直接吞进提交。

提交

默认只提交本轮明确范围内的改动。

用户说“都提交 / 全修改 / 所有修改 / 全部改动”时,解释为审查当前仓库内已暂存、未暂存和未跟踪文件;不包含 ignored 文件。

提交规则:

  • git commit -m 默认中文,标题写清业务对象和动作,不能写“修复问题 / 更新代码”。
  • 大提交用中文多行消息,覆盖主要文件簇、行为变化、测试/evidence 和用户点名事项。
  • 提交消息必须来自真实 diff 审查;关键改动映射不上消息时,先继续审查。
  • 本轮只要实际执行了 git commit,阶段汇报或最终汇报必须回报完整提交消息:单提交至少列出提交 SHA、标题和正文要点;多提交逐条列出,后续为修 hook / push / deploy 追加的修复提交也必须一起回报。
  • 提交前发现待提交对象超过 10MB,先判断是否应进仓库;诊断、trace、视频、临时 evidence、构建产物、日志和压缩包默认不提交。超过 50MB 需强理由;超过 100MB 视为 GitHub 推送硬阻塞。
  • 涉及 i18n 或可见文案时,首次提交前默认跑 npm run i18n:check 或等价最小检查。

提交切线:

  • 当目标是“检查后提交 / 提交后 push”时,以首次提交前完成的审查和暂存范围作为本次提交切线。
  • git commit 成功后新出现的未跟踪、截图、测试输出、后台产物或并发改动,默认不纳入本次提交。
  • 若后续 push 的 hook 失败且必须修改当前已提交内容才能通过,才回到门禁修复路径。

推送

目标涉及 push 时,默认先 git fetch --prune origin。fetch 只更新远端跟踪信息,不等于授权 pull、merge、rebase 或 stash。

fetch 后:

  • 只是 ahead N:继续推送当前提交。
  • 出现 behind 或 ahead + behind:不得自动 pull / merge / rebase / stash;说明远端已有新提交,让用户选择合并主线继续当前 PR、从最新主线重开、或暂缓同步。
  • 用户当轮已明确要求“处理远端更新后继续推 / 同步后再推 / 合并远端再推 / 改到能 push”时,先锁定合并方向、工作区归属和双边范围,再推进。

push 失败先分网络/协议、hook、真实测试失败、权限失败。GitHub 403 / Permission denied / Write access denied 通常表示不能直推上游主仓;贡献代码默认切 fork + PR,而不是索要上游写权限。

绕过门禁、guard 或预算限制不是默认动作;没有用户当轮明确允许,不使用 --no-verify 或 bypass 环境变量。

“检查后提交/推”的动作上限

“检查没问题 / 看下再提交 / 看下再推”默认是静态审查后 Git 动作,不等于主动跑测试,也不等于授权修复。

即使 diff 含 UI,也不得自动启动 UI 审计、截图、Playwright、E2E、构建、lint 或 typecheck。只有用户点名、Git hook 自动触发,或静态审查发现需要机器确认的具体风险,才追加命令。

Read the full file on GitHub · 208 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. 28d ago Changed · +8 lines 6e466bc942d3
  2. 1mo ago Changed · +1 lines 06690b6de957
  3. 1mo ago First seen · 199 lines · 43 tokens per session scan A af435c31cb80

Subscribe to this mod's changes

git-operations is a skill published in the GitHub repository zhuanggenhua/BoardGame (24 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 3,223 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-30.