git-branch

git-branch is a skill for Claude Code, Codex from w693847022/memory_service. It costs 19 tokens per session (926 once invoked), scanned A, original, MIT.

A Git branch management guide for feature and bug-fix work. Git branches are separate lines of development that let changes be prepared before they are merged into another branch.

In plain words
What is it for?
Use it to prepare a feature or fix branch, return to the starting branch, pull updates, merge changes, create a commit, add a tag, and clean up the development branch.
Why use it?
It standardizes how development branches are created, tracked, merged, and tagged. It also describes checks for protecting the main branch and handling merge conflicts.

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/w693847022/memory_service/git-branch
Any agent
npx skills add w693847022/memory_service --skill git-branch
Clone the repo
git clone --depth 1 https://github.com/w693847022/memory_service

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 git-branch

README.md
[![agentmods](https://agentmods.dev/badge/skills/w693847022/memory_service/git-branch.svg)](https://agentmods.dev/skills/w693847022/memory_service/git-branch)
Your own site
<a href="https://agentmods.dev/skills/w693847022/memory_service/git-branch"><img src="https://agentmods.dev/badge/skills/w693847022/memory_service/git-branch.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 926 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.00019 $0.00926
Opus 5 $0.00010 $0.00463
Sonnet 5 $0.00004 $0.00185
Haiku 4.5 $0.00002 $0.00093

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

Security

Grade A, and why

git-branch 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 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.

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.

examples/skills/git-branch/SKILL.md · 129 lines

What it actually says

Git 分支管理技能

为 feature-dev 和 bug-fix 技能提供 Git 分支管理功能。


用法

git-branch prepare <id> <type>  # 准备开发分支
git-branch merge <id> <type>    # 合并开发分支

参数说明:

  • id: feature 或 fix 的记录 ID (如 feat_20260321_1)
  • type: 类型,featurefix

prepare 命令

目标: 在代码修改前准备开发分支

流程

  1. 检查当前分支

    • 获取当前分支名
    • 检查是否为 main 或 master
    • 如果是主干分支,提示用户切换到其他分支并退出
  2. 保存起始分支

    • 将当前分支名保存到环境变量或临时文件
    • 用于后续合并回原分支
  3. 创建开发分支

    • 根据类型生成分支名:
      • feature: feature-{id}
      • fix: fix-{id}
    • 检查分支是否已存在
      • 存在: 直接切换使用
      • 不存在: 创建并切换

输出格式

## 分支准备完成

- 起始分支: <branch_name>
- 开发分支: <dev_branch_name>
- 分支状态: <新建/已存在>

错误处理

场景 处理方式
当前在 main/master 提示用户切换分支,退出并返回错误
Git 命令失败 显示错误信息,退出

merge 命令

目标: 在代码完成后合并开发分支回原分支

流程

  1. 获取起始分支

    • 从环境变量或临时文件读取起始分支名
    • 如果不存在,提示用户输入起始分支名
  2. 切换回起始分支

    • 切换到起始分支
  3. 拉取远程更新

    • 执行 git pull 确保分支最新
  4. 合并开发分支

    • 合并开发分支到起始分支
    • 如果有冲突,尝试自动解决:
      • 使用 git merge -X theirsgit merge -X ours
      • 如果无法自动解决,提示用户手动处理
  5. 生成提交信息

    • 调用 git-commit 技能生成提交信息
    • 执行提交
  6. 打 tag

    • 使用开发分支名作为 tag 名
    • 执行 git tag <dev_branch_name>
  7. 删除开发分支

    • 执行 git branch -D <dev_branch_name>

输出格式

## 分支合并完成

- 起始分支: <branch_name>
- 开发分支: <dev_branch_name>
- Tag: <tag_name>
- 提交信息: <commit_message>

错误处理

场景 处理方式
起始分支不存在 提示用户输入起始分支名
合并冲突无法自动解决 保留冲突状态,提示用户手动处理
提交失败 显示错误信息,保留分支状态

注意事项

  1. 必须在非主干分支执行: 技能会检查当前分支,main/master 分支会拒绝执行
  2. 分支命名规则: feature-{id} 或 fix-{id},确保唯一性
  3. Tag 规则: 使用开发分支名作为 tag 名
  4. 冲突处理: 优先尝试自动解决,失败则让用户手动处理
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 · 129 lines · 19 tokens per session scan A 740c55c61453

Subscribe to this mod's changes

git-branch is a skill published in the GitHub repository w693847022/memory_service (1 stars, last pushed 3mo ago), licensed MIT. It adds 19 tokens to every session and 926 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-31.

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