From ship
Reviews code for testability issues: direct dependency imports, inline side effects, tight coupling, and global state access. Suggests DI, pure/impure separation, and abstraction patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ship:use-context-reviewer-testabilityWhen to use
テスト容易性, モック, mock-friendly, DI
reviewer-testabilityThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
| ID | Pattern | Fix |
| ID | Pattern | Fix |
|---|---|---|
| TE1 | Direct import { db } usage | Inject dependency as parameter |
| TE1 | new Service() inside class | Constructor injection |
| TE2 | fetch() inside component | Extract to hook/service, inject |
| TE2 | Mixed side effects + logic | Separate pure/impure |
| TE3 | Deep mock chains | Simplify dependencies |
| TE4 | Global config access | Pass config as prop/parameter |
| TE4 | Date.now() in logic | Inject clock/time provider |
| TE5 | Tight coupling | Depend on abstractions (DIP) |
Test setup < 10 lines. No deep mock chains. Dependencies explicit.
| Topic | File |
|---|---|
| DI | ${CLAUDE_SKILL_DIR}/references/dependency-injection.md |
| Pure | ${CLAUDE_SKILL_DIR}/references/pure-functions.md |
| Mocking | ${CLAUDE_SKILL_DIR}/references/mock-friendly.md |
npx claudepluginhub thkt/dotclaude --plugin shipPrevents testing anti-patterns like verifying mock behavior, adding test-only methods to production code, and mocking without understanding dependencies. Use when writing, changing tests, or adding mocks.
Assess and design for maintainability. Evaluate code complexity, coupling, and testability. Use when evaluating codebase health or designing for long-term evolution.
Designing loosely coupled code through dependency injection, reducing testability barriers and hidden dependencies.