Aulafy
Courses/Claude Code + Local AI/Writing Good Prompts

Writing Good Prompts

In this book you don't program—you tell Claude Code what you want. The quality of what you get back depends mainly on how you write that prompt. This chapter teaches you how to ask well so you get results that work on the first try.

  • What a prompt is and why it's the most important tool in the book.
  • The four-part recipe for a good prompt.
  • How to course-correct when the result isn't what you expected.

What is a prompt

The recipe for a good prompt

A solid prompt has four parts. You've already seen them in every chapter:

  • What you want to build (the goal). "Create a web chat app with my PDFs."
  • Which tools to use (the context). "Use Ollama with qwen3:4b and nomic-embed-text."
  • How it should behave (the details that matter). "It must cite the file and page; minimal interface."
  • What you expect back (the format). "Do it step by step and write me a README."

Tips that make the difference

  • Ask for it step by step and have it explain what it creates. You learn and stay in control.
  • Give examples of what you want ("the invoice should look like this...").
  • Set limits: "don't use paid services", "make it work offline".
  • Ask for one thing at a time. It's better to build in parts than to drop one giant prompt.
  • Ask it to question you if something isn't clear: "if you're missing information, ask me before starting".

When the result isn't what you wanted

No problem—you fix it by talking. Instead of starting from scratch, adjust:

TerminalCode
No es lo que buscaba: el botón debería estar arriba y en azul. Cámbialo y deja el resto igual.
TerminalCode
Me sale este error al arrancar: [pega aquí el error tal cual]. ¿Qué es y cómo lo arreglo?

Practice challenge

Pick any project from this book and, before looking at the prompt we suggest, write your own using the four-part recipe. Then compare them—you'll see what details to add next time.