DomainDrivenDesign.ir | Clean Code Mastery 2026

Logo

Clean Code Mastery workshop

View the Project on GitHub DomainDrivenDesignSchool/CleanCodeMastery2026

Clean Code Mastery Workshop - 2026

Welcome to the Clean Code Mastery Workshop repository!
This repo contains all practical exercises, refactors, and examples used throughout the workshop.


πŸ“š Core Concepts & Reading Path

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.

1️⃣ Clean Code, Smells & Refactoring (The Trilogy)

πŸ“„ docs/clean-code-trilogy.md


2️⃣ The Biological Metaphor (Mental Model)

πŸ“„ 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:


3️⃣ Impact / Effort Matrix for Code Smells

πŸ“„ docs/impact-effort-matrix.md

Not every smell should be refactored.

This document introduces:


4️⃣ Design by Contract

πŸ“„ 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.


5️⃣ Resources

πŸ“„ Resoruces On the resource page, there is a greate collection of talks, articles, books, blogs and other materials that helps us become better programmers.


πŸ“Œ How to Use These Documents

Refactoring without intent is just rewriting.


🎭 Epic Teams

Three legendary teams - each with their unique superpower:

🐱 Garfield Grumblers (3 members)

Motto: β€œThis code stinks worse than Mondays.”
Focus: Code smell detection, readability, checklists

🟒 Yoda Architects (4 members)

Motto: β€œDo. Or do not. There is no sloppy code.”
Focus: Meaningful naming, responsibility, modeling

πŸ’₯ Rambo Refactors (4 members)

Motto: β€œPainless refactor - guaranteed.”
Focus: Safe refactoring, debt elimination, bold changes


πŸ›  Branch Structure

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.


Pull Request Rules

PRs should be constructive, human-friendly, and discussion-driven.


βœ… How to Submit a PR

  1. From your team branch, create a new branch:
    feature/session-XX-taskname
  2. Keep commits small and meaningful.
  3. Open the PR to your team branch (not main).
  4. Fill out the PR template completely.

πŸ“ PR Template

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?”


πŸ”„ Cross-Team Review (Mandatory)

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:


πŸ“… Session Workflow

πŸ”΄ BEFORE (30–60 min prep)


🧭 Team Roles

Role Responsibility
Driver Types the code
Navigator Guides design direction
Spotter Hunts for code smells
Challenger Constantly asks β€œWhy this way?”

πŸ’‘ Pro Tips


πŸš€ Let’s Write Legendary Code!
Garfield Grumblers, Yoda Architects, Rambo Refactors,

Code so clean, Uncle Bob would approve.!