04) Techniques to help refine AI agent output - Coding-With-The-Force/Salesforce-Cursor-IDE-Claude-AI-Setup-Guide GitHub Wiki

Using Markdown Files to define rules in prompts

We already discussed this in the previous section in much greater detail, but the gist of it is, use markdown to easily create context for your prompts that's simple to tweak and easy to reuse over and over. Don't make them overly verbose as it will actually eventually hurt your output and cause you to spend way more money than you'd like to.

An example of a markdown file I use in prompts to help make sure my agent writes code that adhere's to the Apex Common Library is located here: Apex Common Library Guide Markdown File


Inviting the AI to ask you refining questions prior to building the application

This is the single greatest trick I found online. Ask the agent to ask you questions about their task! It's important, you would ask refining questions to a product owner who assigned you the task right? Why not let the agent ask you refining questions? It improves the output 10 fold imo. I love it so much I put it in my user rules for cursor. I normally write the prompt to ask me questions like so, "Ask me up to 15 questions to help clarify any confusion you have about the code you're about to write".


Setting up MCP Servers

We talked about how to setup the Salesforce MCP server in great detail here , but this is useful for any tool/platform you may want to integrate to grant your AI greater context. Check out other MCP Servers (like JIRA, Asana, etc) and use them to refine your context even more. This makes an enormous difference in your output.


Setting up multiple AI agents to play the role of a business analyst, developer, and a tester

This is something I have limited experience testing, and quite frankly is expensive, but from my preliminary testing using a multi-agent workspace, spawning multiple AI agents to play different roles and check each others work does make the code marginally better (maybe 5% more reliable on average), but this is more complicated, not cheap, and I'm admittedly still exploring this. When I have tested this more and refined it a bit more I will make updates to this wiki.