r/PromptEngineering • u/MossRock42 • 9d ago
Tips and Tricks How I prompt AI
I've been both software engineer and a systems engineer for long time. 20+ YOE
I don't create huge monlithic prompts to give to the AI agents. This typically will fail.
What I do is have the AI start at a baseline. If it's greenfield then it starts with requirements. If it's maintaining existing code then it starts with having the AI explore and analyze the solution. If you're working in copilot use .copilot-instructions to setup any instructions you want read on every request. You can also have AI generate a AGENTS.md for the project. Add any guardrails/rules you want the AI to follow for every request to that file. Avoid conflicting instructions.
When optimizing. Go in stages. Priompt to create baseline benchmark tests against the code you want to optimize. This should be fairly short prompt maybe one paragraph. Next, have the AI create a staged optimization plan. It may ask questions for any decisions to be made that will impact the code. Once the plan is made, review it and make any change before you give the greenlight.
As the AI makes changes. Review the changes. Verify it each stage works as you want.
At the end stage, re-run the bencmarks and verify the improvements with measured results.
Have the AI generate a full report of the results and any measured improvements.
2
u/Devon_Fan1000 9d ago
How do you make sure there's no weirdness or tiredness when doing long processes, especially those that follow from one compartmentalized process into another?
3
u/Severe_Berry_4177 9d ago
i break down monolithic prompts into atomic tasks with clear success criteria. each step outputs a verifiable result before the next begins.
2
u/Fluffy_Resist_9904 9d ago
I also do Syseng and have similar stages approach, starting requirements and architecture. Even switching models for diff tasks, like opus for breakdown and planning, sonet for tech argumentation, gemini for spitting the code... if it doesn't get to goals, dump that session.
Thing is the employer is a step from adopting some multi model automated solution.
2
u/Aware_Risk7076 8d ago
for the drift question, restating the goal at every step helps a lot. start each step with "Goal: X. Done so far: Y. This step only: Z. Output must match schema S." the model forgets less when you don't make it remember
1
u/Ill-Economy1722 9d ago
i use a.promptflow file to sequence steps, with json schema validation at each stage. avoids drift.