agentleFS
liuxiao20051106-progliuxiao20051106-prog/claude-skills/git-workflow/SKILL.md

git-workflow

Skill1 starsChanged 3 months agoMITView on GitHub

规范化 Git 工作流:Conventional Commits 提交、PR 描述自动生成、分支命名、pre-commit 检查清单。用户说"提交代码"、"写commit"、"PR描述"、"分支命名"、"git规范"、"commit规范"时触发。

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use squad-commands, ci-cd-pipelines and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Microsoft AzureSkill

    squad-commands

    Categorized catalog of common Squad operations. Coordinator reads this file and presents it as an interactive menu when the user asks for available commands or help.

    Also in 5 projects that use this

  • harrissohail6Skill

    ci-cd-pipelines

    CI/CD pipeline design and implementation. Auto-activates when discussing deployment, automation, or pipelines.

    Also in 6 projects that use this

  • Microsoft AzureSkill

    architectural-proposals

    How to write comprehensive architectural proposals that drive alignment before code is written

    Also in 4 projects that use this

  • GitHubSkill

    e2e-template-testing

    End-to-end validation of coordinator and agent template changes

    Also in 3 projects that use this

  • GitHubSkill

    notification-routing

    Route agent notifications to specific channels by type — prevent alert fatigue from single-channel flooding

    Also in 3 projects that use this

  • frostneySkill

    native-nostalgia-stack

    Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.

    Also in 3 projects that use this

  • +5 more from Azure
  • +1 more from github

The file

Files
SKILL.md

git-workflow · Git 工作流规范

规范化日常 Git 操作,让提交历史干净、PR 描述完整、分支命名一致。

流程

1. 提交代码(commit)

分析暂存区变更,生成符合 Conventional Commits 的 message:

git diff --cached --stat          # 变更范围
git diff --cached --name-only     # 受影响文件

格式:

<type>(<scope>): <简短描述>

<详细说明 — 做了什么、为什么、影响范围>

type 选择:

type用在哪
feat新功能
fix修 bug
refactor重构(不改功能)
perf性能优化
docs文档
style格式(空格、分号)
test测试
chore构建/依赖/工具
ciCI/CD

原则:

  • subject 用祈使句:add 不用 added/adds,中文用动词开头
  • scope 可选但要精准:(auth) (upload) (api)
  • 不超过 72 字符(英文)/ ~35 字(中文)
  • 一个 commit 只做一件事
  • 不提交调试代码、临时文件、注释掉的代码

输出:生成 message 后,询问确认再执行 git commit -m "..."

2. PR 描述

对比当前分支和 base 分支,生成结构化 PR:

## 做了什么
- <变更概要 1>
- <变更概要 2>

## 为什么这样做
<一句话说明动机>

## 影响范围
- 改动的模块/文件
- 是否破坏性变更:是 / 否

## 测试
- [ ] 单测通过
- [ ] 手动验证路径:<步骤>

## 截图(如有 UI 变更)
<附在这里>

原则:

  • 自动从 commit history 提取变更概要
  • 检测 BREAKING CHANGE 自动标注
  • 关联 issue:有 #123 格式的自动链接
  • 不确定"为什么"时询问用户

3. 分支命名

检查当前分支名是否符合规范,不符合则建议重命名:

规范:

<type>/<简短描述>
前缀用途示例
feat/新功能feat/user-avatar
fix/修复fix/login-crash
refactor/重构refactor/auth-module
docs/文档docs/api-guide
chore/杂项chore/update-deps
release/发布release/v1.5.0
hotfix/紧急修复hotfix/oom-on-export
  • 全小写,- 分隔词,不用 _
  • 不以数字开头
  • 不超过 40 字符

4. Pre-commit 检查清单

提交前逐项确认:

  • 没有遗留 console.log / debugger / TODO 标记
  • 没有注释掉的代码
  • 没有临时测试文件
  • 相关测试已更新且通过
  • 新依赖已记录在 package.json / Cargo.toml 等
  • 没有多余的格式化改动(只改了你能解释的)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.