Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计提醒

git-workflowGit 工作流

Agent Skill

git-workflow 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,432

周安装

143

GitHub Stars

33

下载量

1,144
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:git-workflow(Git 工作流)
来源仓库:https://github.com/asyrafhussin/agent-skills
仓库路径:skills/git-workflow
安装命令:
npx skills add https://github.com/asyrafhussin/agent-skills --skill git-workflow
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/asyrafhussin/agent-skills --skill git-workflow

简介

用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务需求快速定位候选结果。

  • 它提供 Git 工作流最佳实践,包括提交规范、分支策略和 Pull Request 审核流程,共包含 25 条规则。
  • 使用时需根据项目类型选择合适的分支模型(如 Git Flow 或 GitHub Flow),并在协作前统一团队约定;不支持自动化提交操作。
  • 安装前请确认是否具备 GitHub 访问权限,并评估是否会触发网络请求或令牌写入,避免安全风险。
  • git-workflow 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Git Workflow

Git best practices, commit conventions, branching strategies, and pull request workflows. Guidelines for maintaining a clean, useful git history.

When to Apply

Reference these guidelines when:

  • Writing commit messages
  • Creating branches
  • Setting up git workflows
  • Reviewing pull requests
  • Maintaining git history

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Commit MessagesCRITICALcommit-
2Branching StrategyHIGHbranch-
3Pull RequestsHIGHpr-
4History ManagementMEDIUMhistory-
5CollaborationMEDIUMcollab-

Quick Reference

1. Commit Messages (CRITICAL)

  • commit-conventional - Use conventional commits
  • commit-atomic - Atomic commits (one logical change)
  • commit-present-tense - Use imperative present tense
  • commit-meaningful - Descriptive, meaningful messages
  • commit-body - Add body for complex changes
  • commit-references - Reference issues/tickets
  • commit-git-hooks - Enforce standards with Husky + commitlint

2. Branching Strategy (HIGH)

  • branch-naming - Consistent branch naming
  • branch-feature - Feature branch workflow
  • branch-main-protected - Protect main branch
  • branch-short-lived - Keep branches short-lived
  • branch-delete-merged - Delete merged branches
  • branch-release - Release branch strategy
  • branch-workflow-strategies - GitFlow vs GitHub Flow vs Trunk-Based
  • branch-monorepo - Monorepo git workflows

3. Pull Requests (HIGH)

  • pr-small - Keep PRs small and focused
  • pr-description - Write clear descriptions
  • pr-reviewers - Request appropriate reviewers
  • pr-ci-pass - Ensure CI passes
  • pr-squash - Squash when appropriate
  • pr-draft - Use draft PRs for WIP and early feedback

4. History Management (MEDIUM)

  • history-rebase - Rebase vs merge
  • history-no-force-push - Avoid force push to shared branches
  • history-clean - Keep history clean
  • history-tags - Use tags for releases
  • history-worktree - Work on multiple branches with git worktree

5. Collaboration (MEDIUM)

  • collab-code-review - Effective code reviews
  • collab-conflicts - Handle merge conflicts
  • collab-communication - Communicate changes
  • collab-gitignore -.gitignore best practices

Essential Guidelines

Conventional Commits

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

<body>

<footer>

Types

TypeDescription
featNew feature
fixBug fix
docsDocumentation only
styleFormatting, no code change
refactorCode change, no feature/fix
perfPerformance improvement
testAdding/updating tests
choreMaintenance, dependencies
ciCI/CD changes
buildBuild system changes
revertRevert previous commit

Examples

# ✅ Good commit messages
feat(auth): add password reset functionality

fix(cart): resolve quantity update race condition

docs(readme): add installation instructions

refactor(api): extract validation into middleware

test(user): add unit tests for registration

chore(deps): update dependencies to latest versions

# With body and footer
feat(orders): implement order cancellation

Add ability for users to cancel pending orders within 24 hours.
Cancelled orders trigger refund process automatically.

Closes #123
BREAKING CHANGE: Order status enum now includes 'cancelled'

# ❌ Bad commit messages
fix bug
update
WIP
asdfasdf
changes
misc fixes

Branch Naming

# ✅ Good branch names
feature/user-authentication
feature/JIRA-123-password-reset
fix/cart-total-calculation
fix/issue-456-login-redirect
hotfix/security-patch
docs/api-documentation
refactor/database-queries
chore/update-dependencies

# ❌ Bad branch names
new-feature
john-branch
test
fix
temp
asdf

Branch Workflow

# Main branches
main          # Production-ready code
develop       # Integration branch (optional)

