Strategies

High-Value Prompting Strategies

The best prompt pattern depends on the job. Below are the main strategies that matter most in real engineering usage.

Role prompting

Use this when expertise matters. It helps set the right perspective, vocabulary, and level of analysis.

Few-shot prompting

Give one or two examples when you want consistency. This is useful for code review formats, naming conventions, JSON structure, and data extraction tasks.

Constraint prompting

Use explicit limits like framework version, security rules, budget, response length, or forbidden approaches. Constraints reduce creative drift.

Planning then execution

Best for multi-step tasks. Ask for a plan first, then implementation. This improves control and helps you catch bad assumptions early.

Self-check prompting

Ask the model to review its own output for missing assumptions, edge cases, and contradictions. This is useful, but do not blindly trust the self-check.

When to use which strategy

SituationBest strategyWhy
Code reviewRole + structured outputProduces review comments in a predictable format.
Transforming dataFew-shot + constraintsExamples strongly improve consistency.
Large feature designPlan then executeLets you validate direction before implementation.
Production incident analysisRole + self-checkEncourages root-cause thinking and caution.