commit
Create a well-formed git commit from current changes using session history for rationale and summary. Use when asked to commit, save, or push current changes.
- License 许可
- MIT
- 所属仓库
- japurcell/skills
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- commit
- description
- Create a well-formed git commit from current changes using session history for rationale and summary. Use when asked to commit, save, or push current changes.
- argument-hint
- [<issue_numbers>] [<co_author>]
02 资源文件 23
- 参考文档evals/evals.json19.1 KB
- 参考文档evals/files/agent-attribution/input.json461 B
- 参考文档evals/files/ambiguous-multi-surface/input.json794 B
- 参考文档evals/files/copilot-attribution/input.json394 B
- 参考文档evals/files/explicit-identity-override/input.json377 B
- 参考文档evals/files/explicit-opt-out/input.json344 B
- 参考文档evals/files/generated-artifact-stop/input.json866 B
- 参考文档evals/files/git-only-established-human/input.json425 B
- 参考文档evals/files/git-only-explicit-human/input.json378 B
- 参考文档evals/files/no-agent-contribution/input.json345 B
- 参考文档evals/files/preserve-and-deduplicate-contributors/input.json614 B
- 参考文档evals/files/repository-policy/input.json481 B
- 参考文档evals/files/single-file-on-main/input.json858 B
- 参考文档evals/files/staged-bugfix-pr/input.json890 B
- 参考文档evals/files/user-overrides-repository-policy/input.json511 B
- 参考文档evals/files/validation-before-commit/input.json382 B
- 脚本evals/grade_benchmark.py27.3 KB
- 脚本evals/prepare_validation_workflow.py6.0 KB
- 参考文档evals/README.md8.6 KB
- 脚本evals/test_grade_benchmark.py28.1 KB
- 脚本evals/test_validate_message.py9.4 KB
- 参考文档references/message.md3.6 KB
- 脚本scripts/validate_message.py4.9 KB
03 SKILL.md 正文
Commit
Inputs
issue_numbers: accept#123or123; dedupe and keep order.co_author: explicit co-author attribution or user opt-out. User instructions take precedence over repository attribution rules and agent defaults.- Documented repo-specific commit conventions override message-format defaults in this skill; retain scope, safety, and execution rules.
Steps
-
Read the conversation for intent, scope, rationale, tests, and issues.
-
Inspect git state before changing anything:
git status --short --branch git diff --cached git diff git diff --cached --name-only git diff --name-only git ls-files --others --exclude-standard git branch --show-current git log --oneline -10 git config user.name git config user.email -
Stop and report the blocker if:
- Not in a git repo
- Git author name or email is unset
- No changes exist within the selected scope
- Conflicts or unmerged paths exist
HEADis detached and no branch will be created- A required command fails unexpectedly
-
Stage intended changes, including new files (
git add -A) after confirming scope. -
Sanity-check newly added files. Stop and report blocker if anything looks random or likely ignored (build artifacts, logs, temp files, scratch outputs).
-
If staging is incomplete or includes unrelated files, ask the user for confirmation before proceeding.
-
Build the message using commit message, write it to a UTF-8 file, and validate it with the bundled script before creating exactly one commit:
python3 <skill-root>/scripts/validate_message.py <message-file> [options] git commit -F <message-file>Before drafting, decide whether the current agent contributed by producing or editing changes in this session. Running Git for changes made by someone else does not establish contribution. Resolve attribution in this order: explicit user instructions, including an identity or opt-out; documented repository policy; then the verified default identity for each contributing agent in contributor attribution. Preserve other reliably established contributors and deduplicate identical identities. Never guess an unknown agent's identity or treat an unknown agent as Codex. If a contributing agent's identity cannot be verified, stop and report that blocker.
No current-agent contribution suppresses only that agent's automatic default; retain explicit and established contributors unless an applicable opt-out or policy excludes them. Add one
Co-authored-by: Name <email>trailer for each resolved contributor and pass that identity once through--co-author 'Name <email>'. When the resolved set is empty, pass no--co-authoroptions and add no trailers. User instructions override conflicting repository policy; repository policy overrides the defaults. Keep Git's author name and email unchanged.Pass
--issue <id>for each verified issue in input order (#123or123; repeatable), and--fixes <id>only for each specific issue the user explicitly intends to close. Fix validation failures before committing the same file; revalidate after every edit. Exit 1 means invalid content; exit 2 means a usage or file-read error. Documented repo conventions still override default-format checks; resolve only those conflicts against the documented conventions. The checker cannot establish imperative wording, correct type, truthful content, session provenance, issue existence, closing intent, or authorship; verify those before passing options.Do not use escaped newlines with
-m. -
Verify the SHA, committed diff, and remaining staged and unstaged changes. Confirm exactly one commit was created with the selected scope. Report discrepancies and stop before pushing.
-
Push only if the user explicitly asked.
-
Report the branch, commit SHA, and subject, or the exact blocker and next action if stopped.
04 同仓库更多 Skills
spec-create
Create or revise a portable behavioral SPEC for a feature or whole product. Use when specifying a new idea, documenting an existing system for reimplementation, or defining a change while preserving compatibility. Implementation planning is a separate task.
prd-ralph
Complete at most one eligible unfinished PRD task, verify it, log progress, and optionally create one scoped commit.
fsdp-style-guide
Mandatory for all UI/UX design, implementation, review, audit, or visual regression tasks. Always use for any work that affects user-facing appearance, behavior, accessibility, branding, layout, navigation, forms, dialogs, alerts, tables, or visual design.
agency-priorities
Provide self-contained USDA strategic goals and Forest Service priorities for agency briefings, proposals, and work-plan alignment. Use when explaining agency direction or evaluating how a project contributes to USDA and Forest Service priorities.
accomplishment-report
Create a concise Forest Service executive accomplishment report when all work in an ExecPlan is completed, or update its existing report. Use at ExecPlan closeout and when asked to report completed work, agency alignment, and estimated AI-assisted versus human-only time and cost savings.
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.