code-simplify

遵循Linux极简主义,编写或精简代码。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "code-simplify" with this command: npx skills add cug-hydro/cug-hydro-skills/cug-hydro-cug-hydro-skills-code-simplify

极简主义检查器

Unix 哲学核心:Do one thing well

原则

  1. 单一职责 - 每个模块只做好一件事
  2. 无冗余 - 避免不必要的变量和过度抽象
  3. 浅层嵌套 - 嵌套不超过 3 层
  4. 早返回 - 用守卫语句处理边界情况,避免 else
  5. 行宽控制 - 每行 ≤100 字符
  6. 明确错误 - 显式检查,不隐藏失败

精简代码的同时,需要:

  • 符合代码排版规范、排版美观;

  • 注意代码的易读性,不能为了单纯的追求简洁,让代码变得深奥难懂。

审查清单

检查项说明
单一职责是否专精一事?
无冗余是否有不必要的变量/抽象?
嵌套深度≤3 层?超过需重构
行宽≤100 字符?
排版是否美观统一?
早返回是否使用守卫语句?
错误处理是否明确清晰?

Actions

审查 $ARGUMENTS 文件的代码,按以下标准检查并直接修改:

  1. 读取文件
  2. 逐项检查
    • 是否单一职责?函数/模块是否只做一件事
    • 是否有冗余变量或过度抽象?
    • 嵌套深度是否 ≤3 层?超过则考虑早返回或提取函数
    • 行宽是否 ≤100 字符?
    • 是否使用早返回/守卫语句处理边界情况?
    • 错误处理是否明确清晰?
  3. 直接修改:发现问题立即重构,不询问确认
  4. 输出修改摘要:列出改了什么、为什么改

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

repomix-gh

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-simplify

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-simplify

No summary provided by upstream source.

Repository SourceNeeds Review