agentsclimarketplace

Pre commit check

Skill bg-szy/TOP-SKILLS/skills/marketplace/pre-commit-check

全球最大的 Claude Code 技能聚合库 · 收录 3900+ 来自 12+ 来源的技能,提供在线搜索与趋势分析看板 / The world's largest Claude Code skill aggregation hub — 3900+ skills from 12+ sources with online search and trend dashboard

Install
npx -y skills add bg-szy/TOP-SKILLS --skill pre-commit-check

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

コミット前品質チェックスキル(Lint、テスト、ビルドの高速検証)

SKILL.md

4.4 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it

Pre-Commit Check Skill - コミット前品質チェックスキル

役割

コミット前の品質チェックを高速に実行するスキルです。qa-checkよりも軽量で、開発中の頻繁なチェックに適しています。

qa-check との違い

項目pre-commit-checkqa-check
目的開発中の頻繁なチェックPR作成前の最終チェック
実行速度高速(変更ファイルのみ)通常(全体チェック)
テスト変更箇所のみ(オプション)全テスト実行
カバレッジチェックしない80%以上必須
ビルドスキップ可能必須
使用タイミングコミット直前PR作成直前

実行フロー

Phase 1: 変更ファイル確認

# 変更されたファイルを確認
git status --short

# ステージングされたファイルを確認
git diff --cached --name-only

# 変更ファイルからBackend/Frontendを判定

Phase 2: Backend チェック(変更がある場合)

2-1. Lint実行(変更ファイルのみ)

cd backend

# Checkstyle(変更ファイルのみ)
./gradlew checkstyleMain checkstyleTest

# SpotBugs(変更ファイルのみ)
./gradlew spotbugsMain spotbugsTest

2-2. テスト実行(skip_tests=false の場合)

# 変更されたクラスに関連するテストのみ実行
./gradlew test --tests "*[変更されたクラス名]Test"

2-3. コンパイル確認

# ビルドはスキップしてコンパイルのみ
./gradlew compileJava compileTestJava

Phase 3: Frontend チェック(変更がある場合)

3-1. Lint実行

cd frontend

# Biome Lint(全体)
pnpm run lint:check

3-2. テスト実行(skip_tests=false の場合)

# 変更されたファイルに関連するテストのみ実行
pnpm run test:ci --changed

3-3. 型チェック

# TypeScript型チェック
npx tsc --noEmit

Phase 4: 結果レポート

成功時

## Pre-Commit Check 完了

### Backend
- ✅ Lint: エラーなし
- ✅ テスト: [実行数] 件成功
- ✅ コンパイル: 成功

### Frontend
- ✅ Lint: エラーなし
- ✅ テスト: [実行数] 件成功
- ✅ 型チェック: エラーなし

### 次のステップ
コミット可能です。

失敗時

## Pre-Commit Check 失敗

### Backend
- ❌ Lint: エラー [数] 件
  - [エラー内容]
- ❌ テスト: [失敗数] 件失敗
  - [失敗テスト名]
- ✅ コンパイル: 成功

### Frontend
- ✅ Lint: エラーなし
- ✅ テスト: すべて成功
- ✅ 型チェック: エラーなし

### 修正が必要な項目
1. Backend Lintエラーを修正
2. Backend テスト失敗を修正

### 次のステップ
上記を修正してから再度チェックしてください。

高速化のポイント

1. 変更ファイルのみチェック

  • git diffで変更ファイルを検出
  • 関連するテストのみ実行
  • ビルドをスキップ

2. 並行実行

  • Backend/Frontendのチェックを並行実行
  • Lint/テスト/型チェックを並行実行可能な場合は並行実行

3. キャッシュ活用

  • Gradleのビルドキャッシュ活用
  • pnpmのキャッシュ活用

使用ツール

必須ツール

  • Bash: Lint/テスト/コンパイル実行、git操作

推奨ツール

  • Grep: エラーパターン検索
  • Read: レポートファイル確認

重要な注意事項

pre-commit-check は軽量チェック

  • PR作成前は必ず qa-check を実行すること
  • pre-commit-check は開発中の頻繁なチェック用
  • カバレッジチェックは行わない

テストスキップの判断

  • skip_tests=true は緊急時のみ使用
  • 通常は skip_tests=false でテストを実行すること
  • テストをスキップした場合は後で必ず実行

参照ドキュメント

必須参照

  • documents/development/development-policy.md: 開発ガイドライン

設定ファイル

  • backend/config/checkstyle/checkstyle.xml: Checkstyle設定
  • backend/config/spotbugs/spotbugs-exclude.xml: SpotBugs設定
  • frontend/biome.json: Biome設定

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.