Skip to content
Back to skills

Commit

ASecurity

変更を git-cz 形式でコミットする。リポジトリの直コミット可否の判定手順と、push 後の CI・conflict の確認を含む。/commit 実行時、「コミットして」「pushして」等の依頼時に使用。--push 引数または「pushして」の依頼で push も行う。境界: PR 作成は create-draft-pr、PR コメントへの対応コミットは pr-comment から呼ばれる。

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
toolsbashgit

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add ukwhatn/.claude --skill commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ukwhatn-commit/badge)](https://www.skillsdirectory.com/skills/ukwhatn-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: commit
description: 変更を git-cz 形式でコミットする。リポジトリの直コミット可否の判定手順と、push 後の CI・conflict の確認を含む。/commit 実行時、「コミットして」「pushして」等の依頼時に使用。--push 引数または「pushして」の依頼で push も行う。境界: PR 作成は create-draft-pr、PR コメントへの対応コミットは pr-comment から呼ばれる。
allowed-tools: Bash(git:*)
---

# /commit

変更をコミットする。`--push` 引数でpushも実行。

## 引数

- `--push`: コミット後にpushする(デフォルト: false)

## 自然言語依頼の正規化

- 「pushして」「コミットしてpushして」等のpush依頼は `--push` 相当として扱う
- 未コミットの変更がない状態で「pushして」と依頼された場合は、新規コミットを作らず既存コミットのpushのみ行う(`git status` で判定)

## 実行手順

### 0. 直コミット可否の確認

PJ `CLAUDE.md` / `CLAUDE.local.md` の記載を確認する。記載が無い、または記載と直近の履歴が食い違うなら `references/commit-policy.md` の手順で判定し、結果を永続化してから進む。チーム開発リポジトリでmain / develop直コミット不可なら作業ブランチへ切り替える。

### 1. 現在の状態確認

```bash
git status
git diff --stat
git log --oneline -5
```

### 2. コミットメッセージの決定

変更内容を分析し、git-cz形式でコミットメッセージを作成:

- prefix: feat/fix/docs/refactor/test/choreなど
- prefix以外は日本語
- 例: `feat: ユーザー認証機能を追加`

### 3. ステージング

```bash
git add <files>
```

NOTE: CLAUDE.mdがglobal gitignoreされている場合は `git add -f` で追加

### 4. コミット

```bash
git commit -m "$(cat <<'EOF'
<コミットメッセージ>
EOF
)"
```

### 5. push(引数に --pushがある場合のみ)

引数に `--push` が含まれる場合:

```bash
git push
```

**rejectされた場合**(別PCから同じリポジトリにpush済みのときに起きる)は、rebaseで取り込んでから再pushする:

```bash
git pull --rebase --autostash && git push
```

rebaseがconflictで停止した場合は `git rebase --abort` で元に戻し、コミットは残したままユーザーに報告する(自動解決しない)。

### 6. push後の確認(--pushの場合のみ)

pushしたブランチにPRがあれば、**CIの結果とconflictの有無を確認してから報告する**。走行中なら完了まで監視する。失敗している・conflictがある場合は、指摘を待たず原因調査に入る。

```bash
gh pr view --json number,mergeable,mergeStateStatus,statusCheckRollup 2>/dev/null
```

PRがまだ無いブランチではこの確認は不要。

### 7. 結果の報告

- コミットハッシュ
- pushした場合はその旨と、PRがあればCI・conflictの状態

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.