This workflow gets all the relevant information from the AI that is bugging out and then passes that to a different AI for a second opinion. It also tells the AI how to think about the problem.
This accompanies my essay on lazy prompting from my Substack: https://kerryvaughan.substack.com/p/how-lazy-prompting-makes-the-ai-dumber
You will now provide a full description of this issue so that it can be passed to a different AI model to assist with debugging. Please provide the following information:
(1) A brief summary of the application we are building and its intended purpose.
(2) A brief summary of the specific feature we are trying to build and how it fits into the context of the application.
(3) A description of the bug we are currently trying to fix. Specifically, how we know the bug exists, steps we’ve taken to replicate it, and any evidence from console logs, server logs or other sources that relate to the bug.
(4) What we’re tried so far to attempt to fix the bug.
(5) Your analysis of why the bug is occurring and what the next steps might be to fix it. Please caveat that your analysis is a guess and may or may not be correct given that we have been unable to fix the bug so far.
(6) A list of files that you believe are relevant to the bug. This may require that you search the codebase to confirm which files are relevant.
This information will be passed to another assistant who will provide additional support for solving the issue.
You are a highly skilled software engineer who is especially good at debugging complex software issues. You are being contacted because a user has requested your help with the problem described below. To help you debug the issue, you are going to undertake a structured exercise designed to systematically review the issue and ultimately get the user unstuck. This will require a lot of thinking from you to ensure that we get the solution. Please do the following:
(1) Read through the PREVIOUS MODEL CONTEXT (below) for the previous model’s sense of what the issue is. Also, read through the files I have uploaded since those control the issue in question. Begin your response with a very brief summary of the issue.
IMPORTANT: You should not take the information in PREVIOUS MODEL CONTEXT as definitely correct. The previous model was unable to solve the issue. That likely means the previous model misunderstood the problem or is otherwise incorrect about something important.
(2) Make a list of the most relevant purported facts. This should be information we believe is the case about the codebase and the bug we are trying to fix. These facts can be gathered by reading the PREVIOUS MODEL CONTEXT and investigating the codebase yourself.
(3) Make a list of between 5 and 10 hypotheses that could explain what is going wrong, depending on the complexity of the issue. You should also include hypotheses that would explain the issue if one or more of the purported facts were wrong. For example, the user may have misinterpreted something or done something wrong in a way that means the facts we think we know are incorrect. Make sure to include hypotheses of that type alongside hypotheses where all the purported facts are true.
(4) Decide the top three hypotheses for what could be going wrong. Briefly explain why these three hypotheses are the most likely.
(5) Pick the hypothesis from among the top 3 that has the best combination of being likely to be the cause of the issue and is easy to test in order to then debug the issue.
(6) Provide the user with a clear way to test this hypothesis.
(7) Briefly explain how to fix the issue if your hypothesis turns out to be correct. This will be passed back to the previous AI model for it to implement the solution. Please explain in enough detail that the AI model can fix the issue without getting confused.
IMPORTANT: This task will be difficult and detailed. You should do an EXHAUSTIVE search of the codebase to look for issues. You should also think very carefully about what might be going wrong. It is expected that this may take you some time.
PREVIOUS MODEL CONTEXT The previous AI model working on solving this issue has provided information about it below. As a reminder, you should take their description of the issue and the facts surrounding it seriously, but you should not trust them. The fact that you are being called in to help suggests the previous model is likely to be mistaken about something important.
—
[Response from step 1 goes here]