name: commit-message description: This skill should be used when the user asks to "create a commit", "generate commit message", "commit changes", "make a commit", mentions "conventional commits", or discusses commit message formatting. Provides guided workflow for creating properly formatted commit messages with line length validation and required trailers. version: 0.2.0
Conventional Commit Message Creation
Create properly formatted conventional commit messages following project standards with line length validation and required trailers.
Purpose
Generate commit messages that:
- Follow conventional commits format (
type(scope): description) - Use component names or GitHub issue numbers as scope
- Respect line length limits (50 for subject, 72 for body)
- Include required trailers (Signed-off-by, Assisted-by)
- Match Tekton commit message standards
Quick Workflow
- Analyze changes: Run git status and git diff to understand modifications
- Determine scope: Use component name from changed files, or GitHub issue number if available
- Generate message: Create conventional commit message with proper formatting
- Add trailers: Include Signed-off-by and Assisted-by trailers
- Confirm with user: Display message and wait for approval before committing
CRITICAL: Never commit without explicit user confirmation.
Conventional Commit Format
Structure
<type>(<scope>): <description>
[optional body]
Signed-off-by: <name> <email>
Assisted-by: <model-name> (via <Tool>)
Type Selection
Choose the appropriate commit type based on changes:
| Type | Description | Example |
|---|---|---|
feat |
New features | feat(storage): add Archivista backend |
fix |
Bug fixes | fix(signing): resolve KMS race condition |
docs |
Documentation | docs(README): update installation steps |
refactor |
Code refactoring | refactor(formats): simplify SLSA builder |
test |
Test changes | test(e2e): add OCI storage tests |
chore |
Maintenance | chore(deps): update go dependencies |
build |
Build system | build(Makefile): add vendor target |
ci |
CI/CD changes | ci(github): add golangci-lint action |
perf |
Performance | perf(reconciler): reduce requeue latency |
style |
Code style | style(format): run goimports |
revert |
Revert commit | revert: undo breaking config change |
For complete type reference, see references/commit-types.md.
Scope Rules
Priority 1: Component from changed files
Analyze staged files to identify the primary component:
git diff --cached --name-only
| File pattern | Scope | Example commit |
|---|---|---|
pkg/chains/signing/* |
signing |
fix(signing): resolve x509 cert issue |
pkg/chains/storage/* |
storage |
feat(storage): add PubSub backend |
pkg/chains/formats/* |
formats |
refactor(formats): simplify SLSA v2 |
pkg/reconciler/taskrun/* |
taskrun |
fix(taskrun): handle nil status |
pkg/reconciler/pipelinerun/* |
pipelinerun |
feat(pipelinerun): add deep inspection |
pkg/config/* |
config |
feat(config): add new signing key |
pkg/artifacts/* |
artifacts |
refactor(artifacts): simplify extraction |
cmd/* |
controller |
feat(controller): add new flag |
docs/* |
docs or filename |
docs(config): update signing options |
test/* |
component being tested | test(storage): add GCS tests |
| Root files | filename | chore(Makefile): add lint target |
AGENTS.md, CLAUDE.md |
docs |
docs(AGENTS.md): update conventions |
Priority 2: GitHub issue number (optional)
If the work is tracked in a GitHub issue and the user provides one, it can be used as the scope:
Fixes #123
Add Fixes #NNN or Closes #NNN in the commit body (not the scope).
Priority 3: Ask user
If changed files span multiple components or scope is unclear, ask the user which component is the primary focus.
Line Length Requirements
Subject Line
- Target: 50 characters maximum
- Hard limit: 72 characters (Tekton community standard)
- Format:
type(scope): descriptioncounts toward limit - Tips: Use present tense, no period at end
Body
- Wrap at 72 characters per line
- Blank line required between subject and body
- Content: Explain why, not what (code shows what)
Required Trailers
Signed-off-by
Always include: Signed-off-by: <name> <email>
This certifies the Developer Certificate of Origin (DCO) — required by tektoncd upstream.
Detection priority order:
- Environment variables:
$GIT_AUTHOR_NAMEand$GIT_AUTHOR_EMAIL - Git config:
git config user.nameandgit config user.email - If neither configured, ask user to provide details
For complete detection logic, see references/trailer-detection.md.
Assisted-by
Always include: Assisted-by: <model-name> (via <Tool>)
Use the actual model name and tool name.
User Confirmation Requirement
CRITICAL RULE: Always ask for user confirmation before executing git commit.
- Generate the commit message following all rules above
- Display the complete message to the user
- Ask: "Should I commit with this message? (y/n)"
- Wait for user response
- Commit only if user confirms
Commit Execution
Use heredoc format for proper multi-line handling:
git commit -m "$(cat <<'EOF'
feat(storage): add Archivista backend
Enable storing attestations in Archivista for improved
discoverability and querying.
Signed-off-by: Developer Name <developer@example.com>
Assisted-by: <Model name> (via <Tool>)
EOF
)"
Never use:
--no-verify(skips pre-commit hooks)--no-gpg-sign(skips signing)--amend(unless explicitly requested and safe)
Format standards
Follow Tekton commit message standards:
- Conventional commit format (
type(scope): description) - Subject line: target 50 characters, hard limit 72
- Body lines wrapped at 72 characters
- Required
Signed-off-bytrailer (DCO) - No trailing punctuation on the subject
Auto-Detection Summary
- Run
git statusandgit difffor staged/unstaged changes - Identify primary component from staged file paths
- If scope unclear, ask user
- Analyze staged files to determine commit type
- Detect author info from environment variables or git config
- Ensure subject line is ≤50 characters (max 72)
- Wrap body text at 72 characters per line
- Add required trailers (Signed-off-by and Assisted-by)
- Display message and ask for user confirmation
- Only commit after receiving confirmation
Additional Resources
references/commit-types.md- Complete commit type reference with descriptionsreferences/trailer-detection.md- Author detection logic and priority order