All skills
cat-xierluo avatar

/git-workflow

@b42f463

Git 工作流安全助手。本技能应在需要执行 GitHub Actions 额度治理(CI 分钟耗尽停挂止血、workflow 停挂/恢复)、分支管理、长期集成分支(long-lived integration branch)、Monorepo 安全合并、PR 创建/审查/合并、冲突处理、cherry-pick、安全回退、stale/已合并/冗余分支审计与清理(branch cleanup,含 squash/rebase merge 校验;用户以「分支有点多」「冗余分支」「清理一下分支」等口语提出时同样适用,先跑 scripts/branch-audit.sh 只读盘点再确认执行)、本地仓库 worktree→PR→merge 标准流程(maoscripts 类仓库 SOP)、开 worktree 前 base 同步检查(防 main drift 致 PR not mergeable)、多 worktree 并行时 main worktree 占用处理、Git 提交身份自检与身份污染排查(identity-audit.sh whoami/history:提交前身份来源链自检、全仓 author/committer/Co-authored-by 尾注审计;用户以「提交身份不对」「多出 coauthor」「陌生作者」「冒出别的署名」等口语提出时同样适用)时使用。不要用于:批量生成提交信息、项目任务分配、长期任务状态管理或本地多 Agent 会话编排。

Use this Skill: https://skilld.dev/gh/cat-xierluo/legal-skills/git-workflow

This session only. Nothing lands on disk.

referencesgh-cli-quickref.md

≈819 tokens on demand. Your agent reads this file only when SKILL.md points to it.

gh CLI 常用命令速查

基于 GitHub CLI (gh) 的常用操作参考。

认证

gh auth login          # 交互式登录
gh auth status         # 查看认证状态

Pull Request

创建

gh pr create --title "feat(module): 描述" --body "正文"
gh pr create --draft   # 创建为草稿

查看

gh pr list                           # 列出 open PR
gh pr list --state all               # 所有状态
gh pr list --author @me              # 我创建的
gh pr view <number>                  # 查看详情
gh pr diff <number>                  # 查看 diff
gh pr checks <number>                # 查看 CI 状态

审查

gh pr review <number> --approve --body "通过"
gh pr review <number> --request-changes --body "建议"
gh pr review <number> --comment --body "评论"

合并

合并前先检查 PR 状态、diff 和 checks:

gh pr view <number> --json title,state,isDraft,mergeable,reviewDecision,headRefName,baseRefName
gh pr diff <number> --name-only
gh pr diff <number> --stat
gh pr checks <number>

diff 不可读、checks 未知、review 不明确、PR 是 draft、mergeable 不明确或 diff 超范围时,不要 merge。

PR 正文缺少 Summary、Test plan、Agent Attribution 或 Issue/Task 关联时,先要求补齐。Monorepo PR 如果出现跨目录污染、大量删除、敏感配置或版本清单不一致,不要 merge。

gh pr merge <number> --squash        # Squash merge
gh pr merge <number> --merge         # Merge commit
gh pr merge <number> --rebase        # Rebase merge

其他

gh pr update-branch <number>         # 同步最新 base
gh pr ready <number>                 # 草稿转为正式
gh pr close <number>                 # 关闭 PR
gh pr reopen <number>                # 重新打开

Issue

创建

gh issue create --title "feat: 描述" --body "正文"
gh issue create --label "bug" --assignee @me

查看

gh issue list                         # 列出 open issue
gh issue list --state all             # 所有状态
gh issue list --label "bug"           # 按标签过滤
gh issue view <number>                # 查看详情

管理

gh issue close <number>
gh issue reopen <number>
gh issue edit <number> --title "新标题"
gh issue comment <number> --body "评论"

Repository

gh repo view                          # 查看当前仓库
gh repo clone <owner>/<repo>          # 克隆
gh repo fork <owner>/<repo>           # Fork

Release

gh release create v1.0.0 --title "v1.0.0" --notes "发布说明"
gh release list
gh release download v1.0.0

Actions

gh run list                           # 列出 workflow 运行
gh run view <run-id>                  # 查看运行详情
gh run watch                          # 实时监控
gh workflow list                      # 列出 workflow

搜索

gh search repos "query"               # 搜索仓库
gh search issues "query"              # 搜索 issue
gh search code "query"                # 搜索代码

API

gh api repos/:owner/:repo/pulls/123   # 调用 REST API
gh api graphql -f query='...'         # 调用 GraphQL

Source: SKILL.md on GitHub

1 warning10d3 checks · Risk SAFE
  • Gen Agent Trust Hub10d

    The skill provides a comprehensive set of guidelines and safety scripts for managing Git workflows, including branch lifecycle management, PR reviews, and GitHub Actions quota monitoring. It features identity verification gates and strictly requires user authorization for destructive operations like force-pushing. No malicious patterns or security risks were identified.

  • Socket10d

    No alerts

  • Snyk10d

    Risk: MEDIUM · 1 issue

Signed by skilld at b42f463. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 20 hours ago.

Activeupdated 2 days ago
Other metadata
metadata
{
  "version": "1.9.0",
  "homepage": "https://github.com/cat-xierluo/legal-skills",
  "author": "杨卫薪律师(微信ywxlaw)"
}

README badge

README badge for cat-xierluo/legal-skills/git-workflow