Files
gh-kenkaiii-minimal-claude/commands/setup-commits.md
2025-11-30 08:30:57 +08:00

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 → Extract lint, typecheck scripts
  • pyproject.toml → Use mypy, pylint
  • go.mod → Use go vet ./..., gofmt -l .
  • Cargo.toml → Use cargo 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.

  1. Review changes: git status and git diff

  2. Generate commit message:

    • Start with verb (Add/Update/Fix/Remove/Refactor)
    • Be specific and concise
    • One line preferred
  3. 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.