engineering-fundamentals
Auto-invoke for general code quality review. Enforces naming conventions, function size, DRY principles, SOLID principles, and code organization.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o engineering-fundamentals.zip https://jpskill.com/download/18280.zip && unzip -o engineering-fundamentals.zip && rm engineering-fundamentals.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18280.zip -OutFile "$d\engineering-fundamentals.zip"; Expand-Archive "$d\engineering-fundamentals.zip" -DestinationPath $d -Force; ri "$d\engineering-fundamentals.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
engineering-fundamentals.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
engineering-fundamentalsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
エンジニアリングの基礎レビュー
「コードは書かれるよりも読まれることの方が多い。機械ではなく、読者のために書け。」
適用場面
以下のレビュー時にこのスキルを有効化してください。
- コードの変更
- 関数と変数の命名
- コードの構成と構造
- 一般的なリファクタリングの決定
レビューチェックリスト
命名
- [ ] 記述的: コンテキストなしで変数を理解できますか?
- [ ] 省略形なし: 名前は完全にスペルアウトされていますか? (
userでusrではない) - [ ] 汎用的な名前なし:
data、temp、info、stuffはありませんか? - [ ] ブール値のプレフィックス: ブール値は
is、has、can、shouldで始まっていますか? - [ ] 関数の動詞: 関数は動作を表す動詞で始まっていますか?
関数設計
- [ ] 単一責任: 各関数は 1 つのことだけを行っていますか?
- [ ] サイズ制限: 関数は 20〜30 行以内ですか?
- [ ] パラメータ数: パラメータは 4 つ未満ですか?
- [ ] 副作用なし: 純粋関数は本当に純粋ですか?
- [ ] 早期リターン: 深いネストの代わりにガード句が使用されていますか?
コード構成
- [ ] DRY: 重複したコードは関数に抽出されていますか?
- [ ] ただし、DRY すぎない: 抽象化は正当化されていますか (3 回の法則)?
- [ ] 凝集度: 関連するものはまとめてグループ化されていますか?
- [ ] 分離: 関係のないものは分離されていますか?
コメントとドキュメント
- [ ] 理由、内容ではない: コメントは明らかなコードではなく、理由を説明していますか?
- [ ] コメントアウトされたコードなし: 不要なコードはコメントアウトされずに削除されていますか?
- [ ] パブリック API の JSDoc: エクスポートされた関数はドキュメント化されていますか?
よくある間違い (アンチパターン)
1. マジックナンバー
❌ if (status === 2) { ... }
setTimeout(callback, 86400000);
✅ const STATUS = { ACTIVE: 2, INACTIVE: 1 };
if (status === STATUS.ACTIVE) { ... }
const ONE_DAY_MS = 24 * 60 * 60 * 1000;
setTimeout(callback, ONE_DAY_MS);
2. 不明瞭な命名
❌ const d = new Date();
const temp = getUser();
const flag = true;
✅ const createdAt = new Date();
const currentUser = getUser();
const isAuthenticated = true;
3. ゴッド関数
❌ function processOrder(order) {
// 200 lines: validate, calculate, save, email, log...
}
✅ function processOrder(order) {
validateOrder(order);
const total = calculateTotal(order);
await saveOrder(order, total);
await sendConfirmationEmail(order);
logOrderProcessed(order);
}
4. 深いネスト
❌ function check(user) {
if (user) {
if (user.active) {
if (user.role === 'admin') {
return true;
}
}
}
return false;
}
✅ function check(user) {
if (!user) return false;
if (!user.active) return false;
if (user.role !== 'admin') return false;
return true;
}
5. 早すぎる抽象化
❌ // Used once, but has 10 configuration options
createFlexibleReusableButton({ ... });
✅ // Just make the button
<button className="primary">Submit</button>
// Abstract when you need it 3+ times
SOLID 原則クイックチェック
| 原則 | 質問 | レッドフラグ |
|---|---|---|
| S単一責任 | 「このクラス/関数は 1 つのことだけを行っていますか?」 | 10 個以上のメソッドを持つクラス |
| O開放/閉鎖 | 「修正せずに拡張できますか?」 | 型に対する switch 文 |
| Lリスコフの置換原則 | 「実装を交換できますか?」 | 契約を破るメソッドのオーバーライド |
| Iインターフェース分離 | 「インターフェースは焦点を絞っていますか?」 | クライアントが未使用のメソッドに依存することを強制される |
| D依存性逆転 | 「高レベルモジュールは抽象化に依存していますか?」 | 依存関係の直接インスタンス化 |
ソクラテス式質問
ジュニアに答えを与える代わりに、これらの質問をしてください。
- 命名: 「新しい開発者は、コンテキストなしでこの名前を理解できますか?」
- 関数サイズ: 「この関数が何をするかを一文で説明できますか?」
- 重複: 「このパターンが 3 か所に見られます。変更が必要になった場合はどうなりますか?」
- 抽象化: 「この抽象化は実際に何回使用されていますか?」
- 可読性: 「6 か月後にこのコードに戻ってきた場合、理解できますか?」
命名規則
| タイプ | 規則 | 例 |
|---|---|---|
| 変数 | camelCase | userName, isActive |
| 定数 | UPPER_SNAKE_CASE | MAX_RETRIES, API_URL |
| 関数 | camelCase + 動詞 | getUser(), handleSubmit() |
| クラス | PascalCase | UserService, AuthProvider |
| ファイル (コンポーネント) | PascalCase | UserProfile.tsx |
| ファイル (ユーティリティ) | camelCase | formatDate.ts |
標準リファレンス
詳細なパターンについては、以下を参照してください。
/standards/global/naming-conventions.md
注意すべきレッドフラグ
| フラグ | 質問 |
|---|---|
| 1 文字の変数 | 「d は何を表していますか?」 |
| 30 行を超える関数 | 「これをより小さな関数に分割できますか?」 |
| 3 レベルを超えるネスト | 「早期リターンを使用できますか?」 |
| コピーペーストされたコード | 「このロジックが変更された場合、何箇所を更新する必要がありますか?」 |
| コメントアウトされたコード | 「これは必要ですか?削除できますか?」 |
| 追跡なしの TODO | 「これに対するチケットはありますか?」 |
| マジック文字列/数値 | 「これは名前付き定数にすべきですか?」 |
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Engineering Fundamentals Review
"Code is read more than it is written. Write for the reader, not the machine."
When to Apply
Activate this skill when reviewing:
- Any code changes
- Function and variable naming
- Code organization and structure
- General refactoring decisions
Review Checklist
Naming
- [ ] Descriptive: Can you understand the variable without context?
- [ ] No abbreviations: Are names spelled out? (
usernotusr) - [ ] No generic names: No
data,temp,info,stuff? - [ ] Boolean prefix: Do booleans start with
is,has,can,should? - [ ] Function verbs: Do functions start with action verbs?
Function Design
- [ ] Single responsibility: Does each function do ONE thing?
- [ ] Size limit: Are functions under 20-30 lines?
- [ ] Parameter count: Are there fewer than 4 parameters?
- [ ] No side effects: Are pure functions actually pure?
- [ ] Early returns: Are guard clauses used instead of deep nesting?
Code Organization
- [ ] DRY: Is duplicated code extracted into functions?
- [ ] But not too DRY: Are abstractions justified (rule of three)?
- [ ] Cohesion: Are related things grouped together?
- [ ] Separation: Are unrelated things separated?
Comments & Documentation
- [ ] Why, not what: Do comments explain reasoning, not obvious code?
- [ ] No commented-out code: Is dead code deleted, not commented?
- [ ] JSDoc on public APIs: Are exported functions documented?
Common Mistakes (Anti-Patterns)
1. Magic Numbers
❌ if (status === 2) { ... }
setTimeout(callback, 86400000);
✅ const STATUS = { ACTIVE: 2, INACTIVE: 1 };
if (status === STATUS.ACTIVE) { ... }
const ONE_DAY_MS = 24 * 60 * 60 * 1000;
setTimeout(callback, ONE_DAY_MS);
2. Unclear Naming
❌ const d = new Date();
const temp = getUser();
const flag = true;
✅ const createdAt = new Date();
const currentUser = getUser();
const isAuthenticated = true;
3. God Functions
❌ function processOrder(order) {
// 200 lines: validate, calculate, save, email, log...
}
✅ function processOrder(order) {
validateOrder(order);
const total = calculateTotal(order);
await saveOrder(order, total);
await sendConfirmationEmail(order);
logOrderProcessed(order);
}
4. Deep Nesting
❌ function check(user) {
if (user) {
if (user.active) {
if (user.role === 'admin') {
return true;
}
}
}
return false;
}
✅ function check(user) {
if (!user) return false;
if (!user.active) return false;
if (user.role !== 'admin') return false;
return true;
}
5. Premature Abstraction
❌ // Used once, but has 10 configuration options
createFlexibleReusableButton({ ... });
✅ // Just make the button
<button className="primary">Submit</button>
// Abstract when you need it 3+ times
SOLID Principles Quick Check
| Principle | Question | Red Flag |
|---|---|---|
| Single Responsibility | "Does this class/function do one thing?" | Class with 10+ methods |
| Open/Closed | "Can I extend without modifying?" | Switch statements for types |
| Liskov Substitution | "Can I swap implementations?" | Overriding methods that break contracts |
| Interface Segregation | "Are interfaces focused?" | Clients forced to depend on unused methods |
| Dependency Inversion | "Do high-level modules depend on abstractions?" | Direct instantiation of dependencies |
Socratic Questions
Ask the junior these questions instead of giving answers:
- Naming: "Would a new developer understand this name without context?"
- Function Size: "Can you describe what this function does in one sentence?"
- Duplication: "I see this pattern in three places. What happens if it needs to change?"
- Abstraction: "How many times is this abstraction actually used?"
- Readability: "If you came back to this code in 6 months, would you understand it?"
Naming Conventions
| Type | Convention | Example |
|---|---|---|
| Variables | camelCase | userName, isActive |
| Constants | UPPER_SNAKE_CASE | MAX_RETRIES, API_URL |
| Functions | camelCase + verb | getUser(), handleSubmit() |
| Classes | PascalCase | UserService, AuthProvider |
| Files (components) | PascalCase | UserProfile.tsx |
| Files (utilities) | camelCase | formatDate.ts |
Standards Reference
See detailed patterns in:
/standards/global/naming-conventions.md
Red Flags to Call Out
| Flag | Question to Ask |
|---|---|
| Single letter variables | "What does d represent?" |
| Functions > 30 lines | "Can we break this into smaller functions?" |
| > 3 levels of nesting | "Can we use early returns?" |
| Copy-pasted code | "If this logic changes, how many places need updating?" |
| Commented-out code | "Is this needed? Can we delete it?" |
| TODO without tracking | "Is there a ticket for this?" |
| Magic strings/numbers | "Should this be a named constant?" |