Code RoomEstablish codebase context for agents
HardPrep Room Coding #4092

Establish codebase context for agents

Vibe & agenticAlgorithms & data structuresSenior–Staff~20 min

A new engineer on your team keeps getting subtly wrong code from the agent — it invents helper functions that already exist, ignores your Result-type error convention and throws instead, and edits a generated file it should never touch. The agent isn't the problem; the context it's given is. As the senior on the team, what would you put in place so any agent run in this repo starts with the right codebase context — conventions, the interfaces it must use, working examples, and an explicit 'do not touch' list?

Implement
find_forbidden_edits(changed_paths: list[str], protected_patterns: list[str]) → list[str]
Examples
in[["src/api/user.ts","src/generated/schema.ts","src/generated_helpers.ts"],["src/generated/","*.gen.ts"]]out["src/generated/schema.ts"]
in[["db/migrations/0001_init.sql","vendor/lib/a.js","README.md"],["db/migrations/","vendor/","README.md"]]out["README.md","db/migrations/0001_init.sql","vendor/lib/a.js"]
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 20 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.