git-guide

A reference guide for Git commits, branches, and commit-message formats. Git is a tool for tracking code changes and working safely with versions of a project.

In plain words
What is it for?
Use it when deciding when to commit, naming branches, writing commit messages, and following the project's Git workflow.
Why use it?
It explains when to create small commits and how to name them, making changes easier to review, undo, and trace.

Command

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/xiaobei930/cc-best/git-guide
Clone the repo
git clone --depth 1 https://github.com/xiaobei930/cc-best
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 722 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.00021 $0.00722
Opus 5 $0.00010 $0.00361
Sonnet 5 $0.00004 $0.00144
Haiku 4.5 $0.00002 $0.00072

Measured 2d ago against content hash 238d33057237, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-guide 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 2d 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.

commands/git-guide.md · 103 lines

What it actually says

/git-guide - Git 提交规范

定义提交时机、频率和规范。

提交时机

必须提交

时机 理由
完成一个原子任务 保证可回滚
完成一个功能模块 里程碑记录
修复一个 bug 问题追溯
重要配置变更 变更追踪
下班/长时间中断前 状态保存

不要提交

情况 原因
代码不可运行 破坏主分支
测试未通过 引入问题
有调试代码 不专业
包含敏感信息 安全风险

提交频率

任务类型 建议频率
新功能开发 每个函数/类完成后
Bug 修复 每个 bug 修复后
重构 每个文件完成后
文档更新 批量更新后
配置变更 每次变更后

原则: 宁可提交多,不要提交少。小步提交便于回滚和追溯。

Commit Message 规范

格式

<type>(<scope>): <subject>

<body>

Type 类型

type 说明 示例
feat 新功能 feat(auth): add login feature
fix Bug 修复 fix(api): correct validation
docs 文档 docs: update architecture
style 格式 style: format with prettier
refactor 重构 refactor(core): simplify logic
test 测试 test(api): add unit tests
chore 构建/工具 chore: update dependencies

Subject 规则

  • 动词开头:add, fix, update, remove, refactor
  • 不超过 50 字符
  • 不加句号

分支策略

main/master (受保护)
  ↑
develop (日常开发)
  ↑
feature/xxx (功能分支)
  ↑
fix/xxx (修复分支)

分支命名

  • feature/user-auth
  • fix/login-error
  • refactor/api-structure

提交前检查

# 自动检查清单
- [ ] git status 确认变更范围
- [ ] git diff 检查具体修改
- [ ] 无调试代码 (print, console.log)
- [ ] 无敏感信息 (.env, secrets)
- [ ] 代码可运行
- [ ] 测试通过(如有)

记住: Git 操作不可逆,提交前三思:文件是否正确、信息是否清晰、分支是否对。

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. 2d ago First seen · 103 lines · 21 tokens per session scan A 238d33057237

Subscribe to this mod's changes

git-guide is a command published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 21 tokens to every session and 722 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-30.