Agent skill · Workflow & Productivity

git-workflow

安全处理 Git 状态检查、提交信息、commit、分支、push、PR 和 rebase。用于用户要求检查改动、生成或创建提交、管理分支、推送、发起 PR 或整理历史时;严格区分每个动作的授权,并保护工作树中已有和无关的修改。

laolaoshirengithub.com/laolaoshirenGitHub ↗
claude-codeMIT
Install
npx skills add laolaoshiren/claude-code-skills-zh --skill git-workflow --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Path: skills/git-workflow/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 725
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Git 工作流助手 ## 核心原则 - 只执行用户明确要求的 Git 动作。生成提交信息不等于暂存或提交;提交不等于推送;创建 PR 不等于合并 PR、关闭 Issue 或发布 Release。 - 把工作树中已有、未跟踪和无关的修改视为用户资产,不覆盖、不回退、不混入本轮提交。 - 优先使用非交互命令。涉及历史重写、冲突选择或远程覆盖时降低自动化程度。 ## 工作流程 ### 1. 读取仓库规则与状态 先阅读适用的 `AGENTS.md`、`CONTRIBUTING.md`、README、提交规范和 CI 说明,再检查: ```bash git status --short --branch git diff git diff --cached git log --oneline -10 git remote -v git branch -vv ``` 同时识别未跟踪文件、当前分支、upstream、远程差异和已有失败。不得只看 staged diff。 ### 2. 明确动作与文件范围 把用户请求拆成独立授权: | 动作 | 默认权限 | |------|----------| | 分析状态、生成 commit message 或 PR 文案 | 只读 | | 暂存、commit | 仅用户要求后执行,只选本轮相关文件 | | 创建或切换分支 | 仅用户明确要求时执行;实现流程需要但未获授权时,先说明原因并取得同意 | | fetch、push、创建 PR | 分别确认在请求范围内,不互相推导 | | merge、关闭 Issue、发布 Release | 必须有明确授权 | | rebase、修改已发布历史、强制更新远程 | 高风险,必须明确授权并满足额外条件 | 存在无关改动时不得使用 `git add .` 或 `git add -A`。逐个暂存目标文件,并用 `git diff --cached` 复核。 ### 3. 规划原子提交 - 根据真实 diff 判断 `feat`、`fix`、`docs`、`refactor`、`test`、`perf` 或 `chore`。 - 沿用仓库近期提交的语言、scope 和格式。 - 一个提交只表达一项可独立理解和验证的改动。 - `Closes #123` 仅在对应 Issue 确实应由该提交自动关闭时使用。 提交信息遵循: ```text <type>(<scope>): <简短描述> <必要时说明原因、关键实现和兼容性> <关联 Issue 或 Breaking Change> ``` ### 4. 验证后执行 提交前先检查验证脚本是否会下载依赖、访问外部服务或产生其他状态,再运行与改动相关的测试、lint、构建或文档检查,并记录实际命令和退出状态。可能产生外部副作用时先取得授权。基线已有失败时

What's inside
Steps it walks through
  1. 核心原则
  2. 工作流程
  3. 1. 读取仓库规则与状态
  4. 2. 明确动作与文件范围
  5. 3. 规划原子提交
  6. 4. 验证后执行
  7. 5. 创建 PR
  8. Rebase 与历史整理边界
  9. 输出
Commands it runs
git status --short --branch
git diff
git diff --cached
git log --oneline -10
git remote -v
git branch -vv
git show --stat --oneline HEAD
More from claude-code-skills-zh
All skills →
About this skill
What does the git-workflow skill do?

安全处理 Git 状态检查、提交信息、commit、分支、push、PR 和 rebase。用于用户要求检查改动、生成或创建提交、管理分支、推送、发起 PR 或整理历史时;严格区分每个动作的授权,并保护工作树中已有和无关的修改。

How do I install it?

Run `npx skills add laolaoshiren/claude-code-skills-zh --skill git-workflow --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From laolaoshiren/claude-code-skills-zh, a repository with 725 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going