1.3 KiB
1.3 KiB
| description | argument-hint | allowed-tools |
|---|---|---|
| Check git status, verify .gitignore, stage everything safe, commit and push | <commit message> | Bash, Read, Write, Edit, Glob, Grep |
Commit and push all changes with message: $ARGUMENTS
Instructions
Phase 1: Audit What's Changed
git status
git diff --stat
git diff --cached --stat
Phase 2: Security Check
Scan for files that should NEVER be committed:
.envfiles (except.env.example)*.pem,*.key,*.p12,*.pfxcredentials.json,service-account*.json.envault/directory
git diff --cached --name-only | xargs grep -l -E "(api_key|apikey|secret|password|token)\s*[:=]\s*['\"][^'\"]+['\"]" 2>/dev/null || true
Phase 3: Verify .gitignore
Check that .gitignore covers secrets, dependencies, build artifacts.
Phase 4: Stage and Commit
git add -A
git diff --cached --name-only | grep -E "\.(env|pem|key)$" && echo "WARNING: Sensitive files staged!" || true
git commit -m "$ARGUMENTS"
Phase 5: If Commit Fails
If pre-commit hooks fail:
- Fix the issues
- Re-stage:
git add -A - Retry commit (max 3 times)
Phase 6: Push
git push origin HEAD
Safety Rules
NEVER commit: .env with real values, private keys, credentials, files > 50MB.
ALWAYS verify .gitignore before staging.