|Methods

The Prompt Engineering Playbook for Developers

Prompt engineering isn't about tricks. It's about giving AI the same context you'd give a new team member. Here's our framework.

Most prompt engineering advice focuses on magic words and formatting tricks. That's the wrong frame. The real skill is context transfer.

The principle

Think of every prompt as onboarding a contractor. They're skilled but have zero context about your project. What would you tell them before they write their first line of code?

The four-part structure

Every effective prompt we write follows this pattern: context (what exists), constraint (what to respect), task (what to do), and example (what good looks like).

Context

Tell the AI about the project architecture, the file it's working in, and the patterns already established. Don't assume it remembers previous conversations.

Constraints

Specify what not to do. Don't add new dependencies. Don't change the existing API. Don't refactor surrounding code. Constraints prevent scope creep.

Task

Be specific about the output format. "Write a function" is worse than "write a TypeScript function that takes a User object and returns a formatted display name string."

Examples

A three-line code example is worth a paragraph of description. Show the pattern you want, and the AI will follow it.

The anti-patterns

Avoid chain-of-thought prompting for code generation. Don't ask the AI to explain its reasoning — ask it to produce code. Don't over-specify implementation details that the AI can figure out from context.