Install
openclaw skills install shadows-smart-commitIntelligent git commit assistant — analyzes diffs, enforces conventional commits, detects secrets, generates meaningful messages. Use when committing code ch...
openclaw skills install shadows-smart-commitVersion: 1.1.0 | Author: Shadows Company | License: MIT
git status shows clean)This skill requires only git on PATH. All commands are standard git operations that read repository state and create commits. No network access, no external APIs, no additional toolchains required.
Run these commands to understand the current state:
git status
git diff --cached --stat
git diff --stat
git log --oneline -5
Analyze:
Before ANY commit, scan staged changes for leaked secrets:
# Scan staged diff for secret patterns
git diff --cached | grep -inE "(api[_-]?key|secret|token|password|credential|private[_-]?key)\s*[:=]\s*['\"][^'\"]{8,}" || echo "PASS: No secrets detected in staged changes"
If secrets detected: STOP immediately. Warn the user with the exact file:line. Do NOT proceed with the commit.
Check for files that should never be committed:
# Check if dangerous files are staged
git diff --cached --name-only | grep -iE "\.(env|pem|key|p12|pfx)$|credentials|secret" || echo "PASS: No sensitive files staged"
Blocked file patterns: .env, .env.*, *.pem, *.key, *.p12, *credentials*, *secret*, node_modules/, __pycache__/, .DS_Store
Limitations: This grep-based scan catches common patterns but may produce false positives (e.g., test fixtures with "password" in variable names) or miss obfuscated secrets. For high-security projects, complement with gitleaks or trufflehog.
git add . or git add -A — these can accidentally include sensitive filesgit add src/feature.ts tests/feature.test.tsFollow Conventional Commits specification (conventionalcommits.org):
type(scope): concise description
[optional body explaining WHY, not WHAT]
Co-Authored-By: Claude <noreply@anthropic.com>
Types: feat, fix, refactor, docs, test, chore, perf, style, build, ci
Rules:
git commit -m "$(cat <<'EOF'
type(scope): subject line
Body explaining the motivation.
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
After commit, verify success:
git log --oneline -1
git status
Confirm: commit SHA visible, working tree status as expected.
Read-only analysis: Phases 1-2 only read git state (status, diff, log). No files are modified, no network calls are made.
Secret detection output: Phase 2 may display matched secret-like patterns in terminal output. Run in a secure terminal where output is not forwarded to shared logging systems.
Write operations: Phase 3 (git add) and Phase 4 (git commit) modify git state. These are local operations — no data is pushed to any remote unless the user explicitly requests git push afterward.
No persistence: This skill does not store credentials, modify config files, or install packages. Each invocation is stateless.
No network access: The entire workflow is local. git push is never executed unless the user explicitly requests it as a separate step.
## Changes Detected
- [file list with change type: added/modified/deleted]
## Security Scan
- Secrets in diff: [PASS — none detected / FAIL — found at file:line]
- Sensitive files: [PASS — none staged / FAIL — list of files]
## Proposed Commit
type(scope): message
## Files to Stage
- [explicit file list, one per line]
## Post-Commit
- SHA: [short hash]
- Status: [clean / remaining unstaged changes]
git add . — always name files explicitlytype(scope): message alwaysgit push --force on main/master--no-verifyPublished by Shadows Company — "We work in the shadows to serve the Light."