Task Master Prompt (Agent Mode)

The Task Master Prompt is a systematic way to guide an agent through a project from start to finish. It creates a clear record of every decision and milestone along the way, so you can always see what was done and why.

Key Features:

  • Automated Task Documentation
    Helps the agent set up and maintain a single “task file” that covers everything from the initial analysis all the way to final implementation.

  • Git Workflow Integration
    Gives the agent precise instructions on how to create branches, merge changes, and clean up repositories, ensuring a smooth and consistent version control process.

  • Checkpoint-Based Progress
    Sets up strategic pause points so the agent can confirm progress with you before moving forward, cutting down on wasted effort or heading off in the wrong direction.

  • Detailed Task Analysis
    Encourages thorough problem-solving before jumping into code changes, preventing rushed solutions and promoting a deeper understanding of the task.

  • Progress Tracking
    Keeps a chronological log of every attempt, success, and failure, making it easy to review what’s been tried and how it worked out.

  • Reusable Documentation
    Each task file can double as a standalone prompt for future collaboration on the task.

  • Source of Truth Management
    Centralizes all project decisions and progress notes in one place so there’s no confusion about what happened or why certain choices were made.

  • Final Review Process
    Walks the agent through a structured review to verify that every step is completed and documented properly before wrapping up the task.

Get the prompt at the below link. Copy/paste it into a temporary document and change the below placeholders reflect your task and project overview etc.

[TASK]: <DESCRIBE YOUR TASK>
[PROJECT OVERVIEW]: <ENTER PROJECT OVERVIEW, OR LINK TO FILE CONTAINING THE DETAILS>   
[MAIN BRANCH]: <YOUR MAIN BRANCH>
[YOLO MODE]: <ask|on|off>

Then off you go!

Give it a go and let me know how it works for you.

13 Likes

is it .md ?

1 Like

What is .md?

.md stands for markdown or markdown format (Basic Syntax | Markdown Guide) which is the standard most models use for their default output.

Hi Maxfahl,

First, I want to thank you for the amazing work you’ve shared—it’s truly inspiring and incredibly helpful for structuring refactoring and debugging processes. :clap:

I have a quick question: do you use your model directly in the “AI Rules”, or do you use it as a systematic prompt in the composer?

Thanks in advance for your reply, and once again, great job on your methodology!

1 Like

Thanks :slight_smile:

I’ve found it best to put everything in the prompt itself, as you can’t trust trust Cursor to always pass the rules etc on to the model.

I’ve iterated on the prompt a bit since I posted it. It now formulates the task file itself a bit like a prompt so that you can just point to it later and it will know what we were working on. It seem to get lost after 4-6 prompts otherwise. Having this file I can just pick up any issue days or weeks later.

I’ve also added stuff like creating a feature branch and then commit/merge at the end. Best used with YOLO mode :slight_smile:

1 Like

Hi maxfahl, thank you for sharing your prompt and I would like to first understand more before I use it. 1) what problem/s were you running into that motivated this prompt 2) do you find this consistently solves your problem?

I am finding my biggest challenge with the agent is its “forgetfulness” and am wondering if your prompt will help me with this

1 Like

The forgetfulness was actually one of the reasons for why I created this prompt. The model would often end up in some kind of loop, where we tried solution number one, then solution number two, and then back to solution number one, which “we” knew didn’t work. Making the agent keep track of what things it has tried reduces this a lot. It keeps the agent grounded on the issue we are actually working on, And prevents it from going off doing something completely different.

For me, the agent mode is quite useless when you don’t give it much context, etc., and this prompt keeps the context and the issue at hand all through the process.

The agent might still focus, but when we have all the information we need in one file, we can quickly get back on track by making it read the task file again.

Letting the agent create a feature branch and then commit and merge at the end is also quite nice.

5 Likes

Wonderful! and thank you for taking the time to provide a very thoughtful answer to my questions. I am mid-project and would like to know at what stage of development you used this prompt successfully? It looks as though it is for the beginning part of the dev process but I am sure if tailoring the prompt accurately I could use this at any stage. What is your experience with this. TIA

