git-flow

A workflow for managing one feature branch in a Git project, from creation through commits, remote upload, and merging into a test branch.

In plain words
What is it for?
Use it to start feature branches, commit work in sequence, push changes, merge them into testing, and manage the process through a .dev-flow.yml configuration.
Why use it?
It organizes the branch lifecycle and records progress by implementation step, while providing categorized guidance when merging causes 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/linshidream/skill-hub/git-flow
Any agent
npx skills add linshidream/skill-hub --skill git-flow
Clone the repo
git clone --depth 1 https://github.com/linshidream/skill-hub

Made for: Claude Code, Codex.

Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,311 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.00051 $0.03311
Opus 5 $0.00026 $0.01656
Sonnet 5 $0.00010 $0.00662
Haiku 4.5 $0.00005 $0.00331

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

Security

Grade A, and why

git-flow 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 2d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/conflict-analyzer.py, scripts/dev-flow-util.py, scripts/init-branch.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/dev/git-flow/SKILL.md · 370 lines

How it starts

The opening of the file, as written. The whole thing — 370 lines — stays where its author put it; the contents beside it link to each section on GitHub.

开发分支生命周期管理

目标

当用户在一个配置了 .dev-flow.yml 的项目中开发新功能时,使用本 skill 管理 feature 分支的完整生命周期:创建分支、按实施步骤提交代码、推送远程、合并到测试分支,并在合并冲突时提供分类报告和解决建议。

V1 只管理单 feature 分支。即使 dev-spec 产出多个 implementation step,也在同一个 feat/{developer}/{feature} 分支内顺序提交。step branch 和 worktree 留作 V2,不在本 skill 中自动创建。

使用场景

当用户说出类似需求时触发:

  • "拉一个新分支开发 xxx 功能"
  • "创建 feature 分支"
  • "提交代码"
  • "推送到远程"
  • "合并到测试分支"
  • "把代码合到 test"

前置条件

项目根目录存在 .dev-flow.yml 配置文件,至少包含以下字段:

project:
  name: my-app
developers:
  zx: { name: your-name }
branching:
  production: master

完整配置参见 examples/dev-flow.example.yml

阶段设计

本 skill 分为 5 个阶段,每个阶段可独立触发,也可通过编排器串联执行。

Phase 1: init — 创建 feature 分支

前置条件:

  • 当前在项目仓库根目录
  • .dev-flow.yml 存在且 branching 配置合法
  • 工作区干净(无未提交变更)

执行流程:

  1. 读取 .dev-flow.ymlbranching.production 字段
  2. git fetch origin
  3. git checkout {production} && git pull origin {production}
  4. 根据 branching.pattern 构造分支名
    • {developer} 从参数或活动状态文件获取
    • {feature} 从 spec slug 获取,或由用户指定
  5. git checkout -b {branch-name}
  6. 解析运行时状态路径:per-feature 模式(默认)下状态文件写到 .dev-flow/states/<feature>.json 并把活动指针 .dev-flow/active 指向该 feature;single 模式或显式 --state 覆盖时维持原行为
  7. 更新状态文件:phase=branched,记录 branchdeveloperfeature 和 history 事件

输出:分支名

异常处理:

  • 工作区有未提交变更 → 提示用户先 stash 或 commit
  • 远程已存在同名分支 → 提示用户确认是续开发还是重新开始

命令:

bash scripts/init-branch.sh --developer zx --feature user-points

如只想执行 Git 操作、不写运行时状态,可追加 --no-state

Phase 2: commit — 提交变更

前置条件:

  • 当前在 feature 分支上
  • 有已暂存或未暂存的变更
  • 如果 .dev-flow-state.json 存在 implementation.current-step,提交内容应只覆盖当前 step 的合理范围

执行流程:

  1. git status 查看变更范围
  2. 检查是否包含敏感文件(.envcredentials*secret**key**password*)→ 阻断并警告
  3. 如果存在当前 step,核对改动是否与 step 的 suggested-scopeacceptance 一致
  4. 如果有 lint/test 配置,运行与当前 step 相关的检查
  5. git add {具体文件}(不用 git add -A
  6. git commit -m "{message}"
  7. 将 commit hash、message、文件列表和 step id 追加到 .dev-flow-state.json
  8. 输出 commit hash 和 summary

异常处理:

  • 包含敏感文件 → 阻断并警告,列出被拦截的文件
  • commit hook 失败 → 不用 --no-verify,修复后重新 commit
  • 改动明显跨越后续 step → 暂停并让用户确认是否扩大当前 step 范围

Read the full file on GitHub · 370 lines

Files

What ships with it

9 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.

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. 2d ago First seen · 370 lines · 51 tokens per session scan A b4024e1fa6ec

Subscribe to this mod's changes

git-flow is a skill published in the GitHub repository linshidream/skill-hub (19 stars, last pushed 21d ago), licensed MIT. It adds 51 tokens to every session and 3,311 once invoked, about $0.0003 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-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

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 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

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens