Prompt generator
A structured prompt that makes AI chat models produce Python code that works in Pybes out of the box.
How to use it
- Click Prompt in the editor toolbar
- The prompt is copied to your clipboard
- Paste it into an AI chat (ChatGPT, Claude, Gemini, etc.)
- Describe what you want done in the What you want to do section at the end
- The AI returns a Pybes-compliant script
Prompt structure
Every generated prompt has six sections:
| Section | Content | What it tells the AI |
|---|---|---|
| 1. Instructions | How the AI should communicate | Ask one question at a time, use plain language, return the full script, comment assumptions |
| 2. I/O contract | Input/output conventions | How to read inputs, how to handle values, how to print output |
| 3. Variable table | Field definitions | Name, type, and notes for each field (included only when fields are defined) |
| 4. Coding rules | Code conventions | Use chardet for encoding detection, UTF-8 output, os.path.join, progress logging |
| 5. Environment | Runtime details | Python 3.12, available packages, reportlab font paths |
| 6. What you want to do | Task description | Where the user writes what the script should accomplish |
How the prompt changes based on fields
| Field state | What’s in the prompt |
|---|---|
| No fields | AI is free to define variables + sample data structures |
| Fields defined | Variable table + instructions to use any unused variables |
Consult prompt (for debugging)
Generated from the Consult button in the console. The content adapts to the situation:
| Situation | Opening message | Button color |
|---|---|---|
| Error detected | ”An error occurred. Please review the error and fix it.” | Red |
| No error detected | ”The script didn’t produce the expected result. Please identify the cause and fix it.” | Grey |
Either way, the prompt includes the console output, the script code, and the input values used.
Key rules embedded in the prompt
| Rule | Why |
|---|---|
| Don’t mention internal filenames | They’re hidden from users and would confuse them |
| When reporting problems, ask the user to share console output | That’s the information needed to debug |
| Print messages in the user’s language | So non-engineers can read them |
Always use inputs[""] syntax | So the app can auto-detect variables |
Prompt language
The prompt language follows your app’s language setting. An English app produces English prompts; a Japanese app produces Japanese ones.
Tip: The prompt language also shapes the AI’s responses. If Japanese is set, the AI replies in Japanese — which makes the whole experience feel natural for non-engineers.