Upgrade with AI Assistance

Modern AI tools like Claude and ChatGPT can help you upgrade your project quickly and safely. Here's how to get the best results.

Why use AI?

  • Faster than reading hundreds of pages of documentation
  • Can analyze your specific codebase and give tailored advice
  • Helps you find and fix breaking changes automatically
  • Explains what changed and why

Prompt Templates

Copy and customize these prompts to get help with upgrades. The more context you provide, the better answers you'll get.

Next.js upgrade

Use this prompt to upgrade from one Next.js version to another:

I want to upgrade Next.js from version 14 to 15.

My setup:
- Next.js 14 with App Router
- Hosting: Vercel
- Auth: NextAuth.js
- Styling: Tailwind CSS

Do the following:
1. Show breaking changes between versions
2. Check if my dependencies are compatible
3. Update package.json with correct versions
4. Show which code needs to change and why
5. Run build and help me fix any errors

Important:
- Keep all existing functionality
- Explain each change so I understand
- Warn if something might break

React upgrade

I want to upgrade React from version 17 to 18.

My setup:
- Create React App / Vite
- State management: Redux/Zustand
- UI library: Material UI / Chakra

Help me:
1. Identify breaking changes
2. Update index.js to new createRoot API
3. Migrate class components if needed
4. Update tests to new act() patterns
5. Enable Concurrent Mode if appropriate

General dependency upgrade

I want to update all dependencies in my project.

Current package.json:
[Paste your package.json here]

Do the following:
1. Show which packages are outdated
2. Identify breaking changes in major versions
3. Suggest safe upgrade order
4. Update package.json
5. Help me fix any compatibility issues

Prioritize:
- Security updates first
- Stability over latest versions

Tips for better results

Provide context

Tell which technologies you use, where the project is hosted, and which libraries are most important.

Be specific

Specify exact versions you're upgrading from and to. 'Upgrade Next.js' is worse than 'Upgrade Next.js 14.0.4 to 15.1.0'.

Share error messages

If something goes wrong, paste the entire error message. The AI can often solve the problem directly.

Test incrementally

Ask the AI to upgrade one thing at a time. Easier to find problems if something goes wrong.

Checklist before upgrading

Whether you use AI or not, follow this checklist:

Before

  • [ ]Commit all changes (clean git state)
  • [ ]Read release notes for the new version
  • [ ]Check that dependencies support the new version
  • [ ]Backup the database if relevant

During

  • [ ]Update package.json
  • [ ]Run npm install
  • [ ]Fix TypeScript/lint errors
  • [ ]Run npm run build
  • [ ]Test locally with npm run dev

After

  • [ ]Test critical flows (login, checkout, etc.)
  • [ ]Verify that the Besökskollen script still works
  • [ ]Deploy to staging first if possible
  • [ ]Monitor error logs after deploy

Common breaking changes

Here are some common things that change between versions:

UpgradeCommon changes
Next.js 14 → 15next/headers and cookies() are now async
Next.js 15 → 16middleware.ts replaced by proxy.ts
React 17 → 18ReactDOM.render()createRoot()
Tailwind 3 → 4New configuration syntax, some utility classes renamed

Recommended AI tools

Important considerations

  • AI can make mistakes - always test the code before deploying
  • Never share API keys or passwords with AI services
  • Always have a backup and ability to rollback
  • If something feels wrong, double-check with official documentation