惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
Webroot Blog
Webroot Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Threat Research - Cisco Blogs
V2EX - 技术
V2EX - 技术
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
Recorded Future
Recorded Future
S
Schneier on Security
I
InfoQ
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The GitHub Blog
The GitHub Blog
S
Security @ Cisco Blogs
O
OpenAI News
W
WeLiveSecurity
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
人人都是产品经理
人人都是产品经理
Cloudbric
Cloudbric
The Last Watchdog
The Last Watchdog
The Hacker News
The Hacker News
Google Online Security Blog
Google Online Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
NISL@THU
NISL@THU
T
Tailwind CSS Blog
V
Visual Studio Blog
PCI Perspectives
PCI Perspectives
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
D
DataBreaches.Net
B
Blog RSS Feed
N
News and Events Feed by Topic
N
News and Events Feed by Topic
H
Heimdal Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
腾讯CDC
Latest news
Latest news
V
Vulnerabilities – Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
WordPress大学
WordPress大学
V
V2EX
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Register - Security
The Register - Security
Help Net Security
Help Net Security

Supabase Blog

AI Agents Know About Supabase. They Don't Always Use It Right. Custom OIDC Providers for Supabase Auth 100,000 GitHub stars Supabase docs over SSH Navigating Regional Network Blocks Supabase Joins the Stripe Projects Developer Preview Log Drains: Now available on Pro Supabase Storage: major performance, security, and reliability updates Supabase incident on February 12, 2026 Hydra joins Supabase X / Twitter OAuth 2.0 is now available for Supabase Auth BKND joins Supabase Supabase is now an official Claude connector Supabase PrivateLink is now available Introducing: Postgres Best Practices When to use Read Replicas vs. bigger compute Introducing TRAE SOLO integration with Supabase Supabase Security Retro: 2025 Sync Stripe Data to Your Supabase Database in One Click Building ChatGPT Apps with Supabase Edge Functions and mcp-use Own Your Observability: Supabase Metrics API Introducing iceberg-js: A JavaScript Client for Apache Iceberg Introducing Supabase for Platforms Adding Async Streaming to Postgres Foreign Data Wrappers Build "Sign in with Your App" using Supabase Auth Introducing Seven New Email Templates for Supabase Auth The new Supabase power for Kiro Introducing Supabase ETL Introducing Analytics Buckets Introducing Vector Buckets Snap, Inc. Launches Snap Cloud, Powered by Supabase Triplit joins Supabase Supabase Series E 1000 Y Combinator Founders Choose Supabase gm 👋 web3, welcome aboard to Sign in with Web3 (Solana, Ethereum) Announcing the Supabase Remote MCP Server Enterprise speed, enterprise standards with Bolt Cloud + Supabase PostgREST 13 Lovable Cloud + Supabase: The Default Platform for AI Builders Processing large jobs with Edge Functions, Cron, and Queues Defense in Depth for MCP Servers OrioleDB Patent: now freely available to the Postgres community Supabase Launch Week 15 Hackathon Winner Announcement The Vibe Coder's Guide to Supabase Environments Testing for Vibe Coders: From Zero to Production Confidence The Vibe Coding Master Checklist Supabase Auth: Build vs. Buy Top 10 Launches of Launch Week 15 Supabase Launch Week 15 Hackathon Storage: 10x Larger Uploads, 3x Cheaper Cached Egress, and 2x Egress Quota Persistent Storage and 97% Faster Cold Starts for Edge Functions Algolia Connector for Supabase New Observability Features in Supabase Improved Security Controls and A New Home for Security Introducing Branching 2.0 Stripe-To-Postgres Sync Engine as standalone Library Supabase Analytics Buckets with Iceberg Support Create a Supabase backend using Figma Make Introducing JWT Signing Keys Supabase UI: Platform Kit Build a Personalized AI Assistant with Postgres Announcing Multigres: Vitess for Postgres Building on open table formats Open Data Standards: Postgres, OTel, and Iceberg Simplifying back-end complexity with Supabase Data APIs PostgreSQL Event Triggers without superuser access Top 10 Launches of Launch Week 14 Supabase MCP Server Data API Routes to Nearest Read Replica Declarative Schemas for Simpler Database Management Realtime: Broadcast from Database Keeping Tabs on What's New in Supabase Studio Edge Functions: Deploy from the Dashboard + Deno 2.1 Automatic Embeddings in Postgres Introducing the Supabase UI Library Supabase Auth: Bring Your Own Clerk Postgres Language Server: Initial Release Migrating from Fauna to Supabase Migrating from the MongoDB Data API to Supabase Dedicated Poolers Postgres as a Graph Database: (Ab)using pgRouting AI Hackathon at Y Combinator Calendars in Postgres using Foreign Data Wrappers Supabase Launch Week 13 Hackathon Winners How to Hack the Base! Running Durable Workflows in Postgres using DBOS database.build v2: Bring-your-own-LLM Restore to a New Project Hack the Base! with Supabase Top 10 Launches of Launch Week 13 Supabase Queues High Performance Disk Supabase Cron Supabase CLI v2: Config as Code Supabase Edge Functions: Introducing Background Tasks, Ephemeral Storage, and WebSockets Supabase AI Assistant v2 OrioleDB Public Alpha Executing Dynamic JavaScript Code on Supabase with Edge Functions ClickHouse Partnership, improved Postgres Replication, and Disk Management Live Share: Connect to in-browser PGlite with any Postgres client
Vibe Coding: Best Practices for Prompting
Prashant Sridharan · 2025-08-16 · via Supabase Blog

