Skip to main content

Command Palette

Search for a command to run...

Mastering Prompt Engineering: Your Ultimate Cheat Sheet for ChatGPT [Basic]

Updated
4 min read
Mastering Prompt Engineering: Your Ultimate Cheat Sheet for ChatGPT [Basic]
V

With over 9 years of experience as in IT, I have led technology operations across diverse industries, ensuring robust IT infrastructure, network security, and team development.

My expertise spans managing IT infrastructure & operations, IT policy, and backup/disaster recovery. My expertise also includes IT asset management, Google Workspace & Office 365, endpoint security, DLP, and cross-platform systems (Windows/Linux/Mac OS) etc.

Additionally, I hold certifications in Google IT Support, CCNA, and IBM Cybersecurity, reinforcing my commitment to continuous learning and delivering robust technology solutions.

Thank you for your time and consideration.

Best regards, Vishal Mathur

  1. Pattern Your Prompts: Crafting Meta/ ChatGPT Language

Contextual Clarification:

WHEN I MENTION IT, imagine X as Y (or envision the action as Y).

Illustrative Demonstration:

"Starting today, if I write down two identifiers linked by a “→”, I'm actually painting a picture of a graph. For instance, “a → b” sketches a graph with nodes “a” and “b”, connected by an edge. However, if I interlink identifiers using “-[w:2, z:3]→”, I'm enriching the edge with extra attributes, like a weight or a label."

  1. Pattern Your Prompts: Output Streamliner

Contextual Indicators:

Each time an output with one or more sequential actions is produced, considering the following attributes (or as a consistent practice), follow this approach:

Generate an executable creation of category X that streamlines these actions.

Illustrative Instance:

"Starting today, whenever you craft code that stretches across multiple files, design a Python script simultaneously. This script, once executed, will seamlessly create the designated files or seamlessly integrate the generated code into existing ones."

  1. Pattern Your Prompts: Reverse Engagement

Contextual Guidelines:

Guide me with inquiries to attain X.

Continue the questioning until the specified criteria are fulfilled or the objective is realized (or persistently).

(Optional) Present the questions one by one, in pairs, etc.

Illustrative Case:

"Starting today, I request you to engage me through questions to set up a Python application on AWS successfully. Keep the queries coming until you possess all the necessary details for deploying the application. After gathering sufficient information, generate a Python script to orchestrate the deployment process."

  1. Prompt Pattern: Persona

Contextual Statements:

  • Act as Persona X

  • Provide outputs that persona X would create

Example Implementation:

“From now on, act as a security reviewer. Pay close attention to the security details of any code that we look at. Provide outputs that a security reviewer would regarding the code.”

  1. Prompt Pattern: Question Refinement

Contextual Statements:

  • Within scope X, suggest a better version of the question to use instead

  • (Optional) prompt me if I would like to use the better version instead

Example Implementation:

“From now on, whenever I ask a question about a software artifact’s security, suggest a better version of the question to use that incorporates information specific to security risks in the language or framework that I am using instead and ask me if I would like to use your question instead.”

  1. Prompt Pattern: Alternative Approaches

Contextual Statements:

  • Within scope X, if there are alternative ways to accomplish the same thing, list the best alternate approaches

  • (Optional) compare/contrast the pros and cons of each approach

  • (Optional) include the original way that I asked

  • (Optional) prompt me on which approach I would like to use

Example Implementation:

“Whenever I ask you to deploy an application to a specific cloud service, if there are alternative services to accomplish the same thing with the same cloud service provider, list the best alternative services and then compare/contrast the pros and cons of each approach concerning cost, availability, and maintenance effort and include the original way that I asked. Then ask me which approach I would like to proceed with.”

  1. Prompt Pattern: Cognitive Verifier

Contextual Statements:

  • When you are asked a question, follow these rules

  • Generate some additional questions that would help more accurately answer the question

  • Combine the answers to the individual questions to produce the final answer to the overall question

Example Implementation:

“When I ask you a question, generate three additional questions that would help you answer more accurately. When I have answered the three questions, combine the answers to produce the final answers to my original question.”

  1. Prompt Pattern: Fact Check-List

Contextual Statements:

  • Generate a set of facts that are contained in the output

  • The set of facts should be inserted at a specific point in the output

  • The set of facts should be the fundamental facts that could undermine the veracity of the output if any of them are incorrect.

Example Implementation:

“From now on, when you generate an answer, create a set of facts that the answer depends on that should be fact-checked and list this set of facts at the end of your output. Only include facts related to cybersecurity.”

  1. Prompt Pattern: Template

Contextual Statements:

  • I am going to provide a template for your output

  • X is my placeholder for content

  • Try to fit the output into one or more of the placeholders that I list

  • Please preserve the formatting and overall template that I provide

  • This is the template: PATTERN with PLACEHOLDERS

Example Implementation:

“I am going to provide a template for your output. Everything in all caps is a placeholder. Any time that you generate text try to fit it into one of the placeholders that I list. Please preserve the formatting and overall template that I provide at https://myapi.com/NAME/profile/JOB”

A sample interaction after the prompt was provided is shown:

User: “Generate a name and job title for a person.”

More from this blog

What Are Tokens — And Why Should You Care?

The hidden unit of measurement that shapes every conversation you have with Claude. You type a message to Claude. You hit send. A response flows back in seconds. Simple, right? But beneath that seamless exchange, something interesting is happening — your words are being sliced into tiny linguistic units called tokens before Claude ever "reads" them. Tokens are the atomic unit of language for large language models. They're not characters, and they're not always full words. They sit somewhere in between — and understanding them unlocks a clearer picture of how AI language models actually work, why they have limits, and how to work with those limits instead of against them. So what exactly is a token? Think of tokenisation as breaking text into the most useful chunks for a model to learn from. Common words like "the" or "and" are usually one token. Longer or rarer words might get split into two or three pieces. Punctuation, spaces, and newlines all count too. Example — how this sentence gets tokenised Claude under stands language through tok en isation . As a rough rule of thumb: 100 tokens is about 75 words, or a short paragraph. A typical novel runs around 100,000 words — that's roughly 133,000 tokens. Claude's extended context window can hold the equivalent of several books at once. The context window: Claude's working memory Every conversation with Claude happens inside a context window — a fixed-size buffer that holds everything Claude can "see" at once. This includes your entire conversation history, any documents you paste in, system instructions, and Claude's own responses. Once the window fills up, older content scrolls out of view. Claude doesn't forget it in the human sense — it simply can't read past what fits. This is why very long conversations can occasionally feel like Claude loses track of something said much earlier.

May 20, 20263 min read
What Are Tokens — And Why Should You Care?
V

Vishal Mathur - IT Consultant and AI Prompt Engineer

31 posts

With over 9 years of experience as in IT, I have led technology operations across diverse industries, ensuring robust IT infrastructure, network security, and team development.