Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Git

ASecurity

Git 操作ルール(コミット作成、メッセージ形式、事前チェック)

20 stars
0 votes
0 copies
0 views
Added 9/20/2026
code-qualitybashgitapi

Works with

api

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add d-zero-dev/frontend-guidelines --skill git --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Git?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Git
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/d-zero-dev-git/badge)](https://www.skillsdirectory.com/skills/d-zero-dev-git)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: git
description: Git 操作ルール(コミット作成、メッセージ形式、事前チェック)
---

# コミット前ブランチチェック(必須・最優先)

コミットを求められたら、他の何より先に以下を行う。

1. `git branch --show-current` で現在のブランチを確認する
2. 現在のブランチが `main` / `dev` のいずれかに該当する場合、コミットを進めず、ユーザーにトピックブランチの作成を提案する
3. 該当しない場合はそのまま以下のコミット作成手順に進む

# コミット作成

- 「コミット」を求められた場合:
  - **重要: 必ず `git status` で現在の状態を確認すること**
  - **重要: 以前の状態やメモリを信用しない — 必ずステージングエリアの現状を確認**
  1. ファイルが既にステージングされている場合:
     - **重要: ステージング済みファイルがある場合、`git add` や `git restore` を絶対に使わない**
     - **重要: ステージングエリアを一切変更しない**
     - `git diff --staged` でステージング済みファイルを確認し、そのファイル*のみ*に基づくコミットメッセージを作成
     - メッセージ付きで `git commit` を直接実行(ユーザーが適宜承認する)
     - ユーザーが既にステージングエリアを準備済み — その判断を完全に尊重すること
  2. ステージングされたファイルがない場合:
     - `git status` で差分を確認
     - シングルパッケージのリポジトリのため、変更ファイルをまとめて1コミットにしてよい
- **各コミット後:**
  - **重要: 自動的に次のコミットに進まない**
  - **重要: 次に何をすべきか推測しない**
  - **重要: 以前の状態のメモリを信用しない**
  - `git status` と `git diff` で現在の状態を確認
  - この判定プロセスの最初に戻る(ファイルがステージングされているかどうかの確認)
  - 続行する前にユーザーの確認または新しい指示を待つ
- OS、アプリケーション設定、またはコンテキストから英語以外の言語が使用されていると判断される場合、コミットコマンド実行の直前に、コミットメッセージの翻訳と説明をその言語で提供すること

# コミット前コンテンツチェック

`git commit` を実行する前に、必ず `git diff --staged` をスキャンして以下の 2 点を確認する。

## 1. 機密・案件情報の検出

プロジェクト固有の名称、企業名、顧客情報、API キー・トークンなど、リポジトリに含めるべきでない情報がないか確認する。

## 2. サンプル値の慣例チェック

サンプル値が「無いこと」ではなく「**予約済み慣例に従っていること**」を確認する。

**許可される値(予約済み慣例):**

- ドメイン: `example.com` / `example.org` / `example.net`、`*.example` / `*.test` / `*.invalid` / `*.localhost`(RFC 2606 / RFC 6761)
- IP: `127.0.0.1`、TEST-NET(`192.0.2.0/24`, `198.51.100.0/24`, `203.0.113.0/24`)、`2001:db8::/32`
- メール: `user@example.com` 系

**検出対象(混入してはいけない値):**

- 実在する無関係ドメイン・URL・パス
- 未取得の創作ドメイン(もっともらしい造語ドメインは将来第三者が取得しうる — supply-chain / SEO リスク)
- 案件キーワード・顧客識別子・実データ由来の識別子
- 実データ・実コーパスでの実験・デバッグの残骸(実 URL、実ページタイトル、実クエリ値など)

**検出時の対処:**

- ステージングから除外するのではなく、**汎用値(example.com 等)へ書き換える**(fixture 内の実ドメインは除外しても解決しない)。書き換え後にテストが通ることを確認してからコミットする
- 判断が難しい場合(実データが検証に不可欠に見える等)はユーザーに確認する

# コミットメッセージの形式

- 英語で記述すること
- 命令法を使用すること
- Conventional Commits を使用すること
  - 使用するタイプ: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`
  - 使用するスコープ: `repo`, `deps`, `github`
- メッセージ本文の各行は100文字以下
- 件名は sentence-case, start-case, pascal-case, upper-case にしない

# コミットメッセージの安全ガイドライン

- 破壊的変更や複雑なコミットメッセージには、必ず heredoc 形式を使用(下記参照)
- シンプルな1行コミットにはシングルクォート (') を使用
- 破壊的変更で複数の -m フラグを絶対に使わない(commitlint のパースエラーの原因になる)

## Heredoc 形式(破壊的変更では必須)

heredoc とコマンド置換を使って複数行のコミットメッセージを渡す。

**形式:**

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

BREAKING CHANGE: 説明

詳細:
- 変更点1
- 変更点2
EOF
)"
```

## シンプルなコミット(非破壊的変更)

```bash
git commit -m 'type(scope): subject line'
```

複数行の非破壊的コミットにも、適切なフォーマットを確保するため heredoc 形式を使用すること

Attribution

d-zero-devd-zero-dev
View sourceMore from d-zero-dev →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

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

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Caveman Review

Ultra-compressed code review comments. Cuts noise from PR feedback while preserving the actionable signal. Each comment is one line: location, problem, fix. Use when user says "review this PR", "code review", "review the diff", "/review", or invokes /caveman-review. Auto-triggers when reviewing pull requests.

1066601 votes

Caveman Commit

Ultra-compressed commit message generator. Cuts noise from commit messages while preserving intent and reasoning. Conventional Commits format. Subject ≤50 chars, body only when "why" isn't obvious. Use when user says "write a commit", "commit message", "generate commit", "/commit", or invokes /caveman-commit. Auto-triggers when staging changes.

1066601 votes

Verification Loop

一个全面的 Claude Code 会话验证系统。

2456590 votes

Springboot Verification

Verification loop for Spring Boot projects: build, static analysis, tests with coverage, security scans, and diff review before release or PR.

2456590 votes

Django Verification

Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.

2456590 votes
View all in code-quality →