$npx -y skills add softspark/ai-toolkit --skill commitCreates Conventional Commits with pre-commit validation. Triggers: commit, conventional commit, git commit, message.
| 1 | # Git Commit |
| 2 | |
| 3 | $ARGUMENTS |
| 4 | |
| 5 | Creates well-structured git commits following Conventional Commits specification. |
| 6 | |
| 7 | ## Project context |
| 8 | |
| 9 | - Staged changes: !`git diff --cached --stat 2>/dev/null || echo "nothing staged"` |
| 10 | - Current branch: !`git branch --show-current 2>/dev/null` |
| 11 | |
| 12 | ## Commit Format |
| 13 | |
| 14 | ``` |
| 15 | <type>(<scope>): <description> |
| 16 | |
| 17 | [optional body] |
| 18 | |
| 19 | [optional footer] |
| 20 | ``` |
| 21 | |
| 22 | ## Types |
| 23 | |
| 24 | | Type | Description | |
| 25 | |------|-------------| |
| 26 | | `feat` | New feature | |
| 27 | | `fix` | Bug fix | |
| 28 | | `docs` | Documentation only | |
| 29 | | `style` | Formatting, no code change | |
| 30 | | `refactor` | Code restructuring | |
| 31 | | `perf` | Performance improvement | |
| 32 | | `test` | Adding/updating tests | |
| 33 | | `chore` | Maintenance tasks | |
| 34 | | `ci` | CI/CD changes | |
| 35 | |
| 36 | ## Examples |
| 37 | |
| 38 | ```bash |
| 39 | # Feature |
| 40 | git commit -m "$(cat <<'EOF' |
| 41 | feat(search): add multi-hop reasoning support |
| 42 | |
| 43 | - Implement query decomposition |
| 44 | - Add iterative retrieval with reasoning |
| 45 | - Include answer synthesis from aggregated context |
| 46 | EOF |
| 47 | )" |
| 48 | |
| 49 | # Bug fix |
| 50 | git commit -m "$(cat <<'EOF' |
| 51 | fix(cache): resolve connection pool exhaustion |
| 52 | |
| 53 | Root cause: connections not returned to pool on error |
| 54 | Solution: use context manager for automatic cleanup |
| 55 | |
| 56 | Fixes #123 |
| 57 | EOF |
| 58 | )" |
| 59 | ``` |
| 60 | |
| 61 | ## Automated Pre-Commit Check |
| 62 | |
| 63 | Run the bundled script for structured pre-commit analysis: |
| 64 | |
| 65 | ```bash |
| 66 | python3 ${CLAUDE_SKILL_DIR}/scripts/pre-commit-check.py |
| 67 | ``` |
| 68 | |
| 69 | Use the output to validate staged changes, detect secrets, and suggest commit type/scope. |
| 70 | |
| 71 | ## Pre-Commit Checklist |
| 72 | |
| 73 | Before committing: |
| 74 | - [ ] Run linting: `make lint` (or `docker exec {app-container} make lint`) |
| 75 | - [ ] Run tests: `make test` (or `docker exec {app-container} make test`) |
| 76 | - [ ] Check for secrets: No API keys or passwords |
| 77 | |
| 78 | ## Git Safety |
| 79 | |
| 80 | - NEVER use `--force` push without explicit request |
| 81 | - NEVER skip hooks (`--no-verify`) unless explicitly asked |
| 82 | - ALWAYS create NEW commits (don't amend previous unless asked) |
| 83 | - Stage specific files, avoid `git add -A` with sensitive files |