Agent skill
reviewing-testability
Testable code design patterns for TypeScript/React applications. Triggers: testability, DI, dependency injection, テスト容易性, モック, mock-friendly.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/reviewing-testability
SKILL.md
テスタビリティレビュー
検出
| ID | パターン | 修正 |
|---|---|---|
| TE1 | 直接 import { db } 使用 |
パラメータとして依存関係注入 |
| TE1 | クラス内の new Service() |
コンストラクタインジェクション |
| TE2 | コンポーネント内のfetch() |
hook/serviceに抽出して注入 |
| TE2 | 副作用 + ロジック混在 | 純粋/不純を分離 |
| TE3 | 深いモックチェーン | 依存関係を簡素化 |
| TE4 | グローバル config アクセス |
prop/パラメータとして渡す |
| TE4 | ロジック内の Date.now() |
clock/timeプロバイダを注入 |
| TE5 | 密結合 | 抽象に依存 (DIP) |
基準
テストセットアップ < 10行。深いモックチェーンなし。依存関係が明示的。
参考
| トピック | ファイル |
|---|---|
| DI | references/dependency-injection.md |
| 純粋 | references/pure-functions.md |
| モック | references/mock-friendly.md |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?