コードの品質問題、アンチパターン、可読性を検査。機能実装、コードレビュー、リファクタリング時に使用。
npx skills add https://github.com/shinpr/ai-coding-project-boilerplate --skill coding-standards
以下のパターンを検出したら実装を一時停止し、該当パターン、影響を受ける現行要件、準拠できる最小の代替案、再開に必要な検証を記録する。代替案によってパターンが解消された場合、または文書化された要件によって維持する根拠を示せた場合に再開する。
広く探索したうえで、システムの正しさと保守性を保ちながら、ユーザー・運用者・保守者に必要な価値を届けるライフサイクルコスト最小の解へ収束させる。
エラー時は速やかに失敗させ、不正な状態での処理継続を防ぐ。元の診断情報を保持したまま失敗を伝播するか、明示的な型付きエラーを返す。
詳細な実装方法(Result型、カスタムエラークラス、層別エラー処理など)は各言語・フレームワークのルールを参照。
Martin Fowler「Refactoring」に基づく重複コードの扱い方:
| 重複回数 | 対応 | 理由 |
|---------|------|------|
| 1回目 | インライン実装 | 将来の変化が予測できない |
| 2回目 | 将来の統合を意識 | パターンが見え始める |
| 3回目 | 共通化実施 | パターンが確立された |
共通化すべきケース
分離したままにするケース
失敗パターン: 近隣2-3ファイルのパターンや依存バージョンをリポジトリ全体での使用状況を確認せずに採用すると、古いパターン、バージョン不一致、アーキテクチャ不整合が発生する。
既存コードからパターン、API、依存を採用する場合:
近隣コードは調査の起点。採用の根拠にするにはリポジトリ全体での使用状況(異なるディレクトリの3ファイル以上)を確認すること。
症状: エラーを修正すると新しいエラーが発生
原因: 根本原因を理解せずに表面的な修正
回避方法: 5 Whysで根本原因を特定してから修正
症状: any型やasの多用
原因: 型エラーを回避したい衝動
回避方法: unknown型と型ガードで安全に処理
症状: 実装後にバグ多発
原因: Red-Green-Refactorプロセスの無視
回避方法: 必要な結果が未実装であるため失敗するテストから開始
症状: 新技術導入時の想定外エラー多発
原因: 事前調査なしで「公式ドキュメント通りなら動くはず」
回避方法:
症状: 重複実装、アーキテクチャ不整合、結合時の障害、古いパターンの採用
原因: 実装前の既存コード理解不足、近隣ファイルのみ参照し代表性を確認していない
回避方法:
各回答を観測済みの根拠に結び付け、修正によって元の失敗を防げる原因に到達するまで掘り下げる。各質問、根拠、最終的な因果関係を記録する。次の回答が推測になる時点で止め、必要な根拠を明記する。
型安全の原則: unknown型と型ガードを使用する。any型は型チェックを無効化し、実行時エラーの原因となる。
any型の代替手段(優先順位順)
型ガードの実装パターン
function isUser(value: unknown): value is User {
return typeof value === 'object' && value !== null && 'id' in value && 'name' in value
}
型の複雑性管理
基本方針
実施手順: 現状把握 → 段階的変更 → 動作確認 → 最終検証
優先順位: 重複コード削除 > 長大な関数分割 > 複雑な条件分岐簡素化 > 型安全性向上
完了定義: 以下3段階すべての完了
Grep -n "TargetClass\|TargetMethod" -o content
Grep -n "DependencyClass" -o content
Grep -n "targetData\|SetData\|UpdateData" -o content
必須: 検索で見つけた全ファイルを読み込み、作業に必要な部分をコンテキストに含める:
影響範囲の構造化報告(必須):
## 影響範囲分析
### 直接影響: ClassA、ClassB(理由明記)
### 間接影響: SystemX、PrefabY(連携経路明記)
### 処理フロー: 入力→処理1→処理2→出力
完了ゲート: 実装を開始する前に、検索・読解・特定の3段階すべてで必要な証跡を揃える。
未使用コードを検出したら、タスク完了までに現行要件と到達可能な呼び出し経路で使用されるかを確認する。
対象: コード・ドキュメント・設定ファイル
推奨原則: 振る舞いの変更は、必要な理由で失敗するテストから始める
開発ステップ:
直接検証するケース:
推奨: 単体テストでの外部依存モック化
Unit testの境界: 外部接続には決定的な代替を使用する。実際の外部境界は、その契約を対象として選定したIntegration testまたはE2E testで検証する
テストを修正: 間違った期待値、存在しない機能参照、実装詳細への依存、テストのためだけの実装
実装を修正: 妥当な仕様、ビジネスロジック、重要なエッジケース
どちらの解釈も入手可能な要件と両立する場合: 未解決の振る舞い判断として差し戻す — 2つの候補となる振る舞い、どちらが正しいかを決める出所、および一方を選ばず停止する条件を示す
観測可能な境界を通じてテストする:公開API、戻り値、例外、外部呼び出し、永続化された状態を検証する。privateメソッド、内部状態、アルゴリズムの詳細は、これらの観測可能な境界を通じてのみ到達する。
references/security-checks.mdを参照Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take shinpr/ai-coding-project-boilerplate-coding-standards from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.