[edit]
@maxfahl I have used your prompt very successfully so far with 100% improved results over the methods I was using, thank you very much :slight_smile:

1 Like

You’re welcome! It is not “perfect” and I’m still working out some kinks. It seems the agent sometimes doesn’t know what to do after receiving the prompt, and it doesn’t always follow all the steps I’ve given it. But it works well most of the time.

I have a feeling I need to structure prompt a bit differently, since I feel the model is not always clear with priorities and the order of execution. Will post any updates to the prompt here.

Glad to hear you found it helpful, thanks for taking the time to write that :slight_smile:

2 Likes

:+1::+1: i’m working on something similar at GitHub - ultrawideturbodev/ultra_wide_turbo_workspace: A structured framework for GPT agents to maintain context, follow processes, and deliver consistent results through well-defined protocols and documentation patterns.

i am wondering sometimes if the models get too much info though. been working on this for days now and at the start it went very well but now i notice they’re going crazy very quickly. getting into loops and forgetting context very fast.

but then sometimes they don’t. it’s weird. :man_shrugging:

hey @maxfahl i found your post quite valuable, maybe the best information i came across similar ideas. thanks for posting this! it boosted my productivity as i was gradually overwhelmed as a non-dev. sorry for my message being a bit long but i wanted to share my experience in return for your effort :slight_smile:

i experienced an occasion where Claude deviated from the instruction set and template, then we had the following exchange which reveals important clues regarding the LLM’s underlying configuration for interpretation and actions:

user: before we start, tell me the reason why you were not able to capture the user journey details from the document as we are trying to follow a documented approach; not being able to capture and follow relevant information should be addressed based on your response to my question

Claude: You raise a valid point about process improvement. The issue occurred because I made two mistakes in my initial approach:

  • Incomplete Initial Search: When I first looked at the user journeys document, I didn’t scroll through the entire document. I only saw the first few user journeys (Sign Up, Forgot Password, etc.) and incorrectly assumed the Create Posting journey wasn’t documented.

  • Assumption Before Verification: Instead of thoroughly searching for “create posting” in the document first, I made an assumption and proceeded to create a task template based on that assumption. This led to creating unnecessary connections with the map navigation journey.

To prevent such issues in the future, I should follow this systematic approach:

  • First, thoroughly search and read ALL relevant documentation
  • Document all findings before making any assumptions
  • Cross-reference findings with other related journeys
  • Only then proceed with task planning

Looking at the search results, I can see that the Create Posting user journey is well documented in two places:

  • Main documentation (lines 374-419):
  • Complete step-by-step flow
  • Validation requirements
  • Success/error handling
  • All relevant files and their purposes
  • Historical documentation (lines 2311-2325):
  • Simplified step overview
  • Core file references

My mistake was in:

  • Not using the search tools effectively - I should have searched for “create posting” first
  • Not reading through the entire user journeys document systematically
  • Making assumptions without proper verification
  • Not cross-referencing multiple sources in the documentation

This is a good learning opportunity for improving our documentation review process. For future tasks, we should:

  • Use search tools first to find ALL relevant documentation
  • Read through complete documents rather than making assumptions from partial views
  • Cross-reference multiple sources when available
  • Only proceed with task planning after thorough documentation review

user: this is a good retrospective with a valuable lesson; furthermore, can you give me the breakdown of your assumption behavior? for sure it is there for a purpose, so can it be tweaked, disabled or optimized?

Claude: Thank you for this insightful question about assumption behavior. Let me break down the different aspects:

1- Purpose of Assumptions

  • Quick Response: Assumptions help provide rapid responses without exhaustive searches
  • Pattern Recognition: Using past experiences to predict common scenarios
  • Efficiency: Avoiding unnecessary deep searches for “obvious” cases

2- Where My Assumptions Failed

  • Assumed Create Posting wasn’t documented because it wasn’t in the first few journeys
  • Connected it to Map Navigation without verification
  • Proceeded with task planning before complete information gathering
  • Used “while not explicitly documented” phrasing without proper verification

3- Current Assumption Behavior:
Input → Quick Pattern Match → Assumption → Action

