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.
npx skills add ArcBlock/agent-skills --skill git-hygienegit clone --depth 1 https://github.com/ArcBlock/agent-skillsWrote 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.
[](https://agentmods.dev/skills/arcblock/agent-skills/git-hygiene)<a href="https://agentmods.dev/skills/arcblock/agent-skills/git-hygiene"><img src="https://agentmods.dev/badge/skills/arcblock/agent-skills/git-hygiene/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.
<a href="https://agentmods.dev/skills/arcblock/agent-skills/git-hygiene"><img src="https://agentmods.dev/badge/skills/arcblock/agent-skills/git-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00091 | $0.04511 |
| Opus 5.5 | $0.00036 | $0.01804 |
| Sonnet 5.5 | $0.00018 | $0.00902 |
| Haiku 4.5 | $0.00009 | $0.00451 |
Grade A, and why
git-hygiene 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 295 lines — stays where its author put it; the contents beside it link to each section on GitHub.
git-hygiene
收工 / 合并后的本地 Git 卫生:回默认分支 → 拉最新 → 只清确认无独特工作的 worktree 与本地分支。
与现有 skill 的分工:
| Skill | 做什么 |
|---|---|
| git-hygiene(本 skill) | 回 main、ff-only pull、按「相对 origin/main 是否还有独有提交」清 worktree/分支 |
git-worktree(compound-engineering) |
创建 / 切换 / 交互式清理 .worktrees/ 约定 下的并行 worktree |
blocklet-branch |
按 blocklet 仓库约定开迭代分支 |
本 skill 不替你 merge PR、不 force-push、不 git clean -fdx、不丢 dirty 改动。
触发
- 「切到 main / 拉最新 / 清理没用的 worktree 和 branch」
- 「确认没有未合并工作再删」
- PR 已 merge 后的本地收尾
- 多 agent 并行结束后的主工作区复位
- 「这些 KEEP 的分支是不是该补 PR / 帮我看看最新改动是什么时候 / 仔细核对没合入的话都发 PR」 → 触发 §4.5-4.7 深挖流程(默认 §3-6 主流程不做这一层,太贵;只在用户明确要求时才逐条调查)
默认假设
- 远程名:
origin - 默认分支:优先
origin/HEAD→ 否则main→ 否则master - 删除前提 = 内容已在
origin/<default>上,不是「我记得 merge 了」
硬规则
- 主工作区 dirty → 停。 有 uncommitted 改动时不
checkout、不删分支。先让用户 commit / stash / 明确丢弃。 - 只
git pull --ff-only。 拒绝非快进;有分叉就报告,不 rebase/merge 擅自修。 - 不删仍有独有提交的分支。
git merge-base --is-ancestor <branch> origin/<default>为假 → KEEP,除非走 squash 校验(见下)。 - 不删 dirty / locked worktree。
- 不删当前检出分支(先切到 default)。
- 主 worktree 永不
worktree remove。 - 远程
origin/<branch>已 gone ≠ 本地可删。 gone 只说明远端没了;本地 tip 仍可能有未合入提交。 - 一次审批只管这一次。 用户说「继续清」时仍对 KEEP 列表逐类处理,不默认
branch -D全部 unmerged。
流程
0. 范围
- 默认:当前 repo(
git rev-parse --show-toplevel) - 用户点名多个 repo(如 site + arc):每个 repo 单独跑完整流程,报告分开写
优先跑确定性脚本(inventory;可选 apply)。脚本在 skill 旁:
# From agentloop plugin install (team):
ROOT="${AGENTLOOP_ROOT:-$HOME/.claude/plugins/marketplaces/arcblock-agent-skills/plugins/agentloop}"
# Or when developing in arc SoT:
# ROOT="$(git rev-parse --show-toplevel)/.claude/plugins/agentloop"
bash "$ROOT/skills/git-hygiene/scripts/git-hygiene.sh" inventory
# 审查报告后:
bash "$ROOT/skills/git-hygiene/scripts/git-hygiene.sh" apply --yes
# 多 repo:
bash "$ROOT/skills/git-hygiene/scripts/git-hygiene.sh" inventory /path/to/other-repo
Agent 必须读脚本输出再决策;apply 只处理 SAFE 类。SQUASH_CANDIDATE / KEEP 由 agent 按下面规则处理。
What ships with it
2 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.
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.
- 1mo ago Changed · -1 lines d4c2cf3e2a4f
- 2mo ago Changed · -8 lines · -100 tokens per session caeee3b12b43
- 3mo ago First seen · 304 lines · 191 tokens per session scan A a65c4791b872
git-hygiene is a skill published in the GitHub repository ArcBlock/agent-skills (5 stars, last pushed 22d ago), licensed MIT. It adds 91 tokens to every session and 4,511 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-08-31.
git-hygiene compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| git-hygieneArcBlock/agent-skills | Skill | 5 | 22d ago | MIT | A | 91 | Claude Code |
| merge-batchdiegosouzapw/OmniRoute | Skill | 91k | 3d ago | MIT | A | 46 | Claude Code |
| prowler-commitprowler-cloud/prowler | Skill | 15k | today | Apache-2.0 | A | 44 | Claude Code, Codex |
| gh-auth-isolationgithub/gh-aw | Skill | 5.8k | today | MIT | A | 20 | Claude Code, Codex |
| github-skillzeenie-ai/OpenCompany | Skill | 1.1k | yesterday | MIT | A | 51 | Claude Code |
| comet-githubrpamis/comet | Skill | 3.3k | today | MIT | A | 72 | Claude Code, Codex |
| re0-mergeLilMGenius/paperthin | Skill | 1.5k | today | MIT | A | 51 | Claude Code, Codex |