Decomposition
intermediateDefinition
Breaking a complex request into smaller, manageable pieces. Instead of asking for an entire feature at once, you split it into steps that each build on the last. This produces more reliable results because each step is easier to verify.
In the wild
Instead of 'Build a shopping cart,' decompose it: first ask for the data structure, then the add-to-cart function, then the total calculation, then the UI. Each piece is small enough to check before moving on.
More from Prompt Engineering Basics
Constraints
Boundaries you set on what the AI should or shouldn't do. Constraints prevent unwanted changes: like modifying files you didn't ask about, adding dependencies, or changing existing behavior.
Context Window
The amount of text an AI model can 'see' at once: your prompt, the conversation history, and any files it's reading. Think of it as the AI's working memory. If important information falls outside the window, the AI can't use it.
Example-Driven Prompting
Showing the AI a concrete example of the input and output you expect, rather than only describing it in words. Examples remove ambiguity because the AI can pattern-match on what you showed, not just what you said.
Iteration
Refining your results through follow-up prompts. Your first prompt rarely produces a perfect result. Iteration means reviewing what you got, identifying what's off, and asking for targeted adjustments rather than starting over.
Output Format
Telling the AI exactly how you want the result structured. Without format guidance, the AI picks its own layout. Specifying the format, a function, a JSON object, a bullet list, a code block, means less cleanup afterward.
Specificity
Being precise about exactly what you want. Instead of vague requests like 'fix the code,' a specific prompt names the file, function, and expected behavior. The more details you give, the less the AI has to guess.