1.2 KiB
1.2 KiB
name, description
| name | description |
|---|---|
| setup-commits | Generate a /commit command that runs checks, then commits with AI-generated messages |
Generate a minimal /commit command that enforces quality checks before committing.
Step 1: Detect Project and Extract Commands
Check for config files:
package.json→ Extractlint,typecheckscriptspyproject.toml→ Usemypy,pylintgo.mod→ Usego vet ./...,gofmt -l .Cargo.toml→ Usecargo clippy,cargo fmt --check
Step 2: Generate /commit Command
Create .claude/commands/commit.md:
---
name: commit
description: Run checks, commit with AI message, and push
---
1. Run quality checks:
```bash
[PROJECT COMMANDS]
Fix ALL errors before continuing.
-
Review changes:
git statusandgit diff -
Generate commit message:
- Start with verb (Add/Update/Fix/Remove/Refactor)
- Be specific and concise
- One line preferred
-
Commit and push:
git add -A git commit -m "your generated message" git push
**Keep it under 20 lines.**
## Step 3: Confirm
Tell user: ✅ `/commit` created. Quality checks + AI commits + auto-push enabled.