Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计提醒

dev-git-workflow开发 git 工作流程

Agent Skill

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

总安装

1,273

周安装

52

GitHub Stars

59

下载量

412
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill dev-git-workflow

简介

dev-git-workflow 推荐现代 Git 协作模式,包括 GitHub Flow、主干开发和堆叠差分策略。

  • 协助制定分支模型、标准化 PR 纪律、强制执行提交约定和仓库保护规则。
  • 适用于中大型团队持续交付和高频发布场景。
  • 使用前应评估团队规模、发布节奏和 CI 成熟度,选择合适的工作流模板。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Git Workflow (Modern Team Collaboration)

Use modern Git collaboration patterns: GitHub Flow for continuous deploy, trunk-based for scale, Conventional Commits for automation, stacked diffs for large features.

Use this skill to choose a branching model, standardize PR discipline, enforce commit conventions, and harden repository settings for safe collaboration.

Quick Start

  1. Identify constraints (team size, release cadence, CI maturity, compliance).
  2. Choose a branching strategy using the decision tree.
  3. Apply the baseline repo settings (branch protection, approvals, checks, merge strategy).
  4. Use the relevant reference doc for implementation details.
  5. If asked "best practice in 2026", verify via web search using data/sources.json as a starting source list.

Quick Reference

TaskTool/CommandWhen to UseReference
Create feature branchgit switch -c feat/name mainStart new workBranching Strategies
Create feature worktreegit worktree add.worktrees/feature -b feature/nameIsolate one feature per agent/branchAI Agent Worktrees
Squash WIP commitsgit rebase -i HEAD~3Clean up before PRInteractive Rebase
Conventional commitgit commit -m "feat: add feature"All commitsCommit Conventions
Force push safelygit push --force-with-leaseAfter rebaseCommon Mistakes
Resolve conflictsgit mergetoolMerge conflictsConflict Resolution
Create stacked PRsgt create stack-name (Graphite)Large featuresStacked Diffs
Auto-generate changelognpx standard-versionBefore releaseRelease Management
Run quality gatesGitHub Actions / GitLab CIEvery PRAutomated Quality Gates

AI Agent Feature Loop

AI Agent Worktrees Reference — Full guide to worktree isolation for Claude Code, Codex, Aider, and other AI coding agents.

flowchart LR
    A[Plan] --> B[Create worktree<br>per agent/feature]
    B --> C[Verify .gitignore<br>+ install deps]
    C --> D[Agent works<br>scoped commits]
    D --> E[Quality gates]
    E -->|pass| F[PR + merge]
    E -->|fail| D
    F --> G[Cleanup worktree<br>+ delete branch]

    style D fill:#fff3cd,stroke:#d4a017
    style F fill:#d4edda,stroke:#28a745

For AI-assisted engineering, prefer this default loop:

  1. Create one worktree per feature branch (git worktree add.worktrees/<feature> -b feature/<name>).
  2. Verify the worktree directory is in .gitignore (git check-ignore -q.worktrees).
  3. Install dependencies and verify clean test baseline before starting work.
  4. Implement scoped changes only for that feature.
  5. Run repository quality gate(s) before PR.
  6. Open one focused PR to the integration branch.
  7. After merge, clean up: git worktree remove + git branch -d.

Parallel agents: One worktree per agent, disjoint file ownership, orchestrator merges from main. See AI Agent Worktrees for setup, safety patterns, and cleanup.

If repository scripts exist (for example scripts/git/feature-workflow.sh), use them to enforce this loop.

Local Safety Preflight (Before Checkout/Merge/Commit)

Use this quick sequence to avoid common local Git blockers during agent-driven work.

  1. Working tree cleanliness:
  • git status --porcelain
  • If non-empty, decide explicitly: commit, stash, or abort branch switch.
  1. Lock/process check:
  • If Git commands fail with index.lock, check running Git processes first:

- test -f.git/index.lock && ps aux | rg "[g]it"

  • Remove stale lock only after confirming no active Git process.
  1. Branch switch guard:
  • Do not checkout/switch when local changes would be overwritten.
  • Commit/stash intentionally; avoid accidental context loss.
  1. Merge conflict protocol:
  • On conflict, stop new edits, resolve conflict file-by-file, rerun relevant tests, then complete merge commit.
  1. Automation note:
  • For recurring branch operations, prefer project scripts/worktrees over ad-hoc local branch juggling.

