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 or working-tree 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. Output language is auto-detected from the user's instruction, the request language, and recent commit history (English fallback); explicit phrases like `用中文提交`, `commit in English`, or `请使用中文拆分提交所有的改动` override detection. Agent commits add an `[AI]` header tag and audit trailers, enforce a Why line for feat/fix/refactor/perf, and support a `chore(wip)` checkpoint mode.
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.commit-language is detected, not fixed-default, because forcing one language fights repos (and users) whose history is already in the other. Resolve it in this order, then use it for scope, subject, body, and explanatory output:
请使用中文拆分提交所有的改动. Honor whichever language the user names.git log -n 20 --format=%s. Match what the repo already does so your commit doesn't read as an outlier.[AI], and trailers: detecting Chinese never changes whether [AI] or agent trailers attach.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-8, 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, 先提交一下,待会再整理.git log -n 20 --format=%s. Note the dominant subject language (this feeds commit-language step 3 in §0), whether subjects carry gitmoji, and whether they already use an [AI] tag.commitlint.config.*, .commitlintrc*, .czrc, .cz.*, .gitmessage, or a CONTRIBUTING commit section exists, treat its allowed type / scope list and length rules as authoritative over this skill's defaults.[AI] + agent trailers on, scope from the changed path.git diff --staged --name-only, plus untracked paths in all-changes). If it includes likely secrets (.env, *.pem, *.key, id_rsa, id_ed25519, *.p12, *.keystore) or large/binary blobs (> ~1 MB), do not commit silently. Surface each risky path with its staged/untracked/tracked state, size when practical, and why it is risky. For large files, ask the user to decide per path before staging or committing: intentionally commit it, leave it untracked, add or adjust a .gitignore pattern, or move it to Git LFS / external artifact storage. Do not treat all-changes as permission to sweep every large file into history. "Safely orchestrate" means catching leaked secrets and accidental artifacts before they enter history, not only splitting commits cleanly.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.scope from the changed paths instead of inventing one: take the common parent of the changed files. In this repo's layout skills/<category>/<name>/… → scope <name>, and platforms/<platform>/… → scope <platform>. Changes spanning unrelated top-level areas are a signal to split (§2), not a reason to pick a vague umbrella scope. Prefer a scope that already appears in git log when it fits.type in English — the Conventional Commit keyword is the one machine-parsed token and stays stable across languages.scope, subject, body, and explanatory output in the commit-language resolved in §0 (user instruction → request language → repo history → English fallback).type ∈ {feat, fix, refactor, perf} and checkpoint-mode is off.<skill-dir> below means this skill's base directory — the path announced when the skill loads. It is not an environment variable, so substitute the literal path:
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.--type for the commit type; choose a key from references/commit-types.md.--summary for the subject line content. The flag is --summary, not --subject; passing --subject is not accepted and fails argparse.--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--confidence / --scope-risk / --tested for the quality-trail trailers (Confidence: / Scope-risk: / Tested:)--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.--confidence <high|medium|low>, --scope-risk <narrow|moderate|broad>, and --tested "<how verified>". Recommended in agent-mode but not enforced — omit a field rather than guessing its value.--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. Then decide whether to pause:
请使用中文拆分提交所有的改动, and preflight found no secret/large-binary risk, no ambiguous split, no missing Why, and no draft-only wording.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. Put the message file outside the working tree — $(git rev-parse --git-dir)/COMMIT_MSG_SKILL or the OS temp dir — never inside the repo, where the all-changes flow's git add -A would sweep it into the commit..gitignore update first, then re-run preflight so ignored files are no longer part of the candidate set. Include .gitignore only when the user approved that ignore policy.all-changes is active for a single atomic commit, run git add -A only after the safety scan is clear or all risky files have explicit include/ignore decisions, so tracked, deleted, and safe untracked non-ignored files 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.git status, re-stage the hook's edits, and retry the same commit message. Say that the hook reformatted files — do not treat the reformatting as your own change.staged-only or all-changes mode was usedcommit-language and which signal chose it (user instruction / request language / repo history)[AI] tag was applied and which Agent-* trailers attachedConfidence / Scope-risk / Tested), if anychore(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.