content/skills/git-github-collaboration/git-commit/SKILL.md
Safely orchestrate Conventional Commits for staged Git changes, or for all working-tree changes when the user explicitly asks to include everything. Use when the user asks to write a commit message, split staged changes, split all changes, commit everything regardless of stage state, include untracked files in the commit set, organize a messy index before committing, or generate structured commit text without pushing by default. Default to English. Switch to Chinese only when the user explicitly says `请使用中文拆分提交所有的改动`. Agent commits automatically inject `Agent-Task` / `Agent-Model` / `Generated-By` trailers and an `[AI]` header tag; Why-line is required for feat/fix/refactor/perf; supports a `chore(wip)` checkpoint mode for long-running agent tasks.
npx skillsauth add bahayonghang/my-claude-code-settings git-commitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this workflow in order: preflight -> split plan -> classify -> compose -> commit/draft -> verify.
Decide the active change authority and output language before doing anything else:
staged-only is the default. Respect the current index and treat unstaged or untracked files as context only.all-changes is allowed only when the user explicitly asks to include everything, such as "all changes", "所有改动", "全部改动", "不管有没有 stage", or "包括未跟踪文件". In this mode, the skill may rebuild the index from the full working tree and should treat any existing partial staging as intentionally overridden by the user.english-output is the default. Use English for commit scope, subject, body, and explanatory output.chinese-output is allowed only when the user explicitly says 请使用中文拆分提交所有的改动. Treat other Chinese-language prompts as english-output unless they include that exact phrase.agent-mode is on by default whenever this skill runs (the caller is an agent). It injects [AI] in the header, attaches Agent-Task / Agent-Model / Generated-By trailers, and applies the Why-line rule for feat / fix / refactor / perf. Turn it off only when the user explicitly says "no AI tag", "不要 AI 标记", "不加 agent trailer", or equivalent.git status --short first. Then inspect the active change set:
staged-only: git diff --staged --stat and git diff --stagedall-changes: git diff --stat, git diff, git diff --staged --stat, and git diff --staged
If rtk is available, prefer rtk git status, rtk git diff --staged, and rtk git diff for model-visible inspection.staged-only or all-changes)staged-only + no staged changes: stop and tell the user to stage files first.all-changes + no staged, unstaged, or untracked changes: stop and say there is nothing to commit.git commit.agent-mode):
agent-model from the model currently running this skill (e.g. claude-opus-4-7, claude-sonnet-4-6, gpt-5-codex). This value is required.agent-task by trying, in order: (a) explicit task ID or issue URL in the user message, (b) closes #N / refs #N mentioned by the user, (c) ticket ID extracted from the current branch name, (d) Agent-Task value from the previous commit on this branch, (e) fallback to unspecified.agent-prompt-ref only when a stable prompt reference exists; otherwise leave empty.checkpoint-mode: triggered by user words such as checkpoint, 打个 checkpoint, 先存一下, WIP, [WIP], work in progress, 先提交一下,待会再整理.all-changes mode, it is acceptable to ignore the current staged subset only because the user explicitly asked to include everything.checkpoint-mode). For every candidate commit, answer:
git revert <sha> undo it without leaving the repo inconsistent?all-changes mode, say whether execution will rebuild the index per commit.checkpoint-mode is detected, skip the atomic check and prepare a single chore(wip): [AI] 🔧 [WIP] <subject> commit covering the active change set. Skip Why enforcement. Still attach agent trailers. In §6 Verify, remind the user to squash [WIP] commits before merging.type, optional scope, emoji policy, output language, [AI] policy, Why policy, and whether ! / BREAKING CHANGE is required.type in English.scope, subject, body, and explanatory output to English.scope, subject, body, and explanatory output to Chinese only when the user explicitly says 请使用中文拆分提交所有的改动.type ∈ {feat, fix, refactor, perf} and checkpoint-mode is off.COMMIT_COMPOSER="$SKILL_DIR/scripts/compose_commit_message"$COMMIT_COMPOSER = "$SKILL_DIR/scripts/compose_commit_message.ps1"bash "$COMMIT_COMPOSER" ...& "$COMMIT_COMPOSER" ...
The wrapper auto-detects python3, python, or py, so do not write python ... directly in the compose step.--body-line for body content--why for the motivation line (rendered as Why: <text> at the top of body)--closes for closing issues--refs for non-closing issue references--footer-line for other structured trailers such as Jira references--breaking-header when the header itself must include !--breaking when a BREAKING CHANGE: trailer is needed--no-emoji only when the user explicitly opts out--ai --agent-model <model> --generated-by-agent.--agent-task <value> (use unspecified only as last-resort fallback).--agent-prompt-ref <ref> only when a stable reference exists.--why "<motivation>" and --require-why so the script fails loudly when Why is missing.checkpoint-mode, use --type chore --scope wip and prepend [WIP] to summary; skip --require-why; skip --closes / --refs.--ai, omit all --agent-* flags, omit --generated-by-agent. Fall back to plain Conventional Commit.Co-Authored-By, attribution lines (e.g. 🤖 Generated with Claude Code), or push commands by default. Generated-By: agent is a structured trailer for audit grep, not an attribution line — it stays.git commit, display the final commit message (header + body + footer) and the list of files to be committed. Explicitly call out whether [AI] is in the header, whether Why is present, and which agent trailers will attach. If the user has been interactive in this session, wait for explicit confirmation. If the user pre-approved (e.g. "直接提交", "commit it"), proceed without pausing.staged-only is active, commit only the safe staged set. Write the message to a file and commit with git commit -F <message-file> so PowerShell and POSIX shells behave consistently.all-changes is active for a single atomic commit, run git add -A first so tracked, deleted, and untracked non-ignored files all enter the commit set.all-changes mode, rebuild the index one commit at a time using file/path boundaries only. Use full-worktree staging plus path-based staging or unstaging as needed, but stop if the split would require hunk-level staging or other hidden reconstruction.rtk is available and the user wants compact feedback, rtk git commit -F <message-file> is acceptable for the final commit step.git push if the user explicitly asked for it.git commit output before claiming success.staged-only or all-changes mode was usedenglish-output or chinese-output was used[AI] tag was applied and which Agent-* trailers attachedchore(wip) checkpointstaged-only, ambiguous split, Why missing for Why-required type, or draft-only request.chore(wip): commits, remind the user to squash them via git rebase -i <base-branch> before merging — but do not run rebase from this skill.tools
文献深度解读助手,像研究生导师一样交互式解读 Zotero 库中的学术论文,面向计算机科学、深度学习、自动化等方向(个人向)。当用户提供文献题目、DOI、PDF 或要求解读某篇论文时触发,通过 Zotero MCP 优先获取全文,并根据用户意图自动选择快速筛选、导师深读或研究复盘模式。完整深读时先完成叙事类型判断、阅读前预检、novelty 校准和作者思考路径重建,再整体概览,并基于图例、正文和表格逐图详细解读(Zotero MCP 无法提取 PDF 图片,解读基于文字信息,必要时提醒上传图片)。适用于:(1)快速判断文献是否值得深读 (2)深入理解某篇论文 (3)学习文章中的方法和技术 (4)批判性分析研究设计 (5)寻找研究灵感。需要多篇论文综合、对比或找研究空白,或 arXiv/DOI 批量规范化时,改用 paper-workbench。
development
Review Codex, Claude, OpenAI, or other agent skill directories as reusable capability packages. Use when asked to audit, review, improve, score, rewrite, debrand, package, or document a SKILL.md, skill package, marketplace skill, or agent skill directory, especially when the user wants a comprehensive findings-first report with concrete patch recommendations and validation steps.
development
Turn vague or complex Codex tasks into strong `/goal` commands with outcome, verification, constraints, boundaries, iteration policy, completion evidence, and pause/block conditions. Use when the user asks for Codex goal instructions, Goal 指令, 目标指令, `/goal` prompts, 中文 Goal 模板, plan-to-goal interviews, success criteria, verification commands, or bounded agent work definitions.
tools
Write, debug, and validate ast-grep structural code search rules. Use this skill when the user needs syntax-aware code search, AST pattern matching, structural refactor discovery, language-construct queries, or searches that plain text tools like rg can miss, such as finding functions with particular descendants, calls inside specific contexts, missing error handling, React hook shapes, decorators, or other Tree-sitter-backed code structures.