Would You Choose a Library Because AI Writes It Better? A developer explores whether developers will choose libraries based on what AI coding agents can write reliably, even if those libraries are harder for humans to learn. The post examines Effect and StyleX, which both work well with coding agents by using typed APIs to reduce errors, but introduce complexity and a steeper learning curve for human maintainers. I was at a conference recently and watched Joel Hooks talk about Effect https://effect.website/ . Effect homepage h1 advertises that it's the "Reliable TypeScript for the AI era". Joel explained that AI agents Kiro https://kiro.dev , Claude Code, etc can write way better TypeScript with Effect then he could ever do by himself. It made me start thinking, is this the future? That raised a question I had not seriously considered before. Are we going to choose libraries based on what coding agents can write reliably, even when those libraries are harder for us to learn? I made a video about that question using two libraries: Effect and StyleX https://stylexjs.com/ . Both libraries work really well with coding agents. Effect can more easily catch expected failures in the type system. StyleX puts styles behind a typed JavaScript API. Both help reduce errors during compilation. That sounds great. However, it also creates a strange situation where the agent may understand the stack better then I could, even though I'm responsible to maintain it long term. To help understand this more let's see how StyleX and Effect work, and where I think where this is all going. To understand Effect, you need to understand how it handles async functions. A normal asynchronous TypeScript function often tells you the success type and leaves the failure behavior in comments, thrown exceptions, or tribal knowledge. Effect gives failures their own typed channel. In the demo, each expected problem has a tagged error: js import { Data, Effect } from 'effect' export class NotFoundError extends Data.TaggedError 'NotFoundError' <{ readonly handle: string } {} export class RateLimitError extends Data.TaggedError 'RateLimitError' <{ readonly retryAfterSeconds: number } {} export class NetworkError extends Data.TaggedError 'NetworkError' <{ readonly reason: string } {} The profile program returns one of those errors based on the scenario: js export const loadProfile = scenario: Scenario = Effect.gen function { if scenario === 'not-found' { return yield new NotFoundError { handle: 'agent-editor' } } if scenario === 'rate-limited' { return yield new RateLimitError { retryAfterSeconds: 30 } } if scenario === 'offline' { return yield new NetworkError { reason: 'The demo API is offline.' } } return profile } I can infer the complete error union from the program instead of maintaining it separately: export type LoadProfileError = Effect.Effect.Error< ReturnType