jpskill.com
🛠️ 開発・MCP コミュニティ

fundamentals-gate

Verify code quality standards are met - naming, structure, DRY principles. Issues result in SUGGESTIONS for improvement.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o fundamentals-gate.zip https://jpskill.com/download/18284.zip && unzip -o fundamentals-gate.zip && rm fundamentals-gate.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18284.zip -OutFile "$d\fundamentals-gate.zip"; Expand-Archive "$d\fundamentals-gate.zip" -DestinationPath $d -Force; ri "$d\fundamentals-gate.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して fundamentals-gate.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → fundamentals-gate フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Gate 5: 基礎レビュー

「良いコードとは、単に動作するコードではありません。他の人が扱えるコードのことです。」

目的

このゲートは、エンジニアリング標準に照らして一般的なコード品質をチェックします。指摘事項はブロックではなく、あくまで提案です。問題ではなく、磨き上げのためのものです。

ゲートの状態

  • PASS — コード品質は堅牢です
  • SUGGESTIONS — 軽微な改善を推奨します

ゲートの質問

質問 1: 命名の明確さ

「新しい開発者が、[variable/function] が何をするものか、その名前だけで理解できるでしょうか?」

着眼点:

  • 説明的で、意図が伝わる名前
  • 略語や一文字の変数名を使用しない
  • Boolean のプレフィックス (is, has, can)
  • 関数の動詞 (get, set, handle)

質問 2: 関数の焦点

「この関数が何をするものか、『そして』を使わずに一文で説明できますか?」

着眼点:

  • 単一責任
  • 適切なサイズ (30 行未満)
  • 明確な入力/出力の関係
  • 隠れた副作用がない

質問 3: コードの再利用

「このパターンをいくつか見かけます。これは意図的な重複ですか、それとも抽出されるべきですか?」

着眼点:

  • 重複の認識
  • 適切な抽象化 (3 回の法則)
  • 一度しか使わないものに対する過剰な設計をしない

基礎チェックリスト

命名

  • [ ] 変数は説明的である (temp, data, x は使用しない)
  • [ ] Boolean は is, has, can, should で始まる
  • [ ] 関数は動詞で始まる
  • [ ] 不必要な略語を使用しない
  • [ ] 一貫した命名パターン

関数

  • [ ] 単一責任
  • [ ] 30 行未満 (一般的に)
  • [ ] 4 つ未満のパラメータ
  • [ ] 深いネストの代わりに早期リターン
  • [ ] マジックナンバーを使用しない (名前付き定数を使用する)

構造

  • [ ] 関連するコードはまとめてグループ化する
  • [ ] 適切なファイル構成
  • [ ] 関心の分離を明確にする
  • [ ] 一貫したフォーマット

コメント

  • [ ] WHAT ではなく WHY を説明する
  • [ ] コメントアウトされたコードは削除する
  • [ ] 明らかなコメントは書かない (// increment counter)
  • [ ] 複雑なロジックはドキュメント化する

レスポンステンプレート

PASS の場合

✅ 基礎ゲート: 合格

コード品質は堅牢です:
- 命名は明確で一貫性がある
- 関数は焦点が絞られている
- 全体的に良い構造

すべてのゲートに合格しました!コードレビューに進みましょう...

SUGGESTIONS の場合

💡 基礎ゲート: 提案

検討すべきいくつかの磨き上げ項目:

**提案 1: [命名]**
`const d = new Date()` → `const createdAt = new Date()`
理由: 説明的な名前は将来の読者の助けになる

**提案 2: [関数サイズ]**
`processOrder()` は 80 行です。以下のように分割することを検討してください:
- `validateOrder()`
- `calculateTotal()`
- `saveOrder()`

**提案 3: [マジックナンバー]**
`if (status === 2)` → `if (status === STATUS.ACTIVE)`
理由: 名前付き定数は自己文書化される

これらは提案であり、ブロックではありません。コードは動作します — これは磨き上げについてです。
コードレビューに進みますか?それとも最初にこれらに取り組みますか?

チェックすべき一般的な問題

1. 不明瞭な命名

❌ const d = new Date();
   const temp = getUser();
   const flag = true;

✅ const createdAt = new Date();
   const currentUser = getUser();
   const isAuthenticated = true;

2. マジックナンバー

❌ if (status === 2) { ... }
   setTimeout(fn, 86400000);

✅ const STATUS = { ACTIVE: 2, INACTIVE: 1 };
   if (status === STATUS.ACTIVE) { ... }

   const ONE_DAY_MS = 24 * 60 * 60 * 1000;
   setTimeout(fn, ONE_DAY_MS);

3. 深いネスト

❌ 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;
   }

