generate-commit-message-draft

A command that drafts a Git commit message from the changes currently staged for commit. Git is a tool for tracking code changes, and staged changes are the edits selected for the next commit.

In plain words
What is it for?
Reviewing staged files, checking the last five commit messages, and writing a commit-message draft to the repository’s temporary folder.
Why use it?
It removes the need to inspect every staged edit and remember the repository’s preferred commit-message style. If no changes are staged, it records that instead.

Command for Codex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/atman-33/kiro-for-codex-ide/generate-commit-message-draft
Clone the repo
git clone --depth 1 https://github.com/atman-33/kiro-for-codex-ide

Made for: Codex.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 977 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00977
Opus 5 $0.00000 $0.00489
Sonnet 5 $0.00000 $0.00195
Haiku 4.5 $0.00000 $0.00098

Measured 3d ago against content hash b8fba1aaa37a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

generate-commit-message-draft scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.codex/prompts/generate-commit-message-draft.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate Commit Message

You are a coding assistant operating at the root of a Git repository. Follow the steps below carefully. If any step fails, continue the process and note the reason in the Notes section at the end of the output.

Goal

  • Analyze the currently staged changes and generate a commit message.
  • Reference the last 5 commit messages to infer the repository’s preferred writing style (format, tone, and conventions).
  • Output the final message to .tmp/commit-message-draft.md, completely overwriting any existing content.

Steps

  1. Preconditions

    • Assume the working directory is the repository root.
    • If any Git command fails, continue and record the cause under Notes.
  2. Check staged files

    • Run:

      • git diff --staged --name-status
      • git diff --staged
    • If there are no staged changes, write the following to .tmp/commit-message-draft.md and stop:

      # Commit Message (Draft)
      
      No staged changes were found.
      
    • If staged files exist, proceed.

  3. Analyze the last 5 commit messages

    • Run: git log -n 5 --pretty=format:%H%n%s%n%b%n---END---

    • From these messages, infer:

      • Title format (e.g., feat: ..., Fix ..., etc.)
      • Language (English or Japanese dominant)
      • Title length range (e.g., 50–72 chars)
      • Body structure (paragraphs vs. bullet points, use of BREAKING CHANGE: or Refs #123)
      • Presence of footers (Co-authored-by, etc.)
    • Adopt a consistent style for the new message.

  4. Summarize staged changes

    • For each file, describe its intent in 1–2 sentences (why, what, how).
    • Order the summary by importance: major → minor changes.
    • If any destructive or API-breaking modifications are detected, add BREAKING CHANGE: at the end of the body.
    • If related issue/PR numbers can be inferred, include Refs #<number> in the footer.
  5. Compose the commit message

    • Title:

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 121 lines · 0 tokens per session scan A b8fba1aaa37a

Subscribe to this mod's changes

generate-commit-message-draft is a command published in the GitHub repository atman-33/kiro-for-codex-ide (16 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 977 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.