Smell #9: Style Drift
Style Drift: The accumulation of inconsistent naming conventions, architectural patterns, and error-handling strategies across different parts of the codebase.
Symptoms
- File A uses Functional components; File B uses Class components (AI suggested both).
- Error handling uses
try-catchin one module andResultobjects in another. - Variable naming switches between
camelCase,snake_case, andPascalCase. - The codebase looks like it was written by ten people who never spoke to each other.
Self-Assessment
If you can tell which AI model (Claude vs GPT) wrote which file, you have Style Drift.
Example
Inconsistent Patterns
Module 1:
const getTasks = () => fetch('/api/tasks').then(r => r.json()); (Functional)
Module 2:
async function listAllTasks() { try { ... } catch (e) { ... } } (Imperative)
Module 3:
class TaskManager { static async fetch() { ... } } (OOP)
Debt Impact
This smell is a major driver of Team Debt:
| Debt Category | Impact | |---------------|--------| | 🏗️ ARCH | No unified "Architecture" exists; it's a collection of conflicting ideas. | | 👥 TEAM | Developers find it jarring to switch between modules; review load increases. |
How to Fix
- Standardize on One: Choose one pattern and refactor the "drifters" to match.
- Automated Linting: Enforce naming and structure via strict ESLint or Prettier rules.
- Shared Rulebook: Use
.cursorrulesto define the team's "One True Way."
How to Prevent
- Style-First Prompting: Explicitly mention the desired pattern in your prompts.
- Pattern References: Show the AI a "Good Example" file before asking for a new one.
- Team Coordination: Agree on standards in a shared
STANDARDS.mdfile (Chapter 16).
Related Smells
- Smell #11: Copy-Paste Loops — Copying divergent patterns.
- Smell #10: Missing Self-Review — Drifting patterns aren't caught during review.
Book Reference
- Chapter 4: The Power of Rules — using instructions to prevent drift.
- Chapter 9: Team Chaos — how drift destroys team productivity.
- Chapter 16: Clean Teams — establishing the unified "Team Voice."