Prompt Engineering General Techniques Cheatsheet - Role/Structure/Constraints/CoT

General prompt-engineering templates organized by pattern — role, structure, CoT, self-verification. Copy a template, fill the variables, and ship.

AI Prompts·25 commands·Last updated 2026-08-23

Role Anchoring 5

You are a senior {domain} expert (10+ yrs); answer professionally but clearly: {q}
Domain+years anchor expertise
As a {role}, complete per {spec}: {task}
Force adherence to a spec
Identity={role}; Goal={goal}; Constraints={c}. Start: {input}
Identity+goal+constraint triad
From a {role} view, give 3 differing opinions with reasoning
Force multi-angle, avoid bias
Assume you are a {job} in {scene}; give full steps for {problem}
Scenario-based roleplay

Structured Output 5

Output JSON with fields name/desc/tags. JSON only, no prose. Text: {t}
Field names + no prose → parseable
Compare A vs B in a Markdown table: perf/usability/ecosystem/cost
Predefined dims, paste-ready
Output as ## heading / ### sub / - bullets. Topic: {t}
Fixed hierarchy, paste-ready
Strictly follow this JSON Schema, no prose: {schema}
Schema constrains field types
Break the req into a checklist: task/priority/effort. Req: {r}
Req → executable list

Constraints & Few-shot 5

Ex1: X→Y; Ex2: A→B. New: {input}
Few-shot sets the format
Length ≤200 words; pro tone; no lists; in Chinese
Explicit beats "be concise"
Use only the provided material; no outside knowledge
Anti-hallucination boundary
Conclusion first, ≤3 reasons, then one counterexample
Fixed answer skeleton
No apologies/small talk unless needed; answer directly
Cut redundant openers

CoT & Verification 5

Think step by step, then give the final answer
Chain of Thought boosts reasoning
List all assumptions, then derive, then flag uncertainty
Explicit assumptions cut errors
After answering, self-check 3 possible errors and fix
Self-verification loop
If info is insufficient, say what is missing — do not guess
Honest boundary, no fabrication
Argue against your conclusion, then synthesize
Adversarial robustness

Pitfalls 5

Swap vague for specific ("a few" → "3 points")
Specific is controllable
Split long tasks, then ask step by step
Too much at once gets messy
Ask for cited rationale on important output
Traceable lowers risk
Run the same prompt a few times for stability
Reduce random variance
Save winning prompts as reusable templates
Build an asset

Tips

  • The core of prompt engineering is translating vague intent into instructions the model executes reliably — role, structure, constraints, and CoT cover most scenarios.
  • Few-shot sets format better than long descriptions; explicit constraints (length/tone/prohibitions) beat "be concise" — models respond more to concrete numbers and negations.
  • Chain of Thought lifts reasoning quality but costs tokens; add a self-verification loop on important output to cut hallucination and misjudgment.
  • Bank verified prompts as reusable templates — steadier and faster than writing ad hoc each time.

Official References

Commands are compiled from the official docs below. Click to verify the latest usage.

Maintained by LaoHand

Publicly updated on Aug 23, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us

Edit this page on GitHub

Edit the source file directly and open a PR to improve this cheatsheet.