Commit staged with generated message

VerifiedSafe

Generates a commit message from staged changes, requests approval, then commits. Stage files first with `git add` before running.

Sby Skills Guide Bot
DevelopmentBeginner
506/2/2026
Claude Code
#git#commit-message#staged-changes#gpg-sign

Recommended for

Our review

Generates a commit message from staged changes, pauses for approval, then commits with GPG signature.

Strengths

  • Analyzes staged files and recent commit history to craft a relevant message
  • Includes a human approval step to prevent inappropriate messages
  • Automatically adds diff stats and added/removed symbols
  • Enforces GPG signing for secure traceability

Limitations

  • Requires files to be staged via git add beforehand
  • Message generation may be slow for large changes (over 500 lines)
  • Does not handle merge conflicts or emergency commits
When to use it

When you want a structured, project-consistent commit message with manual review before signing.

When not to use it

For trivial commits (e.g., fixing a typo) where a quick message suffices, or in fully automated pipelines without human oversight.

Security analysis

Safe
Quality score88/100

The skill only runs standard git commands to review staged changes, generate a commit message, and commit after user approval. There are no destructive operations, data exfiltration, or obfuscated payloads.

No concerns found

Examples

Basic staged commit
Commit the staged changes with a generated message.
Specify custom message after generation
Stage all changes and commit using the commit-staged skill, but I want to edit the message after it's generated.
Commit with GPG sign
Run the staged commit skill, then after approval use GPG signature.

name: committing-staged-with-message description: Generate commit message for staged changes, pause for approval, then commit. Stage files first with git add, then run this skill. compatibility: Designed for Claude Code metadata: model: haiku argument-hint: (no arguments needed) disable-model-invocation: true allowed-tools: Bash, Read, Glob, Grep

Commit staged with Generated Message

Step 1: Analyze Staged Changes

Run these commands using the Bash tool to gather context:

  • git diff --staged --name-only - List staged files
  • git diff --staged --stat - Diff stats summary
  • git log --oneline -5 - Recent commit style
  • git diff --staged - Review detailed staged changes. Size guard: if --stat shows >10 files or >500 lines changed, skip the full diff and rely on --stat + --name-only to generate the message.

Step 2: Generate Commit Message

Use the Read tool to check .gitmessage for commit message format and syntax.

The commit message body MUST include (concisely — no padding, no redundancy):

  1. What changed: bullet points per file or logical group
  2. Symbols added/removed (when applicable): functions, classes, tests
  3. Diff stats: lines added/removed (from --stat summary line) — MUST be the last line of the body
    • Format: + symbol_name, - symbol_name
    • Omit for config/docs/formatting-only changes

Keep the message laser-focused. Do not repeat the subject line in the body.

Step 3: Pause for Approval

Please review the commit message.

  • Approve: "yes", "y", "commit", "go ahead"
  • Edit: Provide your preferred message
  • Cancel: "no", "cancel", "stop"

Step 4: Commit

Once approved:

  • git commit --gpg-sign -m "[message]" - Commit staged changes with approved message (GPG signature mandatory)
  • git status - Verify success
Related skills