design-deep-modules
Skill1 starsChanged 5 months agoMITView on GitHub
Apply the Deep Modules lens to software boundary decisions so callers rely on small, stable contracts while cohesive modules hide meaningful knowledge. Use when a task materially affects what callers must know, which decisions a module owns, dependency direction, public contracts, boundary enforcement, or whether a boundary should be preserved, deepened, merged, split, or delayed. Apply alongside planning, implementation, review, refactoring, or migration guidance when boundary quality is relevant, and as the primary Skill for explicit boundary design or assessment. Avoid for deployment topology alone, general review or local changes with no boundary concern, pure simplification with no boundary concern, visual-only work, or documentation that does not define architecture or public contracts.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- theonly1me/shadowclonetheir own version, first seen Oct 11, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- theonly1me/shadowclone★ 25same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-memorySkill
- agent-skill-designSkill
- alignment-interviewSkill
- complexity-reviewSkill
- project-development-docsSkill
- right-size-engineeringSkill
- tddSkill
- to-ticketsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 21 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Do not confuse a deep module with a deployment topology.
- Distinctive: line 35
Use these decisions inside the workflow of the primary task.
- Distinctive: line 37
Do not turn every touched file, type, or dependency into a broader architecture review.
- Distinctive: line 56
Do callers repeat sequencing, branching, validation, mapping, retries, transactions, cache invalidation, or cleanup?
- Distinctive: line 57
Do framework, transport, persistence, UI, or vendor types leak into policy that should outlive them?
- Distinctive: line 90
Use the strongest practical mechanism already supported by the language, build, or repository: visibility controls, explicit exports, …
- Distinctive: line 92
Prefer machine-enforced restrictions when the repository can support them.
- Distinctive: line 98
verify hidden rules and state transitions through the public contract
- Distinctive: line 99
verify adapters at the external boundary they translate
- Distinctive: line 100
verify shared public contracts across independently changing consumers and providers
- Distinctive: line 101
check forbidden dependencies, private imports, cycles, and exported surfaces when they define the boundary
- Distinctive: line 105
Avoid over-mocking internal collaboration.
- Distinctive: line 109
When the primary task migrates a boundary:
- Distinctive: line 114
Keep temporary adapters, abstractions, or toggles explicit, owned, and removable.
- Distinctive: line 115
Remove direct internal access, obsolete entry points, and temporary machinery before making the migrated boundary authoritative.
- Distinctive: line 117
Do not propose a big-bang rewrite when a compatible incremental path can establish the same boundary.
- Distinctive: line 123
Ask a targeted question before selecting or implementing a boundary change only when the answer materially affects:
- Distinctive: line 136
Do not own the overall change scope, implementation sequence, review format, migration program, or testing cycle.
- Distinctive: line 140
Follow the workflow and output format of the primary task.
- Distinctive: line 142
Keep routine boundary analysis implicit.
- Distinctive: line 144
Do not require dedicated headings, classifications, or a separate architecture report unless the user requested boundary design or …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Design Deep Modules
Objective
Improve a cohesive boundary so callers rely on a small, stable contract while the module owns meaningful functionality, policy, coordination, validation, dependency handling, and change-prone decisions.
Apply the lens within the primary task rather than redefining it. Treat review as input to a boundary decision, not as a search for more abstractions. Recommend the smallest durable change supported by evidence.
Depth Standard
Optimize for depth, not size.
Judge the interface by the total knowledge required to use it correctly, including:
- operations, types, events, options, and configuration
- preconditions, side effects, failure semantics, and consistency guarantees
- ordering, lifecycle, ownership, cleanup, and compatibility expectations
- internal concepts or call sequences callers must reconstruct
Judge the implementation by the useful, cohesive knowledge it hides. Count domain rules, workflows, algorithms, state transitions, integration differences, validation, authorization, retries, transactions, caching, observability, and recovery behavior as depth when they belong to the same abstraction.
Require both depth and cohesion. Do not treat a small interface as justification for a god module, or a large file as proof that a boundary should be split.
Do not confuse a deep module with a deployment topology. Apply the lens within a process, package, library, plugin, or service boundary without using it alone to justify distribution or independent deployment.
Generalize only when current callers, repeated use, or a demonstrated change axis supports it. Prefer a focused boundary over a speculative universal interface.
Apply The Boundary Lens
Use these decisions inside the workflow of the primary task. When the requested outcome is a boundary design or assessment, let the lens guide the full analysis. Otherwise, inspect and surface only the boundary concerns that materially affect the requested result.
Do not turn every touched file, type, or dependency into a broader architecture review.
1. Inspect Boundary Evidence
Identify the candidate boundary, its callers, supported workflows, public entry points, and compatibility surfaces. Inspect repository documentation, exports, call sites, dependency direction, tests, and change history when they can answer the design question.
Distinguish observed behavior from assumptions. Do not infer a public contract from naming or file layout alone.
2. Map Interface Burden And Hidden Knowledge
List what each caller must know or coordinate. Include informal contract knowledge, not only public symbols.
List the decisions the module owns or should own. Group decisions that change for the same reason, and separate decisions with independent change axes.
Ask:
- What should callers be able to forget after crossing this boundary?
- Which workflow, rule, or integration detail becomes private?
- Does the interface express caller intent or expose implementation steps?
- Do callers repeat sequencing, branching, validation, mapping, retries, transactions, cache invalidation, or cleanup?
- Do framework, transport, persistence, UI, or vendor types leak into policy that should outlive them?
- Are safety-relevant consequences visible even when their mechanics are hidden?
3. Choose A Boundary Move
Choose one primary move. Combine moves only when the evidence shows distinct boundary problems.
| Move | Choose when | Required result |
preserve | Existing complexity protects a contract, policy, dependency direction, external-effect seam, compatibility promise, diagnostics, or recovery behavior. | Keep the protected knowledge and explain why callers benefit from the boundary. |
deepen | Callers reconstruct workflow or internal decisions, the public surface is unstable, or infrastructure details leak outward. | Move coherent knowledge inward and expose intent-level operations with explicit consequences. |
merge | A layer, wrapper, service, or interface mostly passes through calls and owns no distinct abstraction or contract. | Remove ceremony while preserving any real translation, policy, or compatibility behavior. |
split | Internals have low cohesion, unrelated change axes, conflicting ownership, or independently evolving policies despite a small public surface. | Create cohesive boundaries without making callers orchestrate the separated internals. |
delay | The change axis, caller need, alternative implementation, or stable contract is not yet demonstrated. | Keep the design focused and record the evidence that would justify a future abstraction. |
Reject changes that merely move code, rename layers, add an interface for hypothetical variation, or reduce file count without reducing caller knowledge or protecting a real decision.
4. Define The Boundary Contract
Define:
- callers and caller-intent operations
- formal and informal interface contract
- hidden decisions and internal responsibilities
- boundary data free of avoidable outer-framework or vendor coupling
- dependency direction and ownership of abstractions
- compatibility surfaces and error semantics
- non-goals and intentionally visible consequences
Point dependencies toward stable policy and away from replaceable details. Let the policy owner define an abstraction only when inversion protects a real boundary, test seam, or compatibility promise.
5. Make The Boundary Enforceable
Use the strongest practical mechanism already supported by the language, build, or repository: visibility controls, explicit exports, package rules, dependency constraints, architecture tests, lint rules, or focused review conventions.
Prefer machine-enforced restrictions when the repository can support them. Do not propose a new dependency or governance layer when an existing mechanism can express the contract.
6. Verify The Boundary Effect
Select only the evidence needed to show that the affected boundary contract holds. Leave test construction and the overall verification workflow to the guidance that owns the primary task.
- verify hidden rules and state transitions through the public contract
- verify adapters at the external boundary they translate
- verify shared public contracts across independently changing consumers and providers
- check forbidden dependencies, private imports, cycles, and exported surfaces when they define the boundary
- compare representative callers before and after; confirm they know less and perform less choreography
- confirm that internal changes along the intended change axis can preserve the public contract
Avoid over-mocking internal collaboration. Fake or mock unstable external effects only when needed to verify policy separately from infrastructure.
Boundary-Specific Migration
When the primary task migrates a boundary:
- Define the target public entry point and compatibility expectations.
- Prevent new violations when practical without requiring the existing baseline to be clean first.
- Move callers in small, behavior-preserving slices.
- Keep temporary adapters, abstractions, or toggles explicit, owned, and removable.
- Remove direct internal access, obsolete entry points, and temporary machinery before making the migrated boundary authoritative.
Do not propose a big-bang rewrite when a compatible incremental path can establish the same boundary. Do not leave migration scaffolding as an accidental permanent API.
Uncertainty And Stop Conditions
State assumptions and offer compatible alternatives when missing evidence does not prevent a useful recommendation.
Ask a targeted question before selecting or implementing a boundary change only when the answer materially affects:
- supported callers or compatibility promises
- safety, authorization, consistency, durability, or data-loss semantics
- ownership or dependency direction
- whether complexity is shallow ceremony or protected depth
Report an investigation as a follow-up instead of a finding when evidence does not prove the problem. Preserve existing observable behavior unless the requested outcome explicitly changes the contract.
Keep The Responsibility Bounded
Own decisions about caller knowledge, hidden decisions, cohesion, public surfaces, dependency direction, contract stability, and boundary enforcement.
Do not own the overall change scope, implementation sequence, review format, migration program, or testing cycle. Apply the relevant task or domain guidance separately without requiring another Skill or coupling to one by name.
Composition And Reporting
Follow the workflow and output format of the primary task.
Keep routine boundary analysis implicit. When a boundary decision materially affects the result, make the chosen move, caller impact, supporting evidence, contract or compatibility consequences, and relevant verification or uncertainty visible.
Do not require dedicated headings, classifications, or a separate architecture report unless the user requested boundary design or assessment as the primary outcome. Even then, adapt the response to the user's requested form and omit irrelevant detail.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

