brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Use this skill for ANY git operation — commits, pushes, PRs, releases, or version tagging. Triggers on: "commit", "push", "save my changes", "create a PR", "open a pull request", "ship this", "make a release", "tag this version", "checkpoint my work", or any request to record or
Claude Code
$ npx -y skills add Zarl-prog/Smart-git-commit --skill smart-git-commit --agent claude-code
Codex
$ npx skills add Zarl-prog/Smart-git-commit --skill smart-git-commit -a codex -y
Cursor
$ npx skills add Zarl-prog/Smart-git-commit --skill smart-git-commit -a cursor -y
Gemini CLI
$ npx skills add Zarl-prog/Smart-git-commit --skill smart-git-commit -a gemini-cli -y
GitHub Copilot
$ npx skills add Zarl-prog/Smart-git-commit --skill smart-git-commit -a github-copilot -y
OpenCode
$ npx skills add Zarl-prog/Smart-git-commit --skill smart-git-commit -a opencode -y
Windsurf
$ npx skills add Zarl-prog/Smart-git-commit --skill smart-git-commit -a windsurf -y
name: smart-git-commit description: > Use this skill for ANY git operation — commits, pushes, PRs, releases, or version tagging. Triggers on: "commit", "push", "save my changes", "create a PR", "open a pull request", "ship this", "make a release", "tag this version", "checkpoint my work", or any request to record or publish code changes. Produces gold-standard commits using a unique 5-part format (CONTEXT/CHANGE/WHY/IMPACT) that is more useful and human-readable than any other agent's default git behavior. Includes secret scanning, test gating, atomic splitting, issue linking, PR creation, and release tagging. Use aggressively whenever git is involved.
Produces gold-standard Git commits: tested, atomic, secure, documented, and traceable. Follow every phase below in order. Never skip phases unless the user explicitly says so.
<!-- line-limit: 500 -->
---
Check for CLAUDE.md, .gitmessage, .git/COMMIT_TEMPLATE at repo root. If found, those rules override this skill's defaults.
cat CLAUDE.md 2>/dev/null && echo "→ Found CLAUDE.md" cat .gitmessage 2>/dev/null && echo "→ Found .gitmessage"
Show what rules were loaded before proceeding.
---
Run full diff analysis before touching `git add`:
git status git diff --stat # which files, how many lines git diff # full diff for small changesets git log --oneline -5 # recent commit context
Categorize every changed file:
| Path pattern | Category | |-------------|----------| | `src/` `lib/` `app/` | feature/fix/refactor | | `tests/` `*.test.*` | test | | `docs/` `*.md` | docs | | `package.json` deps | chore | | `.github/` `Makefile` | tooling |
If files span more than one category → flag for atomic split in Phase 4. Read `references/atomic-patterns.md` if split is needed.
---
Run the automated security scanner:
bash scripts/scan-secrets.sh
If secrets found: 1. `git reset HEAD <file>` to unstage 2. Replace with env var or placeholder 3. Add to `.gitignore` if needed 4. Rotate exposed credentials if already pushed
Read `references/security-rules.md` for the full pattern list.
---
Auto-detect and run the project's test suite:
bash scripts/detect-test-runner.sh
Supported runners: npm test, pytest, cargo test, go test, make test, rspec, mix test, gradle, ctest.
---
If Phase 1 found multiple concerns:
bash scripts/split-commits.sh
Show the proposed split plan. Execute each commit group in sequence (Phases 5-7 repeat per group).
If single concern: proceed directly to Phase 5.
Read `references/atomic-patterns.md` for splitting strategies.
---
Use the **5-part format** for every commit. No exceptions.
<type>(<scope>): <imperative summary — max 72 chars> CONTEXT: <what state existed BEFORE this change — past tense> CHANGE: <exactly what was done — present tense, specific> WHY: <business or technical reason — not obvious from the code> IMPACT: <what this enables/unblocks, or "No breaking changes"> <footers>
| Field | Rule | Good | Bad | |-------|------|------|-----| | CONTEXT | Past tense, describes the gap | "Auth tokens had no expiry" | "There was a bug" | | CHANGE | Present tense, specific | "Adds 15-min sliding expiry with refresh rotation" | "Fixed the token thing" | | WHY | Not obvious from code | "Required for SOC2 compliance" | "To improve security" | | IMPACT | Downstream effect | "Enables audit logging of token refresh events" | "Things are better now" |
fix(payments): prevent double-charge on Stripe webhook retry
CONTEXT: Stripe delivered webhooks twice under high load due to 30s
application timeout, causing duplicate charges.
CHANGE: Adds idempotency_key (order_id + unix_ts hash) to all Stripe
charge requests.
WHY: Stripe's API natively deduplicates on idempotency keys — simpler
than Redis-based deduplication.
IMPACT: Eliminates billing support tickets for duplicate charges.
Closes #301Read `references/message-examples.md` for 15 full examples.
---
Auto-detect from branch name:
git branch --show-current | grep -oE '[0-9]+'
Check for open issues:
gh issue list --state open 2>/dev/null | head -20
Use the correct footer keyword:
| Footer | Intent | |--------|--------| | `Closes #N` | Fully resolves (auto-closes on merge) | | `Fixes #N` | Bug fix (same as Closes) | | `Refs #N` | Related but does not close | | `Part of #N` | One commit in a larger effort |
If no issue found, ask user before proceeding.
---
Stage selectively — never `git add .` blindly:
git add <specific files or directories> git diff --cached --stat # verify before committing git commit -m "<subject>" \ -m "CONTEXT: ... CHANGE: ... WHY: ... IMPACT: ..." \ -m "<footers>" git show --stat HEAD # confirm after
---
Never push directly to `main` or `develop`. Always push to feature branch:
git push origin HEAD git push --set-upstream origin <branch> # if new branch
Show commits b
The git commit skill your AI agent should've had by default. <!-- ⚡ DEMO VIDEO — Add a ~25 second terminal recording here showing: Agent triggered with "commit my changes" Secret scan passing (green ✓) Tests passing The 5-part commit message appearing git log
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.