♻️

Promise Chain to Async/Await Migration

Convert nested promise chains to clean async/await syntax

prompt template
Convert this promise-based code to async/await:

```
[PASTE_PROMISE_CHAIN_CODE]
```

Requirements:
1. **Direct conversion** — maintain identical behavior and error handling
2. **Error handling** — convert .catch() to try/catch, preserve error types
3. **Parallel operations** — use Promise.all() where promises are independent
4. **Sequential operations** — use await for dependent operations
5. **Error propagation** — ensure errors bubble up the same way
6. **TypeScript types** — add return types to async functions
7. **Edge cases** — handle Promise.race, Promise.allSettled if present

Show before/after with comments explaining each transformation.
Flag any behavior changes that the conversion might introduce.

How to Use This Prompt

  1. 1Copy the prompt template above
  2. 2Paste into Claude, ChatGPT, or Cursor
  3. 3Replace [bracketed placeholders] with your specific project details
  4. 4Iterate on the AI output to refine and customize the results