一键导入
deep-modules
Use when refactoring into deep modules, choosing seams, classifying dependencies, deciding adapter strategy, or planning tests around a refactor.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when refactoring into deep modules, choosing seams, classifying dependencies, deciding adapter strategy, or planning tests around a refactor.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when refactoring code, identifying refactor candidates, or improving design after tests are green.
Use when discussing levels of abstraction, composed method, SLAP, stepdown rule, or mixed abstraction levels within a function.
Use when designing interfaces, comparing interface alternatives, applying Design It Twice, or exploring interfaces for a module.
Find deep-module opportunities in a codebase. Use when the user wants to improve architecture, refactor, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
Use when discussing modules, interfaces, implementation, depth, seams, adapters, leverage, locality, or code design terminology.
| name | deep-modules |
| description | Use when refactoring into deep modules, choosing seams, classifying dependencies, deciding adapter strategy, or planning tests around a refactor. |
How to deepen a cluster of shallow modules safely, given its dependencies. The aim is testability and AI-navigability.
Load skill: code-design.
Apply the deletion test to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A "yes, concentrates" is the signal you want.
When assessing a deep-module candidate, classify its dependencies. The category determines how the deepened module is tested across its seam.
Pure computation, in-memory state, no I/O. Always deepenable — merge the modules and test through the new interface directly. No adapter needed.
Dependencies that have local test stand-ins (PGLite for Postgres, in-memory filesystem). Deepenable if the stand-in exists. The deepened module is tested with the stand-in running in the test suite. The seam is internal; no port at the module's external interface.
Your own services across a network boundary (microservices, internal APIs). Define a port (interface) at the seam. The deep module owns the logic; the transport is injected as an adapter. Tests use an in-memory adapter. Production uses an HTTP/gRPC/queue adapter.
Recommendation shape: "Define a port at the seam, implement an HTTP adapter for production and an in-memory adapter for testing, so the logic sits in one deep module even though it's deployed across a network."
Third-party services (Stripe, Twilio, etc.) you don't control. The deepened module takes the external dependency as an injected port; tests provide a mock adapter.