DEV Community

Cover image for How to Write AI Prompts That Actually Work: 4 Game-Changing Tips
its_hayder
its_hayder

Posted on

How to Write AI Prompts That Actually Work: 4 Game-Changing Tips

1. Start with a Clear Goal

This is the “what do you want?” part. It sounds simple, but I used to just throw in half-baked questions and hope for gold. Spoiler alert: didn’t work. Now I start every prompt with a single, clear objective. For example, instead of saying:
“Can you help me find hikes?”
I write:

“I want a list of the best medium-length hikes within two hours of San Francisco that are lesser-known and offer a cool and unique adventure.”
Boom. Now the AI knows exactly what I want.

2. Specify the Return Format

This part was a game-changer for me. You need to tell the AI how you want the information delivered. For example, I might say:
“For each hike, include the name, starting address, ending address, hike distance, drive time, hike duration, and what makes it unique. Return the top 3.”
That’s like giving the AI a blueprint—it’s not guessing, it’s following your structure.

3. Set Warnings or Guardrails

Accuracy matters. Especially if you're sharing this info with someone else. That’s why I also write little reminders like:
“Make sure the name of the trail is correct, that it exists, and that the time is accurate.”
These act as safety checks and keep the AI from hallucinating or giving bad info (which can totally happen).

4. Include Context—Even If It Feels Like Oversharing

This was the part I used to skip and it’s where the magic happens. The more personal context you give, the more tailored and human the AI’s response feels.
In my case, I wrote a whole paragraph explaining how my girlfriend and I love hiking, that we’ve done all the major SF trails, and that we’re craving something new because she’s leaving for LA soon and we want to make this weekend count.
I even mentioned how much I love hikes that end with a good breakfast. I thought I was just rambling, but it made a huge difference. The AI came back with hikes that felt like they got me not just random generic trails.

Top comments (3)

Collapse
 
elliot101 profile image
Elliot

amazing , thanks

Collapse
 
itshayder profile image
its_hayder

Glad you liked it

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

pretty cool seeing how much difference these tweaks actually make for prompts you think it ever gets too detailed or is more always better

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more