From glab
List commits the current branch has ahead of a base branch, with Chinese summary and warnings about debug-only commits (wip / fix typo / test). Use when user asks 比 develop 多了哪些 commit / commits ahead / 我加了哪些提交 / 这分支有哪些改动.
How this skill is triggered — by the user, by Claude, or both
Slash command
/glab:commits-aheadThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
依赖 `git`(必装,本仓库假设已有)。**不依赖 glab**(纯本地 git 操作),所以无需调 `glab:setup`。
依赖 git(必装,本仓库假设已有)。不依赖 glab(纯本地 git 操作),所以无需调 glab:setup。
develop
maingit rev-parse --abbrev-ref --symbolic-full-name @{u} 拿 upstreamdevelopgit rev-parse --verify <base> 2>&1
如果失败(base 不存在),先 git fetch origin <base>:<base> 拉一下,再次校验。仍失败就告诉用户"base 分支 <base> 不存在,请检查名字",结束。
git log <base>..HEAD --oneline --no-merges
得到形如:
abc1234 feat(logger): 接入 SnowLogger
def5678 fix(desensitization): 修复脱敏
...
git diff <base>..HEAD --stat | tail -1
例如:12 files changed, 234 insertions(+), 56 deletions(-)
## <当前分支> 领先 <base> 的提交
总览: <N> 个 commit, <X> 文件改动 (+<additions> / -<deletions> 行)
### 提交列表
| SHA | 类型 | 描述 |
|---|---|---|
| abc1234 | feat | 接入 SnowLogger |
| def5678 | fix | 修复脱敏 |
| ... |
### 调试性提交检查(如有)
⚠ 检测到以下调试性提交,建议 `git rebase -i <base>` 合并或删除后再提 MR:
- xxx1234 "wip: 测试中"
- yyy5678 "fix typo"
commit message 满足任一条件视为调试性:
wip / WIP / fixup / squashfix typo / 修正错字 / 修复拼写test 但不是 conventional test: 前缀(即不以 test: / test( 开头)merge / update 之类无意义提交)调试 / 临时 / debug如果没有调试性提交:提示 "可以 /glab:mr-create 提交 MR 了"。
如果有调试性提交:列 git rebase -i <base> 命令并简单解释(reword / squash / drop)。
npx claudepluginhub itmrboy/glab_skills --plugin glabCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.