aposd-designing-deep-modules
Enforce Design-It-Twice workflow: generate 2-3 radically different approaches, compare them, then implement. Use when designing modules, APIs, or classes before implementation. Triggers on: design, create class, add module, implement feature, new service, API design, before implementing. Produces structured design document with approaches, comparison table, choice rationale, and depth check.
Best use case
aposd-designing-deep-modules is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Enforce Design-It-Twice workflow: generate 2-3 radically different approaches, compare them, then implement. Use when designing modules, APIs, or classes before implementation. Triggers on: design, create class, add module, implement feature, new service, API design, before implementing. Produces structured design document with approaches, comparison table, choice rationale, and depth check.
Teams using aposd-designing-deep-modules should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/aposd-designing-deep-modules/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How aposd-designing-deep-modules Compares
| Feature / Agent | aposd-designing-deep-modules | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Enforce Design-It-Twice workflow: generate 2-3 radically different approaches, compare them, then implement. Use when designing modules, APIs, or classes before implementation. Triggers on: design, create class, add module, implement feature, new service, API design, before implementing. Produces structured design document with approaches, comparison table, choice rationale, and depth check.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Skill: aposd-designing-deep-modules ## STOP - Before Implementing **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 ``` **Time bound:** Smaller modules: 1-2 hours. Larger modules: scale proportionally. This is design time, not implementation time. **If none attractive:** Use identified problems to drive a new iteration of step 2. --- ## Depth Evaluation | 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. --- ## Three Questions Framework 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" | --- ## 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 | 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 Flags | 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 | --- ## Anti-Rationalization Table | Tempting Shortcut | Why It Feels Right | Why It's Wrong | |-------------------|-------------------|----------------| | "I'm confident in my first idea" | Experience says it works | Complex problems defeat intuition; alternatives reveal hidden weaknesses | | "I don't have time for multiple designs" | Deadline pressure | Design time << debugging time for wrong abstraction | | "The alternatives would be worse" | Quick mental dismissal | Without sketching, you can't actually compare | | "This is just a simple module" | Scope seems small | Small modules become core dependencies; getting them wrong cascades | | "I'll refactor later if needed" | Deferred pain | Changing interfaces is expensive; callers multiply | | "The user already knows what they want" | Seems respectful | They know the PROBLEM, not necessarily the best SOLUTION | | "This is a standard pattern" | Feels like best practice | "Standard" often means "first thing I saw"; make it explicit | | "I already know which is best" | Saves time | Then the comparison should be EASY, not skippable | --- ## Process Integrity Checks Before finalizing your design choice, verify: - [ ] I wrote out alternatives BEFORE evaluating them (not just "thought through" them) - [ ] My comparison has at least one criterion where my preferred option loses - [ ] If I chose a hybrid, I stated what I'm sacrificing from each parent approach - [ ] Someone could reasonably disagree with my choice based on the same comparison **If user expresses impatience:** Acknowledge it, but complete the process. Say: "I hear the urgency - this comparison takes 2 minutes and helps avoid rework." --- ## Emergency Bypass Criteria Skip the normal workflow ONLY when ALL of these conditions are true: 1. Production is down RIGHT NOW (not "might break soon") 2. Users are actively impacted, security breach in progress, OR data loss occurring 3. The fix is minimal (rollback or single-line change) 4. You commit to returning for proper implementation within 24 hours **Emergency does NOT mean:** - "Demo in 30 minutes" — That's planning failure - "CEO is asking" — Authority pressure ≠ emergency - "Team is blocked" — They can wait for you to think - "We need this fast" — Speed pressure is when discipline matters MOST --- ## 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] ``` --- ## Chain | After | Next | |-------|------| | Design chosen | cc-pseudocode-programming |
Related Skills
aposd-verifying-correctness
Verify code correctness before claiming done or committing. Run 6-dimension checklist: requirements coverage, concurrency safety, error handling, resource management, boundary conditions, and security. Output PASS/FAIL per dimension with final DONE/NOT DONE verdict. Use after implementation as pre-commit gate. Triggers on: is it done, ready to commit, verify correctness, did I miss anything, pre-commit check.
aposd-simplifying-complexity
Simplify complex code through the Error Reduction Hierarchy: Define out > Mask > Aggregate > Crash. Use when code is too complex, has scattered error handling, configuration explosion, or callers doing module work. Produce technique analysis table with gate checks before simplified code. Triggers on: too complex, simplify, scattered errors, configuration proliferation, verbose error handling. Complements cc-defensive-programming with design-level error elimination.
aposd-reviewing-module-design
Evaluate module design using APOSD principles with 40-item checklist. Detect complexity symptoms (change amplification, cognitive load, unknown unknowns), shallow modules, information leakage, pass-through methods, and structural anti-patterns. Produce categorized design review (Critical/Moderate/Observations/Positive). Use when reviewing code, assessing interfaces, during PR review, or evaluating 'is this too complex?' Triggers on: code review, design review, module complexity, interface assessment, PR review, structural analysis.
aposd-optimizing-critical-paths
Optimize performance through mandatory measure-first workflow with 3 stages: MEASURE (gate) -> FUNDAMENTAL FIX -> CRITICAL PATH REDESIGN. Use when code is too slow, laggy, hangs, doesn't scale, has timeouts, OOM errors, or high CPU/memory. Emphasize that simpler code usually runs faster. Triggers on: performance issues, optimization needed, takes forever, profiling. Produces profiling-backed optimization with verified improvement.
aposd-maintaining-design-quality
Enforce strategic programming discipline when modifying existing code. Guide through STOP-ASK-DECIDE-VERIFY workflow with urgency tier assessment (trivial/minor/standard/emergency). Include when NOT to refactor (Chesterton's Fence, performance-critical, no tests) and block tactical shortcuts via anti-rationalization tables. Use when fixing bugs, extending features, or tempted to make quick fixes. Triggers on: modify code, fix bug, extend feature, quick fix, tactical change.
aposd-improving-code-clarity
Enforce comments-first workflow for new code and improve naming/documentation for existing code. Use when writing new classes, methods, or functions; when code is 'confusing' or 'hard to understand'; when naming precision is poor; or when variable documentation lacks units, bounds, or ownership. Triggers on: new code, comments-first, naming review, documentation review, not obvious, hard to understand. Produces well-documented code with precise naming, or identifies design problems when comments/names are hard to write.
analyzing-deeply
Performs deep structured analysis on complex or ambiguous problems. Activates when problems are unclear, have multiple perspectives, or require careful thinking before proceeding. Uses ultrathink methodology for systematic exploration of problem space.
academic-deep-research
Transparent, rigorous research with full methodology — not a black-box API wrapper. Conducts exhaustive investigation through mandated 2-cycle research per theme, APA 7th citations, evidence hierarchy, and 3 user checkpoints. Self-contained using native OpenClaw tools (web_search, web_fetch, sessions_spawn). Use for literature reviews, competitive intelligence, or any research requiring academic rigor and reproducibility.
22-understand-deep-150
[22] UNDERSTAND. Deep research from all sources — internal (code, git, logs) AND external (web, docs, best practices). Use when choosing libraries, investigating solutions, understanding legal/technical questions, comparing approaches, or anytime you need comprehensive knowledge from both project context and world knowledge. Triggers on "research", "investigate", "find best approach", "what do others do", "compare options", or complex questions requiring multiple sources.
1k-patching-native-modules
Patches native modules (expo-image, react-native, etc.) to fix native crashes or bugs.
squall-deep-research
Deep research via Codex web search and optionally Gemini deep research. Use when asked to 'deep research', 'squall deep research', 'research deeply', or when a question needs web-sourced evidence. Single-agent, not a swarm. (project)
research-deep
Read research outline, launch independent agent for each item for deep research. Disable task output.