Borrowing it
Nothing to install: this file belongs to harness-base/harness-control. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/harness-base/harness-control/main/.agents/skills/hc-git-workflow/SKILL.mdgit clone --depth 1 https://github.com/harness-base/harness-controlWrote 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/harness-base/harness-control/hc-git-workflow)<a href="https://agentmods.dev/skills/harness-base/harness-control/hc-git-workflow"><img src="https://agentmods.dev/badge/skills/harness-base/harness-control/hc-git-workflow/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/harness-base/harness-control/hc-git-workflow"><img src="https://agentmods.dev/badge/skills/harness-base/harness-control/hc-git-workflow.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.00166 | $0.01788 |
| Opus 5.5 | $0.00066 | $0.00715 |
| Sonnet 5.5 | $0.00033 | $0.00358 |
| Haiku 4.5 | $0.00017 | $0.00179 |
Grade C, and why
hc-git-workflow scanned grade C with 1 finding 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 2mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
| **高危禁止** | `reset --hard` / 裸强推(`--force` / `-f`,任意分支——一律用 `--force-with-lease`)/ 直推·强推 `main`(main 只走 PR merge)/ `rm -rf` | hook 会拦(ADR-0025 补齐机器拦截);**有授权也不做** | How it starts
The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Git Workflow
git 写操作可能不可逆(reset / 删分支 / 强推),未授权的提交 / 推送会污染历史。先授权、走约定。
何时用 / 何时不用
- 用:建分支 / 提交 / 合并 / rebase / 解冲突 / 推送 / worktree。
- 不用:只读查询(status / log / diff)随意。
操作三档分级表(rule-0006)
| 档 | 操作 | 规矩 |
|---|---|---|
| 只读随意 | status / log / diff / fetch / ls-remote | 不用问,随时跑 |
| 写需授权 | commit / push / rebase 后强推(仅 --force-with-lease 形态)/ 删分支 / 改 remote / tag |
先问用户;授权不跨批——上一批的"提交吧"不延续到下一批新改动,新改动要重新授权 |
| 高危禁止 | reset --hard / 裸强推(--force / -f,任意分支——一律用 --force-with-lease)/ 直推·强推 main(main 只走 PR merge)/ rm -rf |
hook 会拦(ADR-0025 补齐机器拦截);有授权也不做 |
- 不直接在
main上干活。
发布前起手式(只挂发布类操作前)
发布类操作 = push / 合并 / rebase 后强推 / 开 PR。动手前先过四步:
git status——确认在哪个分支、工作树干不干净。git fetch+ 核 ahead/behind——本地远程对齐了没。- force-with-lease 用显式远端 SHA(
git ls-remote origin <branch>拿),防本地 remote-tracking 信息 stale:git push --force-with-lease=<branch>:<远端SHA> origin <branch> - 核目标 PR 状态(如
gh pr view)——防"PR 已被合了还往老分支推"。
有效期 = 本轮对话:同一轮内查过不重查;跨轮、或有理由怀疑远端变了(如用户说"我合了")才重查。commit 等本地操作不强制查。
分支约定
- 需求分支
feat/<desc>、bug 分支fix/<desc>,都从最新main切。 - Claude Code 自动开的 worktree 分支(
claude/<auto>,前缀不可配)无视它——在 worktree 里手动切自己的需求/bug 分支:git fetch origin main git switch -c feat/<desc> origin/main # bug 修复用 fix/<desc>
改完 → 更新 → 合并
- 干活、提交都在
feat//fix/分支上。 - 落后 main 时本地
rebase main(不是 merge main,保持历史线性):git fetch origin main && git rebase origin/main - 冲突在本地解决:逐文件看
<<<<<<<标记、留对的、git add <file>、git rebase --continue;拿不准停下问,别瞎合。 - push 分支(rebase 后用
git push --force-with-lease;main受保护、不可强推)。 - 开 PR 到
main,CI 绿 + review 才合,合并方式 = merge commit。
备注:SSH 不通的环境(sandbox)push 走:
git -c credential.helper='!gh auth git-credential' push https://github.com/<org>/<repo>.git <branch>
CI 处理(工程级快门,通用不针对具体项目)
CI = 工程级 / 运维级的事故拦截,不针对某个需求、不针对某个具体工程。权威口径见 docs/harness/CI.md;这里讲它跟 git 流程的接口。
三层分工(各管一层,别混):
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.
- 2mo ago First seen · 88 lines · 166 tokens per session scan C d1ded17be965
hc-git-workflow is a skill published in the GitHub repository harness-base/harness-control (22 stars, last pushed 3mo ago), licensed MIT. It adds 166 tokens to every session and 1,788 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
merge-batch
Prepare and merge an owner-selected PR batch with contributor credit and exact-candidate admission. Use for a pasted PR list; combined focused validation is diagnostic, and every actual landing still requires its applicable checks and authorization.
prowler-commit
Creates professional git commits following conventional-commits format. Trigger: When creating commits, after completing code changes, when user asks to commit.
gh-auth-isolation
Safely manage multiple GitHub identities (EMU + personal) in agent workflows.
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.
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.
release-helper
Ensures configuration and code changes are released correctly. Use PROACTIVELY whenever you edit config.json, change any setting, or fix a configuration bug in this project, so the change reaches production.