Prompt Engineering for Builders

Practical prompt patterns for product work — spec writing, user story generation, agent instruction design, and real-world templates you can copy and adapt today.

Anatomy of a Good Prompt

Great prompts aren't magic — they follow a structure. Every effective prompt has four components:

Component What It Does Example
Role Sets expertise level and perspective "You are a senior product manager..."
Context Provides background and constraints "We're building a SaaS app for small teams..."
Task States exactly what you need "Write a product spec for a feature that..."
Format Defines the output structure "Use markdown with headers, bullet points, and a table..."
The Four-Part Formula
ROLE: You are a {{role}} with expertise in {{domain}}.

CONTEXT: {{background about the project, users, constraints}}

TASK: {{specific action you need taken}}

FORMAT: Output as {{format}}. Include {{specific elements}}.
Keep it under {{length}} words. Use {{tone}} tone.
💡 Quick Tip: The more specific your context, the better the output. Include file paths, user types, tech stack, and constraints. AI agents work best when they know exactly what you're working with.

Essential Prompt Patterns

These are the patterns you'll use most often as a builder. Each one solves a specific type of problem.

1. The Expert Consultant SYSTEM PROMPT

Best for: Getting deep expertise on demand. Set up an agent to act as a specialist in any domain.

Expert Consultant Pattern
You are an expert {{domain}} consultant with 15+ years of experience.
You've worked with startups and enterprises. You give direct, actionable
advice — no fluff, no theory without examples.

When I ask a question:
1. First, clarify any ambiguities with 1-2 questions if needed
2. Give your recommendation with reasoning
3. Provide a concrete example or template
4. List potential pitfalls to avoid

Current project: {{brief description}}
My question: {{your question}}

2. The Critic REVIEW

Best for: Reviewing your work before shipping. Catches blind spots you can't see.

Critic Pattern
Review the following {{document type}} with a critical eye.

Look for:
- Logical gaps or inconsistencies
- Missing edge cases or scenarios
- Unclear language or ambiguous requirements
- Assumptions that should be stated explicitly
- Opportunities to simplify or restructure

For each issue found:
1. Quote the problematic section
2. Explain why it's an issue
3. Suggest a specific fix

Be direct and thorough. Don't sugarcoat.

{{paste your content here}}

3. The Transformer CONVERSION

Best for: Converting between formats — rough notes to structured docs, user feedback to requirements, etc.

Transformer Pattern
Transform the following {{input type}} into a {{output type}}.

Rules:
- Preserve all original meaning and intent
- Add structure where it's missing (headers, lists, tables)
- Remove redundancy and filler
- Use clear, professional language
- Keep the same level of detail — don't add or remove substance

Input:
{{paste rough notes, meeting transcript, or raw thoughts}}

Output format:
{{describe the desired structure}}

4. The Explainer LEARNING

Best for: Understanding new concepts, technologies, or codebases quickly.

Explainer Pattern
Explain {{concept/technology/code}} to me.

