Aller au contenu principal

Skill: work-commit

Inline

Generates clear commit messages following Conventional Commits. Use when the user wants to commit, asks for a commit message, or after completing a modification.

Configuration​

PropertyValue
Contextinline
Pre-approved toolsNone declared: the project's permission settings apply
Triggermanual only — run /work-commit

Detailed description​

Commit Message Generation

Conventional Commits Format​

type(scope): short description (< 50 characters)

[optional body - details on the "what" and "why"]

[optional footer - issue references, breaking changes]

Instructions​

1. Analyze the changes​

# View modified files
git status --short

# View detailed diff
git diff --staged

# If nothing is staged, view non-staged changes
git diff

2. Determine the type​

TypeUsage
featNew feature
fixBug fix
refactorRefactoring without functional change
testAdding or modifying tests
docsDocumentation only
styleFormatting, no code change
choreMaintenance, dependencies
perfPerformance improvement

3. Identify the scope​

The scope indicates the part of the code affected:

  • Module name: auth, api, ui
  • Component name: button, modal
  • Feature: login, checkout

4. Write the description​

  • Imperative present: "add" not "added" or "adds"
  • Lowercase: no capital at the start
  • No trailing period
  • < 50 characters

5. Commit​

git add [files]
git commit -m "type(scope): description"

Or with body:

git commit -m "type(scope): description

- Detail 1
- Detail 2

Refs: #123"

Rules​

  • ONE commit = ONE logical change
  • Clear message for someone unfamiliar with the context
  • Explain the WHY, not the HOW (the code shows the how)
  • Reference issues if applicable

Examples​

Good messages​

feat(auth): add OAuth2 login support
fix(api): handle null response from external service
refactor(utils): extract date formatting to separate module
test(cart): add unit tests for price calculation
docs(readme): update installation instructions

Bad messages​

❌ "fix bug" → Too vague
❌ "Update code" → Not informative
❌ "WIP" → Don't commit WIP
❌ "feat: Add new feature..." → Redundant

Manual invocation only​

This skill carries disable-model-invocation: true, so Claude cannot load it — not when keywords match, and not from inside the same-named command either. Start it yourself with /work-commit.

Context inline​

Inline means the skill runs in the conversation (the default, no context key):

  • Sees the full history
  • Its work is visible as it happens
  • Right for almost every skill

Practical examples​

1. Commit Message Examples​

Commit Message Examples

New feature​

Change: Add a logout button in the header

git diff --staged
# src/components/Header.tsx | 15 ++++++
# src/services/auth.ts | 8 +++

Message:

feat(auth): add logout button to header

- Add LogoutButton component
- Implement logout service method
- Clear session on logout

Refs: #234

Bug fix​

Change: Fix a crash when email is null

git diff --staged
# src/utils/validation.ts | 3 ++-

Message:

fix(validation): handle null email in validateUser

Previously crashed when email was null.
Now returns false for null/undefined inputs.

Fixes: #456

Refactoring​

Change: Extract pricing logic into a separate module

git diff --staged
# src/services/order.ts | 45 --------
# src/utils/pricing.ts | 50 +++++++++
# src/utils/pricing.test.ts | 30 ++++++

Message:

refactor(pricing): extract price calculation to dedicated module

- Move calculateTotal from order service
- Add unit tests for edge cases
- No functional changes

Tests​

Change: Add tests for the Button component

git diff --staged
# src/components/Button.test.tsx | 45 +++++++++

Message:

test(ui): add unit tests for Button component

- Test all variants (primary, secondary, outline)
- Test disabled state
- Test click handler

Documentation​

Change: Update the README with new instructions

git diff --staged
# README.md | 25 +++++-----

Message:

docs(readme): update installation and usage instructions

- Add Docker setup instructions
- Update environment variables section
- Fix outdated npm commands

Breaking Change​

Change: Change the authentication API

git diff --staged
# src/services/auth.ts | 50 ++++++------
# src/types/auth.ts | 20 ++---

Message:

feat(auth)!: change authentication to use JWT tokens

BREAKING CHANGE: The login response format has changed.

Before: { token: string, user: User }
After: { accessToken: string, refreshToken: string, user: User }

Migration: Update all login handlers to destructure new response format.

Refs: #789

See also​