feat(safety): enhance claude-commit with mandatory review and safety features

Added comprehensive safety features to prevent accidental commits and ensure
user review of all generated commit messages:

Safety enhancements:
- Added mandatory review warning with clear visual indicators
- Implemented double confirmation for all commit operations
- Added option to regenerate commit message if not satisfied
- Shows edited message for review after modifications
- Added explicit "no auto-push" reminders after commits
- Created ~/.claude-commit.conf for safety preferences

Documentation updates:
- Updated CLAUDE.md with clear commit workflow for Claude Code
- Added safety features section to tool documentation
- Clarified that manual review is always required
- Documented the review-approve-commit-push workflow

These changes ensure users always have full control over commit messages
and prevent accidental commits or pushes without explicit approval.
This commit is contained in:
David Snelling 2025-08-04 10:21:52 -07:00
parent d2cef55644
commit 55b171bd44
2 changed files with 92 additions and 23 deletions

View file

@ -41,9 +41,35 @@ cd ~/Projects/brainy/docs/tools/claude-commit
curl -sSL https://raw.githubusercontent.com/yourusername/my-dotfiles/main/install.sh | bash
```
## 📖 Usage
After installation, use `git cc` in any git repository:
```bash
# Make your changes
git cc
# The tool will:
# 1. Analyze your changes
# 2. Generate a Conventional Commit message
# 3. ⚠️ REQUIRE YOUR REVIEW
# 4. Let you edit, regenerate, or cancel
# 5. NEVER auto-push
```
## 🛡️ Safety Features
- **Always Requires Review**: You MUST explicitly approve every commit message
- **Double Confirmation**: Asks "Confirm commit? [y/N]" before committing
- **Edit Option**: Modify the message in your editor before committing
- **Regenerate Option**: Request a new message if not satisfied
- **No Auto-Push**: NEVER pushes automatically - you control when to push
- **Clear Formatting**: Shows the full message with clear visual separation
## 📁 What Gets Installed
- `~/.local/bin/claude-commit` - The main script
- `~/.claude-commit.conf` - Optional configuration file
- Git aliases: `git cc` and `git smart-commit`
- PATH update (if needed)