MCP HubMCP Hub
返回技能列表

git-workflow-guide

AsiaOstrich
更新于 Today
182 次查看
34
4
34
在 GitHub 上查看
wordautomationdesign

关于

This Claude skill guides developers on Git branching strategies and merge operations when working with branches or pull requests. It helps select workflows like GitFlow or GitHub Flow and provides branch naming conventions. Use it for questions about creating branches, merging code, or establishing team Git practices.

快速安装

Claude Code

推荐
插件命令推荐
/plugin add https://github.com/AsiaOstrich/universal-dev-skills
Git 克隆备选方式
git clone https://github.com/AsiaOstrich/universal-dev-skills.git ~/.claude/skills/git-workflow-guide

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

Git Workflow Guide

This skill provides guidance on Git branching strategies, branch naming conventions, and merge operations.

Quick Reference

Workflow Strategy Selection

Deployment FrequencyRecommended Strategy
Multiple times/dayTrunk-Based Development
Weekly to bi-weeklyGitHub Flow
Monthly or longerGitFlow

Branch Naming Convention

<type>/<short-description>
TypeUsageExample
feature/New functionalityfeature/oauth-login
fix/ or bugfix/Bug fixesfix/memory-leak
hotfix/Urgent production fixeshotfix/security-patch
refactor/Code refactoringrefactor/extract-service
docs/Documentation onlydocs/api-reference
test/Test additionstest/integration-tests
chore/Maintenance taskschore/update-dependencies
release/Release preparationrelease/v1.2.0

Naming Rules

  1. Use lowercase | 使用小寫
  2. Use hyphens for spaces | 使用連字號分隔單詞
  3. Be descriptive but concise | 具描述性但簡潔

Detailed Guidelines

For complete standards, see:

Pre-branch Checklist

Before creating a new branch:

  1. Check for unmerged branches

    git branch --no-merged main
    
  2. Sync latest code

    git checkout main
    git pull origin main
    
  3. Verify tests pass

    npm test  # or your project's test command
    
  4. Create branch with proper naming

    git checkout -b feature/description
    

Merge Strategy Quick Guide

StrategyWhen to Use
Merge Commit (--no-ff)Long-lived features, GitFlow releases
Squash MergeFeature branches, clean history
Rebase + FFTrunk-Based, short-lived branches

Examples

Creating a Feature Branch

# Good
git checkout -b feature/user-authentication
git checkout -b fix/null-pointer-in-payment
git checkout -b hotfix/critical-data-loss

# Bad
git checkout -b 123              # Not descriptive
git checkout -b Fix-Bug          # Not lowercase
git checkout -b myFeature        # No type prefix

Merge Workflow (GitHub Flow)

# 1. Create branch from main
git checkout main
git pull origin main
git checkout -b feature/user-profile

# 2. Make changes and commit
git add .
git commit -m "feat(profile): add avatar upload"
git push -u origin feature/user-profile

# 3. Create PR and merge via GitHub/GitLab UI

# 4. Delete branch after merge
git checkout main
git pull origin main
git branch -d feature/user-profile

Handling Merge Conflicts

# 1. Update your branch with main
git checkout feature/my-feature
git fetch origin
git merge origin/main

# 2. Resolve conflicts in files
# <<<<<<< HEAD
# Your changes
# =======
# Incoming changes
# >>>>>>> origin/main

# 3. Stage resolved files
git add resolved-file.js

# 4. Complete merge
git commit -m "chore: resolve merge conflicts with main"

# 5. Test and push
npm test
git push origin feature/my-feature

Configuration Detection

This skill supports project-specific workflow configuration.

Detection Order

  1. Check CONTRIBUTING.md for "Git Workflow" or "Branching Strategy" section
  2. If found, use the specified strategy (GitFlow / GitHub Flow / Trunk-Based)
  3. If not found, default to GitHub Flow for simplicity

First-Time Setup

If no configuration found:

  1. Ask the user: "This project hasn't configured a Git workflow strategy. Which would you prefer? (GitFlow / GitHub Flow / Trunk-Based)"
  2. After selection, suggest documenting in CONTRIBUTING.md:
## Git Workflow

### Branching Strategy
This project uses **[chosen option]**.

### Branch Naming
Format: `<type>/<description>`
Example: `feature/oauth-login`, `fix/memory-leak`

### Merge Strategy
- Feature branches: **[Squash / Merge commit / Rebase]**

License: CC BY 4.0 | Source: universal-doc-standards

GitHub 仓库

AsiaOstrich/universal-dev-skills
路径: skills/git-workflow-guide
ai-coding-assistantbest-practicesclaude-codeclaude-code-skillscode-reviewdeveloper-experience

相关推荐技能

content-collections

Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。

查看技能

creating-opencode-plugins

该Skill为开发者创建OpenCode插件提供指导,涵盖命令、文件、LSP等25+种事件类型。它详细说明了插件结构、事件API规范及JavaScript/TypeScript实现模式,帮助开发者构建事件驱动的模块。适用于需要拦截操作、扩展功能或自定义AI助手行为的插件开发场景。

查看技能

sglang

SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。

查看技能

langchain

LangChain是一个用于构建LLM应用程序的框架,支持智能体、链和RAG应用开发。它提供多模型提供商支持、500+工具集成、记忆管理和向量检索等核心功能。开发者可用它快速构建聊天机器人、问答系统和自主代理,适用于从原型验证到生产部署的全流程。

查看技能