design-deep-modules
Skill25 starsChanged 32 days agoMITView on GitHub
Use when designing or reshaping a module, or when callers coordinate too many steps. Also use it when the user says "this is hard to test", "callers know too much", or "simplify this interface". Puts related state and decisions behind a small interface that states what the caller wants. Tests then use that interface instead of the internal steps. Not for typing values at a boundary (use `typescript-type-safety`).
1 other project uses a version of this.
Adopted by
Most recently taken up by
- hudrazine/velkrosstheir own version, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- hudrazine/velkross★ 1same 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 repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- evals/AGENTS.mdAGENTS.md
- tooling/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- evals/CLAUDE.mdCLAUDE.md
- tooling/CLAUDE.mdCLAUDE.md
- choose-by-consequenceSkill
- design-deep-modulesSkill
- diagnose-before-editingSkill
- plan-with-review-pageSkill
- research-primary-sourcesSkill
- resolve-conflicts-by-intentSkill
- scope-confirmed-changesSkill
- shadowclone-build-preferencesSkill
- shadowclone-reviewSkill
- shadowclone-workSkill
- tests-that-catch-bugsSkill
- typescript-type-safetySkill
- verify-and-reviewSkill
- write-plain-englishSkill
- choose-by-consequenceSkill
- data-handlingSkill
- diagnose-before-editingSkill
- plan-with-review-pageSkill
- research-primary-sourcesSkill
- resolve-conflicts-by-intentSkill
- scope-confirmed-changesSkill
- shadowclone-build-preferencesSkill
- shadowclone-reviewSkill
- shadowclone-workSkill
- tests-that-catch-bugsSkill
- typescript-type-safetySkill
- verify-and-reviewSkill
- write-plain-englishSkill
- choose-by-consequenceSkill
- design-deep-modulesSkill
- diagnose-before-editingSkill
- guided-pr-reviewSkill
- plan-with-review-pageSkill
- research-primary-sourcesSkill
- resolve-conflicts-by-intentSkill
- scope-confirmed-changesSkill
- shadowclone-reviewSkill
- shadowclone-workSkill
- tests-that-catch-bugsSkill
- typescript-type-safetySkill
- verify-and-reviewSkill
- verify-review-findingsSkill
- write-plain-englishSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
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 20
Do the tests use the public interface, and replace dependencies only at outside boundaries?
- Distinctive: line 25
Read the callers. List the state, the order of steps, and the rules that they coordinate.
- Distinctive: line 26
Put that state and those decisions under one owner.
- Distinctive: line 27
If the boundary is not clear, compare two placements by caller effort, error handling, and test effort.
- Distinctive: line 29
Remove each layer that only forwards calls.
- Distinctive: line 30
Write tests against the new interface, then remove the knowledge that callers no longer need.
- Distinctive: line 35
Easy route: Add a helper for each of the four steps, and keep the order in each command.
- Distinctive: line 37
Best route: Add one operation that takes the intended change and does the four steps inside.
- Distinctive: line 42
Use an options object when callers would otherwise pass related values in a fixed order.
- Distinctive: line 44
Do not add an abstraction without a concrete variation or isolation need.
≈ “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
Use when
Callers repeat the same sequence of calls, a layer only forwards arguments, or tests must reach through layers to see behavior. A deep module gives callers a lot of behavior through a small interface.
Gates
- Can each caller state its intent in one call, without knowing the internal order of steps?
- Does one owner hold each piece of related state and each decision about it?
- Does each new layer serve a real variation or isolation need, not only forwarding?
- Do the tests use the public interface, and replace dependencies only at outside boundaries?
- Are the invariants and the error behavior part of the interface contract?
Process
- Read the callers. List the state, the order of steps, and the rules that they coordinate.
- Put that state and those decisions under one owner. Name an operation for what the caller wants.
- If the boundary is not clear, compare two placements by caller effort, error handling, and test effort.
- Move the internal order of steps behind the interface.
- Remove each layer that only forwards calls.
- Write tests against the new interface, then remove the knowledge that callers no longer need.
Example
Situation: Three commands each read a config file, merge it with defaults, check a policy, and take a lock before they write. Easy route: Add a helper for each of the four steps, and keep the order in each command. Hidden cost: Each command still owns the order. A new command can skip the policy check, and each test must repeat the four steps. Best route: Add one operation that takes the intended change and does the four steps inside. The commands call that operation. Evidence: Each command became one call. A test through the new operation failed without the policy check, and the step tests in each command were no longer needed.
Guardrails
- Use an options object when callers would otherwise pass related values in a fixed order.
- Return the outcomes that callers need, and keep side effects inside their owner.
- Do not add an abstraction without a concrete variation or isolation need.
- A short interface still costs effort if callers must call it in a hidden order.
Completion
- The new interface: its exported names and one call example.
- The caller steps that the module now owns.
- The test command for the new interface, with its result line.
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.

