Encode codebase conventions for agents
Your team is about to have an agent add a new endpoint to a large Node/TypeScript service that has strong but undocumented conventions: a specific way to register routes, a shared validation layer, a typed error envelope, and structured logging with required correlation-id fields. Left to itself the agent will produce a working-but-off endpoint that doesn't match any of these. What's the minimum, highest-leverage context you'd assemble so its FIRST attempt fits the codebase — and why is pointing it at one good example often worth more than a long list of rules?
select_agent_context(paths: list[str], kinds: list[str], tokens: list[int], budget: int) → list[str][["src/routes/orders.ts","src/lib/validate.ts","docs/style.md","CHANGELOG.md"],["golden","interface","rule","noise"],[900,300,200,5000],1500]out["src/routes/orders.ts","src/lib/validate.ts","docs/style.md"][["docs/rules-a.md","src/routes/orders.ts","src/lib/validate.ts"],["rule","golden","interface"],[400,900,300],1000]out["src/routes/orders.ts"][["src/lib/validate.ts","src/lib/errors.ts","docs/rules.md"],["interface","interface","rule"],[200,200,100],1000]out["src/lib/validate.ts","src/lib/errors.ts","docs/rules.md"]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.
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.