Decision Tree: Choosing Branching Strategy

Use this decision tree to select the optimal branching strategy for your team based on team size, release cadence, and CI/CD maturity.

Team characteristics -> What's your situation?
    ├─ Small team (1-5 devs) + Continuous deployment + High CI/CD maturity?
    │   └─ GitHub Flow (main + feature branches)
    │
    ├─ Medium team (5-15 devs) + Continuous deployment + High CI/CD maturity?
    │   └─ Trunk-Based Development (main + short-lived branches)
    │
    ├─ Large team (15+ devs) + Continuous deployment + Very high CI/CD maturity?
    │   └─ Trunk-Based + Feature Flags (progressive rollout)
    │
    ├─ Scheduled releases + Medium CI/CD maturity?
    │   └─ GitFlow (main + develop + release branches)
    │
    └─ Multiple versions + Low-Medium CI/CD maturity?
        └─ GitFlow (long-lived release branches)

Navigation: Core Workflows

Branching Strategies

Branching Strategies Comparison - Comprehensive guide to choosing and implementing branching strategies

  • GitHub Flow (recommended for modern teams): Simple, continuous deployment
  • Trunk-Based Development (enterprise scale): Short-lived branches, daily merges
  • GitFlow (structured releases): Scheduled releases, multiple versions
  • Decision matrix: Team size, release cadence, CI/CD maturity
  • Migration paths between strategies

Pull Request Best Practices

PR Best Practices Guide - Effective code reviews and fast PR cycles

  • PR size guidelines: keep PRs reviewable (often 200-400 LOC works well; split larger changes)
  • Review categories: BLOCKER, WARNING, NITPICK
  • Review etiquette: Collaborative feedback, code examples
  • PR description templates: What, Why, How, Testing
  • Data-driven insights on review efficiency

Commit Conventions

Conventional Commits Standard - Commit message formats and semantic versioning integration

  • Conventional commit format: type(scope): description
  • Commit types: feat, fix, BREAKING CHANGE, refactor, docs
  • SemVer automation: Auto-bump versions from commits
  • Changelog generation: Automated from commit history
  • Tools: commitlint, semantic-release, standard-version

Navigation: Advanced Techniques

Stacked Diffs

Stacked Diffs Implementation - Platform-specific workflows and team adoption

  • What are stacked diffs: Break large features into reviewable chunks
  • When to use: Features > 500 lines, complex refactoring
  • GitLab native support: MR chains
  • GitHub with Graphite: CLI-based stacking
  • Benefits: 60% faster review cycles, better quality

Interactive Rebase

Interactive Rebase & History Cleanup - Maintain clean commit history

  • Auto-squash workflow: fixup! and squash! commits
  • Interactive rebase commands: pick, reword, edit, squash, fixup, drop
  • Splitting commits: Break large commits into focused changes
  • Reordering commits: Logical commit history
  • Best practices: Never rebase public branches

Conflict Resolution

Conflict Resolution Techniques - Merge strategies and conflict handling

  • Resolution strategies: --ours, --theirs, manual merge
  • Rebase vs merge: When to use each
  • Merge tool setup: VS Code, Meld, custom tools
  • Conflict markers: Understanding <<<<<<<, =======, >>>>>>>
  • Prevention strategies: Frequent rebasing, small PRs

Navigation: Automation & Quality

Automated Quality Gates

Automated Quality Gates - CI/CD pipelines and quality enforcement

  • Essential gates: Tests, coverage, linting, security scans
  • Advanced gates: Performance benchmarks, bundle size, a11y checks
  • GitHub Actions workflows: Complete PR checks pipeline
  • GitLab CI pipelines: MR quality gates
  • Pre-commit hooks: Husky + lint-staged setup
  • Quality metrics thresholds: Coverage 80%, complexity < 10

Validation Checklists

Validation Checklists - Pre-PR, pre-merge, pre-release checklists

  • Before creating PR: Code quality, commit hygiene, testing
  • Before merging PR: Review process, CI/CD checks, final verification
  • Before releasing: Pre-release testing, version management, documentation
  • Post-deployment: Immediate verification, monitoring, tasks
  • Hotfix checklist: Critical bug fast-track process

Release Management

Release Management - Versioning and deployment workflows

  • Semantic versioning: MAJOR.MINOR.PATCH
  • Manual release workflow: GitFlow release branches
  • Automated releases: semantic-release automation
  • Hotfix workflow: Emergency patches
  • Changelog generation: Keep a Changelog format
  • Release checklists: Pre-release, release day, post-release

