Best use case
pre-commit-check is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
コミット前品質チェックスキル(Lint、テスト、ビルドの高速検証)
Teams using pre-commit-check should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/pre-commit-check/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How pre-commit-check Compares
| Feature / Agent | pre-commit-check | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
コミット前品質チェックスキル(Lint、テスト、ビルドの高速検証)
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Pre-Commit Check Skill - コミット前品質チェックスキル ## 役割 コミット前の品質チェックを高速に実行するスキルです。qa-checkよりも軽量で、開発中の頻繁なチェックに適しています。 ## qa-check との違い | 項目 | pre-commit-check | qa-check | |------|-----------------|----------| | 目的 | 開発中の頻繁なチェック | PR作成前の最終チェック | | 実行速度 | 高速(変更ファイルのみ) | 通常(全体チェック) | | テスト | 変更箇所のみ(オプション) | 全テスト実行 | | カバレッジ | チェックしない | 80%以上必須 | | ビルド | スキップ可能 | 必須 | | 使用タイミング | コミット直前 | PR作成直前 | ## 実行フロー ### Phase 1: 変更ファイル確認 ```bash # 変更されたファイルを確認 git status --short # ステージングされたファイルを確認 git diff --cached --name-only # 変更ファイルからBackend/Frontendを判定 ``` ### Phase 2: Backend チェック(変更がある場合) #### 2-1. Lint実行(変更ファイルのみ) ```bash cd backend # Checkstyle(変更ファイルのみ) ./gradlew checkstyleMain checkstyleTest # SpotBugs(変更ファイルのみ) ./gradlew spotbugsMain spotbugsTest ``` #### 2-2. テスト実行(skip_tests=false の場合) ```bash # 変更されたクラスに関連するテストのみ実行 ./gradlew test --tests "*[変更されたクラス名]Test" ``` #### 2-3. コンパイル確認 ```bash # ビルドはスキップしてコンパイルのみ ./gradlew compileJava compileTestJava ``` ### Phase 3: Frontend チェック(変更がある場合) #### 3-1. Lint実行 ```bash cd frontend # Biome Lint(全体) pnpm run lint:check ``` #### 3-2. テスト実行(skip_tests=false の場合) ```bash # 変更されたファイルに関連するテストのみ実行 pnpm run test:ci --changed ``` #### 3-3. 型チェック ```bash # TypeScript型チェック npx tsc --noEmit ``` ### Phase 4: 結果レポート #### 成功時 ```markdown ## Pre-Commit Check 完了 ### Backend - ✅ Lint: エラーなし - ✅ テスト: [実行数] 件成功 - ✅ コンパイル: 成功 ### Frontend - ✅ Lint: エラーなし - ✅ テスト: [実行数] 件成功 - ✅ 型チェック: エラーなし ### 次のステップ コミット可能です。 ``` #### 失敗時 ```markdown ## 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設定
Related Skills
soc2-compliance-checker
Soc2 Compliance Checker - Auto-activating skill for Security Advanced. Triggers on: soc2 compliance checker, soc2 compliance checker Part of the Security Advanced skill category.
checking-session-security
This skill enables Claude to check session security implementations within a codebase. It analyzes session management practices to identify potential vulnerabilities. Use this skill when a user requests to "check session security", "audit session handling", "review session implementation", or asks about "session security best practices" in their code. It helps identify issues like insecure session IDs, lack of proper session expiration, or insufficient protection against session fixation attacks. This skill leverages the session-security-checker plugin. Activates when you request "checking session security" functionality.
pre-commit-hook-setup
Pre Commit Hook Setup - Auto-activating skill for DevOps Basics. Triggers on: pre commit hook setup, pre commit hook setup Part of the DevOps Basics skill category.
checking-owasp-compliance
This skill uses the owasp-compliance-checker plugin to automatically identify potential security vulnerabilities based on the OWASP Top 10 (2021) list. It helps ensure your application adheres to industry-standard security practices by providing a detailed analysis of compliance gaps and offering remediation guidance. Use this skill when you need to audit your code for OWASP compliance, identify and fix vulnerabilities, or generate a compliance report. Trigger this skill by asking to "check OWASP compliance", "scan for OWASP vulnerabilities", or using the `/owasp` shortcut.
model-checkpoint-manager
Model Checkpoint Manager - Auto-activating skill for ML Training. Triggers on: model checkpoint manager, model checkpoint manager Part of the ML Training skill category.
insecure-deserialization-checker
Insecure Deserialization Checker - Auto-activating skill for Security Fundamentals. Triggers on: insecure deserialization checker, insecure deserialization checker Part of the Security Fundamentals skill category.
input-validation-checker
Input Validation Checker - Auto-activating skill for Security Fundamentals. Triggers on: input validation checker, input validation checker Part of the Security Fundamentals skill category.
https-certificate-checker
Https Certificate Checker - Auto-activating skill for Security Fundamentals. Triggers on: https certificate checker, https certificate checker Part of the Security Fundamentals skill category.
checking-hipaa-compliance
This skill enables Claude to automatically check for HIPAA (Health Insurance Portability and Accountability Act) compliance issues in codebases, infrastructure configurations, and documentation. It leverages the hipaa-compliance-checker plugin to identify potential violations related to data privacy, security, and access controls. Use this skill when the user explicitly requests to "check HIPAA compliance", "scan for HIPAA violations", "assess HIPAA readiness", or similar phrases related to HIPAA audits and security best practices. It is useful for projects handling protected health information (PHI) and requiring adherence to HIPAA regulations.
governance-checklist-generator
Governance Checklist Generator - Auto-activating skill for Enterprise Workflows. Triggers on: governance checklist generator, governance checklist generator Part of the Enterprise Workflows skill category.
generating-smart-commits
This skill generates conventional commit messages using AI analysis of staged Git changes. It automatically determines the commit type (feat, fix, docs, etc.), identifies breaking changes, and formats the message according to conventional commit standards. Use this when asked to create a commit message, write a Git commit, or when the user uses the `/commit-smart` or `/gc` command. It is especially useful after changes have been staged with `git add`.
generating-conventional-commits
Execute generates conventional commit messages using AI. It analyzes code changes and suggests a commit message adhering to the conventional commits specification. Use this skill when you need help writing clear, standardized commit messages, especially a... Use when managing version control. Trigger with phrases like 'commit', 'branch', or 'git'.