Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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).
.claude/skills/ryanthedev-aposd-designing-deep-modules/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | -1% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 13% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -53% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 15% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -32% | 0% |
Never implement your first design. Generate 2-3 radically different approaches, compare them, then implement.
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 codeIf none attractive: Use identified problems to drive a new iteration of step 2.
| Metric | Deep (Good) | Shallow (Bad) | |--------|-------------|---------------| | Interface size | Few methods | Many methods | | Method reusability | Multiple use cases | Single use case | | Hidden information | High | Low | | Caller cognitive load | Low | High | | Common case | Simple | Complex |
Exemplar: Unix file I/O - 5 methods hide hundreds of thousands of lines of implementation.
Ask these when designing interfaces:
| Question | Purpose | Red 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" |
When embedding functionality in a module:
Target: Somewhat general-purpose
| Aspect | Should Be | |--------|-----------| | Functionality | Reflects current needs | | Interface | Supports multiple uses | | Specialization | Pushed 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 Flag | Symptom | Fix | |----------|---------|-----| | Shallow Module | Interface complexity rivals implementation | Combine with related functionality | | Classitis | Many small classes with little functionality each | Consolidate related classes | | Single-Use Method | Method designed for exactly one caller | Generalize to handle multiple cases | | Information Leakage | Same knowledge in multiple modules | Consolidate in single module | | Temporal Decomposition | Structure mirrors execution order | Structure by knowledge encapsulation | | False Abstraction | Interface hides info caller actually needs | Expose necessary information | | Granularity Mismatch | Caller must do work that belongs in module | Move logic into module | | Silent Failure | Module 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 |
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]| After | Next | |-------|------| | Design chosen | Skill(code-foundations:cc-pseudocode-programming) |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | fail→pass | 19,922 | 16,432 | -18% | 1 | 1 | 0% | 3,529 | 3,485 | -1% | 0 | 0 | — |
case-06 | fail→pass | 16,090 | 10,466 | -35% | 1 | 1 | 0% | 2,380 | 2,685 | +13% | 0 | 0 | — |
case-01 | fail→pass | 34,149 | 11,481 | -66% | 1 | 1 | 0% | 6,215 | 2,948 | -53% | 0 | 0 | — |
case-02 | fail→pass | 21,759 | 24,444 | +12% | 1 | 1 | 0% | 2,813 | 3,226 | +15% | 0 | 0 | — |
case-03 | fail→fail | 24,992 | 14,078 | -44% | 1 | 1 | 0% | 4,069 | 3,186 | -22% | 0 | 0 | — |
case-04 | fail→pass | 24,326 | 11,362 | -53% | 1 | 1 | 0% | 4,123 | 2,823 | -32% | 0 | 0 | — |
case-07 | pass→pass | 15,191 | 12,907 | -15% | 1 | 1 | 0% | 2,367 | 2,940 | +24% | 0 | 0 | — |
case-08 | pass→pass | 15,959 | 11,034 | -31% | 1 | 1 | 0% | 2,103 | 2,734 | +30% | 0 | 0 | — |
case-09 | fail→pass | 12,691 | 7,201 | -43% | 1 | 1 | 0% | 1,975 | 2,223 | +13% | 0 | 0 | — |
case-10 | pass→pass | 14,346 | 8,546 | -40% | 1 | 1 | 0% | 2,194 | 2,195 | +0% | 0 | 0 | — |
case-11 | fail→pass | 10,204 | 5,842 | -43% | 1 | 1 | 0% | 1,580 | 1,917 | +21% | 0 | 0 | — |
case-12 | fail→pass | 14,367 | 9,902 | -31% | 1 | 1 | 0% | 2,092 | 2,481 | +19% | 0 | 0 | — |
case-13 | pass→pass | 16,163 | 12,073 | -25% | 1 | 1 | 0% | 2,405 | 2,636 | +10% | 0 | 0 | — |
case-14 | pass→pass | 15,158 | 10,723 | -29% | 1 | 1 | 0% | 2,387 | 2,659 | +11% | 0 | 0 | — |
case-15 | pass→pass | 17,774 | 18,220 | +3% | 1 | 1 | 0% | 2,898 | 4,419 | +52% | 0 | 0 | — |
case-16 | fail→pass | 8,755 | 5,203 | -41% | 1 | 1 | 0% | 1,178 | 1,915 | +63% | 0 | 0 | — |
case-17 | fail→pass | 7,403 | 10,639 | +44% | 1 | 1 | 0% | 1,202 | 1,898 | +58% | 0 | 0 | — |
case-18 | fail→pass | 13,439 | 12,965 | -4% | 1 | 1 | 0% | 2,166 | 3,010 | +39% | 0 | 0 | — |
case-19 | fail→pass | 21,267 | 14,404 | -32% | 1 | 1 | 0% | 3,620 | 3,238 | -11% | 0 | 0 | — |
case-20 | pass→fail | 11,131 | 16,034 | +44% | 1 | 1 | 0% | 2,023 | 4,102 | +103% | 0 | 0 | — |
case-21 | pass→fail | 5,213 | 11,466 | +120% | 1 | 1 | 0% | 1,051 | 3,149 | +200% | 0 | 0 | — |
case-22 | pass→fail | 7,337 | 12,424 | +69% | 1 | 1 | 0% | 1,341 | 3,091 | +130% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +41 percentage points is the difference between those two pass rates over the 22 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.