From purposeful-commits
Structure staged and unstaged changes into purposeful, logical commits. TRIGGER when: working tree contains changes spanning multiple concerns, or user asks to commit, structure commits, or organize changes. DO NOT trigger when the work is a single logical change — use commit-message-guide alone in that case.
How this skill is triggered — by the user, by Claude, or both
Slash command
/purposeful-commits:purposeful-commitsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Structure Git history as a clear, coherent story of how the codebase evolved — not a development diary, not a single squashed blob. Each commit is a **logical step forward** with a singular purpose.
Structure Git history as a clear, coherent story of how the codebase evolved — not a development diary, not a single squashed blob. Each commit is a logical step forward with a singular purpose.
This skill implements the approach described in Chris Arcand's "Purposeful Commits": break work into the smallest commits that each represent a complete, meaningful change. Follow Kent Beck's principle: make the change easy (which may be hard), then make the easy change.
If commit-message-guide is also active, this skill runs first to structure the work into logical commits; commit-message-guide then applies to each individual commit message.
Changes almost always fall into these categories. Each category should be its own commit:
Not every PR needs all three. Most PRs yield 1–3 commits, occasionally up to 10 for larger changes.
When invoked:
Assess the working tree. Run git diff --stat and git diff --cached --stat to see all staged and unstaged changes. Also run git status to find untracked files. Read the changed files to understand what each change does.
Classify each change. Group the changes by purpose:
Propose a commit plan. Present the user with an ordered list of commits, each with:
Print the plan and wait for the user to approve or adjust before executing anything.
Execute the plan. For each approved commit, stage the relevant files and create the commit. Use git add <specific-files> — never git add -A or git add .. If changes within a single file need to be split across commits, use git add -p or explain to the user which hunks to stage.
Verify. After all commits, run git log --oneline -n <count> to show the result.
Every commit message should explain why, not just what. The diff already shows what changed.
Subject line:
feat:, fix:, refactor:, chore:, docs:, test:) are compatible but optional — follow the repo's existing convention. Check git log --oneline -20 for the project's style.Body (when needed):
Bad commit messages to avoid:
git show --stat <hash> on each commit. Two commits with similar messages may span different files and different scopes — making them wrong to combine. Conversely, two commits touching different files may still be part of the same logical change. If the file list isn't conclusive, read the actual diffs. This only applies to local, unpublished commits — never restructure history that has already been pushed.git log for commit message style, prefixes, and patterns before proposing something different.A user has been working on adding Google OAuth support. Their working tree has:
Authenticator interface from the existing auth code (refactoring)The skill would propose three commits:
1. refactor: Extract pluggable Authenticator interface
Separate the authentication logic into a pluggable interface so that
new providers can be added without modifying the core auth flow.
Files: app/auth/authenticator.rb, app/auth/password_provider.rb,
test/auth/authenticator_test.rb
2. feat: Add Google OAuth provider
Implement Google OAuth as a new authentication provider using the
Authenticator interface extracted in the previous commit.
Files: app/auth/google_provider.rb, config/oauth.yml,
test/auth/google_provider_test.rb
3. chore: Increase session timeout to 120 minutes
Google OAuth token refresh requires longer-lived sessions. The
previous 30-minute timeout caused users to be logged out before
their OAuth token could be refreshed, resulting in a broken
re-authentication flow.
Files: config/session.yml
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub beflagrant/skills-marketplace --plugin purposeful-commits