From bcda4150a7fd04307387795b0ff05cbca341ffcf Mon Sep 17 00:00:00 2001 From: rob Date: Sun, 7 Dec 2025 03:57:41 -0400 Subject: [PATCH] docs: Improve AI auto-adjust prompt with variable substitution guidance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the default prompt template to explain how to use variables: - Variables must be wrapped in curly braces: {variable} - Use triple quotes since content may contain quotes/newlines - Added example: my_var = """{response}""" This helps the AI generate code that works correctly with the variable substitution system. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/smarttools/ui_urwid.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/smarttools/ui_urwid.py b/src/smarttools/ui_urwid.py index bb6fc08..0408fd9 100644 --- a/src/smarttools/ui_urwid.py +++ b/src/smarttools/ui_urwid.py @@ -1831,7 +1831,10 @@ class SmartToolsUI: # Default prompt template for AI code generation/adjustment default_ai_prompt = f"""Write inline Python code (NOT a function definition) according to my instruction. -The code runs directly - variables are already available, no function needed. +The code runs directly with variable substitution. To use an available variable: +- Wrap the variable name in curly braces: {{variable}} +- Use triple quotes since the substituted content may contain quotes/newlines +- Example: my_var = \"\"\"{{response}}\"\"\" INSTRUCTION: [Describe what you want]