git-workflow · diff

v1.2.0 to v1.4.0

56 added, 43 removed. Audit A to A.

---
name: git-workflow
- description: Standard git workflow for handling staged changes on existing branch - add, commit, and push
- description_zh: 在现有分支上处理已暂存代码的标准 git 工作流程 - 添加、提交和推送
- version: 1.2.0
+ description: Standard git workflow for handling changes on the current branch - add, commit, push, then optionally trigger MR generation
+ description_zh: Standard git workflow on current branch with optional handoff to mr-generator after push.
+ version: 1.4.0
author: Pulse Coder Team
---
# Git Workflow Skill
- 这个 skill 提供了一个简化的 git 工作流程,专注于在当前分支上处理更改,不创建新分支。
+ This skill provides a streamlined git workflow for handling changes on the current branch without creating a new branch.
- ## 工作流程步骤
+ ## Workflow Steps
- ### 1. 检查当前状态
+ ### 1. Check current status
```bash
git status
```
- 检查当前分支状态,识别:
- - 已修改的文件 (modified files)
- - 未跟踪的文件 (untracked files)
- - 已暂存的文件 (staged files)
+ Review the branch state and identify:
+ - Modified files
+ - Untracked files
+ - Staged files
- ### 2. 添加更改到暂存区
+ ### 2. Stage changes
```bash
git add <files...>
```
- 根据情况选择:
- - `git add .` - 添加所有更改
- - `git add -A` - 添加所有文件(包括删除的)
- - `git add <specific-files>` - 只添加特定文件
+ Choose based on context:
+ - `git add .` - stage all current changes
+ - `git add -A` - stage all changes including deletions
+ - `git add <specific-files>` - stage only selected files
- ### 3. 提交更改
+ ### 3. Commit changes
```bash
git commit -m "<type>: <short description>"
```
- 提交消息格式:
- ```
+ Recommended commit message format:
+ ```text
<type>: <short description>
- - <详细描述点1>
- - <详细描述点2>
+ - <detail 1>
+ - <detail 2>
```
- 类型包括:
- - `feat` - 新功能
- - `fix` - 修复
- - `refactor` - 重构
- - `docs` - 文档
- - `style` - 格式调整
- - `test` - 测试
- - `chore` - 构建/工具
+ Common types:
+ - `feat` - new feature
+ - `fix` - bug fix
+ - `refactor` - refactor
+ - `docs` - documentation
+ - `style` - formatting/style only
+ - `test` - tests
+ - `chore` - tooling/build/maintenance
- ### 4. 推送到远程仓库
+ ### 4. Push to remote
```bash
git push
```
- ## 快速工作流程
+ ### 5. Ask whether to run `mr-generator`
+ After a successful `git push`, ask the user whether to continue with `mr-generator`:
+ - If user confirms (for example: `y`, `yes`, `confirm`): invoke `mr-generator` skill
+ - If user declines (for example: `n`, `no`, `cancel`): finish workflow without extra actions
+ Suggested prompt:
+ ```text
+ Git workflow completed. Do you want to run mr-generator now?
+ ```
+
+ ## Quick Flow
+
```bash
- # 一键完成
+ # End-to-end quick run
git status
git add .
- git commit -m "描述更改内容"
+ git commit -m "Describe your changes"
git push
+ # Then ask whether to run mr-generator
```
- ## 选择性工作流程
+ ## Selective Flows
- ### 只添加特定文件
+ ### Stage only specific paths
```bash
git add src/ docs/
- git commit -m "feat: 更新核心功能和文档"
+ git commit -m "feat: update core feature and docs"
git push
```
- ### 分批次提交
+ ### Split into multiple commits
```bash
git add src/app.ts
- git commit -m "feat: 添加新功能"
+ git commit -m "feat: add new feature"
git add tests/
- git commit -m "test: 添加对应测试"
+ git commit -m "test: add corresponding tests"
git push
```
- ## 验证步骤
+ ## Validation Checklist
- 完成每个步骤后验证:
- 1. `git status` - 确认工作目录干净
- 2. `git log --oneline -3` - 查看最新提交
- 3. `git branch` - 确认当前分支
+ After each run, verify:
+ 1. `git status` - working tree is clean
+ 2. `git log --oneline -3` - latest commits look correct
+ 3. `git branch` - current branch is expected
+ 4. After successful `git push`, confirm whether MR creation flow (`mr-generator`) is needed
+