Install
$ agentstack add skill-leolee0812-github-flow-skill-github ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
/github —— 正规化提交流程
把用户本地准备提交的改动,从"裸 push"变成一条完整的协作流程: 分支 → Issue → PR → 自审 → 合并。一次跑完,GitHub 雷达图的 Commits / Issues / Pull requests / Code review 四个维度同时 +1。
触发规则(重要)
- 只有用户显式执行
/github时才运行本流程。 - 用户平时的
git commit/git push/ 其他对话,绝不自动套用本流程。 - 如果用户只是问问题,不要直接动手,先确认。
默认策略(可在本文件里按自己喜好修改)
- 合并方式:跑到 merge 时停下来等确认。 把分支、Issue、PR、自审全做完,
合并前必须停下来,给用户看 PR 链接和 diff 摘要,等用户明确说"合并 / 合 / merge / 确认" 之后才执行 gh pr merge。绝不自动合并。
- Review 方式:只贴一句自查 comment。 不做实质代码审查,
只在 PR 上贴一条简短的 self-review comment 占位(一样计入 Code review 维度)。 想要真审查的话,把这条改成"先跑 /code-review 再贴结论"即可。
前置检查
按顺序确认,任何一项不满足就停下来告诉用户,别硬跑:
- 当前目录是 git 仓库:
git rev-parse --is-inside-work-tree gh已安装:gh --version(未安装就提示用户brew install gh或见 https://cli.github.com/)gh已登录:gh auth status(未登录就提示用户gh auth login)- 仓库有 GitHub remote:
git remote -v(没有就提示用户先gh repo create或加 remote) - 有改动要提交:
git status --porcelain(完全干净就告诉用户没东西可提交)
执行步骤
0. 摸清现状
git status --porcelain # 看有哪些改动
git branch --show-current # 当前在哪个分支
git diff --stat # 改动规模
git diff # 看具体改了什么,用来生成 Issue/PR/commit 文案
读完 diff,自己总结这次改动是什么、属于哪类(feat/fix/docs/refactor/chore), 不要为这种能自己判断的事去问用户。
1. 建 Issue
根据 diff 内容生成一个清晰的中文 Issue:
gh issue create --title "" --body ""
记下返回的 Issue 编号(如 #12),后面 PR 要用。
2. 切分支
分支名格式 /,例如 feat/history-list、fix/login-timeout。
- 当前在 main/master 且改动未提交:直接
git checkout -b,
未提交的改动会自动跟着带到新分支。
- 当前已在一个功能分支上:沿用当前分支即可,不用新建。
- 改动已经 commit 到了 main 但没 push:先
git branch保存,
再 git checkout ,然后把 main 回退到远端状态 (git checkout main && git reset --hard origin/main && git checkout )。 这一步有风险,执行前先跟用户说明并确认。
3. 提交并推送
git add -A
git commit -m ": "
git push -u origin
commit message 描述清楚改动,结尾加上(不想署名 AI 的话删掉这条即可):
Co-Authored-By: Claude
4. 开 PR(关联 Issue)
PR 描述里必须写 Closes #,这样合并后会自动关掉 Issue:
gh pr create --title ": " --body "$(cat
Closes #
EOF
)"
记下返回的 PR 编号。
5. 自审 comment
GitHub 不允许 approve 自己的 PR,所以用 --comment(一样计入 Code review):
gh pr review --comment --body "self-review:已本地测试,逻辑无误。"
6. 停下来等确认(关键)
到这里必须停。 向用户报告:
- Issue 链接 / 编号
- PR 链接 / 编号
- 一句话 diff 摘要(改了哪些文件、做了什么)
然后明确问:"确认合并吗?回复'合并'我就 squash 合进 main 并删分支。" 在用户明确同意前,不要执行任何合并命令。
7. 合并(仅在用户确认后)
gh pr merge --squash --delete-branch
合并后告诉用户:main 已更新、Issue 已自动关闭、分支已删除。
收尾报告
跑完后用一句话总结这次循环覆盖了哪几个雷达维度,让用户有"四个角都 +1"的反馈感。
异常处理
- 任一
gh/git命令报错,停下来把原始报错给用户,别盲目重试。 - 用户中途说"不合了",就保留 PR 开着,告诉他 PR 链接,下次可以手动合或继续改。
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: LeoLee0812
- Source: LeoLee0812/github-flow-skill
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.