{"id":"vibe-dev-scoped-coding-agent-prompt","audience":"developers","category":"coding","track":"coding","technique":"constraints","title":"Write a tightly scoped prompt for a coding agent","free":false,"task":"Write the prompt you'll give a coding agent (a Claude Code or Cursor-style tool) to add CSV export to the orders page. Put the prompt in one code block of at most 12 lines, with at most one short line outside it. It must name the files it may change, ban new dependencies, say which columns go in the export, and tell it to run the existing tests and report the result.","materialLabel":"Your ticket and repo notes (attached to your prompt automatically)","material":"TICKET OPS-412: Export orders to CSV\nAs an ops manager I want a \"Download CSV\" button on /admin/orders so I can open orders in a spreadsheet.\nColumns, in this order: order_id, created_at, customer_email, total, status\nOnly export the orders currently shown by the page's filters.\n\nRepo notes\n- Orders page: app/admin/orders/page.tsx\n- Data fetching for that page: app/admin/orders/queries.ts\n- Shared table component used on 9 other pages: components/DataTable.tsx (don't touch, other teams depend on it)\n- Tests: npm test (Vitest). 212 tests, all passing on main.\n- We already have papaparse in package.json? NO, we don't. Team rule: no new dependencies without an RFC.\n- Last time an agent \"helpfully\" upgraded Next.js and broke the build.\n\nOut of scope: Excel (.xlsx) export, scheduled email exports.\n","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":12},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"No file fence","why":"Coding agents edit shared components 'to make it cleaner'.","fix":"Add: \"Only change page.tsx and queries.ts. Don't touch DataTable.tsx.\"","checks":["r0"]},{"title":"Allowing new packages","why":"The agent installs a CSV library or upgrades frameworks.","fix":"Add: \"No new dependencies or upgrades.\"","checks":["r1"]},{"title":"Leaving columns to chance","why":"The agent exports every field in its own order.","fix":"Add: \"Columns in this order: order_id, created_at, customer_email, total, status.\"","checks":["r1"]},{"title":"No test step","why":"The agent says 'done' without running anything.","fix":"Add: \"Run npm test and report pass or fail.\"","checks":["r2"]},{"title":"A prompt buried in explanation","why":"The AI explains its prompt and splits it across blocks.","fix":"Say: \"One code block, at most 12 lines, nothing else.\"","checks":["codeBlocks","maxCodeLines","maxProseWords"]}],"promptHints":[{"label":"Names allowed files","patterns":["page\\.tsx","queries\\.ts","only (change|edit)"]},{"label":"Bans new dependencies","patterns":["no new dependenc","dependenc","packages?"]},{"label":"Lists the columns","patterns":["order_id","columns"]},{"label":"Asks for tests","patterns":["npm test","run.{0,10}tests"]},{"label":"Asks for one block","patterns":["one code block","code block","\\d+ lines"]}],"hint":"Coding agents do what you allow, not what you meant. Give them the files, the limits, the exact output and a test to run.","rubricLabels":["The prompt limits changes to app/admin/orders/page.tsx and app/admin/orders/queries.ts and says not to change components/DataTable.tsx","The prompt bans new dependencies or upgrades, and lists the columns order_id, created_at, customer_email, total, status in that order, exporting only the filtered orders","The prompt tells the agent to run npm test and report the result, and does not ask for Excel or scheduled exports"]}