gpt-engineer — Prompts
Prompt 1: Clarification Prompt
Source: gpt_engineer/preprompts/clarify
Technique: Minimal clarification gate — asks exactly ONE question if ambiguous. The "Nothing to clarify" escape prevents unnecessary questions.
Given some instructions, determine if anything needs to be clarified, do not carry them out.
You can make reasonable assumptions, but if you are unsure, ask a single clarification question.
Otherwise state: "Nothing to clarify"
This is a masterclass in minimal prompting — 3 lines that implement a gating mechanism. The key constraint is "a single clarification question" — preventing the common failure of agents that ask 10 questions before starting.
Prompt 2: Main Generation Prompt
Source: gpt_engineer/preprompts/generate
Technique: Step-by-step generation with completeness mandate and explicit failure mode prevention ("No placeholders")
Think step by step and reason yourself to the correct decisions to make sure we get it right.
First lay out the names of the core classes, functions, methods that will be necessary, As well as a quick comment on their purpose.
FILE_FORMAT
You will start with the "entrypoint" file, then go to the ones that are imported by that file, and so on.
Please note that the code should be fully functional. No placeholders.
Follow a language and framework appropriate best practice file naming convention.
Make sure that files contain all imports, types etc. The code should be fully functional. Make sure that code in different files are compatible with each other.
Ensure to implement all code, if you are unsure, write a plausible implementation.
Include module dependency or package manager dependency definition file.
Before you finish, double check that all parts of the architecture is present in the files.
When you are done, write finish with "this concludes a fully working implementation".
Note the FILE_FORMAT placeholder — this is dynamically replaced with the file format specification from gpt_engineer/preprompts/file_format.
The "this concludes a fully working implementation" ending is a completion signal that the agent must produce.
Prompt 3: Philosophy / Coding Preferences
Source: gpt_engineer/preprompts/philosophy
Technique: Persistent preferences injection — the "remember things between projects" mechanism.
Almost always put different classes in different files.
Always use the programming language the user asks for.
For Python, you always create an appropriate requirements.txt file.
For NodeJS, you always create an appropriate package.json file.
Always add a comment briefly describing the purpose of the function definition.
Add comments explaining very complex bits of logic.
Always follow the best practices for the requested languages for folder/file structure and how to package the project.
Python toolbelt preferences:
- pytest
- dataclasses
Organizations override this file with their own preferences.
Prompting Techniques Used
- Staged generation: clarify → plan → generate → verify — explicit phases prevent jumping to code
- Minimal clarification gate: "ask at most ONE question or say Nothing to clarify" — prevents paralysis
- Completeness mandate: "No placeholders" + "fully functional" enforced in prompt, not just documentation
- Entrypoint-first ordering: generation follows import graph, not arbitrary file order
- Completion signal: "this concludes a fully working implementation" — a termination signal the runner can detect
- Preferences file: Persistent coding philosophy/preferences separate from per-request instructions