Plan first, then change the code
Give MiniMax M2.5 the requirement and the relevant files, and ask for a plan first: which files change and how. Approve the plan, then have it write the change, and run the tests before merging.
Example: Which files does this change touch?
Material
- Requirement
- Add a “discount” column to the order CSV export; use 0 when there is no discount.
- src/export/orders.ts
- const COLUMNS = ['id', 'date', 'total']; rows.map(o => [o.id, o.date, o.total])
- tests/export.test.ts
- expect(header).toEqual('id,date,total')
PromptBased on the requirement and the code below, write a change plan first: which files to edit, what changes in each, and how to verify it. Don’t write code yet.
Sample answer · written by hand to show the reasoning
1) src/export/orders.ts: append 'discount' to COLUMNS and add o.discount ?? 0 to each row, so orders without a discount output 0. 2) tests/export.test.ts: change the header assertion to 'id,date,total,discount' and add an order with no discount, asserting the last column is 0. 3) Verify: run the export tests, then export one discounted and one undiscounted order and open both in a spreadsheet. Generate the code once the plan is approved.