·interface-segregation-principle
</>

interface-segregation-principle

yanko-belov/code-craft

设计界面时使用。在使用不需要的方法实现接口时使用。当被迫为接口方法实现 throw/no-op 时使用。

15安装·0热度·@yanko-belov

安装

$npx skills add https://github.com/yanko-belov/code-craft --skill interface-segregation-principle

SKILL.md

Clients should not be forced to depend on interfaces they don't use.

Many small, focused interfaces are better than one large "fat" interface. If an implementer must throw exceptions or provide no-ops for interface methods, the interface is too large.

Providing both the violation and the correct approach is still providing a violation.

设计界面时使用。在使用不需要的方法实现接口时使用。当被迫为接口方法实现 throw/no-op 时使用。 来源:yanko-belov/code-craft。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/yanko-belov/code-craft --skill interface-segregation-principle
分类
</>开发工具
认证
收录时间
2026-02-12
更新时间
2026-02-18

快速解答

什么是 interface-segregation-principle?

设计界面时使用。在使用不需要的方法实现接口时使用。当被迫为接口方法实现 throw/no-op 时使用。 来源:yanko-belov/code-craft。

如何安装 interface-segregation-principle?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/yanko-belov/code-craft --skill interface-segregation-principle 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/yanko-belov/code-craft