Use Context Reviewer Testability

Testable code design review. Do NOT use for security (use-context-reviewer-security) or readability (use-context-reviewer-readability).

thkt Updated

File contents

use-context-reviewer-testability

Detection

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)

Criteria

Test setup fits in under 10 lines.

References

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

thkt/claude-config/tree/main/skills/use-context-reviewer-testability commit b35cac67f6

Frequently asked questions

npx skillmds@latest add thkt/use-context-reviewer-testability