Navigation: AI Agent Workflows

AI Agent Worktrees

AI Agent Worktrees - Worktree isolation patterns for AI coding agents

  • When to use worktrees with agents (decision table)
  • Directory conventions (.worktrees/, global paths, .gitignore)
  • Agent-specific patterns: Claude Code, Codex, Aider, Copilot Workspace
  • Parallel agent execution: one worktree per agent, disjoint file ownership
  • Safety: lock contention, conflict detection, cross-agent file guards
  • Cleanup lifecycle: removal, pruning, batch cleanup scripts

Navigation: Learning & Troubleshooting

Monorepo Workflows

Monorepo Workflows - Git patterns for monorepo repositories

  • Trunk-based branching for monorepos
  • Sparse checkout and partial clone
  • Affected-only CI (Nx, Turborepo, Bazel)
  • CODEOWNERS per package/directory
  • Monorepo vs polyrepo decision table

Git Hooks Automation

Git Hooks Automation - Pre-commit, commit-msg, pre-push hooks

  • Husky v9+ and lefthook setup
  • lint-staged and commitlint integration
  • Custom hooks (gitleaks, file size limits, branch naming)
  • Team distribution strategies

Git Bisect Debugging

Git Bisect Debugging - Regression hunting with git bisect

  • Manual and automated bisect workflows
  • Writing bisect test scripts
  • Handling merge commits, log and replay

Common Mistakes

Common Mistakes & Fixes - Learn from common pitfalls

  • Large unfocused PRs -> Split into stacked diffs
  • Vague commit messages -> Use conventional commits
  • Rewriting public history -> Never rebase main
  • Ignoring review comments -> Address all feedback
  • Committing secrets -> Use environment variables
  • Force push dangers -> Use --force-with-lease

Decision Tables

When to Use Each Branching Strategy

RequirementGitHub FlowTrunk-BasedGitFlow
Continuous deployment[OK] Best[OK] Best[FAIL] Poor
Scheduled releases[WARNING] OK[WARNING] OK[OK] Best
Multiple versions[FAIL] Poor[FAIL] Poor[OK] Best
Small team (< 5)[OK] Best[WARNING] OK[FAIL] Overkill
Large team (> 15)[WARNING] OK[OK] Best[WARNING] OK
Fast iteration[OK] Best[OK] Best[FAIL] Poor

PR Size vs Review Time

LOCReview TimeBug DetectionRecommendation
< 50< 10 minHigh[OK] Ideal for hotfixes
50-20010-30 minHigh[OK] Ideal for features
200-40030-60 minMedium-High[OK] Acceptable
400-10001-2 hoursMedium[WARNING] Consider splitting
> 1000> 2 hoursLow[FAIL] Always split

Do / Avoid

GOOD: Do

  • Keep PRs under 400 lines (200-400 optimal)
  • Use conventional commit messages
  • Rebase before opening PR (clean history)
  • Require at least one approval before merge
  • Run CI checks on every PR
  • Use stacked diffs for large features (>500 LOC)
  • Squash WIP commits before merge
  • Use --force-with-lease (not --force)

BAD: Avoid

  • Long-lived feature branches (>3 days)
  • Merging without review
  • Rebasing public/shared branches
  • Force pushing to main/master
  • Committing secrets (even "temporarily")
  • Large monolithic PRs (>1000 lines)
  • Vague commit messages ("fix", "update")
  • Skipping CI to merge faster

Anti-Patterns

Anti-PatternProblemFix
Long-lived branchesMerge conflicts, stale codeTrunk-based, short branches
Unreviewed mergesBugs reach productionBranch protection rules
Rebasing mainHistory corruptionNever rebase public branches
1000+ LOC PRsPoor review qualityStacked diffs, split PRs
"fix" commitsUnclear historyConventional commits
No CI gatesBroken mainRequired status checks
Secrets in historySecurity breachPre-commit hooks, gitleaks

Repository Baseline (Security + Reliability)

