From bee
Applies SRP, DRY, YAGNI, naming, error handling, dependency direction, and Kent Beck's four rules of simple design when writing, reviewing, or refactoring code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bee:clean-codeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
These principles apply to ALL code Bee produces, evaluates, or cleans up — regardless of architecture pattern, language, or framework. They are non-negotiable defaults. The target project's CLAUDE.md may add project-specific conventions on top of these.
These principles apply to ALL code Bee produces, evaluates, or cleans up — regardless of architecture pattern, language, or framework. They are non-negotiable defaults. The target project's CLAUDE.md may add project-specific conventions on top of these.
Don't build what nothing asks for.
Before writing any code, abstraction, or interface, ask: does a test or acceptance criterion require this RIGHT NOW?
Every piece of knowledge should have a single, authoritative representation.
Each unit of code should have one reason to change.
Functions should be short enough to understand at a glance.
Every statement in a function should be at the same level of abstraction.
Don't mix high-level orchestration with low-level details.
Clean up before building, not after.
Names should reveal intent. A reader should understand the code without needing comments.
remainingAttempts not num.calculateDiscount() not discount().is, has, can, should.data, info, temp, result — unless scope is 1-2 lines.Errors are not exceptional — they're expected. Handle them explicitly.
catch (e) {} is almost never correct.OrderNotFoundError not Error('not found').Dependencies always point inward — from less stable to more stable.
Prefer composing behavior from small, focused pieces over deep inheritance hierarchies. One level of inheritance is usually fine. Three levels — refactor.
Code should do what its name says. Nothing more, nothing less.
A function called getUser() should not modify the user or trigger side effects.
A comment is a failure to express intent in code.
In priority order — the first rule wins when they conflict:
When producing code (TDD planners, quick-fix, programmer):
When evaluating code (verifier, reviewer):
When cleaning code (tidy):
When the target project has its own CLAUDE.md:
For detailed code examples illustrating each principle, consult:
references/code-examples.md — Concrete code examples for YAGNI, DRY, SRP, abstraction levels, naming, error handling, and anti-patterns like feature envy, Law of Demeter violations, and null returns.npx claudepluginhub incubyte/ai-plugins --plugin beeApplies Clean Code principles (meaningful names, small functions, no side effects) when writing, reviewing, or refactoring code.
Enforces universal code quality rules — KISS, DRY, clean code, code review. Use when writing or reviewing any code.
Scores and improves code readability using six disciplines: meaningful names, small functions, clean error handling, comments, formatting, and unit tests. For code review, refactoring, PR feedback, or establishing quality standards.