Prompt Rules & Patterns

A shared folder with AI prompts and code snippets

From workspace: v0

Team: Main

Total snippets: 8

v0

Prompt Rules & Patterns

8 snippets

Add Context for Better Results

ive relevant background like app type, audience, or device.

Always add context: - What platform? (mobile, web, dashboard) - Who's the audience? (admin, customer) - What’s the goal? (signup, conversion) Context leads to better decisions in output.

Avoid Ambiguity

Avoid vague terms or assumptions, use precise language.

Replace vague phrases with clear, direct language. Bad: "Make this look nice." Good: "Apply Tailwind classes to create a card with rounded corners, a shadow, and 2rem padding."

Specify Inputs and Outputs

Explicitly define the format and structure for both inputs and expected results.

Prompt should define both: 1. What input format is expected. 2. What output format to return. Example: - Input: JSON object of user profile data. - Output: A formatted HTML profile card.

Use Constraints to Focus Output

Guide the assistant with limits like word count, file size, or tech stack.

Use constraints like: - Limit to 100 words. - Use only TailwindCSS. - No external libraries. These reduce hallucinations and improve precision.

Include Examples

Give one or more examples to guide the assistant’s behavior.

Provide at least one clear example to emulate. Example: Input: "Build a testimonial section." Example Output: ```html <section> ... </section>

Use Step By Step

Break down the task into logical steps to ensure better results from the AI.

Use step-by-step instructions for clarity: 1. Load the data from the API. 2. Clean the data and remove null values. 3. Format the result as a table with summary stats. Include bullets or numbering to make tasks easier to follow.

Define Clear Goals

Set a clear objective before writing any prompt.

Define a clear goal or output for this prompt. Avoid combining multiple unrelated tasks. Examples: ✅ Generate a blog post outline. ✅ Refactor this function to improve readability. ❌ Write a blog post and generate social media captions.

Chain Prompts for Multi-Step Tasks

Break multi-phase tasks into a sequence of smaller prompts.

Use chaining for multi-part workflows: Step 1: Generate component layout. Step 2: Add interaction logic. Step 3: Style with Tailwind. Keep each prompt focused and reusable.