How to Vibe Code without breaking everything

Cursor on Steroids (step-by-step)

In Partnership With The Rundown AI

Learn how to make AI work for you

AI won’t take your job, but a person using AI might. That’s why 1,000,000+ professionals read The Rundown AI – the free newsletter that keeps you updated on the latest AI news and teaches you how to use it in just 5 minutes a day.

Here’s what we’ll talk about today

Vibe coding feels magical until your AI helper rewrites half your repo.

Task Master AI is a free, open-source tool designed specifically to fix this mess. It takes your vague AI prompts and transforms them into neatly sequenced tasks the model can’t ignore.

Today, I'll show you exactly how I used Task Master AI and Cursor to build an automated agent-based research loop.

Complete with detailed tasks, clear tests, and self-healing documentation. All without wrecking my codebase.

Why This Matters

A common disaster with vibe coding is when your AI model suddenly decides it should rewrite your entire project, ignoring your existing work entirely (example).

This usually happens because the model doesn't clearly understand task boundaries. Defining small, clear tasks dramatically reduces these AI bulldozer moments.

Task Master AI makes task definition and management effortless, turning your prompts into a manageable sequence of bite-sized tasks. With clear boundaries, Cursor stays on track, and your project stays safe.

In this guide, I'll walk you through:

  • Installing Task Master AI into an existing project.

  • Creating a clear PRD (Project Requirements Document).

  • Turning your PRD into manageable tasks.

  • Using Cursor and Task Master to build an agentic workflow using openai-agents-python step-by-step.

I share the results of this week's experiment on my GitHub.

Let’s dive in.

What I Built (Agentic Loop)

I recently used Task Master AI to create a workflow based on Anthropic’s "evaluator-optimizer" pattern:

  • Expert Agent: Answers with authoritative insights on AI topics, with the ability to search the web for relevant information.

  • Curious Agent: Continuously probes the Expert until answers reach a specified depth.

Here’s the basic flow:

Iteration Loop

Each response is validated by the Curious Agent to check if it meets its goal. The agents iterate until the Curious Agent confirms satisfaction.

Curious Agent Validation step

The result: a streamlined, automated workflow for exploring and mining LLM knowledge, demonstrated through generating a curated list of topics for an AI newsletter.

Example output

Using Task Master AI (Step-by-Step)

Step 1: Install Task Master AI

Open your terminal and run:

npm install -g task-master-ai

And set up Task Master MCP so Cursor can execute Task Master commands for you (like marking tasks as in progress or done):

The exact command to paste is available in the repo

Then you can initialize the Task Master in your repo with:

task-master init

This generates three key files:

  • cursor_rules.mdc: Sets naming and coding standards.

  • dev_workflow.mdc: Guides how Cursor interacts with Task Master.

  • self_improve.mdc: Allows Cursor to refine its own rules over time.

Inside the scripts, we also get example_prd.txt that we can use to create the actual PRD for our project.

In the following section, I'll show you how to use it to generate PRD for our project.

Let's move to the next section.

Step 2: Write a PRD

In Cursor, create a new chat. Paste in the reference to example_prd.txt so that Cursor knows the structure of the PRD.

Then just start talking about your idea with Cursor, and when you’re done, ask it to generate the PRD for you. Here’s how I did it:

Step 3: Convert Your PRD into Tasks

Run the command:

task-master parse-prd PRD.txt

This automatically generates clearly defined tasks stored in tasks directory:

You can check progress anytime with:

task-master list

The output of the Task Master list command. Each task has its status, priority, and dependencies.

Another important thing when working with AI is to commit after every task is finished. After generating the list of tasks, it's a good time to commit.

Step 4: The Smooth Vibe Coding Loop

Once your project structure and tasks are ready, coding becomes a streamlined process of validating the diffs produced by your LLM.

Here's the simple workflow I follow.

1. Start the next task

Open a new chat in Cursor and use this prompt:

Please use Task Master AI to identify the next task and implement it.

If you need to look up documentation, please use the context7 MCP.

Context7 is a great MCP that lets Cursor use the latest version of the documentation. I highly recommend it.

Cursor will then automatically find and implement the next task:

2. Review Cursor’s suggested code

Check for accuracy and completeness. A quick vibe check to see if the AI sticks to the plan. We’ll create more detailed tests in the next steps.

3. Address any deviations or missing details

If Cursor begins to implement something undesirable (for example, creating requirements.txt instead of using Poetry).

It's usually due to unclear task requirements. Simply add the missing details to your task description and instruct Cursor:

In the described situation, it worked perfectly:

4. Write/Update test for the diff

Oftentimes, Cursor will try to mark the task as done without checking if the code works. If this happens to you, make sure to ask to write a test before proceeding with the next task.

Here's an example:

Cursor tries to set the task to done without testing the code. We need to ask it to create a test.

After the test passes, you can close down the task:

Writing the tests along the way reduces the code drift and the risk of hallucination.

If the LLM messes up the code you will know about it (because the test will fail).

5. Commit once your test passes and mark the task as done

Important best practice

We should commit after every task is done to be able to trace back in case something goes wrong.

Luke

After the task is done, we can ask Cursor to close it.

It will be reflected in the project dashboard task-master list :

6. Repeat the cycle

Now we can continue to the next task. This structured loop ensures that your coding remains organized, focused, and free from large-scale errors, leading smoothly toward project completion.

Step 5: See Your Agents in Action

Here’s an example conversation between two agents:

  • Curious Agent writing a newsletter based on recent AI news

  • Expert Agent running the search and proposing topics

Time to Wrap Up!

Here’s the bullet point recap for you to take home:

  • Clearly define outcomes first, then break them down into small tasks. Task Master AI automates that for you!

  • Small tasks mean fewer mistakes.

  • Automate testing and documentation checks with Context7.

  • Commit after every completed task.

🚀 Your Challenge

It’s time for you to take action!

Spin up Task Master AI, draft a PRD for your current side project, and finish the first task.

Tell me your biggest surprise or success. I’ll feature the best stories in the next newsletter.

What do you think about today's newsletter?

Help me improve the newsletter!

Login or Subscribe to participate in polls.

If you have any specific feedback, let me know by responding to this email!