Git助手
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: git-safe-pr-workflow
description: >- Use when this capability is needed. Guide users through a GitHub-first PR workflow that keeps…
category: 工程开发
runtime: 无特殊运行时
---
# git-safe-pr-workflow 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Overview / Safe Defaults / Inspect First”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Overview / Safe Defaults / Inspect First”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Overview / Safe Defaults / Inspect First”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: git-safe-pr-workflow
description: >- Use when this capability is needed. Guide users through a GitHub-first PR workflow that keeps…
category: 工程开发
source: tomevault-io/skills-registry
---
# git-safe-pr-workflow
## 什么时候使用
- 把工程方向的常用动作沉淀成 Agent 可调用的技能 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Overview / Safe Defaults / Inspect First」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "git-safe-pr-workflow" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Overview / Safe Defaults / Inspect First
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Git Safe Pr Workflow
Overview
Guide users through a GitHub-first PR workflow that keeps main clean without requiring
frequent local rebases. Prefer short-lived feature branches, merge origin/main into the
feature branch when syncing, and land changes with Squash and merge.
Bias toward safety over elegance. Choose reversible operations, avoid rewriting shared history, and teach the user in small steps while you work.
Safe Defaults
- Treat
mainandmasteras shared, sensitive branches. - Use a short-lived feature branch for every task.
- Assume a pushed branch or open PR may already be shared.
- Prefer
git fetchbefore any sync, merge, or recovery action. - Prefer merging
origin/maininto a feature branch over rebasing it. - Prefer
git revertover rewriting history when commits may already be pushed. - Prefer
Squash and mergeto keepmainclean.
Inspect First
Before any Git operation that changes history, branches, or remote state, inspect:
- current branch and whether it is the default branch
- clean vs dirty working tree
- upstream tracking branch and whether local commits are pushed
- whether the branch has an open PR or appears shared
- staged and unstaged diff when undoing or syncing work
If you cannot determine whether a branch is shared, assume it is shared and choose the safer path.
Standard Workflow
Use this as the default GitHub workflow for low-experience users:
- Branch from
main. - Commit locally on the feature branch in small logical steps.
- Open a PR early.
- When the branch falls behind
main, mergeorigin/maininto the feature branch. - Resolve conflicts carefully and verify the final code, not just the merge markers.
- Push the updated branch.
- Merge with
Squash and merge. - Delete the feature branch after merge.
Do not teach users to routinely rebase pushed PR branches just to get the latest main.
That workflow is where many novices re-introduce old code or lose work.
Opening PRs
When helping a user open a PR, treat the PR title as the likely final squash-merge commit.
- Write the title so it reads well on
mainafterSquash and merge. - Use a concise Conventional Commit style title when the repo uses that convention.
- Describe the final outcome, not the implementation journey or review process.
- Avoid titles like
WIP,fix stuff,address comments, orupdate branch.
Good default patterns:
feat: add <skill-name> skillfeat(<skill-name>): add <capability>fix(<skill-name>): correct <problem>docs: document <policy or workflow>
For the PR body:
- briefly state what changed
- briefly state why it changed
- mention testing or validation if relevant
If the repo uses GitHub squash merges, prefer the PR title as the default squash commit message.
Sync Decision Tree
- Need the latest
mainon a feature branch? Usefetch, then mergeorigin/maininto the feature branch. - Need a clean
mainhistory? Rely onSquash and merge, not local rebasing of the feature branch. - Need to clean up unpublished local commits? Rebase is acceptable only if the branch is clearly private, unpublished, and not under review.
- Need to undo pushed work? Use
revert. - Need to discard local-only work? Use the least destructive local undo that matches the goal.
If a user asks to rebase a pushed branch, explain why that is risky and propose merging
origin/main instead.
Conflict Resolution Rules
- Resolve conflicts to the desired final code state, not by blindly taking both sides.
- Assume old bugs can be reintroduced during conflict resolution.
- After resolving conflicts, inspect the affected files and summarize what changed.
- Run targeted verification after conflicts: tests, build, or focused checks in the touched area.
- If the resolution is non-obvious, explain it briefly to the user while making the change.
For detailed conflict-handling steps and examples, read references/conflict-resolution.md.
Recovery Rules
- If a merge is in progress and the user wants to stop, abort the merge rather than improvising.
- If a rebase is in progress and has gone wrong, stop and recover with
reflogor rebase abort. - If the wrong commit was pushed, prefer
revert. - If work was committed to the wrong branch, preserve it and move it rather than deleting it.
- When recovering history, explain what reference point you are returning to and why.
For recovery playbooks, read references/recovery.md.
Refuse or Warn Hard
- Do not commit directly to
mainunless the user explicitly asks and the repo policy allows it. - Do not force-push
mainor other protected branches. - Do not rebase a pushed/shared branch by default.
- Do not use
git reset --hard,git clean -fd, branch deletion, or tag deletion unless the user clearly wants destructive cleanup. - Do not bypass branch protections, required checks, or required review flows.
If the user explicitly wants a risky operation, explain the safer alternative first. Only proceed when the request is clear and the branch is not a protected/shared branch.
Teaching Behavior
Teach in short, repeatable notes while working:
- State what you are about to do and why it is the safer path.
- When rejecting rebase, explain that rebase rewrites commit history and is easy to misuse once a branch is pushed.
- When merging
origin/main, explain that this preserves the branch's existing commits and is easier to recover from. - After recovery, explain what went wrong, how you recovered, and what safer habit to use next time.
- Avoid long Git lectures. Teach the next decision, not the whole tool.
GitHub Settings To Recommend
When asked how to support this workflow at the repo level, recommend:
- protect
main - require pull requests before merge
- require status checks
- require at least one review
- enable
Squash and merge - disable
Rebase and merge - optionally disable regular merge commits if the team wants squash-only history
- set the default squash commit message to
Pull request title - auto-delete head branches after merge
For repo policy details, read references/repo-settings.md.
Quick Checklist
Before syncing a feature branch:
- confirm you are on the feature branch, not
main - fetch remote changes
- check for uncommitted work
- merge
origin/main, do not rebase by default - inspect and verify conflict resolutions
Before pushing:
- review
statusand diff - confirm no accidental changes to unrelated files
- explain any conflict resolution that changed behavior
Before undoing:
- determine whether the commits are pushed
- choose
revertfor pushed work - use local-only undo only for unpublished work
Source: caidanw/skills — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核