AgentSkillsCN

branch-strategy

Gantry Board 项目的分支命名规范、合并规则、工作树模式以及保护设置。在创建分支、执行合并或设置工作树时,请务必参考这些规范。

SKILL.md
--- frontmatter
name: branch-strategy
description: Branch naming conventions, merge rules, worktree patterns, and protection settings for the Gantry Board project. Reference this when creating branches, merging, or setting up worktrees.
user-invocable: false

Branch Strategy

Branch Structure

BranchPurposeBaseMerge target
mainReleased stable code
developDevelopment integrationmainmain (via release)
feat/<task-id>-<slug>New featuredevelopdevelop
fix/<task-id>-<slug>Bug fixdevelopdevelop
refactor/<slug>Refactoringdevelopdevelop
release/<version>Release preparationdevelopmain + develop
hotfix/<slug>Emergency fixmainmain + develop

Branch Naming

  • Use lowercase, hyphens for spaces
  • Include task/issue ID when applicable
  • Examples: feat/42-kanban-board, fix/15-websocket-reconnect, refactor/simplify-executor

Merge Rules

develop

  • Direct push: Allowed (small changes, TDD cycle commits, docs)
  • From feature/fix branches: PR required, squash merge
  • Force push: Prohibited

main

  • Direct push: Prohibited
  • From release branches: PR required, merge commit, tag with version
  • From hotfix branches: PR required, merge commit, also merge back to develop
  • Force push: Prohibited

Worktree Naming Convention

Use git worktrees for parallel development:

code
../<repo>-<branch-type>-<task-id>

Examples:

code
../gantry_board-feat-42       # feature branch worktree
../gantry_board-fix-15        # fix branch worktree
../gantry_board-release-0.2   # release branch worktree

Workflow

Feature Development

code
git checkout develop
git pull origin develop
git checkout -b feat/<task-id>-<slug>
# ... develop with TDD commits ...
# Create PR to develop (squash merge)

Release

code
git checkout develop
git checkout -b release/<version>
# ... version bump, changelog ...
# Create PR to main (merge commit)
# Tag: v<version>
# Merge back to develop

Hotfix

code
git checkout main
git checkout -b hotfix/<slug>
# ... fix ...
# Create PR to main (merge commit)
# Tag: v<version>
# Merge back to develop

GitHub Branch Protection

BranchPR requiredForce pushDirect push
mainYesBlockedBlocked
developNoBlockedAllowed

Scaling Note

When the team grows, consider requiring PRs for all merges to develop.