gitflow

A set of Gitflow rules for managing code changes with Git, a version-control system. Gitflow separates production code in main from ongoing work in develop and uses feature, release, and emergency-fix branches.

In plain words
What is it for?
Use it to guide branch creation, pull requests, merges, releases, hotfixes, semantic versioning, and commit naming.
Why use it?
It gives teams a consistent process for reviews, releases, version tags, branch protection, and commit messages.

Cursor rule for Cursor

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 rules/wangtingyeye/llm-agent-study/gitflow
Clone the repo
git clone --depth 1 https://github.com/WangTingYeYe/llm-agent-study

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 731 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.00000 $0.00731
Opus 5 $0.00000 $0.00365
Sonnet 5 $0.00000 $0.00146
Haiku 4.5 $0.00000 $0.00073

Measured yesterday against content hash 93bc0cb53bbd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gitflow 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 yesterday.

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.

.cursor/rules/common/gitflow.mdc · 114 lines

What it actually says

Gitflow工作流规则

主分支

main(或master)

  • 包含生产就绪代码
  • 永远不要直接提交到main分支
  • 只接受来自以下分支的合并:
    • hotfix/* 分支
    • release/* 分支
  • 每次合并后必须使用版本号标记

develop

  • 主开发分支
  • 包含最新交付的开发变更
  • 功能分支的源分支
  • 永远不要直接提交到develop分支

支持分支

feature/*

  • 从develop分支创建
  • 合并回:develop
  • 命名约定:feature/[issue-id]-描述性名称
  • 示例:feature/123-user-authentication
  • 创建PR前必须与develop分支保持同步
  • 合并后删除

release/*

  • 从develop分支创建
  • 合并回:
    • main
    • develop
  • 命名约定:release/vX.Y.Z
  • 示例:release/v1.2.0
  • 仅进行bug修复、文档编写及与发布相关的任务
  • 不添加新功能
  • 合并后删除

hotfix/*

  • 从main分支创建
  • 合并回:
    • main
    • develop
  • 命名约定:hotfix/vX.Y.Z
  • 示例:hotfix/v1.2.1
  • 仅用于紧急生产环境修复
  • 合并后删除

提交信息

  • 格式:type(scope): description
  • 类型:
    • feat: 新功能
    • fix: Bug修复
    • docs: 文档变更
    • style: 格式调整、缺失分号等
    • refactor: 代码重构
    • test: 添加测试
    • chore: 维护任务

版本控制

语义化版本

  • MAJOR版本用于不兼容的API变更
  • MINOR版本用于向后兼容的功能性变更
  • PATCH版本用于向后兼容的bug修复

Pull Request规则

  1. 所有变更必须通过Pull Request进行
  2. 所需批准:至少1个
  3. CI检查必须通过
  4. 不允许直接提交到受保护分支(main, develop)
  5. 合并前分支必须保持最新
  6. 合并后删除分支

分支保护规则

main和develop

  • 要求Pull Request审核
  • 要求状态检查通过
  • 要求分支保持最新
  • 限制规则包括管理员
  • 禁止强制推送
  • 禁止删除

发布流程

  1. 从develop创建release分支
  2. 更新版本号
  3. 修复任何与发布相关的问题
  4. 创建PR到main
  5. 合并到main后:
    • 标记发布
    • 合并回develop
    • 删除release分支

热修复流程

  1. 从main创建hotfix分支
  2. 修复问题
  3. 更新patch版本号
  4. 创建PR到main
  5. 合并到main后:
    • 标记发布
    • 合并回develop
    • 删除hotfix分支
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. yesterday First seen · 114 lines · 0 tokens per session scan A 93bc0cb53bbd

Subscribe to this mod's changes

gitflow is a cursor rule published in the GitHub repository WangTingYeYe/llm-agent-study (4 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 731 tokens. 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.