Token导航 LogoToken导航

Agent Skill · 开发

git-workflow(Git 工作流)

git-workflow 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

git-workflow 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 11,267。

总安装 1,860周安装 76GitHub Stars 11下载 602核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/akillness/oh-my-skills --skill git-workflow

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

作为本地 Git 协作与安全恢复的核心锚点,提供路由优先的工作流支持。适合快速识别当前状态、选择安全模式并推荐最小可逆修复方案。使用时需保持与审查、调试和 PR 流程的边界清晰,避免越界操作。复杂情况应参考协作边界和恢复模式文档,确保操作可追踪可回退。

git-workflow 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/git-workflow

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/akillness/oh-my-skills --skill git-workflow;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

git-workflow 怎么安装?

在终端执行 npx skills add https://github.com/akillness/oh-my-skills --skill git-workflow。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

git-workflow 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

git-workflow 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

git-workflow 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

git-workflow 用的人多吗?

公开数据是累计安装 1,860 次,近一周安装 76 次,下载 602 次,GitHub 11 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

git-workflow 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
git-workflow

Git 工作流 · 本页

1,86011需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Git Workflow

Use this skill as the repo's routing-first local Git collaboration and recovery anchor.

The job is not to teach all of Git. The job is to:

  • identify the current local Git state quickly,
  • choose one safe workflow mode,
  • recommend the smallest reversible fix that solves the problem,
  • keep boundaries to review, debugging, planning, and hosted PR workflows explicit.

Read these references when the case gets sharp-edged or the user needs more than the brief:

If the main need is:

  • reviewing a diff for correctness, architecture, or security → route to code-review
  • reproducing or diagnosing a bug/regression → route to debugging
  • planning tasks, acceptance criteria, or sprint slices → route to task-planning
  • Aider 기반 AI pair-programming 편집 루프 운영 → route to aider-cli-workflow
  • hosted PR lifecycle, branch protection, reviewers, labels, or repo settings → use a dedicated PR/repo-management workflow

When to use this skill

  • Create, rename, or clean up a branch before coding or review
  • Stage changes selectively and shape reviewable commits
  • Decide whether to merge or rebase onto an updated base branch
  • Resolve merge/rebase conflicts safely
  • Push a branch, set upstream, or update rewritten history with --force-with-lease
  • Recover from a bad reset, wrong-branch commit, detached HEAD, dropped commit, or messy rebase
  • Prepare a clean diff before a later PR or review step

When not to use this skill

  • The real question is whether the code or architecture is good
  • The real question is how to split or sequence the work
  • The real question is root cause, not Git mechanics
  • The real question is hosted-service workflow instead of local repository state
  • The user wants a giant Git tutorial instead of the next safe move

Instructions

Step 1: Normalize the local Git intake

Classify the request before suggesting commands.

git_intake:
  current_goal: branch-setup | commit-shaping | sync-with-base | conflict-resolution | push-safety | undo-recovery | history-inspection | unknown
  branch_state: clean | has-unstaged-changes | staged-only | ahead-of-origin | behind-origin | diverged | detached-head | unknown
  collaboration_risk: solo-branch | shared-branch | unknown
  remote_context: no-remote | origin-only | fork-plus-upstream | unknown
  trigger_event:
    - need-clean-commits
    - rebased-branch
    - merge-conflict
    - wrong-branch-commit
    - accidental-reset
    - rejected-push
    - lost-commit
    - prepare-for-review
    - sync-main
    - unclear
  preferred_history: keep-linear | preserve-merge-context | unknown
  confidence: high | medium | low

If the packet is incomplete, choose the safest reasonable next move and state the assumptions.

Step 2: Choose one primary workflow mode

Pick exactly one mode:

  1. branch-and-stage hygiene — branch creation/switching, staging, stash-or-clean decisions
  2. commit-shaping — amend, fixup, reword, interactive rebase, cleaner review units
  3. sync-with-base — fetch + merge/rebase choice when the branch must catch up
  4. conflict-resolution — merge/rebase already produced conflicts; the next safe loop matters most
  5. push-safety — upstream setup, rejected pushes, diverged branches, rewrite-safe pushes
  6. undo-and-recovery — reset/rebase/amend/checkout/branch deletion went sideways; rescue first

Step 3: Use the safety ladder

Always prefer these checks before irreversible actions:

  • git status
  • git branch --show-current
  • git log --oneline --decorate -5

Core rules:

  • Prefer git add -p or explicit staging when commit boundaries matter.
  • Prefer amend or interactive rebase only on local or safely rewritable history.
  • Prefer rebase when the branch is mostly yours and a cleaner review history helps.
  • Prefer merge when the branch is shared or preserving integration context matters more than linear history.
  • Prefer git push --force-with-lease, never raw --force, after intentional history rewrites.
  • Prefer git revert over reset --hard when the bad commit is already shared.
  • Prefer git reflog and a rescue branch before panic cleanup.

