commit-jp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Commit

提交

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
    ,
    git diff
    , and
    git diff --staged
    .
  • Repository-specific commit rules (see AGENTS.md if present).
  • 会话历史(用于推断意图和理由)。
  • 通过
    git status
    git diff
    git diff --staged
    获取的实际变更。
  • 仓库特定的提交规则(若存在请参考AGENTS.md)。

Procedure

操作步骤

  1. Read session history and clarify scope, intent, and rationale.
  2. Inspect the working tree and staged changes (
    git status
    ,
    git diff
    ,
    git diff --staged
    ).
  3. After confirming scope, stage the intended changes (
    git add -A
    ).
  4. Validate newly added files. If build artifacts, logs, temp files, or other junk would be committed, confirm with the user before committing.
  5. If staging is incomplete or unrelated files are included, fix the index or ask.
  6. Choose an appropriate Conventional Commits type and scope for the change (e.g.
    feat(scope): ...
    ,
    fix(scope): ...
    ,
    refactor(scope): ...
    ).
  7. Subject line in Japanese: imperative mood, ≤72 characters, no trailing period.
  8. Body must include:
    • 概要: what changed (bullets).
    • 理由: why it changed, tradeoffs (bullets).
    • テスト: commands you ran, or
      未実行(理由)
      with a reason.
  9. In Codex, append
    Co-authored-by: Codex <codex@openai.com>
    as a trailer unless the user says otherwise.
  10. Wrap body lines at 72 characters.
  11. Write the message with a here-doc or temp file and use
    git commit -F <file>
    (avoid
    -m
    with embedded
    \n
    ).
  12. Commit only when the message matches the staged changes; otherwise fix the index or message first.
  1. 读取会话历史,明确变更范围、意图和理由。
  2. 检查工作区和暂存的变更(使用
    git status
    git diff
    git diff --staged
    命令)。
  3. 确认范围后,暂存目标变更(执行
    git add -A
    命令)。
  4. 验证新增的文件。若将提交构建产物、日志、临时文件或其他无用文件,需在提交前与用户确认。
  5. 若暂存不完整或包含无关文件,修正暂存区或询问用户。
  6. 为变更选择合适的Conventional Commits类型和范围(例如
    feat(scope): ...
    fix(scope): ...
    refactor(scope): ...
    )。
  7. 主题行使用日语:采用祈使语气,长度≤72字符,末尾无句号。
  8. 正文必须包含:
    • 概要:变更内容(使用项目符号)。
    • 理由:变更原因、取舍考量(使用项目符号)。
    • テスト:执行的命令,或标注
      未実行(理由)
      并说明原因。
  9. 在Codex中,除非用户另有说明,否则需添加
    Co-authored-by: Codex <codex@openai.com>
    作为尾部信息。
  10. 正文每行长度不超过72字符,自动换行。
  11. 使用here-doc或临时文件编写提交信息,然后执行
    git commit -F <file>
    命令(避免使用带嵌入
    \n
    -m
    参数)。
  12. 仅当提交信息与暂存变更匹配时才执行提交;否则先修正暂存区或提交信息。

Output

输出

  • One
    git commit
    that reflects the session and staged diff.
  • 一个能反映会话内容和暂存差异的
    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 "未実行(理由)"
最终提交信息正文中的概要理由テスト章节标题及其项目符号内容均需使用日语编写。