用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Integralist/agent-skills --skill commit命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
MANDATORY for any work on Go files (*.go). Load this before editing, reviewing, or creating any *.go file. Go coding conventions and style guide covering naming, error handling, testing, HTTP handlers, caching, concurrency, and observability.
Rewrite text to be more concise, clear, and direct without losing critical information. Inventories load-bearing details first, rewrites, then audits the rewrite to verify nothing essential was dropped — for a plan, technical guide, agent instructions, or any prose too long or hard to follow.
Write or improve technical documentation. Applies documentation best practices: brevity, focusing on why and what rather than how, simple visualizations, modularization, and decoupling from volatile code. Use when writing new documentation from scratch, or editing, or reviewing and rewriting existing documents for clarity and quality.
正在显示 SKILL.md
| name | commit |
| description | Create git commits with intelligent file grouping. Use when committing changes or drafting a commit message. |
| allowed-tools | Bash(git add:*), Bash(git diff:*), Bash(git commit:*) |
If the fields below show commands rather than output, run each one first.
git status 2>/dev/null || echo "(not a git repo)"git diff --cached 2>/dev/null || echo "(not a git repo)"git diff 2>/dev/null || echo "(not a git repo)"git log -5 --oneline 2>/dev/null || echo "(not a git repo)"git branch --show-current 2>/dev/null || echo "(not a git repo)"git diff --stat HEAD 2>/dev/null || git diff --stat --cached 2>/dev/null || echo "(not a git repo)"Review context above:
.env, .env.*, *.env, *secret*, *credential*, *.key).git status --porcelain), use
git add -N <file> then git diff to scan their contents for the
same secrets.--force flag, in which case proceed without asking. No exceptions.Assess staging state:
--allow-empty is not a substitute for one.Analyze files for grouping:
Decide on commits:
All files single purpose → one commit, no prompt
Files split into obvious groups → sequential commits, no prompt
Grouping ambiguous → prompt with 2-3 options
If grouping is ambiguous, present numbered options and wait for the user's response:
If splitting into multiple commits, order them so dependencies come first. Type definitions before consumers. Shared utilities before features that import them. If ordering is unclear, ask.
For each commit group:
If splitting into multiple commits, unstage everything first:
git reset --quiet (skip this if committing only what the user
already staged).
Stage specific files: git add <file1> <file2> (never -A or .).
Verify staged: git diff --cached --name-only.
Draft the commit message:
update X to Y, change config,
add field Z.adopt X for faster completion,
prevent dropped retries on burst.~/.gitcommit (or
chore, feat, fix, etc.).Write the commit message to a uniquely-named temp file with your
file-writing tool (NOT a shell heredoc), then commit from that file.
Use a random suffix so concurrent runs never collide, e.g.
/tmp/commit-msg-<random>.txt where <random> is a short random
string:
git commit -F /tmp/commit-msg-a1b2c3.txt
Do NOT pipe the message via a heredoc (git commit -F - <<'EOF').
git commit -F - reads stdin until the closing delimiter appears
alone at column 0; if the shell receives it indented, with trailing
whitespace, or without a final newline, git never sees the terminator
and blocks on stdin forever — the call then hangs until it times out
with no error. Writing a real file sidesteps stdin, heredocs, and
shell escaping entirely.
If any git commit call hasn't returned within a few seconds, assume
it is blocked reading stdin. Do not wait for the timeout — the message
never reached git. Re-run using the temp-file form above.
If pre-commit hook modifies files: review the changes. Only amend if they're mechanical (formatting, linting). If substantive or unclear, ask before amending.
Update project plan: If you have been working against a project
plan (a plan file, task list, or checklist in the conversation or
filesystem), mark the corresponding task done. Match the plan's
existing format: [x] for Markdown checklists, ✅ for emoji markers, or
whatever convention the document uses.
Skip these from commits unless the user explicitly asks to include them:
.claude/, .cursorrules, .cursorignore,
.github/copilot-instructions.md, .windsurfrules, .clinerules,
.gemini/, .codex/, .omp/, .pi/
Plan documents (docs/plans/*.md) and task lists (docs/tasks/*.md) need
special handling:
[x] checkboxes): commit freely — it's a new plan or task
list being checked in.Status field (e.g.
Planning or Ready → Complete), then move it to docs/plans/completed/ or
docs/tasks/completed/ and commit. Create the directory if it doesn't exist.
If unsure whether the document qualifies as complete, ask.Clear single purpose (no prompt):
Obvious split (no prompt, sequential commits):
Ambiguous (prompt):
The subject states why the change matters, not the mechanics. A
reader who never opens the diff should learn what improves. The diff
already shows what changed; the subject supplies the consequence.
Keep the type prefix and imperative mood from ~/.gitcommit.
BAD: fix(ratelimit): set burst to 200
GOOD: fix(ratelimit): raise burst so valid retries stop being dropped
Use the body for what changed and how it was verified.
Describe the diff, not the request. When the user's description and the actual change disagree — "fixed the nil pointer" against a diff holding no pointer — the message follows the diff, and you say plainly that the two differ. The commit outlives the conversation, so a claim that was only ever true in chat becomes a false permanent record.
Use counts: "3 files" not "several files".
Active voice, specific language.
Omit needless words — see
../shared/CONCISE-PROSE.md.
If ~/.gitcommit exists, read it for the user's preferred
commit-message conventions (type prefixes, scopes, subject style,
examples) and follow them.