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.
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.
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.
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
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):
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.
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:
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.
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.
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:
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.
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:
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).
Important best practice
We should commit after every task is done to be able to trace back in case something goes wrong.
After the task is done, we can ask Cursor to close it.
It will be reflected in the project dashboard task-master list
:
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.
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
Here’s a preview (but you can check the whole output in my repo):
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.
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! |
If you have any specific feedback, let me know by responding to this email!