open-code-ai-java/.opencode/skill/clean-code at main · shcherbi/open-code-ai-java

Load: Ask OpenCode to use the clean-code skill


Description

Clean Code principles with Java examples: DRY, KISS, YAGNI, naming conventions, function design, code smells, and refactoring techniques.


Use Cases

  • "Clean this code"
  • "Refactor this method"
  • "Improve readability"
  • "This function is too long"
  • "What should I name this variable?"
  • "Is this code too complex?"

Examples

> "Use the clean-code skill"
> "This method is 100 lines, help me refactor"
→ Identifies code smells, suggests Extract Method, Guard Clauses

Principles Covered

Principle Key Question
DRY Is this logic duplicated elsewhere?
KISS Is there a simpler way?
YAGNI Do we need this now or "just in case"?

Topics

  • Naming conventions (variables, methods, classes)
  • Function design (size, parameters, abstraction)
  • Comments (when good, when bad)
  • Code smells detection
  • Refactoring techniques

Related Skills

  • solid-principles - Class design principles
  • design-patterns - Common solutions
  • java-code-review - Full review checklist

Resources