git-workflow
帮助团队保持一致的分支与提交策略,降低合并冲突与误操作。
定义并执行严格的 Git 分支、提交与 PR 工作流纪律。
把一套严格的 Git 工作流程落实到日常开发里:先决定分支、阶段性本地 commit(不立刻 push)、六段式 PR 描述、按需建 issue、合并后本地与远端清理。触发场景是开始改动代码、要开分支/提交/推送/开 PR 或合并后清理时。关键点包括禁止在 main 上直接提交、推荐把 git worktree 放到仓库同级或 ~/.worktree/ 以免污染,以及只有本地验证通过才推远端。
▸ 展开 SKILL.md 英文原文
Git workflow discipline — branch decisions before a task, an incremental local-commit rhythm (no immediate push), the six-section PR description, on-demand issue creation, and post-merge cleanup (local branch + remote ref + remote branch). Enforces no direct commits to main, isolated git worktrees (kept outside the repo, under ../ or ~/.worktree/), and pushing only after the whole feature is locally verified. TRIGGER when the user starts any non-main branch task (build a feature / fix a bug / open a branch), prepares to commit/push/open a PR, or cleans up after a merge. | Git 开发流程纪律——覆盖"开始任务前的分支决策"、"阶段性本地 commit 节奏(不立即 push)"、"PR 描述六段式规范"、"按需建 issue 策略"、"合并后清理(本地分支 + 远程引用 + 远程分支)"。强制要求:禁止 main 直接提交、worktree 必须与 repo 隔离存放(置于 ../ 或 ~/.worktree/ 下)、整个功能本地验证后才推送。TRIGGER when:用户开始任何非 main 分支开发任务("做个新功能"/"改 bug"/"开个分支"),或准备 commit/push/开 PR,或 PR 合并完成需要清理时。 Use when this capability is needed.
帮我安装这个 skill:https://raw.githubusercontent.com/tomevault-io/skills-registry/main/0xbb2b--bb-spec--git-workflow/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/tomevault-io/skills-registry/main/0xbb2b--bb-spec--git-workflow/SKILL.md"# Git 工作流纪律 适用于:所有会改动代码的开发任务的完整生命周期。 ## 0. 触发与跳过 **TRIGGER**:开始改动代码的工作 / 提到开分支 / 要求 commit / push / 开 PR / PR 合并后清理。 **SKIP**:纯咨询/阅读、极小打字纠错。 --- ## 1. 分支策略 - **禁止在 main 直接提交** - **允许使用 git worktree**,但工作树必须与当前 repo 物理隔离:放在仓库**同级目录**(如 `../<repo>-<branch>`)或集中到 `~/.worktree/` 下统一管理,**禁止嵌套在当前 repo 工作目录内**(避免污染主仓库、被误 add / commit) ### 开始任务前必查 ```bash git branch --show-current ``` - **在 main** → `git pull` → 创建新分支 - **不在 main** → **必须问用户**:①基于当前分支继续/新开子分支 ②切回 main 后再开新分支。得到答复前不自行切换。 --- ## 2. 阶段性本地 commit - 每完成一个可独立验证的子任务 → `git commit`(本地) - commit message 遵循仓库历史风格(先 `git log --oneline -20` 看一眼) - **禁止阶段性 commit 后立即 push**(本地未推时可 amend/rebase 修正) - 任务队列还有待办 → commit 后直接继续,不中断询问 ---