askill
reviewing-module-design

reviewing-module-designSafety 95Repository

Use when reviewing code, assessing interfaces, during PR review, or when asked "is this too complex?" or "is this design good?"

13 stars
1.2k downloads
Updated 2/7/2026

Package Files

Loading files...
SKILL.md

Review Module Design

Overview

Core Principle: Evaluate code by detecting complexity symptoms and structural anti-patterns. Good design minimizes dependencies, eliminates obscurity, and maximizes module depth.

Evaluation Focus: What's wrong with this code? Why is it hard to understand or modify?

When to Use

  • Reviewing code (PR review, code review)
  • Assessing interface quality
  • Answering "is this too complex?"
  • Evaluating design decisions
  • User says: "review", "check my design", "is this good?", "PR review"

When NOT to Use

  • Creating new modules (see: designing-deep-modules)
  • Transforming/refactoring code (see: simplifying-complexity)
  • Adding documentation (see: improving-code-clarity)
  • Performance optimization (see: optimizing-critical-paths)

Evaluation Checklist

Use this systematic checklist when reviewing code:

1. Complexity Symptoms (Ch2)

SymptomQuestionIf Yes
Change AmplificationDoes a simple change require modifications in many places?Flag dependency problem
Cognitive LoadMust developer know too much to work here?Flag obscurity or leaky abstraction
Unknown UnknownsIs it unclear what code/info is needed for changes?Highest severity - flag immediately

2. Module Depth (Ch4)

CheckDeep (Good)Shallow (Bad)
Interface vs implementationInterface much simplerInterface rivals implementation
Method countFew, powerful methodsMany, limited methods
Hidden informationHighLow
Common caseSimple to useComplex to use

Red flag: If understanding the interface isn't much simpler than understanding the implementation, the module is shallow.

3. Information Hiding (Ch5)

Red FlagDetectionSeverity
Information LeakageSame knowledge in multiple modulesHigh
Temporal DecompositionStructure mirrors execution order rather than knowledgeMedium
Back-Door LeakageShared knowledge not visible in interfaces but both depend on itHigh
OverexposureCommon use forces learning rare featuresMedium

4. Layer Abstraction (Ch7)

Red FlagDetectionSeverity
Pass-Through MethodMethod only passes arguments to another with same APIHigh
Adjacent Similar AbstractionsFollowing operation through layers, abstractions don't changeHigh
Shallow DecoratorLarge boilerplate, small functionality gainMedium

Test: Follow a single operation through layers. Does the abstraction change with each method call? If not, there's a layer problem.

5. Together/Apart (Ch9)

Red FlagDetectionSeverity
Conjoined MethodsCan't understand one method without another's implementationHigh
Special-General MixtureGeneral mechanism contains use-case specific codeHigh
Code RepetitionSame code appears in multiple placesMedium
Shallow SplitMethod split resulted in interface ≈ implementationMedium

Red Flags Quick Reference

Red FlagSourceOne-Line Detection
Shallow ModuleCh4Interface as complex as implementation
ClassitisCh4Many small classes, little functionality each
Information LeakageCh5Same knowledge in multiple modules
Temporal DecompositionCh5Structure follows execution order
Pass-Through MethodCh7Method just delegates to another with same API
Conjoined MethodsCh9Methods only understandable together
Special-General MixtureCh9General mechanism has use-case code
Code RepetitionCh9Same code appears multiple places
Shallow SplitCh9Method split resulted in interface ≈ implementation

Together/Apart Decision Procedure

When evaluating whether code should be combined or separated:

1. Do pieces share information?
   YES → Should probably be together

2. Would combining simplify the interface?
   YES → Should probably be together

3. Is there repeated code?
   YES → Extract shared method (if long snippet, simple signature)

4. Does module mix general-purpose with special-purpose?
   YES → Should be separated

Key principle: Depth > Length. Never sacrifice depth for length.


Depth vs Length Rule

SituationCorrect Action
Long method with clean abstractionKeep together
Short method requiring another's impl to understandCombine them
Method split creating conjoined pairUndo the split
Long method with extractable subtaskExtract subtask only

Test for valid split: Can the pieces be understood independently AND reused separately?


Evaluation Output Format

When reporting findings, use:

## Design Review: [Component Name]

### Critical Issues (Must Address)
- [Red flag]: [Specific location] - [Why it's a problem]

### Moderate Issues (Should Address)
- [Red flag]: [Specific location] - [Why it's a problem]

### Observations (Consider)
- [Pattern noticed] - [Potential concern]

### Positive Patterns
- [What's working well]

Before Flagging a Problem

Before reporting any red flag, validate:

  1. Steel-man check: What's the best argument this design choice is intentional?
  2. Intentional shallowness: Is this an adapter, facade, or decorator where thinness is the point?
  3. Testing seam: Is this "leakage" actually a legitimate dependency injection point?
  4. Abstraction quality: Can callers use this interface correctly without knowing implementation details?

Cross-Module Analysis

Ask before concluding:

  • Are there related modules that should be reviewed together? Classitis often hides across file boundaries.
  • Would combining these modules simplify the overall interface? If yes, flag as potential shallow split.
  • Must callers use these modules in sequence? If yes, possible temporal decomposition.

When Principles Conflict

ConflictResolution
Depth vs CohesionPrefer cohesion. A focused shallow module beats a bloated deep one.
Information Hiding vs TestabilityTesting seams (injectable dependencies) are acceptable "leakage"
Simple Interface vs ConfigurabilityReal systems need configuration; penalize only unnecessary complexity

Common Evaluation Mistakes

MistakeReality
"It's long, so it's complex"Length ≠ complexity. Depth matters more.
"Small classes are better"Small classes are often shallow. Deep > small.
"More methods = better API"Fewer powerful methods beat many limited ones.
"Separation is always good"Subdivision has complexity costs. Sometimes combine.
"Code reuse requires extraction"Only extract if snippet is long AND signature is simple.
"This is clearly good/bad"Always run the systematic checklist.
"Standard pattern = automatically good"Patterns can be misapplied. Require specific evidence.

Anti-Rationalization Table

RationalizationCounter
"I can see this is fine without the checklist"Stop. The checklist exists because intuition misses structural problems. Run it anyway.
"This is too small to review systematically"Stop. Small modules become core dependencies. Small doesn't mean safe.
"I know this codebase well"Stop. Familiarity breeds blindness. Fresh eyes (the checklist) catch what you've normalized.
"The author is senior/experienced"Stop. Experience doesn't prevent complexity. Apply same rigor regardless of author.
"It passes all the tests"Stop. Tests check behavior, not design. Passing tests ≠ good architecture.
"I don't want to be nitpicky"Stop. Red flags aren't nits. Complexity symptoms are real problems. Flag them.
"They'll push back on this feedback"Stop. Your job is accurate evaluation, not social comfort. Present evidence.
"This matches what we already have"Stop. Consistency with bad patterns spreads problems. Evaluate independently.

References: aposd-foundations for complexity symptoms

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

89/100Analyzed 4/29/2026

High-quality review methodology skill with detailed evaluation checklists, systematic red flag detection, and structured output format. Based on sound software design principles (APOSD) covering complexity symptoms, information hiding, abstraction layers, and together/apart decisions. Includes valuable anti-rationalization table to counter common evaluation biases. Very actionable with clear decision procedures and severity ratings. No dangerous operations; purely analytical. Slightly dense but well-organized for a reference skill. Tags (api, testing) improve discoverability. Universal applicability across codebases.

95
85
88
88
92

Metadata

Licenseunknown
Version-
Updated2/7/2026
Publisherryanthedev

Tags

apitesting