Set these repo defaults before scaling a team:

  • Branch protection: require PRs to main (no direct pushes), require status checks, require up-to-date branch on merge.
  • Review gates: require approvals; enforce CODEOWNERS for sensitive paths (auth, payments, infra, prod configs).
  • History policy: pick merge strategy (squash vs merge commits) and make it consistent; document exceptions.
  • Signed changes: require signed commits and signed tags for releases (team-specific key management).
  • Secret prevention: local pre-commit + server-side secret scanning/push protection; rotate on incident.
  • Merge safety: use merge queue (or equivalent) for busy repos to keep main green under high concurrency.
  • Cost control: cache dependencies/builds; run heavy jobs conditionally; cap CI minutes for untrusted forks.

Template: assets/pull-requests/pr-template.md Guide: assets/template-git-workflow-guide.md

Security-Sensitive Changes

For security-related git operations, see dev-git-commit-message/assets/template-security-commits.md:

  • Secrets detection with pre-commit hooks
  • Handling accidental secret commits
  • Security commit metadata (CVE, CVSS)
  • Branch protection for security-sensitive code

Optional: AI/Automation

Note: AI tools assist but cannot replace human judgment for merge decisions.
  • PR summarization - Generate description from commits
  • Change risk labeling - Flag high-risk files (auth, payments)
  • Review suggestions - Identify potential reviewers

Bounded Claims

  • AI summaries need human verification
  • Risk labels are suggestions, not guarantees
  • Merge decisions always require human approval

Related Skills

Usage Notes

For Claude Code:

  • Recommend GitHub Flow for most modern teams (simple, effective)
  • Suggest stacked diffs for features > 500 lines
  • Always validate commit messages against conventional commit format
  • Check PR size - warn if > 400 lines, block if > 1000 lines
  • Reference assets/ for copy-paste ready configurations
  • Use references/ for deep-dive implementation guidance

Progressive Disclosure:

  1. Start with Quick Reference for fast lookups
  2. Use Decision Tree for choosing strategies
  3. Navigate to specific resources for detailed implementation
  4. Reference templates for production-ready configurations
  5. Check validation checklists before PR/merge/release

Quick Command Reference

Common Operations:

# Rebase feature branch
git fetch origin && git rebase origin/main

# Interactive rebase last 3 commits
git rebase -i HEAD~3

# Squash all commits in branch
git rebase -i $(git merge-base HEAD main)

# Force push safely
git push --force-with-lease origin feature-branch

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

# Cherry-pick specific commit
git cherry-pick abc123

# Stash changes
git stash push -m "WIP: implementing feature X"
git stash pop

Conflict Resolution:

# Pull latest with rebase
git pull --rebase origin main

# Use visual merge tool
git mergetool

# Accept their changes
git checkout --theirs <file>

# Accept your changes
git checkout --ours <file>

Trend Awareness Protocol

IMPORTANT: When users ask recommendation questions about Git workflows, branching strategies, or collaboration tools, verify current trends via web search (and/or the links in data/sources.json) before answering.

Trigger Conditions

  • "What's the best Git workflow for [team size/use case]?"
  • "What should I use for [branching/PR management]?"
  • "What's the latest in Git collaboration?"
  • "Current best practices for [branching/code review]?"
  • "Is [GitFlow/Trunk-Based] still relevant in 2026?"
  • "[GitHub Flow] vs [Trunk-Based] vs [GitFlow]?"
  • "Best PR stacking tool?"

Required Searches

  1. Search: "Git workflow best practices 2026"
  2. Search: "[specific strategy] vs alternatives 2026"
  3. Search: "Git collaboration trends January 2026"
  4. Search: "[branching/PR tools] comparison 2026"

What to Report

After searching, provide:

  • Current landscape: What Git workflows/tools are popular NOW
  • Emerging trends: New collaboration patterns, tools, or practices gaining traction
  • Deprecated/declining: Strategies/tools losing relevance or support
  • Recommendation: Based on fresh data, not just static knowledge

Example Topics (verify with fresh search)

  • Branching strategies (Trunk-Based, GitHub Flow, GitFlow)
  • PR stacking tools (Graphite, git-stack, Stacked PRs)
  • Merge queue implementations (GitHub, GitLab)
  • Code review platforms and automation
  • Conventional commits and changelog tools
  • Git hosting platform features (GitHub, GitLab, Bitbucket)
  • AI-assisted Git workflows

Fact-Checking

  • Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
  • Prefer primary sources; report source links and dates for volatile information.
  • If web access is unavailable, state the limitation and mark guidance as unverified.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.64%
按下载量换算143

Claude

33.05%
按下载量换算136

Cursor

17.7%
按下载量换算73

Gemini CLI

10.59%
按下载量换算44

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills