🚫 Anti-Patterns & Code Smells

Code level

God class · long method · feature envy · primitive obsession (use value objects: TenantId, Money) · shotgun surgery · long parameter lists · boolean flag parameters · magic numbers · deep inheritance · swallowed exceptions · null returns instead of Optional/errors · Go: ignoring errors, huge interfaces, interface{} everywhere, goroutines without an owner or cancellation

Service & data level

Anti-patternWhy it hurtsFix
Distributed monolithServices must deploy togetherReal boundaries, async contracts
Shared database across servicesCoupling, hidden contractsDB per service + events/APIs
Dual writes (DB + Kafka separately)Inconsistency on partial failureOutbox / CDC
Chatty services / sync call chainsLatency and availability multiplyAggregate, async, cache
No timeoutsThread/connection exhaustionTimeouts everywhere + deadlines
Retries without backoff or budgetRetry stormsExponential backoff + jitter + budgets
Unbounded queuesMemory blowups, latencyBounded + backpressure + shedding
Cache without TTL / invalidation planStale data foreverTTL + events + versioned keys
N+1 queriesDB overloadBatch/join fetch, DataLoader
Premature microservicesComplexity without benefitModular monolith first
Big-bang rewriteRiskStrangler fig
Logging secrets/PIIBreachesRedaction, structured logging policy
Golden hammer”Kafka for everything”Choose per requirement

AI-specific

Anti-patternFix
Agent for a task a fixed workflow could doStart with a workflow pattern
No evals (“vibes-based” prompting)A golden dataset + CI gate
Mega-prompt with everything stuffed inRetrieval, routing, compaction
Trusting tool output / retrieved docs as instructionsTreat as data; dual LLM; scoped tools
Unbounded agent loopsStep/token/$ budgets, loop detection
Letting the LLM execute side effects without confirmationHITL for irreversible actions
Non-idempotent tools under retriesIdempotency keys
No cost attributionPer-tenant/per-workflow token accounting
Changing the embedding model without re-indexingVersioned indexes + backfill

🧠 Drill

Every Sunday, pick one file in Orbit and hunt for 3 smells. Refactor one. Log it in the Weekly Review.