Help us improve
Share bugs, ideas, or general feedback.
From tdder
Applies clean code principles including naming, loose coupling, high cohesion, and small components. Guides refactoring with prioritized findings and user approval.
npx claudepluginhub t1/tdder --plugin tdderHow this skill is triggered — by the user, by Claude, or both
Slash command
/tdder:clean-codeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Disciplined development approach for writing high-quality, maintainable code.
Refactors code using clean code principles, SOLID design patterns, and modern best practices to improve quality, maintainability, and performance. Use for tangled code, duplication, complexity, or code smells.
Refactors code using clean code principles, SOLID patterns, and modern best practices to improve quality, maintainability, and performance. Use for tangled code, duplication, or code smells.
Enforces clean code principles during code generation and refactoring: function focus, naming clarity, complexity limits, error handling, and self-documenting style. Supports project-specific overrides via config.
Share bugs, ideas, or general feedback.
Disciplined development approach for writing high-quality, maintainable code. This skill is language-agnostic; language-specific conventions come from separate skills.
Components know little about each other. Dependencies flow through well-defined APIs. Changes in one component minimally affect others. Prefer composition over inheritance. Depend on abstractions, not concretions.
Elements that belong together stay together. Each module has a single, well-defined purpose. Related functionality is grouped. Unrelated functionality is separated.
Modifications are contained within boundaries. A feature change affects minimal files/modules. Stable interfaces protect implementations.
Delete dead code immediately. Remove unused abstractions. Eliminate unnecessary features. Code should be easy to delete, not just easy to add.
Functions: one screen or less. Classes: under 100 lines as a guideline. If it cannot be held in working memory, it is too big.
When multiple code smells or improvements are found, present them as a prioritized markdown list,
then use AskUserQuestion to let the user decide how to proceed:
This avoids surprise refactorings and lets the user control scope. This process applies regardless
of whether findings come from direct review or from the clean-code-reviewer agent.
When re-evaluating subagent findings, give due weight to the principle the subagent applied. "It's short enough" or "extraction adds indirection" are not rebuttals — they're rationalizations unless you name the specific principle that outweighs the one being violated. The bias should be toward applying the principle, not toward leaving code as-is.
When reviewing or refactoring code, follow this priority order:
I prefix for interfaces)repositoryWithLocalTempDir() (describes the
distinguishing characteristic) instead of repositoryWithDefaults() (vague, describes absence of configuration)When duplication with slight variations is found, extract the variation into parameters and unify the common structure.
Wrap unstable or external dependencies. Create abstractions around things that might change. Only do this if it also simplifies the code.
Never break tests during refactoring. Make tiny changes, run tests. If tests fail, undo and take smaller steps.
Before suggesting extraction of an inner class to a top-level class, verify:
private.private inner class top-level increases its visibility to package-private.private) over extracting, unless the class is already
used by other classes or extraction enables meaningful independent testing.File length alone is not sufficient justification for extraction when it widens visibility.
Extract complex conditions into well-named methods.
Example: if (timer.hasExpired() && !timer.isRecurrent()) becomes if (shouldBeDeleted(timer))
For a complete refactoring checklist, consult:
references/checklist.md - Read this checklist to verify all clean code principles have been applied during
refactoring