Describe What, Not How
Tell Claude what the function should do, not how to write it.
A function is a reusable block of code that performs a specific task. When asking Claude Code to create one, focus on what the function should accomplish, its purpose, its name, and its behavior, rather than dictating implementation steps. Claude writes better code when it understands the goal.
Where you'll practice this
One Promptles scenario teaches this principle directly.
Your First Function
You're building a simple tip calculator. The file `tips.js` exists but is empty. You need a function called `calculateTip` that figures out how much tip to leave at a restaurant. It should take the bill amount and the tip percentage, then return the tip amount.