--- name: commit description: Create a verified git commit with conventional commit format disable-model-invocation: true argument-hint: [optional message hint] allowed-tools: Bash(bun run lint), Bash(bun run test *), Bash(git *) --- Create a verified conventional commit. Follow these steps exactly. ## Step 1: Check staging area Run `git status` via Bash. If nothing is staged, tell the user to stage files first (`git add `) and stop. Do NOT stage files yourself. ## Step 2: Run verification Run these commands in order. Stop and report the failure if either fails. 1. `bun run lint` 2. `bun run test --run` If either command fails, show the error output and stop. Do NOT create a commit with failing checks. ## Step 3: Show staged changes Run `git diff --staged` to display what will be committed. Summarize the changes briefly for the user. ## Step 4: Generate commit message Generate a conventional commit message following the project format: ``` type(scope): description ``` **Types:** feat, fix, docs, refactor, test, chore, ci, style **Scope:** optional, parenthesized, lowercase (e.g., `feat(login):`) **Description:** lowercase first word, imperative mood, no trailing period If the user passed arguments, use them as a hint for the type or message content: $ARGUMENTS ## Step 5: Create the commit Create the commit using the generated message with a Co-Authored-By trailer: ```bash git commit -m "$(cat <<'EOF' type(scope): description Co-Authored-By: Claude Opus 4.6 EOF )" ``` Show the final commit hash and message after success. ## Rules - NEVER stage files — only the user stages files - NEVER commit if lint or test fails - NEVER use `--no-verify` or skip any checks - NEVER amend a previous commit unless the user explicitly says "amend" - Keep the commit message subject line under 72 characters - Use the HEREDOC format for the commit message to ensure proper formatting