Index of every page on this site: llms.txt
All skills
qiao-925 avatar

/single-responsibility

@50a1ee4
Run it yourself

单一职责能力单元,帮助 Agent 在文件拆分、函数重构、模块设计、代码审查与边界澄清场景中,识别职责混杂、变化原因耦合与命名失真问题,让文件、函数、类与模块都能围绕一个稳定职责组织。关键词:单一职责、职责拆分、边界澄清、重构、文件拆分、函数重构、模块设计。

Use this Skill: https://skilld.dev/gh/qiao-925/qiao-skills/single-responsibility

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesmodule-level.md

≈377 tokens on demand. Your agent reads this file only when SKILL.md points to it.

模块级:围绕稳定意图组织,而不是围绕方便堆放

核心问题

模块级单一职责关注的是:一个目录、一个包、一个模块,到底是不是围绕同一稳定意图组织。

常见组织方式

按业务领域

适用于用户、订单、支付等边界清楚的业务系统。

按技术层次

适用于表现层、业务层、基础设施层分明的系统。

按功能类型

只在功能边界真的稳定时成立。否则很容易演变成新的“大杂烩目录”。

风险信号

  • services/、common/、utils/ 之类目录越来越大,却说不清边界
  • 一个模块里混入多类不相关能力,只因为“都可能复用”
  • 模块职责不清,导致依赖方向混乱甚至循环依赖

收敛原则

  • 模块名称应能表达稳定业务意图或稳定技术职责。
  • 总是一起变化的内容可以内聚;变化原因不同的内容应拆开。
  • 模块导出接口应清楚,不把全部内部实现裸露出去。

与架构治理的边界

  • 当问题是“模块属于哪一层、依赖方向对不对”,优先看 architecture-governance。
  • 当问题是“模块内部职责是不是混在一起”,优先看本 skill。

检查清单

  • 模块名称是否能准确表达职责。
  • 模块内部文件是否围绕同一意图组织。
  • 对外接口是否清楚,而不是把内部结构全部暴露。
  • 没有因为职责混乱引发循环依赖或边界失真。

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning7mo4 checks · Risk SAFE
  • Gen Agent Trust Hub7mo

    This skill provides comprehensive architectural guidelines and best practices for implementing the Single Responsibility Principle (SRP). It is purely educational and instructional, containing no executable code, network operations, or sensitive data access. No security issues were detected.

  • Socket7mo

    No alerts

  • Snyk7mo

    Risk: LOW · No issues

  • Runlayer9mo

    4/4 files flagged

Signed by skilld at 50a1ee4. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago
Other metadata
metadata
{
  "type": "declarative",
  "category": "engineering",
  "scope": "generic",
  "role": "skill-unit"
}

README badge

README badge for qiao-925/qiao-skills/single-responsibility