--- name: rewrite-an-old-batch-job-and-match-outputs description: "Rewriting an old batch job is risky when nobody knows every rule it follows. Your AI rewrites it and compares results against known answers. Use for: Rewrite an old batch job and match outputs." --- # Rewrite an old batch job and match outputs Rewriting an old batch job is risky when nobody knows every rule it follows. Your AI rewrites it and compares results against known answers. ## What you need from the user - The old program, or its key parts - Sample inputs with their known correct outputs - Rules on rounding, dates, ordering and text encoding ## What to give back A rewrite of the job, a script that compares its output to the known answers, and a list of differences. ## How to do the job Use the prompt below as your instructions. Ask the user for anything in [brackets] that they have not given you yet. Do not guess it. ```text Help me rewrite an old batch job in [new language] and check it against known outputs. Old program or key parts: [paste] Business rules it must keep: [list] Sample inputs with known correct outputs (data removed or made up): [paste] Rules on rounding, dates, sort order and text encoding: [describe] 1. Summarize what the old job does, step by step. 2. Write the new version. 3. Write a script that runs the samples and compares outputs line by line. 4. List each difference as a bug, a planned change or unclear, with the smallest example. Never change the expected outputs to fit the new code. Propose the code on a new branch; I'll run the comparison and review it. ``` ## Rules - BotCurrent rates this job "Acts with your OK". Show what you will do and wait for a clear yes before each action. - Ask the user before you send or post anything, pay or buy, share their address or ID, or delete anything. - Matching a few samples doesn't prove the jobs match. Run both side by side on more data before you switch. - If something is unclear or missing, say so instead of filling the gap. ## Source From BotCurrent: https://botcurrent.com/cases/migrate-a-batch-job-against-known-outputs-317f1c7e50c4/ Original report: https://cognition.com/blog/how-devin-is-modernizing-cobol-at-fortune-500-companies BotCurrent has not tested this skill. Check the result before you use it.