Code RoomEncoding unwritten conventions for AI
MediumPrep Room Coding #4041

Encoding unwritten conventions for AI

Vibe & agenticAlgorithms & data structuresMid–Senior~16 min

You're asking an AI agent to add a new React feature (a transaction-dispute flow) to a large TypeScript frontend that has strong, unwritten conventions: a custom useApi hook, a Result-type error pattern instead of throwing, a design-system component library, and a feature-flag wrapper around all new UI. The agent's draft used fetch directly, threw raw errors, used raw HTML inputs, and shipped the feature unflagged. Describe how you'd supply context so the next attempt fits, and the principle behind it.

Implement
check_house_conventions(added_lines: list[str], adds_new_ui: bool) → list[str]
Examples
in[["const res = await fetch(`/api/disputes/${id}`);","if (!res.ok) throw new Error('dispute fetch failed');","return <input value={amount} onChange={onChange} />;"],true]out["raw_fetch=1","raw_throw=1","raw_html_input=1","unflagged_ui=1"]
in[["const result = useApi<Dispute>(`/api/disputes/${id}`);","if (!result.ok) return err(result.error);","return <FeatureFlag name='dispute-flow'><DsTextField value={amount} /></FeatureFlag>;"],true]out[]
in[["export function normalizeDispute(raw: DisputeDto): Dispute {"," return { id: raw.id, amount: raw.amount_cents / 100 };","}"],false]out[]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 16 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.