Skip to main content
The quality of your instructions directly impacts the quality of OpenHands’ output. This guide shows concrete examples of good and bad prompts, explains why some work better than others, and provides principles for writing effective instructions.

Concrete Examples of Good/Bad Prompts

Bug Fixing Examples

Bad Example

Why it’s bad:
  • No information about what the bug is
  • No indication of where to look
  • No description of expected vs. actual behavior
  • OpenHands would have to guess what’s wrong

Good Example

Why it works:
  • Specific file and line number
  • Exact error message
  • Clear expected vs. actual behavior
  • Suggested approach for the fix

Feature Development Examples

Bad Example

Why it’s bad:
  • Scope is too large and undefined
  • No details about authentication requirements
  • No mention of existing code or patterns
  • Could mean many different things

Good Example

Why it works:
  • Specific, scoped feature
  • Clear technical requirements
  • Points to existing patterns to follow
  • Defines what “done” looks like

Code Review Examples

Bad Example

Why it’s bad:
  • No code provided or referenced
  • No indication of what to look for
  • No context about the code’s purpose
  • No criteria for the review

Good Example

Why it works:
  • Clear scope and focus areas
  • Important context provided
  • Business implications explained
  • Requested output format specified

Refactoring Examples

Bad Example

Why it’s bad:
  • “Better” is subjective and undefined
  • No specific problems identified
  • No goals for the refactoring
  • No constraints or requirements

Good Example

Why it works:
  • Specific problems identified
  • Clear constraints and requirements
  • Points to patterns to follow
  • Measurable success criteria

Key Principles for Effective Instructions

Be Specific

Vague instructions produce vague results. Be concrete about:

Provide Context

Help OpenHands understand the bigger picture:
Example with context:

Set Clear Goals

Define what success looks like:
Example with clear goals:

Include Constraints

Specify what you can’t or won’t change:

Common Pitfalls to Avoid

Vague Requirements

Missing Context

Unrealistic Expectations

Incomplete Information

Best Practices

Structure Your Instructions

Use clear structure for complex requests:

Provide Examples

Show what you want through examples:

Define Success Criteria

Be explicit about what “done” means:

Iterate and Refine

Build on previous work:

Quick Reference

The investment you make in writing clear instructions pays off in fewer iterations, better results, and less time debugging miscommunication. Take the extra minute to be specific.