vibecode.sh
Blocks

Example

Provide examples to guide the AI response format and style

Example

The Example block demonstrates what you want through concrete input/output pairs. Instead of describing the desired format in abstract terms, you show it directly. Examples are one of the most powerful ways to guide AI behavior because they communicate expectations clearly and unambiguously.

When to Use

Use Example blocks when:

  • Specific format needed: Tables, lists, or custom structures
  • Style matters: Particular tone, voice, or writing style
  • Complex transformations: Show how input becomes output
  • Edge cases exist: Demonstrate how to handle unusual inputs
  • Words fail: When describing the format is harder than showing it
  • Consistency required: Multiple outputs should follow the same pattern

How to Use

  1. Add an Example block to your prompt canvas
  2. Provide one or more input/output pairs
  3. Choose examples that represent the typical case and important variations
  4. Format examples clearly so the pattern is obvious
  5. Place before asking for the actual output

Examples

Format Demonstration

Convert product features into benefit statements.

Example:
Input: "256GB storage capacity"
Output: "Store thousands of photos, videos, and apps without
worrying about running out of space"

Input: "12-hour battery life"
Output: "Power through your entire day on a single charge -
from morning meetings to evening entertainment"

Style Guide Example

Rewrite formal text in our brand voice (friendly, clear, slightly playful).

Example:
Input: "Users are advised to ensure their credentials are stored
in a secure location to prevent unauthorized access."
Output: "Keep your login details somewhere safe - you wouldn't
leave your house keys on the doorstep, right?"

Structured Output Example

Extract key information from job postings into a structured format.

Example:
Input: "We're looking for a Senior React Developer to join our
remote-first team. 5+ years experience required. Salary range
$150-180k. Must know TypeScript."

Output:
{
  "title": "Senior React Developer",
  "experience": "5+ years",
  "salary": "$150,000 - $180,000",
  "location": "Remote",
  "required_skills": ["React", "TypeScript"],
  "nice_to_have": []
}

Multiple Examples for Variations

Generate commit messages from code diffs.

Example 1 (bug fix):
Input: Fixed null pointer exception in user authentication
Output: fix(auth): handle null user object in login flow

Example 2 (new feature):
Input: Added dark mode toggle to settings page
Output: feat(settings): add dark mode toggle with system preference detection

Example 3 (refactor):
Input: Moved validation logic into separate utility functions
Output: refactor(utils): extract validation logic into reusable helpers

Edge Case Example

Convert names to title case.

Example (normal):
Input: "john smith"
Output: "John Smith"

Example (with particles):
Input: "ludwig van beethoven"
Output: "Ludwig van Beethoven"

Example (hyphenated):
Input: "mary-jane watson"
Output: "Mary-Jane Watson"

Tips

  • Start with a typical example: Show the common case first
  • Include edge cases: Demonstrate how to handle tricky inputs
  • Match complexity: Your examples should be similar in complexity to real inputs
  • Keep examples realistic: Use plausible data, not "foo" and "bar"
  • Show, do not tell: If you catch yourself explaining the example, the example might not be clear enough
  • Use 2-4 examples: One may be too few; more than four rarely adds value
  • Label your examples: "Example (edge case):" helps clarify purpose
  • Test with new inputs: Good examples generalize well to inputs the AI has not seen

On this page