agentleFS
0xMassi0xMassi/claude-skills/git-commit/SKILL.md

Git Commit

Skill8 starsChanged 7 months agoMITView on GitHub

Generates storytelling-focused Conventional Commits messages with Jira context integration, then commits and pushes changes. Use when the user says "commit", "git commit", or asks to commit changes, wants to create a commit, or when work is complete and ready to commit.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If a Jira ticket ID is found:

    line 57
  2. Very specific:

    Use mcp__zapier__jira_software_cloud_find_issue_by_key to fetch ticket details

    line 58
  3. Distinctive:

    Use this context to understand the broader purpose of the changes

    line 60
  4. Distinctive:

    Wait for their response and incorporate their explanation into the commit message.

    line 80
  5. Distinctive:

    Commit only the files that are already staged and understood.

    line 124
  6. Distinctive:

    After receiving the user's approval of the commit message:

    line 129
  7. Distinctive:

    Create commit messages that future developers will appreciate when doing code archeology months later.

    line 157
  8. Distinctive:

    Reference Jira tickets: when found in branch name

    line 230
  9. Distinctive:

    No co-authors: - Never add "Co-Authored-By" or mention Claude Code

    line 233

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Commit

Generate Conventional Commits messages that tell a complete story for future code archeology, with Jira ticket context integration.

When to Use This Skill

Activate this skill when:

  • The user types "commit" or "git commit" (with or without slash command)
  • The user says "commit this" or "let's commit"
  • The user asks to create a commit message
  • Work is complete and ready to commit
  • The user mentions committing or pushing changes

Critical Rules

IMPORTANT: NEVER EVER ADD CO-AUTHOR TO THE GIT COMMIT MESSAGE NEVER mention Claude Code in commit messages

Workflow

1. Gather Context

First, collect information about the current state:

# Current git status
git status

# Current git diff (staged changes)
git diff --staged

# Recent commits for context
git log --oneline -5

# Current branch
git branch --show-current

2. Extract Jira Ticket Context (if applicable)

Parse the current branch name to find Jira ticket IDs using these patterns:

  • PROJ-123-feature-name
  • feature/PROJ-123-description
  • PROJ-123

If a Jira ticket ID is found:

  • Use mcp__zapier__jira_software_cloud_find_issue_by_key to fetch ticket details
  • Get title, description, acceptance criteria, comments
  • Use this context to understand the broader purpose of the changes

3. Human-in-the-Loop - Ask for Context

ALWAYS use the AskUserQuestion tool to ask WHY the change was made.

Based on the diff and Jira context (if available), generate 3-4 plausible options for why the change was made. Present these as multiple choice options using AskUserQuestion.

Example:

Question: "Why did you make these changes?"
Options:
- "Fix bug where X was causing Y"
- "Add new feature for Z"
- "Refactor to improve maintainability"
- (User can always select "Other" to provide custom explanation)

The options should be specific to the actual changes observed in the diff, not generic. Analyze the code changes to infer likely motivations.

Wait for their response and incorporate their explanation into the commit message.

4. Analyze Technical Changes

Review the staged changes to understand WHAT changed technically:

  • Files modified
  • Functions added/updated
  • Dependencies changed
  • Configuration updates

5. Create Enhanced Commit Message

Generate a commit message that tells a complete story for future code archeology:

Format:

type(scope): concise subject line describing what changed

Why this change was needed:
[Incorporate the user's explanation and Jira ticket context]

What changed:
[Technical summary of the modifications]

Problem solved:
[Explain the business/technical problem this addresses]

[If Jira ticket found] Refs: PROJ-123

Conventional Commits Types:

  • feat: new features
  • fix: bug fixes
  • docs: documentation changes
  • style: formatting, missing semicolons, etc.
  • refactor: code restructuring without changing functionality
  • test: adding or updating tests
  • chore: maintenance tasks, dependencies, build process
  • perf: performance improvements
  • ci: continuous integration changes

6. Execute Commit and Push (Requires Confirmation)

IMPORTANT: Do not use git add -A or git add . Commit only the files that are already staged and understood.

CRITICAL: The user MUST confirm before executing git commit or git push. These commands are intentionally NOT in the allowed-tools list, so the user will be prompted for approval.

After receiving the user's approval of the commit message:

  1. Commit with heredoc (for multi-line messages):
git commit -m "$(cat <<'EOF'
type(scope): subject line

Why this change was needed:
[explanation]

What changed:
[technical summary]

Problem solved:
[problem description]

Refs: PROJ-123
EOF
)"
  1. Push:
git push

Storytelling Emphasis

Create commit messages that future developers will appreciate when doing code archeology months later. The message should answer:

  • What changed? (technical summary)
  • Why was this needed? (business context, user explanation)
  • What problem does it solve? (from Jira ticket and user input)
  • How does it relate to the larger feature/project? (Jira context)

Examples

Example 1: Feature with Jira Context

feat(mcp): add tool execution timeout handling

Why this change was needed:
Tools were hanging indefinitely when external APIs failed to respond,
blocking the entire MCP server. This was causing user-facing timeouts
in the chat interface.

What changed:
- Added configurable timeout wrapper around tool execution
- Implemented graceful timeout error messages
- Updated tool registry to support per-tool timeout configuration

Problem solved:
External API failures no longer block the MCP server. Users now receive
clear timeout errors instead of indefinite hanging.

Refs: AGP-582

Example 2: Bug Fix

fix(auth): prevent token refresh race condition

Why this change was needed:
Multiple simultaneous requests were triggering concurrent token refresh
attempts, causing some requests to fail with stale tokens.

What changed:
- Added mutex lock around token refresh logic
- Implemented token refresh deduplication
- Added retry logic for failed requests during refresh

Problem solved:
Concurrent requests no longer cause authentication failures due to
token refresh race conditions.

Example 3: Refactoring

refactor(api): extract validation logic to shared module

Why this change was needed:
Input validation was duplicated across 7 different API endpoints,
making it difficult to maintain consistent validation rules.

What changed:
- Created shared validation utilities in packages/validation
- Updated all API endpoints to use shared validators
- Removed 200+ lines of duplicated validation code

Problem solved:
Validation logic is now centralized and consistent across all endpoints.
Future validation changes only need to be made in one place.

Important Notes

  • Never skip the "why" question - User context is crucial
  • Use heredoc for multi-line commits - Ensures proper formatting
  • Reference Jira tickets when found in branch name
  • Be specific in technical summaries
  • Think about the reader - someone debugging this code in 6 months
  • No co-authors - Never add "Co-Authored-By" or mention Claude Code

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.