testing-assistant について
Claude Patent Creator のテストと検証を支援するスキルです。自動テスト、Claude Code での手動確認、テスト作成、性能評価を扱います。
主な機能
- 01インストールと各機能のテスト実行
- 02Claude Code での MCP ツール検証
- 03ユニットテストと回帰テストの作成
- 04検索・分析速度のベンチマーク
活用シーン
- 01コード変更後のプロジェクト確認
- 02テスト失敗や性能問題の調査
- 03特許検索・分析ツールの検証
MCP 対応
Claude Code を介して MCP ツールを手動テストする手順と、ツールの利用可否を確認する項目を示します。
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ robthepcguy/ claude-patent-creator --skill testing-assistantインストール後、Claude Code で/testing-assistantを入力して読み込まれたか確認します。
詳細
テストアシスタントスキル
Claude Patent Creator のテストと検証を行うエキスパートシステムです。
CLAUDE 向け: テストスクリプトは scripts/ ディレクトリにあります。
- 適切なテストを直接実行してください
- プロジェクトのルートディレクトリから実行してください
- テストにはアクティブな venv が必要です
- テストが失敗した場合にのみ、診断を実行してください
使用する場面
テストスイートの実行、新機能の検証、変更後のテスト、失敗のデバッグ、テストの作成、CI/CD の設定、パフォーマンステスト、E2E 検証、リグレッションテスト。
テストピラミッド
/\
/ \ E2E (Manual + Automated)
/----\
/ API \ Integration Tests
/--------\
/ Unit \ Unit Tests
/----------\
方針: ユニットテスト(高速で分離されている)を多くし、統合テスト(中程度)を少なく、E2E テスト(低速)を最小限にします。
テストスイートの概要
scripts/
+-- test_install.py # Complete installation validation
+-- test_gpu.py # GPU detection and CUDA
+-- test_bigquery.py # BigQuery connection
+-- test_analyzers.py # Claims, spec, formalities
+-- test_embedding_speed.py # Performance benchmarks
+-- test_checkpoint.py # Index checkpoint system
クイックテスト:
python scripts/test_install.py
Claude による手動テスト
Claude Code のインターフェースを通じて MCP ツールをテストします。
クイックテストの例
1. MPEP Search: "Search MPEP for claim definiteness requirements"
2. Patent Search: "Search for patents about neural networks filed in 2024"
3. Claims Review: "Review these claims: [paste test claims]"
4. Full Review: "/full-review" (with test application)
5. Diagrams: "Create a flowchart for this process: [describe]"
検証チェックリスト
[OK] MPEP search returns relevant results
[OK] BigQuery search finds patents
[OK] Claims analyzer identifies issues
[OK] Specification analyzer checks support
[OK] Formalities checker validates format
[OK] Diagrams generate successfully
[OK] Full review workflow completes
[OK] All MCP tools accessible
[OK] Error messages clear and helpful
[OK] Performance acceptable (<2s most ops)
新しいテストの作成
クイックスタート
# Unit test template
def test_basic_functionality():
from mcp_server.your_module import YourClass
instance = YourClass()
result = instance.method("test input")
assert result is not None
print("[OK] test_basic_functionality passed")
テストカテゴリ:
- 基本機能
- エッジケース
- パフォーマンス
- エラー処理
パフォーマンステスト
クイックベンチマーク
from mcp_server.mpep_search import MPEPIndex
import time
index = MPEPIndex()
index.build_index()
index.search("test", top_k=5) # Warm up
start = time.time()
result = index.search("claim definiteness", top_k=5)
duration = time.time() - start
print(f"Search took: {duration:.3f}s")
パフォーマンスのしきい値
| 操作 | しきい値 | 備考 |
|---|---|---|
| MPEP 検索(初回) | <3s | モデルの読み込み |
| MPEP 検索(2 回目以降) | <500ms | モデルをキャッシュ |
| BigQuery 検索 | <2s | ネットワークに依存 |
| クレーム分析 | <3s | 20 件のクレーム |
| 明細書分析 | <10s | 10 ページ |
| 図の生成 | <1s | SVG 出力 |
テスト失敗時のトラブルシューティング
| 問題 | 解決策 |
|---|---|
| インポートエラー | venv を有効にして、pip install -r requirements.txt を実行します |
| GPU テストの失敗 | nvidia-smi を確認し、PyTorch を再インストールするか、テストをスキップします |
| BigQuery の失敗 | 再認証します:gcloud auth application-default login |
| インデックスが見つからない | 再構築します:patent-creator rebuild-index |
| 処理が遅すぎる | GPU の使用状況を確認します。初回実行は時間がかかります。システム負荷を確認してください |
ベストプラクティス
- 変更のたびにテストする
- テストを自動化する
- テストピラミッド(ユニットテストを多くし、E2E テストを少なくする)
- テストを高速にする(スイート全体で 5 分未満)
- テストを分離する(依存関係なし)
- 明確なアサーションを設定する
- テストを文書化する
- テストをバージョン管理する
- 定期的に実行する(毎週)
- パフォーマンスを監視する
クイックリファレンス
すべてのテストを実行
python scripts/test_install.py
python scripts/test_gpu.py
python scripts/test_bigquery.py
python scripts/test_analyzers.py
python scripts/test_embedding_speed.py
リグレッションテスト
python scripts/test_install.py || exit 1
python scripts/test_bigquery.py || exit 1
python scripts/test_analyzers.py || exit 1
echo "[OK] All regression tests passed!"
手動チェックリスト
□ Ask Claude to search MPEP
□ Ask Claude to search patents
□ Ask Claude to review claims
□ Run /full-review command
□ Generate a diagram
□ Verify all tools work
□ Check performance (<2s)
コメント
Markdown 対応