You're probably undercutting your AI tool. Most developers I know treat their AI assistant like a search engine — sloppy queries, vague requests, then act surprised when the output is mediocre. But here's the thing: AI coding assistants respond to specificity like a good barista responds to clear orders.
The Problem with "Generic Prompt Syndrome"
When you say "write a function that parses JSON," you get a vanilla function that technically works. When you say "write a function that parses deeply nested JSON from an API response but ignore null values and log warnings for missing required fields," you get something actually useful.
I tested this with Claude and GitHub Copilot. Same codebase. Same task. The specific prompt gave me production-ready code I could basically ship. The vague one? Boilerplate I'd rewrite anyway.
What Actually Works
1. Give Context About Your Stack
Don't say: "How do I optimize this database query?"
Say: "I have a PostgreSQL table with 10M rows, indexed on user_id. I'm fetching all orders for a user and filtering client-side by date range. That's slow. Using Node.js with Prisma. Show me how to push the date filter to the database."
Now it knows your constraint (Prisma), your problem (N+1-ish behavior), your data size. Different answer entirely.
2. Show Your Constraints
"Write a React component" is a choose-your-own-adventure nightmare.
"Write a React component that shows a list of posts, works without JavaScript enabled, and keeps a filtered view in the URL so people can share search results" — now there's a real task.
3. Include Bad Code If You Have It
Paste your actual attempt. Explain what's broken. AI will debug the real problem, not write the ideal version from scratch (which you didn't want anyway).
"I tried this approach but it's hanging on large datasets" + your code is worth 10x more than "make it faster."
4. Specify Output Format
This one's stupid simple but everyone forgets it.
Instead of: "Give me a regex for email validation"
Write: "Give me a JavaScript regex for email validation that catches 99% of real emails but isn't RFC-compliant. Include test cases."
You get regex + examples + explanation of the tradeoff. You knew what you wanted; you just didn't ask.
Real Example: From Vague to Useful
Bad prompt:
Write a function to validate user input
Better:
I have a form that collects a product name (1-100 chars, alphanumeric + spaces only) and a price (positive number, max 4 decimals). Write a validation function in TypeScript that returns an object with
isValidanderrorsarray. Use practical error messages, not technical jargon.
That second one? I got exactly what I needed. Took 30 seconds to write the prompt instead of 5 minutes tweaking generated code.
The Mindset Shift
Your AI assistant isn't a magic box. It's a very fast junior dev who needs clear requirements. The better your requirements, the better the code.
This applies to ChatGPT, Claude, Copilot, whatever. The tool changes; the principle doesn't.
Quick wins for your next session:
- Paste your actual code instead of describing it
- Mention your framework, language version, and any weird constraints
- Say what you've already tried
- Define "better" — faster? More readable? Less dependencies?
You're probably leaving 30-40% of your AI assistant's potential on the table right now. This is how you get it back.
Want weekly breakdowns of what's actually working in AI and productivity? Check out LearnAI Weekly — curated insights for developers who actually build stuff.
Top comments (0)