Generate concise commit messages based on conversation context and minimal git inspection.
This skill generates concise, meaningful commit messages by:
git diff when context is unavailableSimply invoke this skill after making changes. The skill will:
git diff --cached to analyze changes<type>: <brief summary (<=50 chars)>
[Optional body: concise explanation of what/why, <=3 lines]
[Optional footer: Breaking changes, issue refs]
feat: New featurefix: Bug fixrefactor: Code restructure without behavior changeperf: Performance improvementdocs: Documentation onlystyle: Formatting, whitespacetest: Add/update testschore: Build, tools, dependenciesbuild: Build system changesci: CI/CD changesHas context if:
No context if:
If context available:
If no context:
# Get list of changed files with status
git diff --cached --name-status
# Get file-level stats
git diff --cached --stat
# Get actual changes (for understanding what was done)
git diff --cached
# Alternative: if nothing staged, check working directory
git status --short
git diff --stat
git diff
Principles:
Good Examples:
feat: add scroll limit config commands
Add get-scroll-settings and set-scroll-limit commands
to es_tool.sh for managing ES scroll configuration.
fix: ensure bulk requests end with newline
ES bulk API requires NDJSON format with trailing newline.
refactor: translate es_tool comments to English
Bad Examples:
feat: implement comprehensive elasticsearch scroll configuration management system
This commit adds a full suite of commands for managing scroll-related
settings in Elasticsearch including viewing current configuration,
modifying document count limits, enabling/disabling rejection behavior...
[TOO VERBOSE]
# Show what will be committed
git status --short
# Present message
echo "Proposed commit message:"
echo "----------------------------------------"
echo "<generated_message>"
echo "----------------------------------------"
echo ""
read -p "Commit these changes? (y/n): " response
CRITICAL: The commit message MUST be clean and professional. DO NOT include:
🤖 Generated with [Claude Code] markersCo-Authored-By: Claude attributionsThese add no value and clutter the commit history.
# Commit with generated message (NO extra metadata)
git commit -m "$(cat <<'EOF'
<generated_message>
EOF
)"
# Show result
git log -1 --oneline
START
|
v
Do we have conversation context about changes?
|
+-- YES --> Use context to generate message
| (Skip git diff)
|
+-- NO --> Run git diff to analyze changes
|
v
Are changes staged?
|
+-- YES --> git diff --cached
|
+-- NO --> git diff (working directory)
|
v
Generate concise commit message
|
v
Present to user for confirmation
|
v
User confirms?
|
+-- YES --> git commit
|
+-- NO --> Exit (no commit)
|
v
END
Conversation:
User: Add health check commands to es_tool.sh
Assistant: [edits es_tool.sh, adds check-health, check-shards, etc.]
User: Create a commit
Skill execution:
feat: add cluster health check commands
Implements check-health, check-shards, explain-allocation,
and fix-red-shards for ES cluster diagnostics.
Conversation:
User: Generate commit message
Skill execution:
diff --git a/script/es_tool.sh b/script/es_tool.sh
@@ -841,7 +841,7 @@ execute_http_request() {
- content_type="text/plain"
+ content_type="application/x-ndjson"
+ # Ensure body ends with newline
+ if [[ "$body" != *$'\n' ]]; then
+ body="${body}"$'\n'
+ fi
fix: correct bulk request content-type
Use application/x-ndjson and ensure trailing newline
for ES bulk API NDJSON format compliance.
Conversation:
User: Commit the fix for the bulk API newline issue
Skill execution:
git diff --cached --name-only (just filenames)
script/es_tool.sh
fix: ensure bulk requests end with newline
Add trailing newline to bulk request body for
ES NDJSON format requirements.
When user requests creating a tag (for CI/CD pipeline trigger, release, etc.):
Check existing tag format first:
git tag --sort=-creatordate | head -5
Keep format consistent - DO NOT add 'v' prefix unless project already uses it:
0.4.0, 0.3.0 → use 0.4.1 (no 'v')v0.4.0, v0.3.0 → use v0.4.1 (with 'v')Never assume tag format - always verify from existing tags
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer