Ask claude to do it end to end, then write a solution that fits your needs from it's experience with you driving it.
I did exactly this - probably the single most valuable piece of software I've "written". It's the backbone of every piece of code coming out of any agent under my control (via MCP toolset).