# Supporting branches
feature/*     # New features
fix/*         # Bug fixes
hotfix/*      # Production hotfixes
release/*     # Release preparation

# Workflow
git checkout main
git pull origin main
git checkout -b feature/user-profile

# Work on feature...
git add .
git commit -m "feat(profile): add profile page"

# Keep branch updated
git fetch origin
git rebase origin/main

# Push and create PR
git push -u origin feature/user-profile

Atomic Commits

# ❌ One commit doing multiple things
git commit -m "Add login, fix header, update deps"

# ✅ Separate commits for each change
git commit -m "feat(auth): add login page"
git commit -m "fix(header): correct navigation alignment"
git commit -m "chore(deps): update React to v18.2"

Commit Frequently, Push Regularly

# ✅ Small, frequent commits
git commit -m "feat(cart): add product to cart"
git commit -m "feat(cart): display cart item count"
git commit -m "feat(cart): implement remove item"
git commit -m "test(cart): add unit tests"

# ❌ One massive commit
git commit -m "feat: implement entire shopping cart"

Pull Request Best Practices

PR Title

# Format (like commit)
<type>(<scope>): <description>

# ✅ Good PR titles
feat(auth): implement OAuth2 login
fix(checkout): resolve payment processing error
docs(api): add endpoint documentation

# ❌ Bad PR titles
Update
Fix stuff
WIP

PR Description Template

## Summary
Brief description of what this PR does.

## Changes
- Added user authentication endpoints
- Implemented JWT token generation
- Added password hashing with bcrypt

## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed

## Screenshots (if UI changes)
[Add screenshots here]

## Related Issues
Closes #123
Related to #456

## Checklist
- [ ] Code follows project conventions
- [ ] Self-review completed
- [ ] Tests added/updated
- [ ] Documentation updated

Keep PRs Small

# ✅ Focused PRs
PR #1: Add user model and migrations
PR #2: Implement user registration endpoint
PR #3: Add email verification
PR #4: Implement login/logout

# ❌ Large unfocused PR
PR #1: Add entire user authentication system
       (2000+ lines, 50+ files)

Rebase vs Merge

# ✅ Rebase for feature branches (clean history)
git checkout feature/my-feature
git fetch origin
git rebase origin/main
# Resolve any conflicts
git push --force-with-lease  # Only your branch!

# ✅ Merge for integrating to main (preserve context)
git checkout main
git merge --no-ff feature/my-feature
# Creates merge commit, preserves branch history

# ❌ Never force push to shared branches
git push --force origin main  # NEVER DO THIS

Interactive Rebase (Clean Up)

# Before pushing, clean up commits
git rebase -i HEAD~5

# In editor:
pick abc123 feat: add login page
squash def456 fix typo
squash ghi789 more fixes
pick jkl012 feat: add logout

# Result: clean history with meaningful commits

Handling Conflicts

# During rebase
git rebase origin/main
# CONFLICT in file.ts

# 1. Open conflicted files
# 2. Resolve conflicts (remove markers)
# 3. Stage resolved files
git add file.ts

# 4. Continue rebase
git rebase --continue

# Or abort if needed
git rebase --abort

Git Hooks

# .husky/pre-commit
#!/bin/sh
npm run lint
npm run test:unit

# .husky/commit-msg
#!/bin/sh
npx commitlint --edit $1

# commitlint.config.js
module.exports = {
  extends: ['@commitlint/config-conventional'],
};

Tagging Releases

# Semantic versioning tags
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0

# List tags
git tag -l "v1.*"

# Tag format
v1.0.0    # Major.Minor.Patch
v1.0.0-beta.1  # Pre-release
v1.0.0-rc.1    # Release candidate

.gitignore Best Practices

# Dependencies
node_modules/
vendor/

# Build outputs
dist/
build/
.next/

# Environment files
.env
.env.local
.env.*.local

# IDE
.idea/
.vscode/
*.swp

# OS files
.DS_Store
Thumbs.db

# Logs
*.log
logs/

# Test coverage
coverage/

# Cache
.cache/
*.cache

Useful Git Commands

# View commit history
git log --oneline --graph --all

# See what changed
git diff --staged
git diff HEAD~1

# Undo last commit (keep changes)
git reset --soft HEAD~1

# Discard local changes
git checkout -- file.ts
git restore file.ts  # Git 2.23+

# Stash changes
git stash
git stash pop
git stash list

# Cherry-pick commit
git cherry-pick abc123

# Find who changed a line
git blame file.ts

# Search commits
git log --grep="fix"
git log -S "functionName"

Output Format

When reviewing git practices, output findings:

[category] Description of issue or suggestion

Example:

[commit] Use imperative mood: "Add feature" not "Added feature"
[branch] Branch name 'test' should follow pattern: feature/description
[pr] PR is too large (50+ files), consider splitting

How to Use

Read individual rule files for detailed explanations:

rules/commit-conventional-format.md
rules/branch-naming-convention.md
rules/pr-small-focused.md

References

Examples from Well-Known Projects

Learn from projects with excellent git practices:

  • Linux Kernel - Detailed commit messages and patch workflow
  • React - Conventional commits and thorough PR reviews
  • Vue.js - Clean commit history and good PR templates
  • TypeScript - Structured branching and clear release process
  • Next.js - Conventional commits and automated releases

Configuration Examples

Commitlint

// commitlint.config.js
module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'type-enum': [
      2,
      'always',
      ['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'chore', 'ci', 'build', 'revert']
    ],
    'subject-max-length': [2, 'always', 72],
    'body-max-line-length': [2, 'always', 100]
  }
};

Husky Git Hooks

# .husky/commit-msg
#!/bin/sh
npx commitlint --edit $1

# .husky/pre-commit
#!/bin/sh
npm run lint
npm test

GitHub PR Template

# .github/PULL_REQUEST_TEMPLATE.md
## Summary
Brief description of changes

## Changes
- List key changes
- One per line

## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed

## Related
Closes #issue-number

Metadata

Skill Version: 1.2.0 Last Updated: 2026-03-08 Total Rules: 31 Categories: 5 (Commit Messages, Branching Strategy, Pull Requests, History Management, Collaboration)

Compatible With:

  • Git 2.0+
  • GitHub, GitLab, Bitbucket, Azure DevOps

Recommended Tools:


License

MIT License. This skill is provided as-is for educational and development purposes.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.97%
按下载量换算331

Antigravity

22.23%
按下载量换算254

Gemini CLI

17%
按下载量换算194

windsurf

12.62%
按下载量换算144

Codex

6.96%
按下载量换算80

OpenCode

3.32%
按下载量换算38

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills