SuperAPI AI Directory

commit

General & other

View repository

Updated 10-15 21:53

About this skill

Commit — Quick Git Commit

Create a git commit, supporting a specified message or automatic generation.

Current repository status

!`git status`

Staged diff

!`git diff --staged`

Steps

  1. Based on the above git status output, determine:
    • If there are no staged changes → prompt the user to first git add,end immediately
  2. Based on the above git diff --staged output, generate a commit message (pure reasoning, do not call any commands):
    • If a $ARGUMENTS was provided → use it directly
    • Otherwise → analyze the diff and generate a message conforming to Conventional Commits
  3. Must call the Bash toolExecute:git commit -m "<message>"(simulated output is prohibited)
  4. Must call the Bash toolExecute:git show --stat --pretty=format:"✓ Committed: %s (%h)" -1, show the real output to the user

Commit Message Format

Format:<type>[optional scope]: <description>

Common types:

  • feat — New feature (triggers a minor version)
  • fix — Bug fix (triggers a patch version)
  • docs — Documentation changes
  • style — Code formatting (does not affect logic)
  • refactor — Refactoring (not feat/fix)
  • perf — Performance optimization
  • test — Test-related
  • build — Build system/dependencies
  • ci — CI configuration
  • chore — Other miscellaneous
  • revert — Revert

Rules:

  • Concise but descriptive, first line no more than 72 characters
  • scope is optional:feat(auth): add OAuth2 login
  • Breaking change: add after the type ! or write in the footer BREAKING CHANGE: <描述>

Example:

  • feat: add user authentication with JWT
  • fix(api): handle null response from upstream
  • feat!: remove deprecated /v1/users endpoint

Output

Directly show the real Bash output from Step 4; do not manually concatenate or simulate.