I spent last week untangling a 800-line function that had grown roots. These three prompts are the workflow I now run on any legacy file before I touch it. They force the AI to map, type, and extract instead of guessing, so you get a refactor you can review and merge.
[Claude]
Given this Python file, produce a dependency map as a table: function name, inputs, outputs, global variables touched, and external calls. Then list the three functions with the most tangled coupling. Do not refactor anything yet. Output only the table and the top-three list with a one-line reason each.
[ChatGPT]
Here is a JavaScript file with no type annotations. Write a TypeScript version that adds strict types to every function and object literal. Keep the runtime behavior identical, add no new dependencies, and wrap each changed function in a JSDoc that states the before and after signature. Output the full typed file.
[Cursor]
In this repo, the module has one function that is 300 lines and does three jobs: parsing, validation, and persistence. Split it into three functions each with a single responsibility. Keep the public API unchanged so existing call sites still work. Show the diff plus a 5-line plan of what tests to update.
Full archive at aitoolalliance.com/tag/prompt-pack.