Context-rich prompts
Understand the idea
"Fix my login" invites a generic essay. Naming expected behavior, constraints, and the failing surface gets help you can actually use.
Why vague prompts fail
A short is not automatically a clear one. "Fix my login" contains a topic and no failure. The model then optimizes for a common essay about authentication in general. That can be fluent and still useless for the cookie that never arrives.
AI Lab · prompt rewrite
"Fix my login" produced a generic essay
Vague prompt
Fix my login. It doesn't work.Poor output it produced
Authentication is an important part of modern applications. Consider using OAuth 2.0 with a trusted identity provider, hashing passwords with bcrypt, and adding multi-factor authentication. Here is a high-level checklist for secure login flows, session cookies, and JWT best practices...The pieces of a strong prompt
Pin four things: the symptom, expected versus actual behavior, the stack and failing surface, and constraints. Add what you already tried so the model does not replay dead ends. Those pieces turn a chat into something closer to a bug ticket an engineer could act on.
| Element | Vague | Usable |
|---|---|---|
| Symptom | login broken | 200 JSON ok, no Set-Cookie |
| Expected | make it work | redirect to /dashboard with wb_session |
| Stack | my app | Next.js route handler + cookie session helper |
| Constraints | none | keep cookies; no OAuth migration |
Constraints are part of the question
Without constraints, models "helpfully" propose migrations, new libraries, or greenfield rewrites. If you must keep the current session design, say so. Constraints are not rudeness; they are the shape of an acceptable answer.
Relevant code and errors beat summaries
Prefer exact error text and the smallest code that demonstrates the failure. Paraphrases lose the detail a model needs to stay aligned with your runtime. If a header is missing, say the header name. If a status code is wrong, say the number.
Check the reply against what you asked
When the answer arrives, score it against your prompt: did it respect constraints, address the stated symptom, and stay on the named stack? If not, the next message should correct the miss - not accept a polished digression.
Mental model
FOLLOW THE VALUE
Stop inventing bugs.
01 / 03Trace the transformation
Live example
Logs move from a vague ask to the ingredients of a usable prompt.
Your console output appears here.
Guided challenge
Name a real constraint
The third log says vibes. Change it to constraints.
Your console output appears here.
EXPECTED CONSOLE OUTPUT
fix my login expected Set-Cookie; actual 200 without cookie constraints stack usable-prompt
Hints 0/2
Use all hints or make 3 failed runs (0/3).
Free sandbox
Make a variation, test an assumption, or break the example on purpose. This draft is saved separately.
Your console output appears here.
Quiz
A quick check for understanding. Retry as often as you like; your learning path stays open.
Ready to call this one understood?
Mark this lesson complete to earn 100 XP. You can always revisit it.