hc-git-workflow

hc-git-workflow is a skill for Claude Code, Codex from harness-base/harness-control. It costs 166 tokens per session (1,788 once invoked), scanned C, original, MIT.

Git workflow guidance for making changes to a Git repository, including branches, commits, merges, rebases, conflict resolution, pushes, and worktrees.

In plain words
What is it for?
It is for creating feature or bug branches, committing, rebasing, merging, resolving conflicts, pushing, opening pull requests, and cleaning up worktrees under defined safety rules.
Why use it?
It separates read-only checks from actions that change history or shared code, and requires authorization for permitted write operations. It also sets checks and repository conventions before publishing changes.

Skill for Claude CodeCodex

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 skills/harness-base/harness-control/hc-git-workflow
Any agent
npx skills add harness-base/harness-control --skill hc-git-workflow
Clone the repo
git clone --depth 1 https://github.com/harness-base/harness-control

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 hc-git-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/harness-base/harness-control/hc-git-workflow.svg)](https://agentmods.dev/skills/harness-base/harness-control/hc-git-workflow)
Your own site
<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="Measured on agentmods" height="20"></a>
Per session 166 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,788 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00166 $0.01788
Opus 5 $0.00083 $0.00894
Sonnet 5 $0.00033 $0.00358
Haiku 4.5 $0.00017 $0.00179

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

Security

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 4d 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 补齐机器拦截);**有授权也不做** |
.agents/skills/hc-git-workflow/SKILL.md · 88 lines

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。动手前先过四步:

  1. git status——确认在哪个分支、工作树干不干净。
  2. git fetch + 核 ahead/behind——本地远程对齐了没。
  3. force-with-lease 用显式远端 SHAgit ls-remote origin <branch> 拿),防本地 remote-tracking 信息 stale:
    git push --force-with-lease=<branch>:<远端SHA> origin <branch>
    
  4. 核目标 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>
    

改完 → 更新 → 合并

  1. 干活、提交都在 feat/ / fix/ 分支上。
  2. 落后 main 时本地 rebase main(不是 merge main,保持历史线性):
    git fetch origin main && git rebase origin/main
    
  3. 冲突在本地解决:逐文件看 <<<<<<< 标记、留对的、git add <file>git rebase --continue;拿不准停下问,别瞎合。
  4. push 分支(rebase 后用 git push --force-with-leasemain 受保护、不可强推)。
  5. 开 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 流程的接口。

三层分工(各管一层,别混):

Read the full file on GitHub · 88 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. 4d ago First seen · 88 lines · 166 tokens per session scan C d1ded17be965

Subscribe to this mod's changes

hc-git-workflow is a skill published in the GitHub repository harness-base/harness-control (22 stars, last pushed 1mo ago), licensed MIT. It adds 166 tokens to every session and 1,788 once invoked, about $0.0008 per session on Opus 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

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.

obra/superpowers · 37 tokens

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.

microsoft/vscode · 62 tokens

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.

microsoft/vscode · 51 tokens

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.

microsoft/vscode · 53 tokens

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…

microsoft/vscode · 71 tokens