commit
Safe git commit workflow that prevents commits to main branch. Use when the user asks to "commit changes", "save changes", "git commit", or when completing a task that needs version control. Automatically creates feature branches when on main. NEVER creates pull requests unless explicitly requested by the user.
When & Why to Use This Skill
This Claude skill automates a secure and standardized Git commit workflow designed to protect the integrity of the main branch. It enhances developer productivity and repository health by automatically handling branch creation, code formatting, and conventional commit messaging, ensuring that every change is tracked safely and professionally within a version control system.
Use Cases
- Automated Branch Management: Automatically creates 'feat/' or 'fix/' branches when an agent or user attempts to commit on the main branch, preventing accidental direct pushes to protected branches.
- Standardized Version Control: Enforces the use of conventional commit messages (e.g., feat:, fix:, refactor:) to maintain a clean, searchable, and readable project history.
- Pre-Commit Quality Assurance: Integrates automated formatting and project checks (such as moon fmt) into the commit process to ensure code consistency before changes are finalized.
- Safe Agentic Coding: Provides a fail-safe mechanism for AI agents performing autonomous coding tasks, ensuring they adhere to organizational best practices for version control without manual oversight.
| name | commit |
|---|---|
| description | Safe git commit workflow that prevents commits to main branch. Use when the user asks to "commit changes", "save changes", "git commit", or when completing a task that needs version control. Automatically creates feature branches when on main. NEVER creates pull requests unless explicitly requested by the user. |
Safe Commit Workflow
- Check branch:
git branch --show-current - If on main: Create branch
git checkout -b feat/<name>orfix/<name> - Format:
moon fmt && moon info - Commit with conventional message (
feat:,fix:,refactor:, etc.) - Never push or create PR unless explicitly requested