Appearance
Agentic Prompt Engineering
Agentic HandbookCentral thesis: The prompt is the fundamental unit of engineering — master seven reusable prompt formats and their composable "Lego block" sections to communicate clearly to the trifecta of you, your team, and your agents.
Overview
With agents, every prompt becomes a force multiplier. One well-crafted prompt can generate tens or hundreds of hours of productive work; one bad prompt compounds failure at the same rate. Each line you write can trigger tens or hundreds of tool calls and run for minutes to hours, which makes agentic prompt engineering one of the most important skills an engineer can master.
The senior mindset shift is asking who am I creating this prompt for? The answer is now three audiences — you, your team, and your agents — the stakeholder trifecta for the age of agents. The winners build libraries of reusable, battle-tested prompts with composable sections that swap in and out like Lego blocks.
Once your prompts become reusable and consistent, you reach a level where you know what a prompt will do given a certain input. That predictability is what moves you from inside the loop, to outside the loop, all the way to ZTE — the North Star of agentic coding, where your presence isn't needed.
This lesson covers the seven agentic prompt formats, the composable sections that make them up (graded by usefulness and skill), the input→workflow→output pattern, and the critical distinction between system and user prompts.
Key concepts
The Stakeholder Trifecta
Every prompt is engineered for three consumers: you (your future self), your team, and — most importantly — your agents. There's a new type of consumer of your work now, and consistent prompt structure is how you communicate clearly to all three at once. Consistency is the greatest weapon against confusion for the entire trifecta.
The Seven Levels of Agentic Prompt Formats
Each level adds a capability and stacks on the previous. Levels one through four cover 80–90% of real engineering work; five through seven are meta territory.
- High-Level Prompt — the reusable ad-hoc one-off. 1–3 sections (title, high-level prompt, purpose). Where you start when work repeats three times; a terrible place to end.
- Workflow Prompt — the most important format. Introduces the workflow section: a sequential, numbered list of tasks the agent executes. Also brings metadata, variables, and report.
- Control-Flow Prompt — adds conditions, loops, and early returns to the workflow ("if no path to plan, stop and ask").
- Delegation Prompt — kicks off other agents (sub-agents or primary). Your primary agent becomes the prompt engineer for its sub-agents; needs variables to pass down.
- Higher-Order Prompt — passes prompts into prompts (e.g.
/build <path-to-plan>); scaffolds top-level structure while the inner work varies. - Template Meta Prompt — a prompt that builds another prompt in a specific format. The single most powerful prompt you can write; teaches your agent to build like you and your team.
- Self-Improving Prompt — the expert level. Agents update agents by having prompts update their own expertise section live.
Composable sections — the Lego blocks
Sections are swappable; only add what you need. Graded roughly by usefulness / skill:
| Section | Usefulness | Skill | Role |
|---|---|---|---|
| Workflow | S | C | Step-by-step play — the most important section by far |
| Variables (static & dynamic) | A | B | Pass information into prompts; reference by name throughout |
| Examples | A | B | Show desired output/result; drastically lifts performance |
| Report / Output | B | C | Response format — JSON, YAML, or a specific structure |
| Instructions | B | C | Auxiliary info surrounding the workflow steps |
| Purpose | B | D | One or two direct sentences on what the agent does |
| Codebase Structure (context map) | C | C | A map of where files are — speeds the agent up |
| Relevant Files | C | C | A quick list of files to reference |
| Metadata | C | C | Model, allowed tools, argument hints (Claude Code specific) |
| Title | C | D | Names the prompt |
Name sections whatever you want — these information-dense keywords just recur across tens of thousands of prompts.
Input → Workflow → Output
Every strong prompt has a consistent three-step shape: inputs (variables), the workflow (the actual work), and the output (report). Input and output are especially for you and your team — you instantly see what comes in and what goes out — while the whole thing serves the agent.
System prompts vs user prompts
Everything in the tier list grades user prompts — every Claude Code prompt and slash command enters the window as a user prompt. System prompts are the law for every conversation: written once, run many times, and a mistake scales to every user prompt. You're far more delicate with them. Most engineers never reach this level, but building your own specialized agents forces you to.
For sub-agents, a workflow in the system prompt is good (you want them doing one specific thing). For full primary-agent system prompts, usually don't prescribe a rigid workflow, variables, or reporting — favor purpose, instructions, and examples, and keep the workflow loose to preserve agency. --append-system-prompt extends the existing prompt; a full override (via SDK) blows it away entirely — powerful and dangerous.
How to apply it
- Start at level one. When you catch yourself repeating work three times, drop it into a high-level prompt.
- Scale to a workflow prompt as soon as the task has real steps — this is where most of your prompt output comes from.
- Add control flow (conditionals, loops, early returns) only when the task needs branching.
- Introduce variables — static ones you reference throughout, dynamic ones passed as arguments — to make prompts reusable.
- Delegate when work should fan out to multiple agents; write clear self-contained sub-prompts with defined output expectations.
- Keep sections consistent. Open a prompt, collapse to the second level, and read the sections top-to-bottom — if a teammate could execute it, it's high quality.
- Only add sections you need — swap the Lego blocks; a prompt without an output format simply omits the report.
- Build the template meta prompt once your formats stabilize — the prompt that generates your prompts multiplies your velocity.
- Reserve system prompts for when you build custom agents; keep them to purpose, instructions, and examples.
Commands & conventions
Metadata and variable syntax (Claude Code user prompts):
markdown
---
description: Create a detailed implementation plan
argument-hint: <user-prompt>
model: opus
allowed-tools: Read, Write, Bash
---
# Quick Plan
## Purpose
Create a detailed implementation plan based on the user's requirements.
## Variables
USER_PROMPT: $ARGUMENTS
PLAN_OUTPUT_DIR: `specs/` # static variable — reference throughout
## Workflow
1. Read the relevant files.
2. Draft the plan following the specified format.
3. Write the plan to PLAN_OUTPUT_DIR.
## Report
Return only the path to the plan you created.Appending to the system prompt when delegating a background primary agent:
bash
claude -p --dangerously-skip-permissions \
--append-system-prompt "$SYSTEM_RULES" \
"$USER_PROMPT"Conventions: positional dynamic variables via $1, $2 / $ARGUMENTS; a natural-language NAME: syntax for static variables referenced across the prompt; store reusable prompts in .claude/commands/; keep system prompts rare and deliberate (only a handful per codebase).
Key takeaways
- The prompt — now the agentic prompt — is the fundamental unit of engineering.
- Engineer for the trifecta: you, your team, and your agents.
- There are seven prompt formats; levels one to four do 80–90% of the work.
- The workflow section is the single most important section, every time.
- Sections are composable Lego blocks — only add what you need.
- Every good prompt follows input → workflow → output.
- Consistency beats complexity — it makes you, your team, and your agents faster.
- System prompts are the law: written once, run many, mistakes scale to every user prompt.
- The template meta prompt — the prompt that builds prompts — is the peak of agentic prompt velocity.
Notable quotes
"The prompt is now the fundamental unit of engineering. And with agents, every prompt you create becomes a force multiplier."
"Consistency is the greatest weapon against confusion for both you and your agent."
"Great prompting is great communicating."
"What's better than a prompt? A prompt chain. What's better than a prompt chain? An agent. What's better than an agent? Many focused, specialized agents."