System Prompts & Types of Prompting — simple, useful, and ready to use

Mayank GurjarMayank Gurjar
4 min read

Short version up front: system prompts set the AI’s role and behavior. The way you prompt (zero-shot, few-shot, chain-of-thought, etc.) changes accuracy, tone, and usefulness. Below you’ll find clear explanations, quick examples, practical templates, and bite-size tips you can use immediately.


What is a system prompt? (1-line)

A system prompt is an instruction that tells the AI who to be and how to behave before you start asking questions.
Example: You are a friendly tech writer who explains things simply and gives short examples.


Why system prompts matter (small, important points)

  1. Sets tone & expertise — answers match the role you gave (teacher, reviewer, lawyer, etc.).

  2. Reduces back-and-forth — fewer edits and clarifying prompts.

  3. Keeps consistency — useful for multi-part content or product docs.

  4. Improves safety/limits — can instruct the model to avoid certain content.


Types of prompting — what they are, when to use them, and short examples

1) Zero-Shot

  • What: Ask without examples.

  • When: Clear, common tasks (summaries, definitions).

  • Example: Summarize this article in 3 sentences.

2) Few-Shot

  • What: Give 2–4 examples to show the pattern.

  • When: When you want a specific style or format.

  • Example:

Q: Define "DRY" in programming.
A: DRY = Don't Repeat Yourself - avoid duplicate code.

Q: Define "YAGNI" in programming.
A: YAGNI = You Aren't Gonna Need It - don't add features before they're needed.

Q: Define "KISS" in programming.
A:

3) Chain-of-Thought (CoT)

  • What: Ask the model to show its reasoning steps.

  • When: Complex reasoning, debugging, multi-step calculations.

  • Example: Explain step-by-step how you'd debug a failing API call.

4) Instruction Prompting

  • What: Direct, explicit instructions (length, tone, format).

  • When: Content creation, specific outputs.

  • Example: Write a 150-word explanation of OAuth2 for non-devs, friendly tone.

5) Role / Persona Prompting

  • What: Tell the model a role (e.g., “You are a startup mentor”).

  • When: Advice that needs perspective or authority.

  • Example: You are a product manager with 10 years of B2B SaaS experience.

6) Iterative / Refinement Prompting

  • What: Provide output, then ask for revisions.

  • When: Editing drafts, tuning code, improving clarity.

  • Example: Shorten this paragraph to 2 sentences and make it more active.

7) Retrieval-Augmented / Contextual Prompting

  • What: Provide external text or documents as context.

  • When: When answers must reflect provided content (policy, docs).

  • Example: Based on the following doc, list the three user-facing changes.

8) Prompt Chaining

  • What: Break a big task into smaller prompts and combine outputs.

  • When: Long workflows: research → outline → write → edit.

  • Example: Step 1: “List headlines.” Step 2: “Expand headline #2 into a 300-word post.”


Practical templates you can copy/paste

  1. System prompt (general):
You are an expert [role]. Answer concisely, use bullets, and include one short example.
  1. Content writer:
You are a senior technical writer. Produce a clear, 5-paragraph article with headings and one code snippet. Keep language simple for beginners.
  1. Code assistant:
You are a helpful programmer. Explain issues step-by-step, show corrected code, and include tests if applicable.

Quick tips (one-liners — high impact)

  • Start with a clear system prompt for every session.

  • Use few-shot when format matters.

  • Use CoT for tricky logic or math.

  • Provide only the context needed — too much context can confuse.

  • Ask the model to show examples, not just tell.

  • Combine methods: system prompt + few-shot + iteration = strong results.


Two short, practical examples

Example — Blog outline (fast):
System prompt:

You are a friendly content strategist. Produce a 6-point blog outline about "Remote onboarding".

Follow up (instruction): Expand point 3 into a 200-word section with a checklist.

Example — Debugging (stepwise):
System prompt:

You are a pragmatic backend engineer. Explain root causes, tests to run, and exact commands to try.

User prompt: A Rails app throws "NoMethodError" in production; logs show nil from user.profile.name.
AI: gives step-by-step diagnostic checks, safe fixes, and a test snippet.


Common mistakes to avoid (short)

  • Vague system prompts: “Be better” → useless.

  • Overloading with irrelevant context.

  • Expecting creative structure without examples when you need consistency.

  • Not iterating—first output is rarely perfect.


Closing — use this now

Pick one system prompt from the templates, set it at the start of your next session, and try one of these:

  • Zero-shot for quick tasks.

  • Few-shot when format matters.

  • CoT for reasoning.

0
Subscribe to my newsletter

Read articles from Mayank Gurjar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Mayank Gurjar
Mayank Gurjar