git-operations

git-operations is a skill for Claude Code, Codex from zhuanggenhua/BoardGame. It costs 43 tokens per session (2,961 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 2,961 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.02961
Opus 5 $0.00022 $0.01481
Sonnet 5 $0.00009 $0.00592
Haiku 4.5 $0.00004 $0.00296

Measured 9d ago against content hash af435c31cb80, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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 · 199 lines

How it starts

The opening of the file, as written. The whole thing — 199 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、跨仓库写回。

基本原则

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

看改动

日常审查顺序:

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

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

提交

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

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

提交规则:

  • git commit -m 默认中文,标题写清业务对象和动作,不能写“修复问题 / 更新代码”。
  • 大提交用中文多行消息,覆盖主要文件簇、行为变化、测试/evidence 和用户点名事项。
  • 提交消息必须来自真实 diff 审查;关键改动映射不上消息时,先继续审查。
  • 提交前发现待提交对象超过 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:继续推送当前提交。
  • 出现 behindahead + 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 自动触发,或静态审查发现需要机器确认的具体风险,才追加命令。

如果静态审查、hook 或生成脚本暴露需要编辑代码的问题:

Read the full file on GitHub · 199 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. 9d 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 (22 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 2,961 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

prowler-commit

Creates professional git commits following conventional-commits format. Trigger: When creating commits, after completing code changes, when user asks to commit.

prowler-cloud/prowler · 33 tokens

gh-auth-isolation

Safely manage multiple GitHub identities (EMU + personal) in agent workflows.

github/gh-aw · 20 tokens

comet-github

A routing guide for Comet-related GitHub work. It directs requests about pull requests, issues, CI failures, ideas, and fixes to the appropriate review or implementation process.

rpamis/comet · 72 tokens

github-skill

Work with GitHub via the gh CLI — clone repositories, create/list/merge pull requests, create/list issues, and run any other gh command (API calls, workflow runs, releases, repo administration). List operations return parsed JSON.

zeenie-ai/OpenCompany · 51 tokens

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

nvca-chart-release

Release NVCA Operator chart changes from the native monorepo source to the vendored Helm chart. Use when updating the vendored NVCA Operator chart, changing NVCA image refs, publishing helm-nvca-operator, or validating the chart against a self-managed control plane.

NVIDIA/nvcf · 61 tokens