SuperAPI AI Directory

git-commit

Coding & development

View repository

Updated 10-15 21:51

About this skill

Standardized commit

At the start, state: "I am using the git-commit skill to generate and submit a standardized commit."

Quick start

  1. Check status/diff/log, to confirm the commit scope and language style.
  2. Stage the target files and display the "list to be committed".
  3. Generate a commit message that conforms to the Angular specification.
  4. Only push when the user explicitly passes push=true , by default do not push.

When NOT to use (Do NOT use)

  • The working tree has no pending changes to commit.
  • The user only requests code analysis/review, no commit is needed.
  • The user explicitly requests only generating suggestions, without executing git commit。

Triggering examples and non-examples

  • Should trigger:
  • "Help me commit these changes following the Angular specification."
  • "Write a commit message and push."
  • Should not trigger:
  • "Review this PR to see if there are any problems."
  • "Analyze the root cause of this error."

Usage examples

# 基本提交
git-commit 修复上传逻辑

# 提交并 push
git-commit push=true

Pre-check command

git status --short
git diff HEAD
git branch --show-current
git log --oneline -10

Message specification

Header:<type>(<scope>): <summary>

Type:

  • feat New feature
  • fix Bug fix
  • docs Documentation change
  • refactor Refactor
  • perf Performance optimization
  • test Test-related
  • chore Miscellaneous maintenance
  • style Code formatting adjustment

Suggested Scope values (commonly used in this project):

  • storage / upload / download / bucket / rs
  • cdn / fop
  • sandbox / sandbox-template
  • user / account
  • ali / aws
  • tools / share / m3u8
  • cmd / common

Summary rules: imperative mood, present tense, lowercase first letter, no period.

Body rules:

  • docs can be omitted, other types are recommended to have it
  • At least explain "why the change" and "the scope of impact"
  • Non- docs types, the body must be at least 20 characters
  • A single body paragraph must not exceed 3 lines, keep it concise

Footer (as needed):

  • BREAKING CHANGE: ...
  • Fixes #123 / Closes #456

Language rules

  • Refer to the language of the last 10 commits.
  • If recent ones are mostly Chinese, use Chinese; if recent ones are mostly English, use English.

Execution flow

  1. First confirm the list of files to commit.
  2. Execute git add(add by file name, avoid git add -A)。
  3. Display the commit message draft and confirm.
  4. Execute git commit。
  5. Only when the user explicitly passes push=true whenonly then execute push:
    • git push
    • or git push -u origin <current-branch>
    • not passed push=true , skip the push step

Pre-commit check reminder

Before committing the code, remind the user to confirm that the following have passed:

  • make test — Unit tests
  • make lint — Static checks
  • gofmt -s -w . — Code formatting

Key constraints

  • Do not use emoji in the commit message
  • Do not include AI-assisted tool-related information in the commit message
  • Do not add content such as "Generated with" or "Co-Authored-By: AI"
  • Do not use --force or --delete and other dangerous push options
  • Do not auto-push when the user has not explicitly passed push=true when

Output template

已提交: <commit-hash>
标题: <type(scope): summary>
分支: <branch>
Push: 成功/失败/未执行

Failure fallback

  • Workspace has no changes: output git status result, indicating there is nothing to commit.
  • git commit failed (hook error): output the full error, recommend fixing and retrying, do not skip the hook.
  • git push failed (remote conflict): output the error, recommend pulling/rebasing first and then retrying.

Acceptance criteria (unified)

  • Input prerequisites: parameters and context are parseable; for omitted parameters, execute according to the skill defaults and note this in the output.
  • Output requirements: provide results according to the output template agreed by the skill, and include key evidence (commands, paths, links, or log summaries).
  • Pass determination: the main process steps are completed and there are no blockers; if there are unfinished items, the scope of impact and next steps must be clearly marked.
  • Default strategy (non-interactive): when confirmation is needed but the user does not respond in time, continue with the "recommended default/minimum-risk option"; when interactive selection is needed, prioritize the recommended option.
  • Blocker escalation: when encountering missing permissions, credentials, or external dependencies, stop that step immediately and output "blocker + what has been tried + information the user needs to provide".

System specification (AGENTS.md)

When executing this skill, also comply with AGENTS.md the system specification in ; if there is a conflict with this skill, this skill takes precedence.