clean-code

仓库创建 2026年1月29日最近提交 5 天前SkillHot 收录 21 天前
▸ 精选理由

实用的编码规范与重构建议,提升团队代码质量。

这个 Skill 做什么

以简洁命名、小函数和良好错误处理提升代码可读性与可维护性。

把代码写成别人一看就懂、好改又可靠的样子:讲究命名、短小函数、单一职责和稳健的错误处理。适合在代码审查、重构或面对臃肿函数与臭味时使用。还会强调测试、注释与格式规范,目标是让代码对读者友好,降低后续维护成本。

▸ 展开 SKILL.md 英文原文

Write readable, maintainable code through disciplined naming, small functions, and clean error handling. Use when the user mentions "clean up this code", "this function is too long", "code smells", "naming conventions", "boy scout rule", "single responsibility", or "unit test quality". Also trigger when reviewing a pull request for readability, untangling a messy function, debating comment styles, or improving error-handling patterns. Covers SRP, comment discipline, formatting, and unit testing. For refactoring techniques, see refactoring-patterns. For architecture and dependency rules, see clean-architecture.

开发编程可维护性命名重构通用
1.8k
Stars
179
Forks
40
仓库内 Skill
+188
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/wondelai/skills/main/clean-code/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/wondelai/skills/main/clean-code/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Clean Code Framework

A disciplined approach to writing code that communicates intent, minimizes surprises, and welcomes change. Apply these principles when writing new code, reviewing pull requests, refactoring legacy systems, or advising on code quality.

## Core Principle

**Code is read far more often than it is written — optimize for the reader.** The read-to-write ratio is well over 10:1, so every naming choice, function boundary, and formatting decision either adds clarity or adds cost. Clean code reads like well-written prose: names reveal intent, functions tell a story one step at a time, and the Boy Scout Rule applies — always leave the code cleaner than you found it.

## Scoring
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有