I am a {{your level — e.g., "mid-level developer who knows React but not Rust"}.

Requirements:
- Start with a one-paragraph overview
- Use analogies to things I already know
- Include a practical code example
- Explain the "why" — not just the "what"
- List the top 3 things I should know before using this
- Point me to the best resource for going deeper

Keep it under 800 words. Be specific, not generic.

Writing Specs with AI

Product specs are one of the highest-leverage things you can generate with AI. A good spec aligns your team, prevents scope creep, and gives agents clear instructions.

The Spec Template

Product Spec Prompt
Write a product spec for the following feature.

Context:
- Product: {{what you're building}}
- Users: {{who uses it}}
- Problem: {{what pain point this solves}}
- Constraints: {{tech stack, timeline, budget, etc.}}

The spec should include:
1. Overview — one paragraph summary
2. User Stories — 3-5 stories in "As a [user], I want [action] so that [benefit]" format
3. Requirements — functional requirements as a checklist
4. Non-Functional Requirements — performance, security, accessibility
5. Edge Cases — what could go wrong
6. Out of Scope — what we're explicitly NOT building
7. Success Metrics — how we'll know it worked
8. Open Questions — things we still need to figure out

Use clear, concise language. No marketing speak. Write for engineers.

Iterate on the Spec

Don't accept the first draft. Push back and refine:

Refinement Prompts
# Make it more specific
"This is too generic. Rewrite the requirements section with
specific technical details. Assume we're using {{tech stack}}.
Include API endpoints, data models, and error handling."

# Challenge assumptions
"Challenge the assumptions in this spec. What are we taking
for granted that might be wrong? What could we build instead
that solves the same problem with less complexity?"

# Add edge cases
"List 10 edge cases we haven't considered. Focus on:
- User error scenarios
- Data edge cases (empty, huge, malformed)
- Concurrent access issues
- Network failures and timeouts"
💡 Pro Tip: Save your best specs as templates. When you need a similar spec next time, start from the previous one and swap out the context. This compounds over time.

User Stories & Requirements

AI is excellent at generating user stories from rough ideas. The key is giving it enough context about your users and their pain points.

From Problem to Stories

User Story Generator
Generate user stories for a feature that {{describe feature}}.

Our users:
- Primary: {{describe primary user persona}}
- Secondary: {{describe secondary user persona}}
- Their biggest pain point: {{describe the problem}}

For each user type, generate:
1. Happy path stories (the main flow works perfectly)
2. Edge case stories (things go wrong)
3. Admin/operational stories (managing the feature)

Format each story as:
"As a [type of user], I want [action] so that [benefit]."

Add acceptance criteria for each story as a bullet list.

Prioritization Framework

Once you have stories, use AI to prioritize them:

Prioritization Prompt
Prioritize these user stories using the MoSCoW method:
- Must have (non-negotiable for launch)
- Should have (important but not critical)
- Could have (nice to have if time permits)
- Won't have (explicitly deferred)

Criteria for prioritization:
1. User impact — how many users does this affect?
2. Risk — what happens if we don't build this?
3. Dependencies — does this block other stories?
4. Effort — rough estimate (S/M/L)

{{paste your user stories here}}

Agent Instruction Design

Your agent's instructions (CLAUDE.md, .cursorrules, etc.) are prompts that run every session. They deserve the same care as any other prompt you write.

Structure Your Instructions

CLAUDE.md Template
# Project Context
Brief description of what this project is and who it's for.

# Tech Stack
- Frontend: {{framework}}
- Backend: {{framework}}
- Database: {{database}}
- Testing: {{framework}}

# Code Style
- Use {{language}} conventions
- Prefer {{pattern}} over {{alternative}}
- Naming: {{convention}}
- Imports: {{order}}

# Behavioral Rules
1. Always read the full file before making changes
2. Never delete code without explaining why
3. Ask before making destructive changes
4. Keep changes minimal and focused
5. Run tests after making changes

# Project-Specific Knowledge
- Key files and their purposes
- Important architectural decisions
- Common gotchas or quirks

Test Your Instructions

Before committing instructions, test them with real tasks:

  • Ask the agent to make a simple change — does it follow your rules?
  • Give it an ambiguous task — does it ask clarifying questions?
  • Ask it to do something destructive — does it check with you first?
  • Give it a complex task — does it break it into steps?
⚠️ Important: Agent instructions are living documents. Update them every time you notice the agent doing something you didn't intend. Each iteration makes it better.

Iteration & Refinement

The best prompts aren't written — they're evolved. Here's how to iterate effectively.

The Iteration Loop

  1. Write your first draft — don't overthink it, just get the structure down
  2. Test with a real task — use it on something you actually need done
  3. Identify gaps — what did the agent get wrong? What was missing?
  4. Add specificity — fill in the gaps with concrete examples and constraints
  5. Test again — repeat until the output is consistently good

Refinement Prompts

Common Refinement Prompts
# Make it shorter
"Condense this to half the length. Keep all key information
but remove examples and explanations that aren't essential."

# Make it more specific
"This is too generic. Rewrite it for {{specific context}}.
Include concrete examples from {{specific domain}}."

# Change the audience
"Rewrite this for {{audience}}. They know {{what they know}}
but not {{what they don't know}. Use {{tone}} tone."

# Add structure
"Restructure this with clear headers, bullet points, and
a summary table at the top. Make it scannable."
💡 The 80/20 Rule: A prompt that gets you 80% of the way there in 30 seconds is better than a perfect prompt that takes 10 minutes to write. Start rough, iterate fast.

Copy-Paste Templates

Here are ready-to-use templates for common builder tasks. Copy, fill in the blanks, and go.

Feature Brainstorm
I'm building {{product description}} for {{target users}}.

Brainstorm 10 feature ideas that would delight these users.
For each idea:
- Name (3-5 words)
- One-line description
- User value (why they'd care)
- Complexity estimate (S/M/L/XL)
- One-sentence implementation approach

Prioritize ideas that are high-value and low-complexity.
Competitive Analysis
Analyze the competitive landscape for {{product category}}.

Compare these competitors: {{list 3-5 competitors}}

For each, cover:
1. What they do well
2. Where they fall short
3. Their pricing model
4. Their target audience
5. What we could do differently

Present as a comparison table followed by a summary of
the biggest opportunity gap for a new entrant.
Release Notes
Write release notes for version {{version}} of {{product}}.

Changes in this release:
{{list your changes — can be rough bullet points}}

Format:
- Start with a one-paragraph summary
- Group changes by category (Features, Improvements, Fixes)
- Use active voice and user-benefit language
- Include a "What's Next" section with upcoming plans
- Keep it under 500 words
- Tone: professional but friendly
Onboarding Flow Design
Design an onboarding flow for {{product}}.

Our users: {{describe who signs up}}
Their goal: {{what they want to accomplish}}
Key "aha" moment: {{when they realize the value}}

Design a step-by-step onboarding that:
1. Gets them to the "aha" moment in under 2 minutes
2. Asks for minimal information upfront
3. Shows progressive disclosure of features
4. Includes helpful tooltips and examples
5. Has a clear success state

Output as a numbered flow with screen descriptions.

Common Mistakes to Avoid

Mistake Why It Fails Fix
Too vague Agent fills gaps with assumptions Add context, constraints, and examples
Too long Key instructions get lost in noise Use structure — headers, lists, sections
No format spec Output is inconsistent and hard to use Always specify output format explicitly
Negative-only rules Agent doesn't know what TO do State both what to do and what to avoid
One-shot thinking First draft is rarely the best Iterate — test, refine, test again
No examples Agent guesses at your standards Include 1-2 examples of good output
Ignoring context limits Agent forgets earlier instructions Put critical rules at the end (recency bias)
ℹ️ The Recency Effect: AI models pay more attention to instructions at the end of the prompt. Put your most important rules last. If you have a critical constraint like "never delete files," put it at the bottom, not buried in the middle.

✍️ Try It Now

Use Prompt Studio to write, test, and refine your prompts with live token counting and cost estimation.

Open Prompt Studio →