Agent skill

git-commit

Plans and executes git commits with optional TICKET_ID prefix. Analyzes staged changes, proposes optimal commit structure (single or multiple), generates descriptive messages with technical context, and executes after user approval. Use when committing code changes, creating atomic commits, or splitting large changesets.

Stars 5
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/antoniocascais/claude-code-toolkit/tree/main/skills/git-commit

SKILL.md

Git Commit Planning

Analyze staged changes and create optimal commit plan, then execute after user approval.

Arguments

$ARGUMENTS may contain a TICKET_ID (e.g., JIRA-123, GH-456).

  • If provided: prefix all commit messages with TICKET_ID:
  • If empty: omit prefix, use descriptive message only

Workflow

1. Confirm Commit Scope

bash
git status --porcelain

Show user:

  • Staged files (ready to commit)
  • Unstaged changes (not included)
  • Untracked files

Ask user to confirm scope:

  • Proceed with staged - commit only what's staged
  • Add specific files - stage additional files before commit
  • Stage all changes - add all modified/untracked files
  • Let me stage manually - exit and let user stage

If nothing to commit (no staged + no changes) → inform and exit.

2. Analyze Changes

Run in parallel:

bash
git diff --staged --stat
git diff --staged --name-only
git log --oneline -5  # for message style reference

Assess:

  • File count and types
  • Lines changed
  • Logical groupings (features, fixes, refactors)
  • Whether changes should be split into multiple commits

3. Plan Commits

Single commit when:

  • 1-3 related files
  • Single logical change
  • Coherent unit of work

Multiple commits when:

  • Unrelated changes mixed together
  • Multiple features/fixes in one staging
  • Cross-functional changes (code + tests + docs should sometimes split)

4. Generate Messages

Title format (max 60 chars):

  • With TICKET_ID: TICKET-123: Add user authentication
  • Without: Add user authentication middleware

Prefixes: Add, Fix, Update, Refactor, Remove, Implement

Body (technical context for future readers):

Target ~50-150 words. Audience: technical people reading git history to understand WHY.

Style:

  • Prose or bullets with substance (not terse lists)
  • Explain the problem and why this solution
  • Skip obvious details (diff shows what changed)

Anti-patterns:

  • Single sentence ("Fixed the bug")
  • Terse bullets ("- Added X", "- Removed Y")
  • Multi-paragraph essays

Example:

TICKET-123: Fix memory leak in cache service

Cache entries weren't being cleaned up when TTL expired, causing
memory to grow unbounded under sustained load. This adds reference
counting to track active cache users and a cleanup routine in the
TTL handler that only removes entries with zero references.

5. Present Plan

Format:

COMMIT PLAN
===========

Files: X | Lines: +Y/-Z

Commit 1: [message title]
  file1.js (new)
  file2.ts (modified)

Body:
[technical explanation]

[If multiple commits, show each]

Approve? (yes/no/modify)

6. Execute

After approval:

Single commit:

bash
git commit -m "title" -m "body"

Multiple commits:

  1. git reset (unstage all)
  2. For each commit:
    • git add [specific files]
    • git commit -m "title" -m "body"

7. Report

bash
git log --oneline -3
git log -1 --format=medium

Show:

  • Commits created
  • Next steps (push, PR)

Error Handling

  • Nothing to commit: No staged or unstaged changes, inform and exit
  • Commit failure: Show error, suggest fix
  • Title too long: Truncate or split

Expand your agent's capabilities with these related and highly-rated skills.

antoniocascais/claude-code-toolkit

test-quality

Guides strong, effective unit test generation using proven testing techniques. Use when writing unit tests, reviewing test quality, improving existing tests, generating test cases, checking test coverage strength, or when tests exist but may be weak. Triggers on: unit test, test quality, test coverage, write tests, improve tests, review tests, test strength, mutation testing, boundary testing.

5 0
Explore
antoniocascais/claude-code-toolkit

skill-forge

Creates new Claude Code skills with proper structure and best practices. Use when user wants to create a skill, update an existing skill, add a new command, scaffold a workflow, define skill hooks, or asks "how do I make a skill".

5 0
Explore
antoniocascais/claude-code-toolkit

workflow-review

Reviews Claude Code sessions and proposes workflow improvements. Use when: (1) /workflow-review command, (2) "review my workflow", "how can I improve", (3) after long sessions when nudged, (4) start of session with pending review. Analyzes tool usage patterns, CLAUDE.md configuration, and compares against CC best practices. Proposes: CLAUDE.md updates, new skills, underused CC features. Saves session summaries to .claude/workflow-reviews/ for cross-session continuity.

5 0
Explore
antoniocascais/claude-code-toolkit

clarice

Conducts realistic mock interviews with detailed feedback and scoring. Use for interview prep, behavioral questions, technical interviews, STAR practice, system design interviews, or interview coaching.

5 0
Explore
antoniocascais/claude-code-toolkit

pr-review

Reviews code changes before merging. Use when reviewing PRs, checking staged changes, reviewing diffs, code review, merge readiness check, or validating changes before commit/push.

5 0
Explore
antoniocascais/claude-code-toolkit

voice-mode

Activates voice conversation mode using Pocket TTS Docker container. Use when user says "voice mode", "let's talk", "talk to me", "speak your responses", or wants Claude to respond with spoken audio. Speaks all responses through TTS and plays via speakers.

5 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results