Manual
EN / JA

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

  1. Click Prompt in the editor toolbar
  2. The prompt is copied to your clipboard
  3. Paste it into an AI chat (ChatGPT, Claude, Gemini, etc.)
  4. Describe what you want done in the What you want to do section at the end
  5. The AI returns a Pybes-compliant script

Prompt structure

Every generated prompt has six sections:

SectionContentWhat it tells the AI
1. InstructionsHow the AI should communicateAsk one question at a time, use plain language, return the full script, comment assumptions
2. I/O contractInput/output conventionsHow to read inputs, how to handle values, how to print output
3. Variable tableField definitionsName, type, and notes for each field (included only when fields are defined)
4. Coding rulesCode conventionsUse chardet for encoding detection, UTF-8 output, os.path.join, progress logging
5. EnvironmentRuntime detailsPython 3.12, available packages, reportlab font paths
6. What you want to doTask descriptionWhere the user writes what the script should accomplish

How the prompt changes based on fields

Field stateWhat’s in the prompt
No fieldsAI is free to define variables + sample data structures
Fields definedVariable 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:

SituationOpening messageButton 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

RuleWhy
Don’t mention internal filenamesThey’re hidden from users and would confuse them
When reporting problems, ask the user to share console outputThat’s the information needed to debug
Print messages in the user’s languageSo non-engineers can read them
Always use inputs[""] syntaxSo 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.