testing-gate
Gate 6 - Verify tests exist and cover critical paths. Issues result in WARNINGS (encourages tests, doesn't block).
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o testing-gate.zip https://jpskill.com/download/18294.zip && unzip -o testing-gate.zip && rm testing-gate.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18294.zip -OutFile "$d\testing-gate.zip"; Expand-Archive "$d\testing-gate.zip" -DestinationPath $d -Force; ri "$d\testing-gate.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
testing-gate.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
testing-gateフォルダができる - 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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Gate 6: テスト検証
「テストは理解の証です。テストできないなら、本当に理解していると言えますか?」
目的
このゲートは、ジュニアが機能に対してテストを書くことを奨励します。オーナーシップゲートとは異なり、これは完了をブロックするものではありません。テストの習慣を奨励するために警告を発します。
ゲートの状態
- PASS — テストが存在し、重要なパスをカバーしている
- WARNING — テストがない、またはカバレッジが不十分(注記付きで続行可能)
注記: このゲートはブロックしません。目標は、強制ではなく奨励を通じてテストの習慣を身につけることです。
ゲートの質問
順番に質問してください。
質問 1: テストの存在
「この機能のためにどのようなテストを書きましたか?」
確認事項:
- 少なくとも1つのテストファイルが存在する
- テストが実際に実行されている(スキップされていない)
- テストが意味のあるものである(単に
expect(true).toBe(true)ではない)
テストがない場合:
「この機能のテストがないようですね。テストは完了に必須ではありませんが、身につける価値のある習慣です。もし時間があれば何をテストしますか?」
質問 2: カバレッジ戦略
「あなたのテストは何を証明していますか?」
確認事項:
- ハッピーパスがカバーされている
- 少なくとも1つのエッジケースが考慮されている
- エラー状態(該当する場合)
フォローアップ:
「もし私が[特定の部分]を壊した場合、どのテストがそれをキャッチしますか?」
質問 3: テストの品質
「あなたの最も重要なテストを見せてください。それはどのような動作を検証しますか?」
確認事項:
- 実装ではなく、動作をテストしている
- 明確なテスト名
- AAAパターン(Arrange, Act, Assert)
レスポンステンプレート
PASSの場合(テストが存在する)
✅ TESTING GATE: PASSED
テストを含めてくれてありがとうございます!以下をカバーしていることがわかります。
- [彼らが書いた特定のテスト]
- [彼らが処理したエッジケース]
主な強み: [彼らがうまくやったこと]
追加を検討してください: [将来のための1つの提案]
コードレビューに進みます...
WARNINGの場合(テストがない)
⚠️ TESTING GATE: WARNING
この機能のテストは見つかりませんでした。大丈夫です - 続行できます。
しかし、テストが重要な理由は次のとおりです。
1. **面接の宝**: 「重要なフローのテストを実装しました...」
2. **自信**: 変更によって何かが壊れないことを知る
3. **ドキュメント**: テストはコードがどのように使用されるべきかを示します
次回の簡単な勝利:
- まずハッピーパスをテストする
- 1つのエッジケースを追加する
- それだけでもほとんどの人より優れています!
コードレビューに進みます...
WARNINGの場合(テストが弱い)
⚠️ TESTING GATE: WARNING
テストは存在するが、もっと強くできる:
**問題点**: [何が欠けているか、または弱いか]
**質問**: 「もし[シナリオ]の場合、あなたのテストはそれをキャッチしますか?」
これはあなたをブロックしませんが、以下を検討してください。
- [具体的な改善提案]
コードレビューに進みます...
優れたテストスイートとは?
| レベル | カバレッジ | 特徴 |
|---|---|---|
| 最小限 | 1-2個のテスト | ハッピーパスのみ |
| 良い | 3-5個のテスト | ハッピーパス + 主要なエッジケース |
| 強い | 5-10個のテスト | ハッピーパス + エッジケース + エラー状態 |
| 面接準備完了 | 完全なピラミッド | 重要なフローに対するユニット + 統合 + E2E |
ソクラテス式ガイダンス
テストを追加したいが、どこから始めればよいかわからない場合:
- 「もし壊れたら本当にまずいことになることは何ですか?」
- 「ユーザーは決して送信しないが、ハッカーは送信する可能性のある入力は何ですか?」
- 「サーバーが遅い場合、またはエラーを返す場合はどうなりますか?」
スタック固有のヒント
| スタック | 提案 |
|---|---|
| Vite + React | 「Vitest + React Testing Library は高速で統合されています」 |
| Next.js | 「Vitest または Jest は Next とうまく連携します」 |
| API/Backend | 「supertest またはネイティブ HTTP でエンドポイントをテストします」 |
| Python | 「pytest は標準です - シンプルで強力です」 |
面接とのつながり
「テストは面接の宝です。」
テストに合格した場合:
- 彼らの STAR ストーリーのためにそれをメモする
- 「面接であなたのテスト戦略について話すことができます」
- 「何パーセントのカバレッジを達成しましたか?」(履歴書用)
テストをスキップした場合:
- 「次回は、2〜3個のテストでもポートフォリオに大きな違いをもたらします」
- 「雇用主はあなたのリポジトリにテストファイルがあるのを見るのが大好きです」
WARNING で BLOCKING ではない理由
- 奨励 > 強制: ポジティブな強化を通じて習慣を身につける
- いくつかの機能は些細なこと: すべてのものがテストを必要とするわけではない
- 時間の制約が存在する: 本番環境のプレッシャーは現実的である
- 学習曲線: テストには学習曲線があります。進捗を妨げないでください
目標は、テストを有益なものと感じさせることであり、懲罰的なものではありません。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Gate 6: Testing Verification
"Tests are proof of understanding. If you can't test it, do you really understand it?"
Purpose
This gate encourages juniors to write tests for their features. Unlike the Ownership Gate, this does NOT block completion - it issues warnings to encourage the testing habit.
Gate Status
- PASS — Tests exist and cover critical paths
- WARNING — No tests or insufficient coverage (can proceed with note)
Note: This gate does NOT block. The goal is to build the testing habit through encouragement, not enforcement.
Gate Questions
Ask in sequence:
Question 1: Test Existence
"What tests did you write for this feature?"
Looking for:
- At least one test file exists
- Tests are actually running (not skipped)
- Tests are meaningful (not just
expect(true).toBe(true))
If no tests:
"I noticed there aren't tests for this feature. Testing isn't required to complete, but it's a habit worth building. What would you test if you had time?"
Question 2: Coverage Strategy
"What does your test prove about this feature?"
Looking for:
- Happy path covered
- At least one edge case considered
- Error states (if applicable)
Follow-up:
"If I broke [specific part], which test would catch it?"
Question 3: Test Quality
"Show me your most important test. What behavior does it verify?"
Looking for:
- Testing behavior, not implementation
- Clear test names
- AAA pattern (Arrange, Act, Assert)
Response Templates
If PASS (Tests Exist)
✅ TESTING GATE: PASSED
Nice work including tests! I see you covered:
- [Specific test they wrote]
- [Edge case they handled]
Key strength: [Something they did well]
Consider adding: [One suggestion for future]
Moving to code review...
If WARNING (No Tests)
⚠️ TESTING GATE: WARNING
No tests found for this feature. That's okay - we can proceed.
But here's why tests matter:
1. **Interview Gold**: "I implemented tests for critical flows..."
2. **Confidence**: Know your changes don't break things
3. **Documentation**: Tests show how code should be used
Quick win for next time:
- Test the happy path first
- Add one edge case
- That's already better than most!
Proceeding to code review...
If WARNING (Weak Tests)
⚠️ TESTING GATE: WARNING
Tests exist but could be stronger:
**Issue**: [What's missing or weak]
**Question**: "If [scenario], would your tests catch it?"
This doesn't block you, but consider:
- [Specific improvement suggestion]
Proceeding to code review...
What Makes a Good Test Suite?
| Level | Coverage | Characteristics |
|---|---|---|
| Minimal | 1-2 tests | Happy path only |
| Good | 3-5 tests | Happy path + main edge cases |
| Strong | 5-10 tests | Happy path + edge cases + error states |
| Interview-Ready | Full pyramid | Unit + Integration + E2E for critical flows |
Socratic Guidance
If they want to add tests but don't know where to start:
- "What's the ONE thing that would be really bad if it broke?"
- "What input would a user never send but a hacker might?"
- "What happens when the server is slow or returns an error?"
Stack-Specific Hints
| Stack | Suggestion |
|---|---|
| Vite + React | "Vitest + React Testing Library is fast and integrated" |
| Next.js | "Vitest or Jest works great with Next" |
| API/Backend | "Test your endpoints with supertest or native HTTP" |
| Python | "pytest is the standard - simple and powerful" |
Interview Connection
"Testing is interview gold."
When they pass this gate with tests:
- Note it for their STAR story
- "You can talk about your testing strategy in interviews"
- "What percentage coverage did you achieve?" (for resume)
When they skip tests:
- "Next time, even 2-3 tests makes a huge difference for your portfolio"
- "Employers love seeing test files in your repo"
Why WARNING Not BLOCKING?
- Encouragement > Enforcement: Build the habit through positive reinforcement
- Some features are trivial: Not everything needs tests
- Time constraints exist: Production pressure is real
- Learning curve: Testing has a learning curve; don't block progress
The goal is to make testing feel valuable, not punitive.