Awesome-omni-skill commit
Create commits with code quality checks and conventional commit messages
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/commit-taketo-yoda" ~/.claude/skills/diegosouzapw-awesome-omni-skill-commit-67eae5 && rm -rf "$T"
skills/development/commit-taketo-yoda/SKILL.md/commit - Commit Creation Skill
Create commits with proper code quality checks and conventional commit messages.
Language Requirement
IMPORTANT: All commit messages MUST be written in English.
Step 0: Verify Branch (MANDATORY)
CRITICAL: This step MUST be performed before any other step.
Check Current Branch
git branch --show-current
Branch Validation Rules
| Current Branch | Action |
|---|---|
| ❌ STOP - Never commit directly to main |
| ❌ STOP - Never commit directly to develop |
| ✅ Proceed with commit |
| ✅ Proceed with commit |
| ✅ Proceed with commit |
| ✅ Proceed with commit |
| ✅ Proceed with commit |
If on develop
or main
developmain- STOP immediately - Do not proceed with commit
- Inform the user about the branch policy violation
- Create a feature branch:
git fetch origin git checkout -b feature/<issue-number>-<description> origin/develop - After branch creation, proceed with the commit workflow
Error Message Template
If on protected branch, display:
⚠️ ERROR: Cannot commit directly to '{branch_name}' branch. This project uses Git Flow. Please create a feature branch first: git checkout -b feature/<issue>-<description> origin/develop See .claude/instructions.md for branching guidelines.
Pre-flight Checks (MANDATORY)
1. Format Code
cargo fmt --all
This automatically formats all code. Stage any formatting changes.
2. Clippy Check
cargo clippy --all-targets --all-features -- -D warnings
CRITICAL: Zero warnings required. Fix all issues before committing.
3. Security Check
Verify no secrets in staged files:
- No API keys
- No passwords or credentials
- No tokens or secret strings
- No
files with real values.env - No
or similarcredentials.json
Files to check:
git diff --cached --name-only
If secrets are found:
- Remove secrets from files
- Add file to
if appropriate.gitignore - WARN the user about the security issue
Steps
Step 1: Check Current Status
git status
Identify:
- Staged changes
- Unstaged changes
- Untracked files
Step 2: Run Pre-flight Checks
Execute format and clippy checks. If clippy fails:
- Fix all warnings
- Re-run clippy until clean
Step 3: Stage Changes
# Stage specific files git add <files> # Or stage all changes git add .
Step 4: Review Staged Changes
git diff --cached
Verify all intended changes are staged.
Step 5: Generate Commit Message
Use Conventional Commits format:
<type>(<scope>): <description> [optional body] [optional footer] Co-Authored-By: Claude <noreply@anthropic.com>
Types
| Type | Description |
|---|---|
| New feature |
| Bug fix |
| Documentation only changes |
| Formatting, no code change |
| Code change that neither fixes a bug nor adds a feature |
| Performance improvement |
| Adding or correcting tests |
| Maintenance tasks |
| CI configuration changes |
Scope (Optional)
Common scopes for this project:
- Domain layer changesdomain
- Application layer changesapplication
- Adapter layer changesadapters
- Port definitionsports
- CLI changescli
- Dependency updatesdeps
Examples
feat(cli): add --verbose flag for detailed output fix(domain): correct dependency graph cycle detection docs: update README with new installation instructions refactor(adapters): extract common HTTP client logic test(application): add unit tests for GenerateSbomUseCase
Step 6: Create Commit
Use HEREDOC for proper formatting:
git commit -m "$(cat <<'EOF' <type>(<scope>): <description> <body if needed> Co-Authored-By: Claude <noreply@anthropic.com> EOF )"
Step 7: Verify Commit
git log -1 --format=full
Confirm:
- Commit message is in English
- Type is correct
- Co-Authored-By is present
- No secrets in the commit
Error Handling
Clippy Failures
If clippy fails with warnings:
- Read the warning messages carefully
- Fix each warning
- Re-run clippy
- Once clean, proceed with commit
Pre-commit Hook Failures
If a pre-commit hook rejects the commit:
- Read the hook output
- Fix the issues
- Stage the fixes
- Create a NEW commit (do not amend unless specifically needed)
Secrets Detected
If secrets are found in staged files:
- STOP - Do not commit
- Remove secrets from the file
- Consider if the file should be in
.gitignore - WARN the user
- Ask for confirmation before proceeding
Example Usage
User: "変更をコミットして"
Claude executes /commit skill:
- Runs
cargo fmt --all - Runs
cargo clippy --all-targets --all-features -- -D warnings - Checks for secrets in staged files
- Reviews changes with
git diff --cached - Generates conventional commit message in English
- Creates commit with Co-Authored-By trailer
- Confirms commit with
git log -1 - Reports success to user