Getting Started with Agents
AI agents are your coding partners. Describe what you want in natural language, and they generate the code for you.Natural Language
No coding required - just describe it
Real-Time Generation
Watch code appear instantly
Interactive
Refine through conversation
Context-Aware
Agents understand your full project
Your First Agent Interaction
Start with simple requests to get comfortable, then gradually try more complex features.
Writing Effective Prompts
The Formula
Good prompts include:- What you want to build
- How it should look or behave
- Which technologies to use (optional)
- Why specific requirements matter (optional)
Examples
- UI Components
- Layouts
- Features
Basic:
- “Create a button”
- “Create a primary button with rounded corners and an orange background”
- “Create a primary button with rounded corners, orange background (#F97316), white text, and a hover effect that darkens it slightly. Use Tailwind CSS.”
Prompt Patterns
Adding Features
- “Add a product card that displays an image, title, price, and ‘Add to Cart’ button”
- “Add a search bar that filters the product list in real-time as the user types”
- “Add a dark mode toggle that switches between light and dark themes”
Modifying Existing Code
- “Make the navigation bar sticky at the top when scrolling”
- “Make the hero section full height with content vertically centered”
- “Make all buttons have a subtle shadow and slight lift on hover”
Styling Changes
- “Change the primary color to #F97316 throughout the app”
- “Change the font to Inter and increase the base size to 16px”
- “Change the card backgrounds to white with a subtle border instead of shadows”
Debugging
- “Fix the bug where the form submits even with validation errors”
- “Fix the layout breaking on mobile screens below 640px”
- “Fix the TypeScript error in the UserProfile component”
Advanced Techniques
Referencing Existing Code
Mention Files
Mention Files
“Update the Button component in components/Button.tsx to use the new color scheme”
Reference Components
Reference Components
“Make the ProductCard component match the styling of the existing FeatureCard”
Specify Location
Specify Location
“Add a new component called Newsletter in the components/marketing folder”
Iterative Refinement
Build features gradually:Multi-Step Features
For complex features, break down the steps:Breaking down complex features helps the agent understand the full scope and build it correctly piece by piece.
Working with Different Agents
Stream Agent Workflow
1. Quick UI
Build visual components fast
2. Iterate Rapidly
Try different designs quickly
3. Refine Styling
Perfect colors, spacing, typography
4. Switch for Logic
Move to Iterative for functionality
Iterative Agent Workflow
1. Plan Feature
Describe the complete feature
2. Let It Think
Agent plans multi-step approach
3. Review Code
Check generated logic carefully
4. Test & Refine
Fix issues through conversation
Best Practices
Be Specific
Be Specific
Vague: “Make it look better”
Specific: “Increase the padding to 24px, use a softer shadow, and make the corners more rounded”More details = better results
Build Incrementally
Build Incrementally
Don’t: “Build a complete e-commerce site”
Do:
- “Create product card component”
- “Create product grid layout”
- “Add filtering controls”
- “Implement shopping cart”
Review Generated Code
Review Generated Code
- Always check what the agent created
- Look for potential issues
- Understand the code
- Test functionality
- Ask for explanations if unclear
Provide Feedback
Provide Feedback
- Tell the agent what worked
- Explain what didn’t work
- Give examples of desired behavior
- Ask for alternatives if needed
Learn as You Go
Learn as You Go
- Ask agents to explain code
- Request comments in complex sections
- Understand patterns used
- Build your own knowledge
Common Patterns
Building a Landing Page
Hero Section
“Create a hero section with headline, subheadline, CTA button, and background gradient”
Adding Functionality
Troubleshooting
Agent Doesn't Understand
Agent Doesn't Understand
Solutions:
- Rephrase your request
- Break it into smaller parts
- Provide examples or references
- Be more specific about requirements
- Try a different agent
Generated Code Has Errors
Generated Code Has Errors
Solutions:
- Point out the specific error
- Copy the error message to the agent
- Ask it to fix the issue
- Provide context about what should happen
- Test incrementally to catch errors early
Design Doesn't Match Vision
Design Doesn't Match Vision
Solutions:
- Provide reference images or URLs
- Be very specific about colors, spacing, fonts
- Use exact pixel values or Tailwind classes
- Iterate in small steps
- Ask for alternatives
Feature Too Complex
Feature Too Complex
Solutions:
- Break into smaller sub-features
- Build foundation first, add details later
- Switch to Iterative agent for complex logic
- Provide pseudocode or step-by-step plan
- Reference similar existing code