liveBook · Manning

Prompt decomposition

As explained in Prompt Engineering in Practice

Prompt decomposition is the process of separating a prompt into components according to their roles and whether their content is stable or variable.

Prompt decomposition separates a prompt by role and by what changes between requests. In a chat workflow, stable role, instructions, constraints, and output format belong in the system prompt; the specific task data belongs in the user prompt. This avoids repeating shared standards with every request. section 6.2.3 section 6.4.2

To decompose a monolithic prompt, classify each part in order:

  • Put the role assignment and task instructions in the system prompt. section 6.4.2
  • Keep communication rules, constraints, and required output sections with those reusable instructions. section 6.4.2
  • Move the changing input into a user prompt template and delimit it clearly. section 6.4.2

Production rollout review

A reusable system prompt assigns a site reliability engineer and release-manager role, asks for deployment risks, missing safeguards, rollback gaps, and unclear dependencies, and prohibits invented deployment details. It requires four output sections: Summary, Risks, Missing Safeguards, and Recommendations. The user prompt supplies only the current rollout plan as a delimited `{{rollout_plan}}` value. section 6.4.2

Decomposition also applies when one prompt has accumulated unrelated use cases. Assemble focused fragments at runtime according to context instead of extending one instruction block indefinitely. Splitting FAQ and returns-policy work into focused prompts made the logic clearer and reduced average token count; smaller units also make failures and edits easier to isolate. section 11.6.10

How Prompt Engineering in Practice covers it

How deep it goes
Works through classifying role, instructions, communication rules, output format, and input, then identifies runtime fragments as a broader mitigation.
Examples
Uses an issue assistant, a production rollout review template, and a split between FAQ and returns-policy prompts.
What it assumes
Starts with a monolithic prompt containing role, instructions, constraints, input, and output format, then classifies those parts step by step.
What you can do after
Practice separating reusable configuration from request inputs and splitting overloaded prompts into focused fragments.
How it connects
Connects system prompts, user prompts, prompt templates, output formats, and prompt composition.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Prompt Engineering in Practice. The section links point to the parts of the book it draws on.