8.7k superdesigndev

code-quality Skill

编写或审查代码、注释、测试或文档时使用。

安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。

查看源码

技能指令原文(SKILL.md)

Code quality

  1. Enforce, don't instruct. If a machine can check a rule, add the check.

Apply these rules to code you change; fix old code in its own PR.

  1. Comments: none by default. Keep one only for behavior we cannot change

(vendor, platform, protocol) or a public contract. A reason worth keeping
moves to a test, the docs, or the commit message.

  1. Tests must be able to fail. Test behavior through the real entry point;

if a test still passes with every dependency returning None, it is fake.
Break the behavior, show the failing run, then land it. Never turn CI
green by skipping, retrying, sleeping, or loosening an assertion.

  1. Docs say only what code cannot. Keep a sentence only if, without it,

the next person would change the code wrongly. Each fact once, where it
belongs; when docs and code disagree, fix the doc.

配合站内内容