Skip to main content

design-deep-modules

Design or improve a module so callers get substantial behavior through a small stable interface. Use when choosing seams, reducing orchestration in callers, or making a subsystem easier to test and change.

来源信息

仓库
theonly1me/shadowclone
最近来源活动
2026年9月27日 19:18
检测到的 SKILL.md 语言
英语
星标
9
Forks
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
design-deep-modules
description
Design or improve a module so callers get substantial behavior through a small stable interface. Use when choosing seams, reducing orchestration in callers, or making a subsystem easier to test and change.
metadata
{"shadowclone-category":"architecture","shadowclone-section":"engineering","shadowclone-applies-when":"designing or reshaping a module or subsystem"}
# Design Deep Modules ## Use when Callers coordinate too many steps, an abstraction only forwards arguments, or tests must reach through layers to observe behavior. A deep module provides substantial behavior through a small interface. ## Process 1. Read the callers and identify the state, ordering, and policy they currently coordinate. 2. Put related state and decisions under one owner. Define an operation that expresses the caller's intent. 3. When the boundary is unclear, compare two placements by caller burden, error handling, and testability. 4. Move internal sequencing behind the interface. Remove forwarding layers that provide no useful variation or isolation. 5. Test through the public interface, replacing dependencies only at real external boundaries. 6. Revisit callers and remove knowledge now owned by the module. ## Guardrails Keep invariants and error behavior in the interface contract. Use an options object when callers would otherwise correlate primitive arguments. Return outcomes callers need, and contain side effects within their owner. Add an abstraction for a concrete variation or isolation need. A short interface still imposes complexity if callers must know a hidden sequence of calls. ## Completion Callers express intent without coordinating internal steps, and tests exercise behavior without depending on that sequence.
在 GitHub 查看