Commit Message
The commit-message skill generates clear, conventional commit messages from diffs. It is designed for piped input (--stdin) and non-interactive workflows, making it ideal for shell aliases and Git hooks.
SKILL.md Overview
The skill defines:
- Conventional Commits format —
<type>(<scope>): <subject>with an optional body - Type vocabulary — feat, fix, refactor, docs, test, chore, perf, style
- Rules — 72-char subject lines, imperative mood, explain “why” not “what”
- Split guidance — If multiple logical changes are detected, suggest separate commits
commit-message/└── SKILL.mdBasic Usage
Run from GitHub
Run the official example directly from the docs:
skillx run github:skillx-run/skillx/examples/skills/commit-message "Generate a commit message for my staged changes"Run from a Local Clone of this Repository
If you are working inside a clone of skillx-run/skillx, use the repository path:
skillx run ./examples/skills/commit-message "Generate a commit message for my staged changes"Interactive Mode
Run the skill and describe what you changed:
skillx run github:skillx-run/skillx/examples/skills/commit-message "Generate a commit message for my staged changes"The agent reads your staged diff and produces a commit message.
Piped Input with —stdin
The most powerful usage pipes a diff directly into the skill:
git diff --staged | skillx run github:skillx-run/skillx/examples/skills/commit-message --stdinThis sends the staged diff as input to the agent. The skill’s instructions tell the agent to analyze the diff and generate a conventional commit message.
Print Mode (Non-Interactive)
Use --print to output the skill content without launching an interactive session. This is useful for scripting:
git diff --staged | skillx run github:skillx-run/skillx/examples/skills/commit-message --stdin --printIn --print mode, skillx outputs the skill instructions to stdout and exits immediately — no agent session is created, no cleanup is needed.
Workflow Examples
Quick Commit Message
A one-liner to generate and review a commit message:
git diff --staged | skillx run github:skillx-run/skillx/examples/skills/commit-message --stdinThe agent outputs something like:
feat(scanner): add SARIF 2.1.0 output format
Add structured SARIF output to the scan report formatter, enablingintegration with GitHub Code Scanning and other SARIF-compatibletools.Review Before Committing
Generate the message, review it, then commit:
# Stage your changesgit add -p
# Generate the commit messageskillx run github:skillx-run/skillx/examples/skills/commit-message "Generate a commit message for my staged changes"
# Copy the suggested message and commitgit commit -m "feat(scanner): add SARIF 2.1.0 output format"Diff of Recent Commits
Generate a message for squashing recent commits:
git diff HEAD~3 | skillx run github:skillx-run/skillx/examples/skills/commit-message --stdinPR Description
The skill also works for pull request descriptions by providing a broader diff:
git diff main...HEAD | skillx run github:skillx-run/skillx/examples/skills/commit-message --stdinThe Conventional Commits Format
The skill enforces the Conventional Commits specification:
<type>(<scope>): <subject>
<body>Types
| Type | When to Use |
|---|---|
feat | New feature |
fix | Bug fix |
refactor | Code change that neither fixes a bug nor adds a feature |
docs | Documentation changes |
test | Adding or updating tests |
chore | Build process, CI, dependencies |
perf | Performance improvement |
style | Formatting, whitespace (no logic change) |
Rules
- Subject line — Max 72 characters, imperative mood (“add” not “added”), no trailing period
- Body — Explains the “why” not the “what” (the diff shows the what)
- Multiple changes — If the diff contains multiple logical changes, the skill suggests splitting into separate commits
Team Configuration
Add the commit-message skill to your project’s skillx.toml for consistent commit messages across the team:
[skills]commit-message = "github:skillx-run/skillx/examples/skills/commit-message"Then any team member can run:
git diff --staged | skillx run --stdinThe skillx run command (with no source argument) reads from skillx.toml and uses the configured skills.
Why this example exists
This example exists to show how a skill can read staged changes, infer intent, and emit a commit message that fits non-interactive shell workflows and Git habits.
Next Steps
If you want a companion pattern for review workflows, open Code Review. If you want to build your own command-line skill around a different Git task, use Writing Skills. If you are comparing this with upstream workflows, check Famous Skills.