Prompting Guide
Getting great results from AI depends heavily on how you communicate your needs. This guide covers best practices for effective prompting.
Core Principles
Be Specific
Instead of vague requests, provide concrete details about what you need.
✗ "Make a website"
✓ "Create a React landing page with a hero section, 3-column feature grid, and email signup form. Use Tailwind CSS."
Provide Context
Share relevant background information, existing code, or constraints.
✓ "I'm working on a Next.js 14 app with TypeScript. Here's my current auth setup: [code]. How can I add role-based access?"
State Desired Output
Specify the format and type of response you want.
✓ "Explain the trade-offs between SSR and SSG. Give me a bullet list comparison, then a brief recommendation."
Prompt Templates
Code Generation
Create a [language/framework] [component/function] that [does X]. It should [requirements]. Handle [edge cases].
Code Review
Review this code for [performance/security/best practices]. Focus on [specific areas]. Suggest improvements.
Debugging
I'm getting [error]. Here's my code: [code]. What I expected: [X]. What happened: [Y].
Architecture
Design a system for [use case] that handles [requirements]. Consider [constraints]. Compare approaches.
Advanced Techniques
- •Chain prompts: Break complex tasks into sequential steps
- •Provide examples: Show input/output pairs for pattern matching
- •Set constraints: Limit response length, format, or scope
- •Request reasoning: Ask the model to explain its approach