This failed because it prioritized speed over accuracy.

4- Optimized Behavior Should Be
Input → Quick Search → Evidence Gathering → Verification → Action

5- Optimization Strategies:

a) Search First, Assume Later

  • ALWAYS perform a quick search before making assumptions
  • Use available tools (codebase_search, grep_search) as first response
  • Only make assumptions when search yields no results

b) Assumption Validation Protocol

  1. Document the assumption
  2. State why it’s being made
  3. Verify with available tools
  4. Correct if evidence contradicts

c) Progressive Disclosure

  1. Start with “Let me search for relevant information”
  2. Share search results
  3. Only then proceed with analysis
  4. Make explicit when moving from facts to assumptions

d) Assumption Levels

  • L1: Direct evidence available (Use this)
  • L2: Indirect evidence suggests (Verify first)
  • L3: No evidence but logical inference (Explicitly state as assumption)
  • L4: Pure speculation (Avoid)

7 - Practical Changes for Our Work:

  • Always prefix responses with search results
  • Explicitly mark assumptions when made
  • Provide confidence levels in responses
  • Create verification checkpoints before proceeding

For example, in our create posting task, I should have:

  • Started with: “Let me search for create posting documentation”
  • Shown the search results
  • Said: “Based on these results, I see the user journey is documented at…”
  • Then proceeded with task planning
    This would have caught the error early and maintained accuracy while still being efficient.

i’ve added few lines in between your prompt and trying how it works and it seems there’s an improvement, e.g Claude now can conclude the given task with fewer errors. i am working on something less complicated right now - automated test scripts for my mobile app - but i can say that the ride is smoother overall :slight_smile:

2 Likes

I’m quite happy with the current state of the prompt. Please let me know how it works for you all!

I’ve have noticed this phenomenon as well during my AI adventures.

I think I’m starting to have the same problems with the latest version of my prompt. It’s like the AI gets confused about priorities when receives too much information…

yea exactly! i tried to clean my system prompt up a bit at least. i tihnk it has to do with context of the convo as well. i had a convo with an agent yesterday (lol) and it said whne context limit is reached it doesnt neccessarely remove the start but things from the start get fuzzy. i think that fuzzyness creates randomness and overall chaos.

think its very wise to really aim for atomic tasks, keep some file(s) updates and then start a new convo when possible

Yes :sweat_smile: And even my approach makes the Cursor agent choke… I wish you could utilize the system prompt somehow, but it feels it’s off limits because of some security reason or something.

I was also using a very similar approach to this, and had the same issues.

The problem seems to be related to the Model’s context window. In case you don’t know, the actual cognitive load of the model isn’t what is advertised as the context window. What most models do is use advanced RAG-like algorithms to summarize and extract key details from long contexts/prompts.

So, once the covnersation gets a little too long, it will start forgetting details.

The only solution to this is to create smaller tasks, and proceed to a new chat after each small completion.

What I’ve been doing is dividing the process into an extensive documentation phase, then planning the high-level view of the implementation process, then focusing on creating smaller tasks and subtasks.

If you want to maintain context between conversations, you can create a memory bank with a project overview and add another overview to the task card. The task/subtask card should always be included as context for every prompt in the conversation.

Also, using TDD has helped a lot. Implementing a CI pipeline as soon as possible is crucial. There should be tests everywhere. This is to make sure the agent won’t randomly break your working code when implementing a new function. And if it breaks, you’ll catch it early and you can just revert and try running the task again, it usually won’t happen twice.

4 Likes

Another note on TDD,

Creating the tests first also serve as a guideline to the agent, it will always create the implementation code aiming to pass the test objectives, so it’s less likely to go off-rails.

Also, if it doesn’t pass some test objectives, it’s easy to add debug logs and the agent can find serious issues with the implementation logic that would otherwise go unnoticed.

Overall, I think that there should be a lot more focus on QA and DevOps if you want to have a complex project build with AI Coding Agents.

1 Like

TDD works great for AI coding for me. I’d say best outcome was from asking AI implement function according to tests.

1 Like