Skip to content
Glossary Workflow

Prompt engineering

The art of formulating instructions so an LLM produces exactly the desired result — not approximately.

Definition

Prompt engineering is the practice of structuring instructions to an LLM to maximize relevance and precision of results. In a coding agent context, this includes task decomposition, explicit constraints, verifiable exit conditions, and minimum necessary context.

postcursors perspective

The term is often reduced to "asking good questions". In reality, in an agentic workflow, prompt engineering is an engineering skill: you specify a deliverable, not a question. Data shows 53% of sessions have a "wrong_approach" friction — initial prompt quality is the first optimization lever.

In practice

A good coding agent prompt has three components: what you want (precise task), how to validate it (exit condition), and what you don't want (constraints). Missing any of the three is the most common cause of disappointing results.

Common misconceptions

  • Reducing prompt engineering to 'asking the right questions' — it's specification, not conversation
  • Believing a longer prompt is always better — beyond 20 lines, the agent loses track

The difference between a prompt that produces usable code and one that produces noise usually comes down to 3 elements: is the task precise? Is the exit condition verifiable? Are the constraints explicit?

A prompt like “improve performance” will never pass all three filters. A prompt like “optimize the Doctrine query in OrderRepository::findActiveByPartner() — response time must go under 200ms, without modifying the repository’s public interface” passes all of them.

See also