agentleFS
hudrazinehudrazine/velkross/skills/design-deep-modules/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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.

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
  1. Distinctive:

    Do not confuse a deep module with a deployment topology.

    line 29
  2. Distinctive:

    Use these decisions inside the workflow of the primary task.

    line 35
  3. Distinctive:

    Do not turn every touched file, type, or dependency into a broader architecture review.

    line 37
  4. Distinctive:

    Do callers repeat sequencing, branching, validation, mapping, retries, transactions, cache invalidation, or cleanup?

    line 56
  5. Distinctive:

    Do framework, transport, persistence, UI, or vendor types leak into policy that should outlive them?

    line 57
  6. Distinctive:

    Use the strongest practical mechanism already supported by the language, build, or repository: visibility controls, explicit exports, …

    line 90
  7. Distinctive:

    Prefer machine-enforced restrictions when the repository can support them.

    line 92
  8. Distinctive:

    verify hidden rules and state transitions through the public contract

    line 98
  9. Distinctive:

    verify adapters at the external boundary they translate

    line 99
  10. Distinctive:

    verify shared public contracts across independently changing consumers and providers

    line 100
  11. Distinctive:

    check forbidden dependencies, private imports, cycles, and exported surfaces when they define the boundary

    line 101
  12. Distinctive:

    Avoid over-mocking internal collaboration.

    line 105
  13. Distinctive:

    When the primary task migrates a boundary:

    line 109
  14. Distinctive:

    Keep temporary adapters, abstractions, or toggles explicit, owned, and removable.

    line 114
  15. Distinctive:

    Remove direct internal access, obsolete entry points, and temporary machinery before making the migrated boundary authoritative.

    line 115
  16. Distinctive:

    Do not propose a big-bang rewrite when a compatible incremental path can establish the same boundary.

    line 117
  17. Distinctive:

    Ask a targeted question before selecting or implementing a boundary change only when the answer materially affects:

    line 123
  18. Distinctive:

    Do not own the overall change scope, implementation sequence, review format, migration program, or testing cycle.

    line 136
  19. Distinctive:

    Follow the workflow and output format of the primary task.

    line 140
  20. Distinctive:

    Keep routine boundary analysis implicit.

    line 142
  21. Distinctive:

    Do not require dedicated headings, classifications, or a separate architecture report unless the user requested boundary design or …

    line 144

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

MoveChoose whenRequired result
preserveExisting 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.
deepenCallers 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.
mergeA 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.
splitInternals 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.
delayThe 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:

  1. Define the target public entry point and compatibility expectations.
  2. Prevent new violations when practical without requiring the existing baseline to be clean first.
  3. Move callers in small, behavior-preserving slices.
  4. Keep temporary adapters, abstractions, or toggles explicit, owned, and removable.
  5. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.