SuperAPI AI Directory

git-commit

Coding & development

View repository

Updated 11-11 22:14

About this skill

git commit

Please commit changes on disk by unit of work. Unsaved edits in the editor may not be savable in this environment.

Procedure

  1. Get-Location; git branch --show-current to check the current location and branch
  2. git config user.name to get the username (used for the commit message)
  3. Except when it has been confirmed that there are no unsaved edits, use any save function permitted in the current harness if available. If there is no save function, it fails, or completion cannot be confirmed, continue with the contents on disk and clearly state in the final report that unsaved edits may not be reflected. Do not add extensions or helper scripts for saving.
  4. After the save process, check git status --short、git diff、git diff --cached . If there are no changes, finish with "Nothing to commit". Determine the targets for this round, including any existing staged changes, and if unrelated changes or changes of unknown ownership are mixed in and the targets cannot be determined, ask for confirmation.
  5. For each unit of work, explicitly specify the target paths and run git add -- <対象パス> . After success, verify with git diff --cached that the entire staged set consists only of that unit of work, then rungit diff --cached --check . If add or the check fails, stop and report. If unrelated staged changes remain, do not unstage them on your own; stop and ask for confirmation.
  6. After the check succeeds, run git commit -m '<コミットメッセージ>' , confirm success, and then proceed to the next unit of work. Make independent work separate commits. After completion, report the commit IDs and remaining changes, and do not push.

Commit message format

Conventional Commits Create the commit message in the format

<type>(<scope>): <subject> - <user.name>

Example (reflectinggit config user.name ):

  • feat(auth): ログイン機能を追加 - <user.name>
  • fix(api): タイムアウトエラーを修正 - <user.name>
  • docs(readme): セットアップ手順を更新 - <user.name>