# Commit

> Create a git commit with proper message format and co-authorship

- Skill: `majiayu000/commit-59` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/commit-59`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/commit-59/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/commit-59

---


# Git Commit Skill

Create a well-formatted git commit for staged changes.

## Process

1. **Analyze Changes**
   - Run `git status` to see all untracked and modified files (never use -uall flag)
   - Run `git diff --cached` to see staged changes
   - Run `git diff` to see unstaged changes
   - Run `git log --oneline -5` to see recent commit message style

2. **Draft Commit Message**
   - Summarize the nature of changes (new feature, enhancement, bug fix, refactoring, test, docs)
   - Use correct verb: "add" for new features, "update" for enhancements, "fix" for bugs
   - Keep message concise (1-2 sentences) focusing on "why" not "what"
   - Follow repository's existing commit message style

3. **Safety Checks**
   - DO NOT commit files containing secrets (.env, credentials.json, etc.)
   - Warn user if they request to commit sensitive files
   - Stage specific files by name, avoid `git add -A` or `git add .`

4. **Create Commit**
   Use HEREDOC format for proper formatting:
   ```bash
   git commit -m "$(cat <<'EOF'
   Your commit message here.

   Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
   EOF
   )"
   ```

5. **Verify Success**
   - Run `git status` after commit to confirm

## Rules

- NEVER update git config
- NEVER use destructive commands (push --force, reset --hard, checkout ., clean -f)
- NEVER skip hooks (--no-verify, --no-gpg-sign)
- NEVER amend commits unless explicitly requested
- NEVER use -i flag (interactive mode not supported)
- NEVER push unless explicitly requested
- If pre-commit hook fails, fix issues and create NEW commit (don't amend)

## User Request
$ARGUMENTS

