Skip to content
Back to skills

Commit Changes

ASecurity

Create thoughtful git commits with conventional commits format. Invoke when user says "commit", "commit these changes", "create a commit", "save my changes", or after completing a task.

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 8, 2026
developmentgobashreactdebuggingrefactoringgitapidatabasefrontendci/cd

Works with

  • api
  • mcp

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill commit-changes --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit Changes?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commit Changes
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-commit-changes/badge)](https://www.skillsdirectory.com/skills/majiayu000-commit-changes)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: commit-changes
description: Create thoughtful git commits with conventional commits format. Invoke when user says "commit", "commit these changes", "create a commit", "save my changes", or after completing a task.
tools:
  - mcp__serena__*
  - Bash:git *
  - Read
  - Grep
  - AskUserQuestion
  - TodoWrite
---

# Commit Changes Skill

## Purpose

Create well-structured git commits following conventional commits format with project-aware module emojis. This skill analyzes changes, crafts meaningful commit messages, and ensures commits are atomic and purposeful.

## Natural Language Triggers

This skill activates when the user says things like:
- "Commit these changes"
- "Create a commit"
- "Commit this"
- "Save my changes"
- "Make a commit for this work"
- After completing a scratchpad task: "Done with this task, commit it"

## Workflow Execution

### Phase 1: Gather Context (Parallel)

Execute these in parallel for efficiency:

1. **Project Context:**
   - Read project's `CLAUDE.md` for module emojis and conventions
   - Identify current development phase/priorities

2. **Git Context:**
   - `git status` - See staged/unstaged changes
   - `git diff --cached` - Review staged changes (if any)
   - `git diff` - Review unstaged changes
   - `git branch --show-current` - Current branch
   - `git log --oneline -5` - Recent commits for style reference

### Phase 2: Analyze Changes

1. **Categorize Changes:**
   - Which files are modified/added/deleted?
   - Which module(s) are affected?
   - What type of change is this? (feat, fix, refactor, docs, etc.)

2. **Staging Decision:**
   - If nothing staged but changes exist: Determine what should be staged together
   - Group logically related changes
   - Don't mix unrelated changes in one commit
   - If multiple logical changes exist, use `AskUserQuestion` to ask which to commit first

3. **Validate Commit-Worthiness:**
   - Ensure changes represent one logical unit of work
   - Check for debugging code, console.logs, temp files
   - Verify no secrets or sensitive data included

### Phase 3: Craft Commit Message

**Format:**
```
{module emoji}{change type emoji} {type}({scope}): {description}

{optional body explaining what and why}
```

**Components:**

1. **Module Emoji:** From project's CLAUDE.md
   - Check `## Project Modules` section for project-specific emojis
   - Default examples: 🌐 api, 🎨 frontend, πŸ—„οΈ database, πŸ” auth, πŸ“š docs
   - Use the most specific module that applies

2. **Change Type Emoji:**
   - ✨ feat: New feature
   - πŸ› fix: Bug fix
   - πŸ“ docs: Documentation
   - πŸ’„ style: Formatting/style
   - ♻️ refactor: Code refactoring
   - ⚑️ perf: Performance improvements
   - βœ… test: Tests
   - πŸ”§ chore: Tooling, configuration
   - πŸš€ ci: CI/CD improvements
   - πŸ”₯ fix: Remove code or files
   - 🎨 style: Improve structure/format
   - πŸš‘οΈ fix: Critical hotfix
   - πŸŽ‰ chore: Begin a project
   - πŸ—οΈ refactor: Architectural changes
   - 🏷️ feat: Add or update types
   - ⚰️ refactor: Remove dead code

3. **Type:** Conventional commit type (feat, fix, docs, style, refactor, perf, test, chore, ci)

4. **Scope:** Module name from CLAUDE.md (e.g., api, frontend, skills)

5. **Description:**
   - Imperative mood ("Add feature" not "Added feature")
   - No period at end
   - Under 50 characters
   - Focus on capability/value added

6. **Body (optional):**
   - Explain what and why, not how
   - Context for the change
   - Reference issue numbers if applicable

### Phase 4: Confirm with User

Use `AskUserQuestion` to confirm the commit:

```
AskUserQuestion:
  question: "Ready to commit with this message?"
  header: "Commit"
  options:
    - label: "Yes, commit"
      description: "Create the commit with this message"
    - label: "Edit message"
      description: "I want to modify the commit message"
    - label: "Stage more files"
      description: "I need to include additional files"
    - label: "Cancel"
      description: "Don't commit right now"
```

Display the proposed commit message clearly before asking.

### Phase 5: Execute Commit

1. **Stage files** (if not already staged):
   ```bash
   git add <files>
   ```

2. **Create commit** using HEREDOC for proper formatting:
   ```bash
   git commit -m "$(cat <<'EOF'
   {module emoji}{type emoji} {type}({scope}): {description}

   {body if present}
   EOF
   )"
   ```

   **IMPORTANT:** Do NOT add Claude attribution (e.g., "Co-Authored-By: Claude") to commit messages.

3. **Confirm success:**
   ```bash
   git log -1 --oneline
   ```

### Phase 6: Report Result

Display:
```
βœ“ Committed: {short hash} {commit message first line}

πŸ“Š Stats: {files changed}, {insertions}+, {deletions}-

🌿 Branch: {branch-name}
```

## Smart Staging Logic

When unstaged changes exist across multiple areas:

1. **Single logical change:** Stage all related files automatically
2. **Multiple logical changes:** Present options via `AskUserQuestion`:
   ```
   question: "Multiple changes detected. Which to commit first?"
   options:
     - "Module A changes (3 files)"
     - "Module B changes (2 files)"
     - "All changes together"
     - "Let me specify"
   ```

3. **Mixed concerns:** Warn and suggest splitting:
   - "These changes span unrelated modules. Recommend separate commits."

## Quality Checks

Before committing, verify:
- [ ] No `console.log` or debug statements (unless intentional)
- [ ] No TODO comments that should be addressed first
- [ ] No secrets, API keys, or sensitive data
- [ ] Changes are complete (no half-finished work)
- [ ] Commit message accurately describes changes

## Error Handling

### Nothing to Commit
If no changes exist:
```
ℹ️ No changes to commit.
   Working tree is clean.
```

### Merge Conflicts
If conflicts exist:
```
⚠️ Cannot commit: merge conflicts present.
   Resolve conflicts first, then commit.
```

### Detached HEAD
If in detached HEAD state:
```
⚠️ Warning: You're in detached HEAD state.
   Consider creating a branch before committing.
```

## Integration with Other Skills

**Called by:**
- `do-work` skill - After completing each scratchpad task
- User directly via natural language

**Works with:**
- Project CLAUDE.md - Module emojis and conventions
- Scratchpad - Context for what was being worked on

## Project-Specific Adaptations

The skill reads the project's CLAUDE.md to determine:
- Module names and their emojis
- Commit message conventions (if custom)
- Scope naming patterns

**Example from a project CLAUDE.md:**
```markdown
## Project Modules
- **api** 🌐: REST API endpoints
- **frontend** 🎨: React UI components
- **database** πŸ—„οΈ: Database layer
```

This skill would then use 🌐 for api changes, 🎨 for frontend changes, etc.

## Best Practices

### βœ… DO:
- Create atomic commits (one logical change)
- Write meaningful commit messages
- Reference issues when applicable
- Stage related files together
- Use project-specific module emojis

### ❌ DON'T:
- Commit unrelated changes together
- Use vague messages like "updates" or "fixes"
- Include debugging code
- Commit secrets or credentials
- Skip the body when context is needed
- Add Claude attribution to commit messages

---

**Version:** 1.0.0
**Last Updated:** 2025-12-29
**Maintained By:** Escapement
**Converted From:** commands/commit.md

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.