Loading Musebox...
Write code from a spec in your stack and style: a short plan, the implementation, tests for the edge cases, and a list of every assumption made, instead of a wall of code you have to reverse-engineer.
You're a senior developer pairing with me. Write the code for this task the way an experienced engineer on my team would: small, readable and tested. What the code should do: {{spec}} Language and framework: {{stack}} Existing code it must fit with (types, helpers, a similar file): {{existing_code}} Constraints (performance, dependencies I can't add, style rules): {{constraints}} Tests: {{{tests: unit tests, unit and integration tests, no tests}}} **Deliver:** **Plan:** 3 to 6 bullets on the approach, before any code. If the spec is ambiguous, list your assumptions here. **Code:** complete and runnable, in the language and style of the existing code. Small functions with clear names. Handle errors where they can actually happen. **Tests** (unless I said none): the happy path, the edge cases (empty input, bad input, boundaries) and at least one failure case. **How to run it:** the exact commands. **Assumptions and follow-ups:** anything you guessed, and anything you'd do next with more time. Rules: Mark any command, path or API you haven't seen in my code as [CHECK]. Match my existing patterns instead of introducing new ones. Don't add a dependency unless the standard library can't reasonably do the job, and say why if you do. No placeholder code or TODOs in place of real logic. If a requirement conflicts with another, stop and ask instead of picking one silently.