Documentation Writing effective prompts

Writing effective prompts

The quality of your output depends heavily on how clearly you describe the task. These patterns consistently produce better results.

Be specific about what you want
Vague

"Make a button"

Specific

"Add a "Subscribe" button to the top-right of the navbar. It should be outlined with a primary color border, link to /auth, and shrink to an icon on mobile."

Describe the end state, not the steps
Vague

"Create a component, then add state, then add a click handler"

Specific

"Build a counter component that starts at 0, increments on click, and resets to 0 when it reaches 10."

Reference existing files
Vague

"Add authentication"

Specific

"Add a login form to the Auth page at src/pages/Auth.tsx. Use the same card style as the existing form on that page."

Scope changes carefully
Vague

"Redesign the whole app"

Specific

"Only change the landing page hero section. Don't touch other components."

Tip
If a change doesn't look right, describe what's wrong rather than asking Claude to "fix it". "The button is too wide on mobile — it should be full-width only below 640px" is much more actionable than "the button looks wrong".