WhoBuilt

Refactoring a Next.js & Tailwind app with Cursor

Aug 25, 2025· 58 min· 16K views·Watch on YouTube

Lee Robinson of Cursor’s parent company, Anysphere, walks through refactoring an older Next.js app with Cursor, showing how he uses AI as a pair programmer.

Inventory the app and plan the cleanup

Lee starts with a two-year-old Next.js 13 app using MDX, Tailwind, and ESLint. He identifies work including updating dependencies, removing the old blog and unused code, migrating from inline styles, and replacing job content stored in MDX with data from Ashby.

Upgrade with codemods and simplify tooling

He uses upgrade commands and codemods for Next.js and Tailwind, then checks the changes as the app runs. He moves from Tailwind 3 to 4 and starts replacing ESLint with Biome, while noting that lint autofixes can make broad changes and need review.

Refactor the app and remove old content

Lee uses Cursor agents to combine the Genius component into the homepage and migrate inline styles to Tailwind. He removes the blog and unused assets, reviews the diffs, and deletes the careers page after deciding it adds little beyond the homepage.

Fetch career postings from Ashby

He builds a career route that fetches job details from Ashby and renders the posting’s HTML, title, department, and location. The existing job IDs are not human-readable slugs, so Lee leaves URL naming as a product decision and restructures the careers layout to share the application form.

Review progress and the cost of the session

After about an hour, Lee says the app has a cleaner shared careers layout, fewer duplicate font loads, Tailwind in place of many inline styles, and job content coming from Ashby instead of MDX. He describes AI as a pair programmer that helps with repetitive edits while he directs and reviews changes. He reports spending about $35 using GPT-5 High Fast and GPT-5 with medium reasoning.

Takeaways

  • Use codemods for predictable framework upgrades, then inspect the resulting changes.
  • Ask an agent to handle repetitive refactors, but review diffs and run the app as you go.
  • Treat lint autofixes cautiously because they can change more files than expected.
  • Prototype API-driven content with one route before expanding it across the app.
  • Make URL and slug decisions with product needs in mind when the data source provides only opaque IDs.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • feature
    Tailwind CSS: The app was migrated from Tailwind 3 to Tailwind 4
    “but also for Tailwind 3 to 4”
    YouTube
    Unverified1 source· Talk
  • feature
    Next.js: The app was upgraded from Next.js 13 through versions 14 and 15
    “Next.js 13-to-14-to-15 updates”
    YouTube
    Unverified1 source· Talk
  • feature
    Anysphere: Anysphere is Cursor's parent company
    Anysphere is Cursor's parent company
    “Anysphere website, which is the parent company of Cursor”
    YouTube
    Unverified1 source· Talk
  • feature
    Biome: Used for formatting and linting in place of ESLint
    “move to Biome for formatting and linting”
    YouTube
    Unverified1 source· Talk
  • feature
    Ashby: Its API provides job posting data used to render careers pages
    “We should also be able to read all this information from Ashby.”
    YouTube
    Unverified1 source· Talk
  • feature
    Ashby: The API is used by the job application form to submit applications
    “300 lines of error handling and talking to the Ashby API”
    YouTube
    Unverified1 source· Talk
  • uses
    GPT-5 with high and medium reasoning was used during the session
    “I'm using GPT-5 with high reasoning”
    YouTube
    Unverified1 source· Talk
  • metric
    GPT-5: About $35 for roughly one hour of coding, using GPT-5 High Fast and GPT-5 with medium reasoning
    “I was coding for about an hour ... and it was about $35.”
    YouTube
    Unverified1 source· Talk

Related talks