create-commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

create-commit

create-commit

変更内容を分析して Conventional Commits 形式でコミットを作成します。
Analyze changes and create commits in Conventional Commits format.

フロー

Flow

Step 1: 変更内容を確認する

Step 1: Check changes

bash
git status
git diff --staged
staged がない場合は
git diff
も確認してユーザーに staging を案内する。
bash
git status
git diff --staged
If there are no staged changes, also check
git diff
and guide the user to stage changes.

Step 2: Conventional Commits type を決定する

Step 2: Determine Conventional Commits type

type用途
feat
新機能
fix
バグ修正
docs
ドキュメントのみの変更
refactor
機能変更なしのコードリファクタリング
test
テストの追加・修正
chore
ビルドプロセス・補助ツール等の変更
style
コードスタイルのみの変更(空白、フォーマット等)
build
ビルドシステムや外部依存関係の変更
ci
CI 設定の変更
perf
パフォーマンス改善
typePurpose
feat
New feature
fix
Bug fix
docs
Documentation-only changes
refactor
Code refactoring without functional changes
test
Adding or modifying tests
chore
Changes to build processes or auxiliary tools
style
Code style-only changes (whitespace, formatting, etc.)
build
Changes to build systems or external dependencies
ci
Changes to CI configuration
perf
Performance improvements

Step 3: scope を推定する

Step 3: Estimate scope

変更ファイルのパスから scope を推定する。 複数にまたがる場合は省略可。
Estimate the scope from the path of changed files. Can be omitted if changes span multiple scopes.

Step 4: コミットメッセージを生成してユーザーに確認する

Step 4: Generate commit message and confirm with user

フォーマット:
type(scope): subject
例:
feat(auth): ソーシャルログイン機能を追加
fix(api): レスポンスのエラーハンドリングを修正
refactor(ui): コンポーネント構造を整理
ユーザーに提案して確認を取る。
Format:
type(scope): subject
Examples:
feat(auth): Add social login functionality
fix(api): Fix response error handling
refactor(ui): Organize component structure
Propose to the user and get confirmation.

Step 5: コミットを実行する

Step 5: Execute commit

bash
git commit -m "$(cat <<'EOF'
type(scope): subject

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
重要:
--no-verify
は絶対に使用しない(pre-commit フックを迂回しない)。
bash
git commit -m "$(cat <<'EOF'
type(scope): subject

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
Important: Never use
--no-verify
(do not bypass pre-commit hooks).

注意事項

Notes

  • Breaking change がある場合は
    !
    を付ける:
    feat!: ...
    または body に
    BREAKING CHANGE:
    を記述
  • 件名は命令形・現在形で記述(日本語可)
  • 件名は 72 文字以内
  • .env
    や認証情報ファイルが含まれる場合は警告してコミットを中止する
  • Add
    !
    for breaking changes:
    feat!: ...
    or write
    BREAKING CHANGE:
    in the body
  • Subject should be in imperative and present tense (Japanese is allowed)
  • Subject should be within 72 characters
  • Warn and abort the commit if
    .env
    or authentication information files are included