agentleFS
mazreanmazrean/agent-skills/skills/committing-code/SKILL.md

committing-code

Skill2 starsChanged 8 months agoMITView on GitHub

Creates clean, atomic commits following Conventional Commits specification. Use when committing code changes, writing commit messages, or when user mentions commit, conventional commits, or atomic commits.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    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:

    Create well-structured, atomic commits that follow Conventional Commits specification.

    line 8
  2. Distinctive:

    When committing, follow these steps:

    line 49
  3. Distinctive:

    Look for mixed concerns:

    line 68
  4. Distinctive:

    Use interactive staging to pick specific changes:

    line 94
  5. Distinctive:

    Write commit messages in imperative mood ("add feature" not "added feature")

    line 195
  6. Distinctive:

    Keep subject line under 50 characters

    line 196
  7. Very specific:

    When unsure about scope, omit it: feat: add new feature

    line 200

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Committing Code

Create well-structured, atomic commits that follow Conventional Commits specification.

Use this skill when making commits, writing commit messages, splitting changes into logical units, or following project commit conventions.

Supporting files: CONVENTIONAL-COMMITS.md for commit message format, ATOMIC-COMMITS.md for splitting changes.

Quick Start

# Stage specific changes (not all at once)
git add -p

# Commit with conventional format
git commit -m "feat(parser): add support for array parsing"

Commit Message Format

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Common types:

TypePurposeSemVer
featNew featureMINOR
fixBug fixPATCH
docsDocumentation only-
styleFormatting, whitespace-
refactorCode restructure, no behavior change-
perfPerformance improvement-
testAdding/fixing tests-
choreBuild, tooling, deps-
ciCI/CD configuration-

Workflow Checklist

When committing, follow these steps:

Commit Workflow:
- [ ] Step 1: Review all changes (git diff)
- [ ] Step 2: Identify logical units of work
- [ ] Step 3: Stage changes for first unit (git add -p)
- [ ] Step 4: Write commit message (conventional format)
- [ ] Step 5: Verify commit is atomic (single purpose)
- [ ] Step 6: Repeat for remaining units

Step 1: Review Changes

git status
git diff

Look for mixed concerns:

  • Whitespace changes mixed with logic changes
  • Multiple unrelated features
  • Bug fixes mixed with refactoring

Step 2: Identify Logical Units

Each commit should be:

  • Single-purpose: One logical change
  • Complete: Codebase works after commit
  • Reversible: Can be reverted independently

Bad (mixed concerns):

Add user authentication and fix typo in README and update deps

Good (separate commits):

feat(auth): add user authentication
docs: fix typo in README
deps: update lodash to 4.17.21

Step 3: Stage Selectively

Use interactive staging to pick specific changes:

# Stage by hunks
git add -p

# Commands in interactive mode:
# y - stage this hunk
# n - skip this hunk
# s - split into smaller hunks
# e - manually edit hunk
# q - quit

Step 4: Write Commit Message

Format:

<type>(<scope>): <imperative description>

<body explaining why, not what>

<footer with references/breaking changes>

Examples:

Simple fix:

fix(api): handle null response from payment gateway

Feature with body:

feat(search): add fuzzy matching for product names

Users frequently misspell product names. Fuzzy matching
improves search success rate by ~40% based on analytics.

Closes #234

Breaking change:

feat(api)!: change authentication to OAuth2

BREAKING CHANGE: API now requires OAuth2 tokens instead of
API keys. See migration guide in docs/auth-migration.md.

Step 5: Verify Atomicity

Before finalizing, check:

  • Does this commit do ONE thing?
  • Can it be described in one short sentence?
  • Would reverting it break unrelated features?
  • Are tests passing after this commit?

Step 6: Repeat

Continue staging and committing remaining logical units.

Common Patterns

After Large Refactoring Session

# You've made many changes. Split them:
git stash                    # Save current state
git stash show -p | head     # Review what you have
git checkout -p stash        # Selectively apply changes
git add -p                   # Stage first logical unit
git commit -m "refactor: ..."
# Repeat until stash is empty

Fix-up Previous Commit

# Made a mistake in last commit (not yet pushed)
git add <files>
git commit --amend --no-edit

# Or with new message
git commit --amend -m "fix: corrected message"

Interactive Rebase (cleanup before PR)

# Squash/reorder last N commits
git rebase -i HEAD~N

# In editor:
# pick   abc1234 feat: add feature
# fixup  def5678 fix typo
# squash ghi9012 more changes

Tips

  • Write commit messages in imperative mood ("add feature" not "added feature")
  • Keep subject line under 50 characters
  • Wrap body at 72 characters
  • Reference issues in footer: Closes #123, Fixes #456
  • Breaking changes require exclamation mark (!) or BREAKING CHANGE: footer
  • When unsure about scope, omit it: feat: add new feature

Resources

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.