SuperAPI AI 工具集

git-workflow

编程与开发

查看项目

更新于 10-15 16:29

技能介绍

用途

git-workflow 是一个 Git 工作流助手技能,帮助用户按照最佳实践处理提交(commits)、分支(branches)和拉取请求(pull requests)。

主要能力

提交消息规范

提交消息的生成与验证使用脚本 get_skill_script("git-workflow", "commit_message.py")。

格式:

<type>(<scope>): <subject>

<body>

<footer>

支持的提交类型:

  • feat:新功能
  • fix:错误修复
  • docs:仅文档
  • style:格式调整,不改变代码
  • refactor:既不修复错误也不添加功能的代码改动
  • perf:性能改进
  • test:添加或更新测试
  • chore:维护任务

示例一:

feat(auth): add OAuth2 login support

Implemented OAuth2 authentication flow with Google and GitHub providers.
Added token refresh mechanism and session management.

Closes #123

示例二:

fix(api): handle null response from external service

Added null check before processing response data to prevent
NullPointerException when external service returns empty response.

Fixes #456

分支命名

格式:

<type>/<ticket-id>-<short-description>

示例:

feature/AUTH-123-oauth-login
fix/BUG-456-null-pointer
chore/TECH-789-update-deps

拉取请求(PR)规范

标题:遵循提交消息格式。

描述模板:

## Summary
Brief description of what this PR does.

## Changes
- Change 1
- Change 2

## Testing
How was this tested?

## Checklist
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] No breaking changes

使用方式:常用命令

开始工作:

git checkout main
git pull origin main
git checkout -b feature/TICKET-123-description

提交:

git add -p  # Interactive staging
git commit -m "type(scope): description"

更新分支:

git fetch origin
git rebase origin/main

创建 PR:

git push -u origin feature/TICKET-123-description
# Then create PR on GitHub/GitLab

适用场景

适用于需要在团队中统一提交消息、分支命名与拉取请求描述规范的开发工作流。

限制

资料未提供该技能的安装方式、依赖要求、支持平台范围及收费信息,暂未提供。