Smell #9: Style Drift

Severity: Medium

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-catch in one module and Result objects in another.
  • Variable naming switches between camelCase, snake_case, and PascalCase.
  • 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

  1. Standardize on One: Choose one pattern and refactor the "drifters" to match.
  2. Automated Linting: Enforce naming and structure via strict ESLint or Prettier rules.
  3. Shared Rulebook: Use .cursorrules to 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.md file (Chapter 16).

Related Smells

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."

Build a codebase with a single voice