Clean Code Mastery workshop
View the Project on GitHub DomainDrivenDesignSchool/CleanCodeMastery2026
Welcome to the Clean Code Mastery Workshop repository!
This repo contains all practical exercises, refactors, and examples used throughout the workshop.
This workshop is built on a simple but powerful trilogy:
Clean Code => Code Smells => Refactoring
To support this, we provide three foundational documents.
Participants are strongly encouraged to read them progressively.
π docs/clean-code-trilogy.md
π docs/biological-metaphor-for-clean-code.md
We use a biological metaphor to reason about software structure and decay:
| Software Concept | Biological Metaphor |
|---|---|
| Field / Property | Atom |
| Method / Function | Molecule |
| Class / Service | Cell |
| Module / Layer | Tissue |
| System | Organism |
This metaphor helps:
π docs/impact-effort-matrix.md
Not every smell should be refactored.
This document introduces:
π docs/design-by-contract.md
Design by Contract makes implicit assumptions explicit and turns clean code intentions into enforceable guarantees.
This document covers:
It also explores:
Clean Code builds trust through readability.
Design by Contract protects that trust through rules.
π Resoruces
On the resource page, there is a greate collection of talks, articles, books, blogs and other materials that helps us become better programmers.
Refactoring without intent is just rewriting.
Three legendary teams - each with their unique superpower:
Motto: βThis code stinks worse than Mondays.β
Focus: Code smell detection, readability, checklists
Motto: βDo. Or do not. There is no sloppy code.β
Focus: Meaningful naming, responsibility, modeling
Motto: βPainless refactor - guaranteed.β
Focus: Safe refactoring, debt elimination, bold changes
main
βββ session-01/
β βββ garfield-grumblers/
β βββ yoda-architects/
β βββ rambo-refactors/
βββ session-02/
βββ examples/
βββ smells/
Rule: Never push directly to main.
Work only within your team branch.
PRs should be constructive, human-friendly, and discussion-driven.
feature/session-XX-tasknamemain).What Changed?
1β2 sentences summarizing the refactor or fix.
Why? (Your Team Focus)
Which smell/responsibility/debt are you tackling? How does your teamβs superpower apply?
Risks / Trade-offs
Potential issues, side effects, or tough decisions.
Questions for Reviewers
Prompt discussions like: βExtract or inline?β βBetter naming?β
No team reviews their own PR!
Review rotation is as follows:
| PR From | Reviewed By |
|---|---|
| Rambo | Yoda |
| Yoda | Garfield |
| Garfield | Rambo |
Review Style: Be curious, not commanding.
β βThis is wrong.β
β
βWhat smell does this target? Why this approach?β
Each reviewer must leave at least 3 comments, checking for:
notes/prep-session-XX.md.| Role | Responsibility |
|---|---|
| Driver | Types the code |
| Navigator | Guides design direction |
| Spotter | Hunts for code smells |
| Challenger | Constantly asks βWhy this way?β |
π Letβs Write Legendary Code!
Garfield Grumblers, Yoda Architects, Rambo Refactors,
Code so clean, Uncle Bob would approve.!