Best practices for AI prompts in Lightrun Autonomous Debugger¶
Effective prompt writing for the
Optimize prompt clarity¶
Writing effective prompts is key to improving the accuracy of the Autonomous Debugger. Before diving into the specifics of crafting your prompts, it’s important to first understand the intent behind your prompt. Clearly identifying what you want to achieve—whether it's locating a bug, tracing performance issues, or investigating configuration problems—will guide how you structure your prompt. Once you’ve clarified the goal, follow these guidelines to further optimize your prompts:
- Keep prompts concise: Shorter prompts generally yield better results.
✔️ Null pointer exception in UserService constructor. ❌ I think there's something wrong with the user service and it's throwing some errors, maybe in the constructor?
- Use terms from the codebase: This helps the debugger locate relevant files and context.
✔️ Issue in paymentController.java, line 45, related to processPayment function. ❌ Error in payment handling
- Include path information: If you know where the issue might be, specifying file paths can guide the debugger.
✔️ Error in /src/controllers/paymentController.js ❌ There’s an issue in the payment controller
- Emphasize the main issue: Clearly state the core problem or misbehavior so the AI can prioritize it.
✔️ Payment gateway fails to process with error code 500 ❌ Something is wrong with the payment
Improve debugger output¶
Enhance the debugger’s effectiveness with these strategies:
- Open relevant files: Open the files you suspect contain bugs to bring them into the debugger’s context.
- Refine unclear hypotheses: If the debugger focuses on secondary issues, rewriting your prompt to be more specific.
- Train through known bugs/Jiras: Practice prompt writing using known issues or Jira tickets to improve your communication style.
- Specify relevant subparts: If specific project components are relevant, mention them explicitly with paths or names.
- Provide more details: Include logs and stack traces to give the debugger additional context.
Last update: April 17, 2025