Skip to content
Skills Library
Programming · Automation

commit-workflow

/commit-workflow

Use when you're about to commit (especially with a mixed diff) to stage changes, split into atomic commits, and write Conventional Commit messages with emoji

Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
3
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when you're about to commit (especially with a mixed diff) to stage changes, split into atomic commits, and write Conventional Commit messages with emoji

Original author description

Use when you're about to commit (especially with a mixed diff) to stage changes, split into atomic commits, and write Conventional Commit messages with emoji

How it works

  1. When to Use
  2. Prerequisites
  3. Workflow
  4. Examples
  5. Common Rationalizations
  6. Red Flags
  7. Verification
  8. Tips
  9. See Also
Original SKILL.md headings · 189 lines, 902 words
SKILL.md preview
---
name: commit-workflow
description: Use when you're about to commit (especially with a mixed diff) to stage changes, split into atomic commits, and write Conventional Commit messages with emoji
metadata:
  category: workflow
  agent_type: general-purpose
---

# Commit Workflow

## When to Use

- Before every commit — to enforce conventional commit format consistently
- When a diff mixes multiple logical concerns (feat + refactor + docs)
- When you want emoji-annotated commits for visual git history
- In teams that enforce Conventional Commits via CI

## Prerequisites

- Changes staged or present as unstaged modifications
- Optional: pre-commit hooks configured (`husky`, `pre-commit`, or similar)

## Workflow

### 1. Stage and Inspect

If nothing is staged, stage everything and inspect what changed:

```powershell
# Check current state
git --no-pager status --short

# Stage all if nothing is staged
$staged = git --no-pager diff --cached --name-only
if (-not $staged) { git add -A }

# Review the diff
git --no-pager diff --cached --stat
```

### 2. Run Pre-Commit Checks (Optional)

```powershell
# Node.js projects
npm run lint && npm run build

# Python projects
ruff check . && pytest --tb=short -q

# Generic pre-commit hooks
pre-commit run --all-files
```

Skip with `--no-verify` flag on the final commit if checks are handled externally.

### 3. Analyze the Diff for Atomic Splits

```powershell
git --no-pager diff --cached
```

Ask: *Do these changes serve more than one logical purpose?*

**Split when changes involve:**

- Different concerns (e.g., new feature **and** bug fix)
- Different file types (e.g., source code **and** documentation)
- Different modules with no dependency between them

If splitting, use `git add -p` to stage partial hunks:

```powershell
git add -p   # interactive hunk selection
```

### 4. Write the Commit Message

Format: `<emoji> <type>(<scope>): <imperative description>`

**Type → Emoji mapping (most common):**

| Type | Emoji | Use for |
|------|-------|---------|
| `feat` | ✨ | New feature |
| `fix` | 🐛 | Bug fix |
| `fix` | 🚑️ | Critical hotfix |
| `docs` | 📝 | Documentation only |
| `style` | 💄 | Formatting, no logic change |
| `refactor` | ♻️ | Code change without feat/fix |
| `perf` | ⚡️ | Performance improvement |
| `test` | ✅ | Adding or fixing tests |
| `chore` | 🔧 | Build, tooling, config |
| `ci` | 👷 | CI/CD changes |
| `revert` | ⏪️ | Reverting a change |
| `wip` | 🚧 | Work in progress |
| `security` | 🔒️ | Security fix |
| `breaking` | 💥 | Breaking change |
| `deps` | ➕ | Add dependency |
| `deps` | ➖ | Remove dependency |

**Rules:**

- First line ≤ 72 characters
- Imperative mood: "add feature" not "added feature"
- Scope is optional: `feat(auth): add JWT refresh`

```powershell
git commit -m "✨ feat(api): add pagination to /users endpoint"
```

### 5. Multi-Commit Flow (Split Changes)

```powershell
# First logical unit
git add src/api/users.ts
git commit -m "✨ feat(api): add cursor-based pagination to users endpoint"

# Second logical unit
git add docs/api.md
git commit -m "📝 docs(api): document pagination parameters for users endpoint"

# Third logical unit (cleanup found along the way)
git add src/utils/query.ts
git commit -m "♻️ refactor(utils): extract page-size validation into shared helper"
```