AI-powered tools like Lovable, Cursor, and Claude Code have transformed how we build software. You can now turn ideas into working applications by describing what you want in plain language. Instead of spending days on boilerplate setup and API configuration, you tell your AI assistant what you need and watch it build a working demo in minutes.

But there's a crucial skill that separates effective vibe coders from frustrated ones: knowing how to communicate with AI tools. A vague "make it look better" might produce unusable results, while a well-structured prompt generates clean, functional code that works in your specific context.

This guide shows you how to get the most out of AI coding assistants through effective prompting strategies, iterative refinement techniques, and systematic approaches that turn your ideas into deployable applications.

Your AI assistant isn't a mind reader. It's more like a skilled developer who just joined your project. It knows coding patterns, frameworks, and best practices, but it doesn't know your specific application, users, or the decisions you made in previous prompts.

The most effective vibe coders provide clear context rather than assuming the AI will "just know" what they want. Consider the difference between these prompts:

Vague: "Build me a login page" Specific: "Create a login form in React using Tailwind, connected to Supabase Auth, with error handling for expired tokens and social login options"

The first prompt is like asking a chef for "food" while the second gives specific ingredients and cooking instructions. The detailed prompt provides enough context for the AI to generate code that integrates properly with your existing stack.

Context accumulates throughout your coding session, but AI assistants usually start fresh with each new conversation. Successful vibe coders weave context into their prompts: "We have the login and task list working. Now implement filtering and archiving for completed tasks." This approach builds coherent applications rather than disconnected components.

The most effective prompts organize information into three distinct layers that give your AI assistant everything it needs to generate production-quality code:

Layer 1: Technical context and constraints Specify your stack, styling framework, and architectural patterns. This tells the AI how your code should look and behave within your existing project.

Layer 2: Functional requirements and user stories Describe what the feature does from a user's perspective, including specific behaviors and interactions.

Layer 3: Integration requirements and edge cases

Explain how this code connects with your existing application and handles real-world scenarios that separate demos from production-ready features.

Here's an example three-layer prompt for a todo item component:


_22

Create a TodoItem component with the following specifications:

_22

_22

Technical context:

_22

- React component using TypeScript

_22

- Styled with Tailwind CSS using our design system

_22

- Uses Lucide React icons for UI elements

_22

- Follows existing component patterns with proper props interface

_22

_22

Functional requirements:

_22

- Display todo text with completion checkbox

_22

- Show edit button that toggles inline editing mode

_22

- Include delete button with confirmation dialog

_22

- Visual distinction between completed and pending todos

_22

- Smooth transitions between view and edit modes

_22

_22

Integration and edge cases:

_22

- Integrates with Supabase for state management

_22

- Handle empty or whitespace-only todo text gracefully

_22

- Optimistic UI updates during API calls

_22

- Keyboard shortcuts: Enter to save, Escape to cancel

_22

- Loading states for delete and update operations

_22

- Prevent double-clicks on action buttons


This structure eliminates guesswork and reduces back-and-forth iterations. Instead of getting generic code that needs extensive modification, you receive functionality that's much closer to your requirements on the first attempt.

Even well-structured prompts rarely produce perfect code on the first try, and that's normal. The power of vibe coding lies in rapid iteration cycles that let you refine and improve code in real time.

Think of AI-generated code as a solid first draft that you sculpt into exactly what you need. Follow this cycle:

Prompt → Review → Ask for explanation/refactor → Build next step

This approach helps you uncover blind spots, add necessary improvements, and gradually transform demo code into production-ready functionality.

The "what could go wrong?" technique#

Even detailed prompts can miss edge cases. Use this follow-up prompt to identify potential issues:


_10

What could go wrong with this code? What edge cases should I handle?


For example, if your AI generates a function to fetch blog posts from an API, this follow-up might reveal the need to handle empty responses, invalid JSON, network timeouts, or missing data fields. The AI can then refactor the code to address these scenarios.

Security-focused iteration#

Security gaps often slip through initial code generation. Ask directly about security considerations:


_10

What security best practices should I follow with this code? How should I handle authentication and sensitive data?


This might surface recommendations about storing API keys in environment variables, implementing rate limiting, or adding input validation to prevent injection attacks.

Use your AI assistant as both a code generator and a teaching tool. Instead of accepting code at face value, ask it to explain its decisions:


_10

Why did you choose this approach over alternatives? What are the trade-offs?


