๐Ÿ’ฌ

How to Talk to AI Coding Agents

Your results are only as good as your prompts. Learn the patterns that turn AI into a world-class coding partner โ€” no programming experience required.

๐Ÿ† The Golden Rule of Vibe Coding Prompts

Describe the WHAT, not the HOW. Tell the AI what you want the user to experience, not how to write the code. You're the product manager โ€” the AI is the developer.

โŒ Don't say:

"Create a useState hook for the email field and add an onChange handler that validates with regex"

โœ… Do say:

"Add an email field to the signup form that validates the email in real time and shows a red error message if it's invalid"

Prompt Templates You Can Copy

๐Ÿš€ Starting a New Project

Use this when creating something from scratch

Build a [type of app] that lets users [core action]. Key features: - [Feature 1 with specific behavior] - [Feature 2 with specific behavior] - [Feature 3 with specific behavior] Tech stack: [framework] with [styling] Style: [design description โ€” modern, minimal, colorful, etc.] Start with the main page and navigation.

Example:

"Build a recipe organizer that lets users save, search, and categorize their favorite recipes. Key features: add recipes with ingredients and steps, search by ingredient, filter by category (breakfast, lunch, dinner, dessert). Tech stack: Next.js with Tailwind CSS. Style: clean and modern with food-themed colors. Start with the main page and navigation."

โœจ Adding a Feature

Use this when adding something to an existing project

Add [feature name] to the [page/component]. What it should do: - [Behavior 1] - [Behavior 2] - [Edge case handling] It should match the existing design style. Make sure it works on mobile too.

๐Ÿ› Fixing a Bug

Use this when something isn't working right

There's a bug in [location/page/feature]: What happens: [describe current behavior] What should happen: [describe expected behavior] Steps to reproduce: [how to trigger the bug] Please fix this and explain what was wrong.

๐Ÿ”ง Improving Existing Code

Use this when things work but could be better

The [feature] works but needs improvement: Current problem: [what's not ideal] Desired improvement: [what you want instead] Keep the existing functionality working. Don't change [things that should stay the same].

๐ŸŽจ Designing a Page

Use this when you care about visual appearance

Design a [page type] page with the following sections: 1. [Section 1]: [description of what it shows] 2. [Section 2]: [description of what it shows] 3. [Section 3]: [description of what it shows] Design inspiration: [reference website or style] Colors: [color scheme or let AI choose] Make it responsive and include dark mode support.

Common Prompting Mistakes

๐ŸŽฏ

Being Too Vague

"Make the app better" gives AI nothing to work with.

Fix: "Add a loading spinner while data fetches, and show an empty state with helpful text when no results are found."

๐Ÿ“š

Asking for Everything at Once

"Build me a full e-commerce site with payments, inventory, user accounts, reviews, and a recommendation engine."

Fix: Break it into steps. Start with the product listing page, then add the cart, then checkout, etc.

๐Ÿ”„

Not Iterating

Expecting perfect results from a single prompt and starting over when it's not right.

Fix: Treat it as a conversation. Say "Good, but change the header color to blue and make the buttons bigger."

๐Ÿ—๏ธ

No Context About the Project

"Add a dashboard" without explaining what the app does or who it's for.

Fix: "This is a fitness tracking app for casual gym-goers. Add a dashboard that shows their weekly workout summary and progress toward goals."

โš™๏ธ

Micromanaging Implementation

"Use a for loop with index i from 0 to array.length to iterate over the items and create a div for each one."

Fix: "Display all the items in a grid layout with a card for each one showing the name, image, and price."

Best Practices

๐Ÿชœ Build in Layers

Start with the basic structure, then add styling, then add interactivity, then add edge cases. Each layer builds on the last.

๐Ÿ“ Reference What Exists

"Make the new settings page match the style of the existing profile page." Referencing existing work gives AI concrete examples to follow.

๐ŸŽญ Describe the User Experience

"When a user clicks Submit, show a loading state, then redirect to the dashboard with a success toast." Tell AI what the user sees and feels.

๐Ÿ” Ask AI to Explain

After AI generates code, ask "Explain what this code does in simple terms." Understanding builds confidence and helps you prompt better next time.

๐Ÿ“ Set Constraints

"Keep it simple โ€” no external libraries. Use only what's already installed." Constraints help AI make better choices and avoid over-engineering.

๐Ÿงช Request Tests

"Add tests for the checkout flow that verify the total calculation, coupon codes, and empty cart handling." Tests catch bugs before users do.

Advanced Prompting Patterns

The Specification Pattern

For complex features, write a mini-spec before asking AI to build:

Feature: User notifications - Users receive notifications for: new messages, friend requests, system alerts - Show unread count as a badge on the bell icon - Clicking opens a dropdown with the 10 most recent notifications - Each notification shows: icon, message, timestamp, read/unread status - Clicking a notification marks it as read and navigates to the relevant page - "Mark all as read" button at the bottom

The Role Pattern

Give AI a persona to improve output quality:

You are a senior frontend developer who specializes in accessible, performant React applications. Build a data table component that handles sorting, filtering, and pagination for up to 10,000 rows.

The Example Pattern

Show AI what you want by describing examples:

Build a card component similar to how Stripe's dashboard displays payment cards โ€” clean, minimal, with the amount prominently displayed, status as a colored badge, and date in relative format ("2 hours ago").

Level Up Your Prompting

Get weekly prompt templates and real-world examples in your inbox.

Follow Our Blog