Skip to content

Prompt Writing Guide

SamuraiAI can automate various tasks using AI, but to get AI to do the job accurately, “how you communicate” is important. This guide summarizes tips for writing prompts (instructions to AI).


The key to prompts is to clarify “who, what, and how you want it done”. Communicate politely and specifically, just as you would when asking someone to do something.

Tell what you ultimately want to achieve first.

  • ❌ Vague: “Summarize the invoice”
  • ✅ Clear: “Extract date, amount, and recipient from invoice PDF and add each row to a Google Spreadsheet”

Points

  • Specifically write “what to create” and “what to output”
  • Summarizing the purpose in one sentence makes it easier for AI to understand

Don’t give complex work all at once; break it into stages.

  • ❌ “Organize data, summarize in a table, create a report, and send”
    1. “Aggregate sales data in the spreadsheet”
    2. “Create a graph from the aggregated results”
    3. “Summarize the results in PDF and send to Slack”

Points

  • Breaking instructions into steps improves AI accuracy
  • Writing in order is more reliable than summarizing in long sentences

3. Write Conditions and Constraints Specifically

Section titled “3. Write Conditions and Constraints Specifically”

Clearly state the scope and rules of the work.

  • “Process only the latest 10 items”
  • “Use only data from columns C and D”
  • “Display amounts with comma separators”
  • “Ignore blank data”

Points

  • When conditions are specified, AI can avoid unnecessary processing
  • Write conditions as much as possible with numbers, ranges, and formats

Always tell how you want to receive the results.

  • “Output in table format”
  • “Return in JSON format”
  • “Make a bulleted list, one item per line”
  • “Please use Markdown table format”

Points

  • Specifying the output format makes it easier to automate subsequent processes
  • Present a sample format if possible

Expressions like “good feeling”, “appropriate”, and “roughly” are not conveyed to AI.

  • ❌ “Make it a nice report”
  • ✅ “Create a bar graph of monthly sales and overlay a line graph showing year-over-year comparison”

Points

  • Instead of subjective words, give instructions with specific actions, conditions, and objectives
  • Adding “examples” or “formats” makes it even more accurate

6. Also Give Instructions for Unexpected Situations

Section titled “6. Also Give Instructions for Unexpected Situations”

Specifying how to handle errors and exceptions makes the flow less likely to stop.

  • “If data is not found, leave it blank”
  • “If login fails, stop processing”
  • “Report if there is invalid data”

Points

  • Giving instructions for failure cases in advance increases work safety
  • It’s convenient to also specify “exception output format”

Rather than explaining various things in long sentences, summarize the main points briefly.

  • Be aware of “who, what, and how you want it done”
  • Remove unnecessary explanations

Points

  • Even if short, AI can understand accurately if conditions and objectives are clear
  • Sentences that are too long can cause misunderstandings

AI understands faster with concrete examples.

  • “Aggregate sales data” → “Example: 2025/09/01, 10000 yen, Taro Yamada”
  • “Summarize the text” → “Example: Summarize just the key points in 200 characters or less”

As needed, you can have multiple output formats presented for comparison.

  • Output in 3 types: “table format”, “JSON format”, “bulleted list”
  • Choose which is suitable for your workflow

  • Is the goal clear?
  • Is it broken into steps?
  • Are conditions and constraints written specifically?
  • Is the output format specified?
  • Are there no ambiguous expressions?
  • Are unexpected cases handled?
  • Is it short and easy to understand?