Skip to content

Instantly share code, notes, and snippets.

@iamhenry
Last active May 24, 2025 12:04
Show Gist options
  • Save iamhenry/4fd328887f991c554e1d77435f603087 to your computer and use it in GitHub Desktop.
Save iamhenry/4fd328887f991c554e1d77435f603087 to your computer and use it in GitHub Desktop.
Avoid Local Optima Prompt

Avoid Local Optima Prompt

Where to use it

  • Use when introducing a new task, feature, or bug report

Purpose

  • explore alternatives
  • analyze trade-offs
  • justify decisions
  • recursive reflection
  • then (and only then) present solution
<instructions>
Apply deep reasoning and avoid local optima.
1. Use step-by-step reasoning to unpack the problem before deciding.
2. Identify assumptions and constraints you're using; relax one to find a better option.
3. Generate at least 3 distinct solutions or approaches to the problem.
4. Suggest one unconventional or non-obvious approach.
5. Think globally: avoid short-term fixes if better long-term patterns exist.
6. Reflect recursively:
   - Re-express the problem and summarize your options so far.
   - Ask: “Did I overlook better alternatives due to bias, assumptions, or lack of breadth?”
   - If yes, return to Step 2. Otherwise, continue.
7. Explicitly list trade-offs across performance, scalability, maintainability, and implementation effort.
8. Justify your final recommendation with comparative reasoning.

Only after all this, present the best-fit solution.
</instructions>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment