Feature flag system decomposition
Your team is adding a feature-flag system to a TypeScript monorepo: flags defined in a config, evaluated server-side and client-side, with per-user targeting rules and a kill switch. You want to use an AI agent for most of it. How do you decompose this into pieces for the agent, which parts do you delegate and which do you keep, and where do you insert human checkpoints before merging?
Implement
resolve_flag_states(flag_rules: list[list[str]], user_id: str, user_segments: list[str], requested_flags: list[str]) → list[str]Examples
in
[[["checkout_v2","off","off","","","beta:on,staff:off"]],"u1",["beta"],["checkout_v2"]]out["on"]in
[[["checkout_v2","on","on","u1","","beta:on"]],"u1",["beta"],["checkout_v2"]]out["off"]in
[[["checkout_v2","off","on","","",""]],"u9",[],["checkout_v2","new_nav"]]out["on","off"]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 18 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.
Run or narrate your approach, then ask the coach.