<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Diksha Anand</title>
    <description>The latest articles on DEV Community by Diksha Anand (@dikshaanand).</description>
    <link>https://dev.to/dikshaanand</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4095839%2Fddf01764-bede-4940-84ee-2fb2b5af8901.png</url>
      <title>DEV Community: Diksha Anand</title>
      <link>https://dev.to/dikshaanand</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dikshaanand"/>
    <language>en</language>
    <item>
      <title>What are the Basics of Prompt Writing ??</title>
      <dc:creator>Diksha Anand</dc:creator>
      <pubDate>Wed, 26 Aug 2026 14:01:10 +0000</pubDate>
      <link>https://dev.to/dikshaanand/what-are-the-basics-of-prompt-writing--2fn7</link>
      <guid>https://dev.to/dikshaanand/what-are-the-basics-of-prompt-writing--2fn7</guid>
      <description>&lt;p&gt;Prompt writing (prompt engineering) is the practice of structuring instructions so an LLM generates precise, high-quality, and contextually accurate outputs. Rather than treating the model like an open-ended conversationalist, effective prompting treats it like a programmable engine that requires clear constraints, context, and schemas.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Component&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1. Role / Persona&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Sets domain expertise, perspective, and technical level.&lt;/td&gt;
&lt;td&gt;&lt;em&gt;"Act as a Principal Database Architect specializing in distributed systems."&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;2. Task / Objective&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;States the exact deliverable in one direct sentence.&lt;/td&gt;
&lt;td&gt;&lt;em&gt;"Compare PostgreSQL and MongoDB for high-concurrency write workloads."&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;3. Context &amp;amp; Input Data&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Feeds raw data, constraints, target audience, or source copy.&lt;/td&gt;
&lt;td&gt;&lt;em&gt;"Audience: Staff Engineers. Target workload: 10k writes/sec with JSON payloads."&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4. Negative Constraints&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Explicitly bans unwanted behaviors, filler words, or patterns.&lt;/td&gt;
&lt;td&gt;&lt;em&gt;"Do NOT use generic intro phrases ('In today's world...'). Do not use buzzwords like 'seamless'."&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;5. Structural Schema&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mandates the output format (Markdown table, JSON, bullet points).&lt;/td&gt;
&lt;td&gt;&lt;em&gt;"Output a 4-column Markdown table: Feature, Postgres, MongoDB, Primary Trade-off."&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;6. Examples (Few-Shot)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Anchors expected tone, length, and formatting style.&lt;/td&gt;
&lt;td&gt;&lt;em&gt;Provide a 2-sentence golden example of the expected technical depth.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Universal Prompt Architecture&lt;br&gt;
Here is the modular framework to structure everyday professional prompts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# ROLE &amp;amp; OBJECTIVE&lt;/span&gt;
Act as a [Specific Role/SME]. Your task is to [Specific Task/Deliverable].

&lt;span class="gh"&gt;# CONTEXT &amp;amp; INPUTS&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Target Audience: [e.g., Beginners / C-Suite / Technical Specialists]
&lt;span class="p"&gt;-&lt;/span&gt; Source Data / Background: [Insert raw facts, parameters, or text]

&lt;span class="gh"&gt;# OPERATIONAL GUIDELINES&lt;/span&gt;
&lt;span class="p"&gt;1.&lt;/span&gt; [Core instruction 1]
&lt;span class="p"&gt;2.&lt;/span&gt; [Core instruction 2]

&lt;span class="gh"&gt;# NEGATIVE CONSTRAINTS (What to Avoid)&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Do NOT include conversational throat-clearing (e.g., "Sure, I can help with that", "Here is...").
&lt;span class="p"&gt;-&lt;/span&gt; Do NOT summarize or repeat the prompt premise.
&lt;span class="p"&gt;-&lt;/span&gt; Avoid generic adjectives; quantify claims with specific units or bounds.

&lt;span class="gh"&gt;# OUTPUT FORMAT&lt;/span&gt;
[Specify exact layout: JSON schema, Markdown tables, or numbered steps]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Core Prompting Techniques
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Zero-Shot vs. Few-Shot Prompting
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Zero-Shot Prompting:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Asking the model to perform a task using instructions only. Best for straightforward and well-defined tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Few-Shot Prompting:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Including 1–3 high-quality input/output examples inside the prompt. Best for strict formatting, nuanced tone matching, or complex classification.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Chain-of-Thought (Reasoning Steps)
&lt;/h3&gt;

&lt;p&gt;Adding instructions such as &lt;em&gt;"Think step-by-step before providing your final answer"&lt;/em&gt; can encourage more deliberate reasoning and may improve performance on complex logical or mathematical tasks.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; For production prompts, you generally don't need to request hidden reasoning. Instead, ask for the &lt;strong&gt;key reasoning, assumptions, or verification steps&lt;/strong&gt; you actually need to see.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  3. Chunking (Modular Prompting)
&lt;/h3&gt;

&lt;p&gt;Instead of asking the model to generate a 3,000-word document in one prompt, break the workflow into sequential passes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outline → Section Drafts → Editorial QA&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This gives you more control over quality, consistency, and revisions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common Prompting Mistakes &amp;amp; Fixes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Mistake 1: Being Too Broad
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Write about SEO."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Create a 5-step checklist for diagnosing indexation drops using Google Search Console."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second prompt defines the &lt;strong&gt;topic, task, format, and scope&lt;/strong&gt;, giving the model much less room to guess.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 2: Telling the Model What to Do, But Not What to Avoid
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Without negative constraints, AI may introduce clichés, unnecessary filler, repetitive transitions, or generic language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Add explicit constraints such as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Avoid AI clichés, generic introductions, unnecessary repetition, and robotic transitions."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Mistake 3: Forgetting the Output Structure
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A vague output request can produce inconsistent formatting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Provide a 3-column Markdown table with the columns: Issue, Root Cause, Remediation."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The more important the output format is, the more explicitly it should be defined in the prompt.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>beginners</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