This forces the AI to articulate its reasoning and helps you understand the implications of different implementation choices.

You can also ask the AI to predict deployment issues before you encounter them:


_10

If I deploy this code to production with Supabase, what potential problems should I watch for?


This might reveal important considerations like enabling Row Level Security, adding password complexity rules, or implementing proper error logging.

Put the AI into "self-review mode" to catch issues proactively:


_10

Review this code as if it's going live tomorrow. Identify security concerns, performance bottlenecks, and missing error handling. Suggest specific improvements.


Once you understand the three-layer structure and iterative refinement, certain patterns emerge. Here are templates for common vibe coding scenarios:

Data modeling template#


_18

Technical context:

_18

- Database: [Supabase/PostgreSQL/etc.]

_18

- Language/Framework: [TypeScript/Python/etc.]

_18

- Constraints: [Naming conventions, relationship patterns]

_18

_18

Data requirements:

_18

- Entity: [Name and purpose]

_18

- Core fields: [Essential fields with types]

_18

- Relationships: [Connections to other entities]

_18

- Business rules: [Validation requirements, constraints]

_18

_18

Integration considerations:

_18

- Data validation: [Required fields, format requirements]

_18

- Performance: [Indexing needs, query patterns]

_18

- Security: [Access control, sensitive data handling]

_18

- Migration: [How this fits with existing schema]

_18

_18

Create a data model for [specific use case].


Follow-up prompts:

  • "Explain your column and index choices"
  • "What queries will be slow at scale? Suggest optimizations"
  • "Show me how to seed example data and query it with Supabase"

API endpoint template#


_21

Technical context:

_21

- Framework: [Express/Next.js API routes/FastAPI/etc.]

_21

- Authentication: [JWT/session-based/API keys]

_21

- Data layer: [Database ORM, external APIs]

_21

- Response format: [JSON structure preferences]

_21

_21

Endpoint specification:

_21

- Method and route: [GET/POST/etc.] /api/[path]

_21

- Purpose: [What this endpoint accomplishes]

_21

- Request format: [Body structure, query params, headers]

_21

- Response format: [Success and error responses]

_21

- Business logic: [Key operations and validations]

_21

_21

Integration and edge cases:

_21

- Authentication: [Access control, permission levels]

_21

- Validation: [Input sanitization, required fields]

_21

- Error handling: [Specific error scenarios and responses]

_21

- Rate limiting: [Protection against abuse]

_21

- External dependencies: [Third-party APIs, database queries]

_21

_21

Create an API endpoint that [specific functionality].


UI component template#


_21

Technical context:

_21

- Framework: [React/Vue/Angular/etc.]

_21

- Styling: [Tailwind/CSS modules/styled-components]

_21

- State management: [useState/Zustand/Redux]

_21

- Icon library: [Lucide/Heroicons/etc.]

_21

_21

Component specification:

_21

- Purpose: [What this component does]

_21

- Props interface: [Expected props with types]

_21

- User interactions: [Clicks, hovers, keyboard events]

_21

- Visual states: [Loading, error, empty, success states]

_21

- Accessibility: [ARIA labels, keyboard navigation]

_21

_21

Integration considerations:

_21

- Parent integration: [How it fits in the app]

_21

- Performance: [Memoization, lazy loading needs]

_21

- Error boundaries: [Failure handling]

_21

- Mobile responsiveness: [Breakpoint considerations]

_21

- Testing: [Key behaviors to verify]

_21

_21

Create a [component name] component that [specific functionality].


These templates work because they mirror how AI needs to reason about code. They provide technical constraints, functional objectives, and real-world considerations upfront, leading to more accurate initial results.

Why context matters more than cleverness#

AI coding assistants are pattern matchers trained on clean, happy-path code examples. They default to what looks most common: functional snippets that work under typical conditions. Edge cases and security considerations are called "edge cases" because they appear less frequently in training data.

Unless you explicitly prompt for comprehensive error handling, security measures, and edge case management, the AI will generate "good enough to run" code rather than "ready for production" code.

This is why structured prompting isn't optional for serious vibe coding. The three-layer approach, iterative refinement, and explicit requests for security and error handling transform AI from a demo generator into a collaborative development partner.

Effective vibe coding requires more than good prompts; it needs the right infrastructure. Supabase provides an ideal foundation for AI-generated applications with its integrated Postgres development platform.

When your AI assistant generates code that needs user authentication, database operations, file storage, or real-time features, Supabase handles these requirements seamlessly. Your prompts can focus on business logic while Supabase manages the complex backend infrastructure that typically causes integration headaches.

The platform's instant APIs, built-in authentication, and real-time subscriptions work together cohesively, eliminating the need to stitch together multiple services. Whether you're building with Lovable, Replit, or any other AI coding tool, Supabase provides the production-ready backend that scales with your vibe-coded applications.

Ready to put these prompting techniques into practice? Supabase gives you the integrated backend platform that works seamlessly with your favorite AI coding tools. Start building with Supabase and turn your next idea into a production-ready application.