## Examples

### Feature with Co-authored Docs

```powershell
git add -A
git commit -m "✨ feat(notifications): add real-time push alerts via WebSocket

- Implement WebSocket connection pool
- Add client-side reconnect logic with exponential backoff
- Write integration tests for disconnect/reconnect scenarios

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
```

### Hotfix

```powershell
git add src/auth/token.ts
git commit -m "🚑️ fix(auth): prevent JWT secret from leaking into error logs"
```

### Breaking Change

```powershell
git commit -m "💥 feat(config)!: rename API_KEY to COPILOT_API_KEY

BREAKING CHANGE: rename environment variable API_KEY → COPILOT_API_KEY.
Update .env files and CI secrets before deploying."
```

## Common Rationalizations

| Rationalization | Reality |
|----------------|---------|
| "Commit fast, clean up messages later" | Messages written later lose the original context. The intent at commit time is the most accurate. |
| "WIP commits will be squashed later" | PRs more often merge without squashing. Write meaningful commits from the start. |
| "Nobody reads commit messages" | `git log`, `git blame`, and `git bisect` all depend on commit messages. |
| "It's a small change, no type prefix needed" | Small changes are the easiest to classify. Without classification, changelogs become impossible. |

## Red Flags

- Meaningless commit messages like `fix`, `update`, `changes`, `stuff`
- Multiple unrelated changes bundled in one commit
- No issue or PR reference in the commit message
- Hundreds of lines of changes committed as "minor fix"
- Tests and implementation in separate commits for the same feature

## Verification

- [ ] Commit message follows Conventional Commits format (`type(scope): description`)
- [ ] Each commit contains exactly one logical change
- [ ] Breaking changes are marked with `BREAKING CHANGE:`
- [ ] `git log --oneline` tells a readable story of the changes

## Tips

- **Check `git log --oneline` after** — if you can't parse the history at a glance, the messages need work
- **One commit = one revert**: if reverting a commit breaks something unrelated, it wasn't atomic
- **Use `git commit --amend`** to fix the last message before pushing
- **`git add -p` is your friend** for splitting mixed diffs without stashing
- **CI conventional commit lint**: add `commitlint` to `husky` to enforce format automatically

## See Also

- [`add-to-changelog`](../../documentation/add-to-changelog/SKILL.md) — keep CHANGELOG in sync after committing
- [Conventional Commits spec](https://www.conventionalcommits.org/)
- [gitmoji reference](https://gitmoji.dev/)
- *Inspired by: [awesome-claude-code/resources/slash-commands/commit](https://github.com/hesreallyhim/awesome-claude-code)*

Versions

The database has no other skills named commit-workflow.

Database snapshot: 13.11.2026 · package version 30220e1458a5 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100commit
    Writes brief conventional-commit messages, runs pre-commit checks, stages changes, commits them, and proposes splitting when the diff mixes concerns. Use when the user asks to commit, stage and commit, write a commit message, or split a change into atomic commits.
  • 96commit
    Creates atomic conventional git commits using git-agent. This skill should be used when the user requests "commit", "git commit", "create commit", or wants to commit changes using AI atomic commits.
  • 90commit-work
    Create high-quality git commits: review/stage intended changes, split into logical commits, and write clear commit messages (including Conventional Commits). Use when the user asks to commit, craft a commit message, stage changes, or split work into multiple commits.
  • 100trove-commit
    Git commit workflow and message conventions. Use when creating, drafting, or reviewing atomic commits with conventional messages.
  • 100professional-commit-workflow
    Creates professional git commits with automated pre-commit checks for Java, Python, React, and documentation projects. Generates emoji conventional commit messages and analyzes staging status. Produces atomic commits following best practices. Use when the user asks to "commit my…
  • 100commit
    Creates atomic Conventional Commits. Use when committing code changes, splitting hunks into revertable units, or writing commit messages.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.