clean-code
通过 Clean Code 评审提升代码质量
混乱的代码会拖慢评审、重构和功能开发。此技能会引导 Claude、Codex 和 Claude Code 进行实用的 Clean Code 检查。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "clean-code" from https://skillstore.io/skills/sickn33-clean-code.md and its manifest at https://skillstore.io/api/skills/sickn33-clean-code/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“clean-code”。 评审一个包含大型函数和不清晰命名的 pull request。
预期结果:
- 指出隐藏业务意图的模糊命名。
- 标记抽象层级混杂且职责过多的函数。
- 建议更小、更易评审的变更,并配以更清晰的测试。
正在使用“clean-code”。 在添加功能前重构一个遗留服务。
预期结果:
- 识别副作用、过长方法和数据结构泄漏。
- 按清晰度、风险和维护价值对重构步骤排序。
- 推荐能在清理过程中保护行为的测试。
正在使用“clean-code”。 为团队创建一份共享的 Clean Code 检查清单。
预期结果:
- 按命名、函数、注释、错误、测试和类对评审标准分组。
- 保持每个检查项都可执行,并且在评审过程中易于应用。
安全审计
安全All static findings are false positives caused by Markdown inline code, fenced code examples, technical terms, or source attribution. I found no executable shell command, system reconnaissance instruction, unauthorized network behavior, or prompt injection attempt in SKILL.md.
风险因素
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/sickn33-clean-code/audits/5?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/sickn33-clean-code?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/sickn33-clean-code?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/sickn33-clean-code/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/sickn33-clean-code.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
sickn33. (2026). clean-code security audit report (audit version 5) [Author version unspecified]. Skillstore. https://skillstore.io/skills/sickn33-clean-code/audits/5BibTeX 引用
@techreport{sickn33-sickn33-clean-code-2026,
author = {sickn33},
title = {clean-code security audit report (audit version 5)},
institution = {Skillstore},
year = {2026},
number = {5},
url = {https://skillstore.io/skills/sickn33-clean-code/audits/5},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "clean-code security audit report (audit version 5)"
version: "unspecified"
type: report
authors:
- name: "sickn33"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/sickn33-clean-code/audits/5"
identifiers:
- type: other
value: "skillstore:sickn33-clean-code:audit:5"
description: "Skillstore immutable audit report identifier"
比较变体
3 个可安装变体每位作者的技能都保持为独立的可安装项。推荐变体按 Skillstore 证据排序。
为什么此变体排名第一
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
评审 Pull Requests
在变更进入主分支之前应用一致的 Clean Code 反馈。
重构遗留代码
在修改旧模块之前,找出不清晰的命名、过大的函数、隐藏的副作用和设计异味。
制定团队标准
将 Clean Code 原则转化为命名、注释、测试和类设计方面的共享评审标准。
试试这些提示
评审所选代码中是否使用了能揭示意图的命名。为变量、函数、类和方法建议更清晰的名称。
根据大小、单一明确目的、抽象层级、副作用和参数数量评估每个函数。优先给出最有用的修复建议。
使用 Clean Code 原则分析此模块。识别代码异味,对重构步骤排序,并说明预期的维护收益。
为此仓库创建一份 Clean Code 评审检查清单。涵盖命名、函数、注释、错误、测试、对象和类。
最佳实践
- 同时提供相关代码和团队风格指南。
- 评审大型模块时,要求按优先级列出发现的问题。
- 将重构建议与保护现有行为的测试配套使用。
避免
- 不要在没有明确目标的情况下要求大范围重写。
- 不要把每条 Clean Code 指南都当作绝对规则。
- 在重构过程中改变行为时,不要跳过测试。