quality-check
コード品質チェックと自動修正を実行します。コミット前やコード変更後に使用してください。
When & Why to Use This Skill
This Claude skill automates code quality assurance by performing comprehensive checks, including type verification, linting, and unit testing. It streamlines the development workflow by not only identifying errors and style inconsistencies but also providing automated fixes and formatting to ensure a clean, production-ready codebase before every commit.
Use Cases
- Pre-commit Validation: Automatically run type checks (ty), linting (ruff), and tests (pytest) to catch bugs and style issues before pushing code to a repository.
- Automated Code Refactoring: Use the auto-fix capability to instantly resolve linting warnings, apply formatting standards, and correct unsafe code patterns.
- Pull Request Preparation: Ensure code meets project standards and passes CI/CD requirements by verifying quality locally before submitting a PR.
- Post-Change Verification: Quickly validate that recent logic updates haven't introduced regressions or type mismatches in complex Python environments.
| name | quality-check |
|---|---|
| description | コード品質チェックと自動修正を実行します。コミット前やコード変更後に使用してください。 |
Quality Check Skill
このスキルは、コード品質チェックと自動修正を実行します。
使用タイミング
- コミット前の品質チェック
- コード変更後の検証
- Pull Request作成前
実行コマンド
品質チェック(検証のみ)
uv run check
- 型チェック(ty)、リント(ruff)、テスト(pytest)を実行
- コードの変更は行わない
- エラーや警告を報告
自動修正 + フォーマット
uv run fix
- コードの自動修正(--unsafe-fixesを含む)
- フォーマットの適用
- 可能な限りの問題を自動修正
個別コマンド
uv run typecheck # 型チェックのみ
uv run lint # リントのみ
uv run fmt # フォーマットのみ
スキルの動作
- まず
uv run checkで問題を検出 - 問題がある場合は
uv run fixで自動修正を試行 - 残った問題をユーザーに報告
- 必要に応じて手動修正をガイド
重要な注意事項
- コミット前は必ず実行:
uv run checkは必須 - 自動修正の確認:
uv run fix後は変更内容を確認 - 型アノテーション: 小文字のビルトイン型(
list,dictなど)を使用 - import順序: 標準ライブラリ → サードパーティ → ローカルimport
- inline import禁止: 関数内でのimportは避ける
エラー処理
品質チェックで問題が見つかった場合:
- エラー内容を明確に報告
- 自動修正可能か判断
- 自動修正を実行または手動修正方法を提案
- 修正後に再度チェックを実行