Install any skill in seconds. Free to start, no credit card required.
Get Started Free →doccker/cc-code-quality-principles
当编写新模块、设计接口、重构代码或代码审查时触发。提供经典模块化六原则检查清单(大小适中/调用深度/扇入扇出/边界清晰/作用域内聚/可预测性),适用于 PR/Review/新模块设计场景。
Passed 21 of 22 test cases with the skill, and 13 of 22 without it.
and 8 more in the full report
8 fixed13 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 8 test cases the skill fixed. Same model, same prompt, with and without the skill.
What is the recommended default maximum line count threshold for a Python module file when auditing for single responsibility adherence?
| Checked | Without skill | With skill |
|---|---|---|
| Specifies 300 lines as the default maximum threshold for Python files | Missed | Passed |
The instructions your model reads when the skill loads.
经典软件工程设计原则在 AI 协作场景下的现代化清单。 用作新模块设计、重构、代码审查时的对照表,不替代具体执行 skill。
/review、/new-feature、/optimize、/design 命令在设计阶段| # | 原则 | 一句话 | 衡量指标 | 详细案例 |
|---|---|---|---|---|
| 1 | 模块大小适中 | 单文件控制在职责边界内 | 行数/职责数 | 引用 cc-size-check |
| 2 | 减少调用深度 | 调用链尽量 ≤ 3 层 | 栈深度 | modularity.md#调用深度 |
| 3 | 多扇入,少扇出 | 被复用 > 主动依赖 | 依赖数/被依赖数 | modularity.md#扇入扇出 |
| 4 | 接口边界清晰 | 入参/出参/异常统一 | 统一响应包装 | modularity.md#边界清晰 |
| 5 | 作用域内聚 | 改 A 不波及 B | 跨模块副作用 | 引用 cc-refactor-safety |
| 6 | 功能可预测 | 同输入→同输出 | 幂等/无副作用/可测 | predictability.md |
主要执行交给
cc-size-checkskill;本 skill 仅作总纲提示。
核心:单文件超限是设计信号,不是格式问题。提示职责过载,应拆分。
默认阈值:Java ≤ 300 / Go ≤ 400 / Vue ≤ 200 / TS ≤ 300 / Python ≤ 300(项目可覆盖)。
❌ 反例:Controller → ServiceA → ServiceB → ServiceC → DAO → Mapper(6 层)。定位 bug 需要逐层进栈,新人难以理解。
test cases passed, vs 13 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.