Taming AI Coding Agents: How Pattern-Based Codebases Using Effect Act as an Intermediate Representation

samgoodwin89 · x · 2026-07-23

Developer Sam Goodwin shared the engineering practice of using "pattern-based codebases" combined with the Effect framework at Alchemy.

The core insight is that AI coding agents often go off the rails when facing open-ended design questions. By establishing repeatable patterns and conventions, developers can constrain the AI, forcing it to extrapolate from existing structures rather than inventing new subsystems. The Effect framework makes this practical through built-in features like dependency injection, tagged errors, and services, which eliminate whole categories of design decisions—acting effectively as an intermediate representation (IR) for AI. This high level of consistency not only improves the accuracy of AI-generated code but also reduces cognitive load for human developers.

Original post →

More from coding & agent

coding & agent channel →