/bee:clean-codefrom bee
Applies clean code principles (SRP, DRY, YAGNI, naming, error handling, dependency direction, Kent Beck's four rules) when writing, reviewing, or refactoring code.
Ships in bee. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub incubyte/ai-plugins --plugin bee21 skills in this plugin
/ai-ergonomicsThis skill should be used when evaluating how well code supports LLM-assisted development. Contains context window friendliness, explicitness, module boundaries, test-as-spec, and naming criteria./ai-workflowThis skill should be used when explaining why Bee follows spec-first TDD workflows, or when teaching mode is on. Contains the reasoning behind spec → plan → test → code ordering./architecture-patternsThis skill should be used when evaluating architecture options, checking dependency direction, or deciding between onion, MVC, and simple patterns. Contains YAGNI-based decision criteria.Other plugins' skills for the same job