From be60f8c03be40e691276df51ee4aef9764e34ffb Mon Sep 17 00:00:00 2001 From: juanmichelini Date: Wed, 17 Dec 2025 17:57:57 -0300 Subject: [PATCH 1/4] Add 'Visualize the Target' pattern - New pattern focusing on avoiding negation in AI prompts - Explains why positive framing is more effective than negative - Includes examples for code generation and image generation - Solves selective-hearing and compliance-bias obstacles Co-authored-by: openhands --- documents/patterns/visualize-the-target.md | 43 ++++++++++++++++++++++ documents/relationships.mmd | 2 + website/config/authors.yaml | 3 ++ 3 files changed, 48 insertions(+) create mode 100644 documents/patterns/visualize-the-target.md diff --git a/documents/patterns/visualize-the-target.md b/documents/patterns/visualize-the-target.md new file mode 100644 index 0000000..63a7fbe --- /dev/null +++ b/documents/patterns/visualize-the-target.md @@ -0,0 +1,43 @@ +--- +authors: [juanmichelini] +--- + +# Visualize the Target + +## Problem +Negation is cognitively difficult to process and often counterproductive. When you tell AI what you *don't* want, you're first making it think about the unwanted thing, then asking it to avoid it. This creates mental overhead and can actually increase the likelihood of getting what you're trying to avoid. + +The same principle applies beyond code generation - in image generation, "Create a picture of a room with no elephants" is more likely to produce a room with elephants than simply saying "Create a room." + +## Pattern +Instead of describing what you don't want, directly describe what you do want. Transform negative instructions into positive ones by focusing on the desired outcome. + +**Transform negations:** +- "Don't use global variables" → "Use local variables and parameter passing" +- "Don't make the function too complex" → "Keep the function simple and focused on a single responsibility" +- "Don't write comments" → "Write self-documenting code with clear variable and function names" +- "Don't use nested loops" → "Use helper functions or built-in methods like map/filter" +- "Don't hardcode values" → "Use configuration files or constants" + +**For prompts:** +- "Don't generate verbose code" → "Generate concise, minimal code" +- "Don't use deprecated methods" → "Use current best practices and modern APIs" +- "Don't create security vulnerabilities" → "Follow secure coding practices" + +## Example + +**Instead of:** +``` +"Create a user authentication system. Don't store passwords in plain text, don't use weak encryption, don't forget input validation, and don't make it vulnerable to SQL injection." +``` + +**Use:** +``` +"Create a secure user authentication system that hashes passwords with bcrypt, validates all inputs, uses parameterized queries, and follows OWASP security guidelines." +``` + +**Image generation example:** +- ❌ "Generate a clean office space with no clutter, no personal items, and no distracting elements" +- ✅ "Generate a minimalist office space with a clean desk, organized shelving, and professional lighting" + +The positive framing gives AI a clear target to aim for rather than a list of things to mentally juggle and avoid. \ No newline at end of file diff --git a/documents/relationships.mmd b/documents/relationships.mmd index 919ccd9..5ae1098 100644 --- a/documents/relationships.mmd +++ b/documents/relationships.mmd @@ -54,6 +54,8 @@ graph LR patterns/habit-hooks -->|solves| obstacles/context-rot patterns/hooks -->|solves| obstacles/selective-hearing patterns/reminders -->|solves| obstacles/selective-hearing + patterns/visualize-the-target -->|solves| obstacles/selective-hearing + patterns/visualize-the-target -->|solves| obstacles/compliance-bias %% Pattern → Pattern relationships (enables, uses, similar, alternative) patterns/reference-docs -->|enables| patterns/knowledge-composition diff --git a/website/config/authors.yaml b/website/config/authors.yaml index b5b5713..854f009 100644 --- a/website/config/authors.yaml +++ b/website/config/authors.yaml @@ -14,3 +14,6 @@ nitsan_avni: steve_kuo: name: Steve Kuo github: kuoman +juanmichelini: + name: Juan Michelini + github: juanmichelini From 78530bbbf8c4becbae460c58c863390f05b3eb58 Mon Sep 17 00:00:00 2001 From: juanmichelini Date: Wed, 17 Dec 2025 18:06:03 -0300 Subject: [PATCH 2/4] Update visualize-the-target pattern relationships - Remove compliance-bias relationship - Add limited-context-window and limited-focus relationships - Keep selective-hearing relationship Co-authored-by: openhands --- documents/relationships.mmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documents/relationships.mmd b/documents/relationships.mmd index 5ae1098..8622574 100644 --- a/documents/relationships.mmd +++ b/documents/relationships.mmd @@ -55,7 +55,8 @@ graph LR patterns/hooks -->|solves| obstacles/selective-hearing patterns/reminders -->|solves| obstacles/selective-hearing patterns/visualize-the-target -->|solves| obstacles/selective-hearing - patterns/visualize-the-target -->|solves| obstacles/compliance-bias + patterns/visualize-the-target -->|solves| obstacles/limited-context-window + patterns/visualize-the-target -->|solves| obstacles/limited-focus %% Pattern → Pattern relationships (enables, uses, similar, alternative) patterns/reference-docs -->|enables| patterns/knowledge-composition From 45caf455f994d3ddb59f65da18c0f50cfbce39b7 Mon Sep 17 00:00:00 2001 From: juanmichelini Date: Wed, 17 Dec 2025 18:10:48 -0300 Subject: [PATCH 3/4] Update visualize-the-target.md --- documents/patterns/visualize-the-target.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documents/patterns/visualize-the-target.md b/documents/patterns/visualize-the-target.md index 63a7fbe..3e147d3 100644 --- a/documents/patterns/visualize-the-target.md +++ b/documents/patterns/visualize-the-target.md @@ -5,7 +5,7 @@ authors: [juanmichelini] # Visualize the Target ## Problem -Negation is cognitively difficult to process and often counterproductive. When you tell AI what you *don't* want, you're first making it think about the unwanted thing, then asking it to avoid it. This creates mental overhead and can actually increase the likelihood of getting what you're trying to avoid. +When you tell an AI that you *don't* want a thing, you're first activating context related to a thing, then asking it to avoid that thing. This creates an overhead and can increase the likelihood of getting what you're trying to avoid. The same principle applies beyond code generation - in image generation, "Create a picture of a room with no elephants" is more likely to produce a room with elephants than simply saying "Create a room." @@ -40,4 +40,4 @@ Instead of describing what you don't want, directly describe what you do want. T - ❌ "Generate a clean office space with no clutter, no personal items, and no distracting elements" - ✅ "Generate a minimalist office space with a clean desk, organized shelving, and professional lighting" -The positive framing gives AI a clear target to aim for rather than a list of things to mentally juggle and avoid. \ No newline at end of file +The positive framing gives AI a clear target to aim for rather than a list of things to juggle and avoid. From 689fb70fd901985e437e0d7b96bdb589b94ed4f9 Mon Sep 17 00:00:00 2001 From: juanmichelini Date: Wed, 17 Dec 2025 18:14:08 -0300 Subject: [PATCH 4/4] Update visualize-the-target.md --- documents/patterns/visualize-the-target.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/patterns/visualize-the-target.md b/documents/patterns/visualize-the-target.md index 3e147d3..c9de890 100644 --- a/documents/patterns/visualize-the-target.md +++ b/documents/patterns/visualize-the-target.md @@ -10,7 +10,7 @@ When you tell an AI that you *don't* want a thing, you're first activating conte The same principle applies beyond code generation - in image generation, "Create a picture of a room with no elephants" is more likely to produce a room with elephants than simply saying "Create a room." ## Pattern -Instead of describing what you don't want, directly describe what you do want. Transform negative instructions into positive ones by focusing on the desired outcome. +Instead of describing what you don’t want, directly describe what you do want. Visualize the target we are aiming for. Transform negative instructions into positive ones by focusing on the desired outcome. **Transform negations:** - "Don't use global variables" → "Use local variables and parameter passing"