4. 神関数

❌ function processOrder(order) {
     // 100+ 行のバリデーション、計算、保存、メール送信...
   }

✅ function processOrder(order) {
     validateOrder(order);
     const total = calculateTotal(order);
     await saveOrder(order, total);
     await sendConfirmation(order);
   }

5. 意味のないコメント

❌ // Increment counter
   counter++;

   // Get user
   const user = getUser();

✅ // レート制限: ユーザーあたり 1 分あたり最大 100 リクエスト
   if (requestCount >= 100) {
     throw new RateLimitError();
   }

ソクラテス式基礎質問

修正点を指摘する代わりに、以下のように質問します:

  1. d は何を意味しますか?新しい開発者はわかるでしょうか?」
  2. 「この文脈で、数字の 2 は何を意味しますか?」
  3. 「『そして』を使わずにこの関数を説明できますか?」
  4. 「このパターンを 3 回見かけますが、これは意図的ですか?」
  5. 「6 か月後にこのコメントを理解できますか?」

標準リファレンス

詳細なパターンについては、以下を参照してください:

  • /standards/global/naming-conventions.md
  • /standards/global/error-handling.md
  • /standards/frontend/component-architecture.md

命名クイックリファレンス

タイプ パターン
変数 camelCase, 説明的 userEmail, isLoading
Boolean is/has/can/should プレフィックス isActive, hasPermission
関数 動詞 + 名詞 getUser(), handleSubmit()
定数 UPPER_SNAKE_CASE MAX_RETRIES, API_URL
クラス PascalCase UserService, ApiClient

提案をスキップする場合

すべての提案に対応する必要はありません:

  • プロトタイプコード — 磨き上げは後回しにできる
  • 時間的制約 — 動作するコードをまずリリースし、後で磨き上げる
  • 最小限の影響 — 単なるスタイルの好みの問題である場合
  • 既存のパターン — 不完全であっても、コードベースの慣例に合わせる

基礎は成長のためのものであり、完璧を求めるものではありません。学習のために提案をメモしておきますが、リリースをブロックしないでください。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Gate 5: Fundamentals Review

"Good code is not just code that works. It's code that others can work with."

Purpose

This gate checks general code quality against engineering standards. Issues are SUGGESTIONS, not blockers — they're polish, not problems.

Gate Status

  • PASS — Code quality is solid
  • SUGGESTIONS — Minor improvements recommended

Gate Questions

Question 1: Naming Clarity

"Would a new developer understand what [variable/function] does from its name alone?"

Looking for:

  • Descriptive, intention-revealing names
  • No abbreviations or single letters
  • Boolean prefixes (is, has, can)
  • Function verbs (get, set, handle)

Question 2: Function Focus

"Can you describe what this function does in one sentence without using 'and'?"

Looking for:

  • Single responsibility
  • Reasonable size (under 30 lines)
  • Clear input/output relationship
  • No hidden side effects

Question 3: Code Reuse

"I see this pattern in a few places. Is it intentional duplication or should it be extracted?"

Looking for:

  • Awareness of duplication
  • Appropriate abstraction (rule of three)
  • Not over-engineering for one-time use

Fundamentals Checklist

Naming

  • [ ] Variables are descriptive (no temp, data, x)
  • [ ] Booleans prefixed with is, has, can, should
  • [ ] Functions start with verbs
  • [ ] No unnecessary abbreviations
  • [ ] Consistent naming patterns

Functions

  • [ ] Single responsibility
  • [ ] Under 30 lines (generally)
  • [ ] Fewer than 4 parameters
  • [ ] Early returns instead of deep nesting
  • [ ] No magic numbers (use named constants)

Structure

  • [ ] Related code grouped together
  • [ ] Appropriate file organization
  • [ ] Clear separation of concerns
  • [ ] Consistent formatting

Comments

  • [ ] Explain WHY, not WHAT
  • [ ] No commented-out code (delete it)
  • [ ] No obvious comments (// increment counter)
  • [ ] Complex logic documented

Response Templates

If PASS

✅ FUNDAMENTALS GATE: PASSED

Code quality is solid:
- Naming is clear and consistent
- Functions are focused
- Good structure overall

All gates passed! Let's move to code review...

If SUGGESTIONS

💡 FUNDAMENTALS GATE: SUGGESTIONS

A few polish items for consideration:

**Suggestion 1: [Naming]**
`const d = new Date()` → `const createdAt = new Date()`
Why: Descriptive names help future readers

**Suggestion 2: [Function size]**
`processOrder()` is 80 lines. Consider splitting into:
- `validateOrder()`
- `calculateTotal()`
- `saveOrder()`

**Suggestion 3: [Magic number]**
`if (status === 2)` → `if (status === STATUS.ACTIVE)`
Why: Named constants are self-documenting

These are suggestions, not blockers. The code works — this is about polish.
Proceed to code review? Or address these first?

Common Issues to Check

1. Unclear Naming

❌ const d = new Date();
   const temp = getUser();
   const flag = true;

✅ const createdAt = new Date();
   const currentUser = getUser();
   const isAuthenticated = true;

2. Magic Numbers

❌ if (status === 2) { ... }
   setTimeout(fn, 86400000);

✅ const STATUS = { ACTIVE: 2, INACTIVE: 1 };
   if (status === STATUS.ACTIVE) { ... }

   const ONE_DAY_MS = 24 * 60 * 60 * 1000;
   setTimeout(fn, ONE_DAY_MS);

3. 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;
   }

4. God Functions

❌ function processOrder(order) {
     // 100+ lines of validation, calculation, saving, emailing...
   }

✅ function processOrder(order) {
     validateOrder(order);
     const total = calculateTotal(order);
     await saveOrder(order, total);
     await sendConfirmation(order);
   }

5. Meaningless Comments

❌ // Increment counter
   counter++;

   // Get user
   const user = getUser();

✅ // Rate limit: max 100 requests per minute per user
   if (requestCount >= 100) {
     throw new RateLimitError();
   }

Socratic Fundamentals Questions

Instead of pointing out fixes, ask:

  1. "What does d stand for? Would a new developer know?"
  2. "What does the number 2 mean in this context?"
  3. "Can you describe this function without saying 'and'?"
  4. "I see this pattern three times — is that intentional?"
  5. "Would you understand this comment in 6 months?"

Standards Reference

See detailed patterns in:

  • /standards/global/naming-conventions.md
  • /standards/global/error-handling.md
  • /standards/frontend/component-architecture.md

Naming Quick Reference

Type Pattern Example
Variable camelCase, descriptive userEmail, isLoading
Boolean is/has/can/should prefix isActive, hasPermission
Function verb + noun getUser(), handleSubmit()
Constant UPPER_SNAKE_CASE MAX_RETRIES, API_URL
Class PascalCase UserService, ApiClient

When to Skip Suggestions

Not every suggestion needs addressing:

  • Prototype code — Polish can wait
  • Time pressure — Ship working code, polish later
  • Minimal impact — If it's just style preference
  • Existing patterns — Match codebase conventions even if imperfect

Fundamentals are about growth, not perfection. Note suggestions for learning, but don't block shipping.