# Code Quality

Use when writing or reviewing code, comments, tests, or docs.

- Repository: https://github.com/superdesigndev/treg (6950 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add superdesigndev/treg --skill code-quality -g -a claude-code -y`
Codex: `npx skills add superdesigndev/treg --skill code-quality -g -a codex -y`
Cursor: `npx skills add superdesigndev/treg --skill code-quality -g -a cursor -y`
Gemini CLI: `npx skills add superdesigndev/treg --skill code-quality -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add superdesigndev/treg`

## Description

Use when writing or reviewing code, comments, tests, or docs.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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.

2. **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.

3. **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.

4. **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.

