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 agentmods add skills/arcblock/agent-skills/git-hygienenpx 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.svg" alt="Measured on agentmods" 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 | $0.00191 | $0.04645 |
| Opus 5 | $0.00096 | $0.02322 |
| Sonnet 5 | $0.00038 | $0.00929 |
| Haiku 4.5 | $0.00019 | $0.00464 |
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 3d 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 — 304 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.
- 3d 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 3d ago), licensed MIT. It adds 191 tokens to every session and 4,645 once invoked, about $0.0010 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-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
auto-perf-optimize
Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.
chat-perf
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…