ryanthedev/code-foundations/aposd-designing-deep-modules

Claude Code and agent skill by ryanthedev/code-foundations

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Guides module and API design using APOSD principles: generates multiple design alternatives, compares them on information hiding and interface depth, and produces a documented design decision. For creating new module/API design; not for assessing existing designs (use aposd-reviewing-module-design) or routine-level design (use cc-routine-and-class-design).

Install

npx vskill@latest install ryanthedev/code-foundations/aposd-designing-deep-modules

SKILL.md

Skill: aposd-designing-deep-modules

Before Implementing — the design-it-twice gate

Never implement your first design. Generate 2-3 radically different approaches, compare them, then implement.


Design-It-Twice Workflow

BEFORE implementing any module:
1. DEFINE - What are you designing? (class, API, service)
2. GENERATE - 2-3 RADICALLY different approaches
3. SKETCH - Rough outline each (important methods only, no implementation)
4. COMPARE - List pros/cons, especially ease of use for callers
5. EVALUATE - Is there a clear winner or hybrid?
6. VERIFY - Does chosen design pass depth evaluation?
7. IMPLEMENT - Only then write the code

If none attractive: Use identified problems to drive a new iteration of step 2.


Depth Evaluation

MetricDeep (Good)Shallow (Bad)
Interface sizeFew methodsMany methods
Method reusabilityMultiple use casesSingle use case
Hidden informationHighLow
Caller cognitive loadLowHigh
Common caseSimpleComplex

Exemplar: Unix file I/O - 5 methods hide hundreds of thousands of lines of implementation.


Three Questions Framework

Ask these when designing interfaces:

QuestionPurposeRed Flag Answer
"What is the simplest interface that covers all current needs?"Minimize method count"I need many methods"
"In how many situations will this method be used?"Detect over-specialization"Just this one situation"
"Is this easy to use for my current needs?"Guard against over-generalization"I need lots of wrapper code"

Information Hiding Checklist

When embedding functionality in a module:

  • [ ] Data structures and algorithms stay internal
  • [ ] Lower-level details (page sizes, buffer sizes) hidden
  • [ ] Higher-level assumptions (most files are small) hidden
  • [ ] No knowledge shared across module boundaries unnecessarily
  • [ ] Common case requires no knowledge of internal details

Generality Sweet Spot

Target: Somewhat general-purpose

AspectShould Be
FunctionalityReflects current needs
InterfaceSupports multiple uses
SpecializationPushed up to callers OR down into variants

Push specialization UP: Top-level code handles specific features; lower layers stay general.

Push specialization DOWN: Define general interface, implement with device-specific variants.


Red Flags

Red FlagSymptomFix
Shallow ModuleInterface complexity rivals implementationCombine with related functionality
ClassitisMany small classes with little functionality eachConsolidate related classes
Single-Use MethodMethod designed for exactly one callerGeneralize to handle multiple cases
Information LeakageSame knowledge in multiple modulesConsolidate in single module
Temporal DecompositionStructure mirrors execution orderStructure by knowledge encapsulation
False AbstractionInterface hides info caller actually needsExpose necessary information
Granularity MismatchCaller must do work that belongs in moduleMove logic into module
Silent FailureModule handles errors internally but gives callers no way to know something went wrong (no error return, no observable state change, no logging)Errors are implementation details that can be hidden; failures are not — surface failure states even when hiding the mechanism

Mandatory Output Format

When designing, produce:

## Design: [Component Name]
### Approaches Considered
1. [Approach A] - [1-2 sentence description]
2. [Approach B] - [1-2 sentence description]
3. [Approach C] - [1-2 sentence description] (if applicable)
### Comparison
| Criterion | A | B | C |
|-----------|---|---|---|
| Interface simplicity | | | |
| Information hiding | | | |
| Caller ease of use | | | |
| [Domain-specific criterion] | | | |
### Choice: [A/B/C/Hybrid]
Rationale: [Why this wins, what's sacrificed]
### Depth Check
- Interface methods: [count]
- Hidden details: [list]
- Common case complexity: [simple/moderate/complex]

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
117
Repository forks
8
7-day trend score
24

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ryanthedev/code-foundations/aposd-designing-deep-modules/badge)](https://verified-skill.com/skills/ryanthedev/code-foundations/aposd-designing-deep-modules)

Something wrong with this skill or its page? Tell us.