with one click
g-pre-commit-check
// PROACTIVELY use this skill before any git commit. Self-review staged changes: summarize diff, check for missing items, security review. Must complete before commit proceeds.
// PROACTIVELY use this skill before any git commit. Self-review staged changes: summarize diff, check for missing items, security review. Must complete before commit proceeds.
| name | g-pre-commit-check |
| description | PROACTIVELY use this skill before any git commit. Self-review staged changes: summarize diff, check for missing items, security review. Must complete before commit proceeds. |
Automated self-review before every commit. This skill is triggered proactively
when Claude detects commit intent, and also enforced via a PreToolUse hook
on git commit commands.
flowchart TD
A1(["git commit detected"]) --> C
A2(["/g-pre-commit-check"]) --> C
C["1. Gather Changes"]
C --> D{"staged changes?"}
D -- None --> E["Notify unstaged"]
D -- Yes --> F["2. Auto-fix"]
F --> G["3. Summarize"]
G --> H["4. Review Checklist"]
H --> I["5. Present Results"]
I --> J{"Issues?"}
J -- No --> K(["Proceed"])
J -- Yes --> L["6. User Decision"]
L -- Fix --> C
L -- Proceed --> K
git commit command/g-pre-commit-checkRun git diff --cached --stat and git diff --cached to see all staged changes.
If nothing is staged, check git diff for unstaged changes and inform the user.
Run ESLint auto-fix on staged files to apply formatter corrections (prettier, import order, etc.):
eslint <staged-files> --fix
git add <modified-files> and notify the user (e.g. "prettier formatting applied to X files").Produce a brief summary:
Check each item against the staged diff:
.env files or credentials stagedconsole.log, print, debugger) left inFormat the review as:
## Pre-Commit Review
**Changes**: <summary>
**Scope**: small / medium / large
### Passed
- <items that passed>
### Issues Found
- <severity> <file:line> <description>
### Recommendation
- Proceed with commit / Fix issues first
[HINT] Download the complete skill directory including SKILL.md and all related files