commit-jp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCommit
提交
Purpose
目的
- Produce a commit that reflects the real code changes and session context.
- Follow common git conventions (type prefix, short subject, wrapped body).
- Include both a summary and rationale in the body.
- Write commit messages in Japanese by default (if AGENTS.md or similar specifies another language, follow that; Japanese is the default).
- 生成能反映真实代码变更和会话上下文的提交。
- 遵循通用的Git约定(类型前缀、简短主题、换行的正文)。
- 正文需包含变更概要和理由。
- 默认提交信息使用日语编写(若AGENTS.md或类似文件指定了其他语言,则遵循该规定;日语为默认语言)。
When to Use
使用场景
- "commitして" (or similar), or when the user asks to commit, prepare a commit message, or finalize staged work.
- 当用户说“commitして”(或类似表述),或者用户要求提交、准备提交信息、完成暂存工作时。
Do Not Use When
禁用场景
The user wants push or PR creation as well (use a push skill instead).
当用户同时需要推送或创建PR时(请改用推送技能)。
Inputs
输入信息
- Session history (to infer intent and rationale).
- Actual changes via ,
git status, andgit diff.git diff --staged - Repository-specific commit rules (see AGENTS.md if present).
- 会话历史(用于推断意图和理由)。
- 通过、
git status和git diff获取的实际变更。git diff --staged - 仓库特定的提交规则(若存在请参考AGENTS.md)。
Procedure
操作步骤
- Read session history and clarify scope, intent, and rationale.
- Inspect the working tree and staged changes (,
git status,git diff).git diff --staged - After confirming scope, stage the intended changes ().
git add -A - Validate newly added files. If build artifacts, logs, temp files, or other junk would be committed, confirm with the user before committing.
- If staging is incomplete or unrelated files are included, fix the index or ask.
- Choose an appropriate Conventional Commits type and scope for the change (e.g. ,
feat(scope): ...,fix(scope): ...).refactor(scope): ... - Subject line in Japanese: imperative mood, ≤72 characters, no trailing period.
- Body must include:
- 概要: what changed (bullets).
- 理由: why it changed, tradeoffs (bullets).
- テスト: commands you ran, or with a reason.
未実行(理由)
- In Codex, append as a trailer unless the user says otherwise.
Co-authored-by: Codex <codex@openai.com> - Wrap body lines at 72 characters.
- Write the message with a here-doc or temp file and use (avoid
git commit -F <file>with embedded-m).\n - Commit only when the message matches the staged changes; otherwise fix the index or message first.
- 读取会话历史,明确变更范围、意图和理由。
- 检查工作区和暂存的变更(使用、
git status和git diff命令)。git diff --staged - 确认范围后,暂存目标变更(执行命令)。
git add -A - 验证新增的文件。若将提交构建产物、日志、临时文件或其他无用文件,需在提交前与用户确认。
- 若暂存不完整或包含无关文件,修正暂存区或询问用户。
- 为变更选择合适的Conventional Commits类型和范围(例如、
feat(scope): ...、fix(scope): ...)。refactor(scope): ... - 主题行使用日语:采用祈使语气,长度≤72字符,末尾无句号。
- 正文必须包含:
- 概要:变更内容(使用项目符号)。
- 理由:变更原因、取舍考量(使用项目符号)。
- テスト:执行的命令,或标注并说明原因。
未実行(理由)
- 在Codex中,除非用户另有说明,否则需添加作为尾部信息。
Co-authored-by: Codex <codex@openai.com> - 正文每行长度不超过72字符,自动换行。
- 使用here-doc或临时文件编写提交信息,然后执行命令(避免使用带嵌入
git commit -F <file>的\n参数)。-m - 仅当提交信息与暂存变更匹配时才执行提交;否则先修正暂存区或提交信息。
Output
输出
- One that reflects the session and staged diff.
git commit
- 一个能反映会话内容和暂存差异的操作。
git commit
Template
模板
Types and scopes are examples—adjust to the repo and the change.
<type>(<scope>): <short Japanese summary>
概要:
- <what changed>
- <what changed>
理由:
- <why it changed>
- <why it changed>
テスト:
- <commands run> or "未実行(理由)"The section headings 概要, 理由, and テスト and their bullets are written in Japanese in the final commit message body.
类型和范围仅为示例,请根据仓库和变更情况调整。
<type>(<scope>): <short Japanese summary>
概要:
- <what changed>
- <what changed>
理由:
- <why it changed>
- <why it changed>
テスト:
- <commands run> or "未実行(理由)"最终提交信息正文中的概要、理由和テスト章节标题及其项目符号内容均需使用日语编写。