Step 4: Apply the decision ladder

Use these callouts explicitly:

Merge vs rebase
  • Use rebase when rewrite risk is low and reviewable linear history matters.
  • Use merge when the branch is shared, integration context matters, or rewrite risk is not worth it.
Revert vs reset
  • Use revert for collaborative undo on already-pushed history.
  • Use reset only when rewriting local history intentionally.
  • Use restore / checkout of files when the worktree/index needs repair more than the branch history.
Normal push vs --force-with-lease
  • Use normal push when history was not rewritten.
  • Use --force-with-lease after rebase, amend, squash, or another intentional rewrite.
  • If the branch may be shared and the remote state is unclear, stop and name the collaboration risk.

Step 5: Build the Git Workflow Brief

Return this exact structure:

# Git Workflow Brief

## Recommended mode
- Mode: branch-and-stage hygiene | commit-shaping | sync-with-base | conflict-resolution | push-safety | undo-and-recovery
- Why this mode fits: ...

## Current state
- Branch: ...
- Worktree / index state: ...
- Remote context: ...
- Collaboration risk: solo-branch | shared-branch | unknown
- Confidence: high | medium | low

## Safest next move
1. ...
2. ...
3. ...

## Commands

...


## Why this is the safe path

- ...
- ...

## Watch-outs

- ...
- ...

## Recovery fallback

- If this goes wrong, use...

## Adjacent handoff

- Use `code-review` when...
- Use `debugging` when...
- Use `task-planning` when...

Step 6: Use concise mode packets

  • branch-and-stage hygiene — branch name, dirty/clean state, selective staging, stash only when it lowers risk
  • commit-shaping — reviewable commit units, amend/fixup/rebase only when rewrite is safe
  • sync-with-base — fetch first, decide merge vs rebase explicitly, name rewrite risk before starting
  • conflict-resolution — inspect → resolve → git add → continue/commit, with abort as the calm fallback
  • push-safety — distinguish upstream creation, normal push, rejected push, and rewritten-history push
  • undo-and-recovery — identify what moved, inspect reflog, create a rescue branch, prefer reversible steps first

Use the detailed command packets in references/mode-selection-and-command-packets.md when you need the expanded workflow.

Step 7: Keep boundaries sharp

Before finalizing:

  • Do not turn this into a hosted PR tutorial.
  • Do not pretend every branch should be rebased.
  • Do not recommend reset --hard casually without naming the data-loss risk.
  • Do not hide the solo-vs-shared branch distinction.
  • Do not drift into code-review judgment, root-cause analysis, or backlog design.

Output format

Always return a compact Git Workflow Brief, not a giant command dump.

Required qualities:

  • choose one mode
  • state the collaboration risk
  • prefer the safest reversible path that solves the current problem
  • make rewrite risk explicit
  • include a recovery fallback when the commands have teeth
  • keep routing boundaries to review, debugging, planning, and hosted PR workflows visible

Examples

Example 1: rebased branch needs safe push

Input

I rebased my feature branch onto main and now I need to push it without overwriting teammates.

Output sketch

  • Mode: push-safety
  • State whether the branch looks solo or shared
  • Recommend git push --force-with-lease origin <branch> only if rewrite is expected
  • Watch-out warns against raw --force

Example 2: clean up local commits before review

Input

Help me turn these messy local commits into something clean before review.

Output sketch

  • Mode: commit-shaping
  • Suggest explicit staging plus git rebase -i or git commit --amend
  • Keep the goal focused on reviewable commit units, not review comments themselves

Example 3: wrong-branch reset panic

Input

I think I hard-reset the wrong branch. Can Git recover this?

Output sketch

  • Mode: undo-and-recovery
  • Start with git reflog
  • Create a rescue branch from the pre-reset SHA before further cleanup
  • Explain when to stop and avoid more destructive commands

Example 4: request is really PR review

Input

Review this PR and tell me if the architecture is okay.

Output sketch

  • Route away from git-workflow
  • Explain that local Git prep is not the main problem here
  • Hand off to code-review

Best practices

  1. Inspect before surgery. Status, branch, and recent log beat guesswork.
  2. Prefer reviewable commits over giant snapshots. Commit shape affects review quality.
  3. Treat history rewrites as collaboration decisions, not personal preferences. Shared branches change the answer.
  4. Use --force-with-lease, not raw --force. Rewrite safely or do not rewrite.
  5. Reach for reflog early in recovery. Lost commits are often only misplaced pointers.
  6. Choose the smallest safe fix. Not every problem needs branch surgery.
  7. Route out when the problem changes. Review, debugging, planning, and hosted PR work stay separate.

References

平台分布

Codex

31.79%
按下载量换算191

Claude

30.71%
按下载量换算185

Cursor

18.41%
按下载量换算111

Gemini CLI

9.1%
按下载量换算55

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills