prompting cursor and claude code effectively8 / 9
the four-part prompt that actually works
Build a function build_prompt(context, goal, constraints, format)
that returns a single string with each part on its own line, prefixed
by the part name and a colon. Then call it with these four arguments
and print the result:
- context:
"fastapi route file" - goal:
"add delete handler" - constraints:
"use existing pool" - format:
"diff only"
Expected output:
context: fastapi route file
goal: add delete handler
constraints: use existing pool
format: diff only
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _