[KongchangAI]
· 2 min read· 1,315 words

The Five-Part Prompt Framework: Taking LLM Output from "Good Enough" to "Ship-Ready"

The Five-Part Prompt Framework: Taking LLM Output from "Good Enough" to "Ship-Ready"

The five-part prompt template—role, context, output schema, constraints, and examples—turns vague requests into deliverable output.

The article presents a prompt template built from five parts: role, context, output schema, constraints, and examples. The author argues that ordinary prompts fail because inputs lack structural constraints—each missing section maps to a predictable failure mode. By defining a writing persona, providing background, specifying JSON field formats, listing banned words, and giving examples, model output shifts from generic to concrete and deliverable. A case study shows the same model returning complete JSON with quantified selling points and a clear CTA. The author identifies four working mechanisms and notes the framework suits content generation and structured extraction but requires caution in complex reasoning; it's best used as a checklist, not a mechanical formula.

Most prompt engineering articles just tell you to "be specific" without ever explaining how. One developer has distilled a five-part prompt template from hands-on practice, claiming it can transform the same model's output from "generic rambling" into "ready to deliver."

Why Ordinary Prompts Always Fall Short

The original author states bluntly that most prompt tutorials are useless because they lack actionable granularity. His counterexample is telling: a simple prompt like "write a product description for my SaaS" gets GPT to return something like "Welcome to AcmeCloud, the leading cloud management platform that helps businesses streamline operations..."—copy that could apply to any SaaS company on earth.

The root cause isn't model capability; it's the lack of structural constraints in the input. The author proposes a principle: every missing section in a prompt corresponds to a predictable failure mode.

Breaking Down the Five-Part Structure

The template consists of five blocks, each with a clear responsibility.

Role

The first section defines the role and experience background the model should adopt—for example, "You are a B2B SaaS marketer with 10 years of experience, writing for an operations director at a 200-person company." The role section calibrates tone and vocabulary, steering the model to organize language from a specific perspective rather than randomly sampling from generic corpora.

Context

The second section lays out project background, target audience, and specific goals. In the original example, it specifies that the product is a Kubernetes cost optimization tool, the audience is an operations director at a Series B SaaS company, and the goal is to generate qualified demo bookings. The more specific the context, the less likely the model drifts into generic marketing speak.

Output Schema

The third section prescribes the return format in a field-based way. The original requires a JSON response containing headline (max 10 words), subheadline (max 20 words), 3 selling points (15 words each), and CTA button copy (3 words). The author's explanation: when the model must fill fields, it can't ramble—structured output forces structured thinking.

JSON Schema and Structured Output

The original requires the model to return JSON with fixed fields like headline, subheadline, selling points, and CTA, which involves the LLM's "structured output" capability. Modern APIs (such as OpenAI's JSON mode, Structured Outputs, and Anthropic's tool calling) allow developers to precisely declare field names, types, lengths, and required items using JSON Schema. The model is constrained during decoding to generate only content that conforms to the schema. Compared to verbally describing fields in the prompt, schema-level constraints significantly reduce format errors and missing fields. Note, however, that field-based output mainly guarantees "correct shape," not "quality content"—whether selling points hit audience pain points still depends on the quality of the role, context, and examples sections. Therefore, output structure should be used in conjunction with the other four sections, not relied upon alone.

Constraints

The fourth section lists hard limits: word count caps, tone requirements, mandatory elements, and forbidden words. The original specifically bans "leverage," "synergy," and "revolutionize," claiming this one rule alone eliminates 80% of corporate boilerplate.

How Banned Words and Negative Constraints Work

The original bans words like "leverage," "synergy," and "revolutionize." The principle behind this is compressing the model's output distribution. LLMs compute probabilities for each token during generation; corporate boilerplate appears frequently because it's statistically ubiquitous in marketing corpora. Negative constraints effectively downweight or block specific token sequences during decoding, forcing the model to bypass these high-probability but low-information expressions and choose more specific wording. In practice, negative constraints work best paired with positive requirements—for example, "don't use abstract verbs; use quantifiable actions and numbers"—otherwise the model may simply swap in a different batch of synonymous boilerplate. Also, banned-word lists should be customized to the specific scenario; overly broad lists can harm fluency.

Examples

The fifth section provides one positive example and one negative example. The original's positive example is "Cut your K8s bill by 40% in 30 days"; the negative example is "Unleash the power of cloud optimization." The author's experience: one good example beats ten rules.

Real-World Comparison

In the original case study, after applying the framework, the same model returned complete JSON: headline "Cut your K8s bill by 40% in 30 days," subheadline noting automatic cluster resizing and 12 hours saved per week for the ops team, three selling points covering $18K annual savings, 15-minute setup with no code, and SOC 2 compliance with data staying in your VPC, and a CTA of "See your savings."

Same model, same product, dramatically different output quality. This comparison shows that prompt engineering gains come primarily from input structure completeness, not model upgrades.

Four Mechanisms That Make It Work

The author summarizes why the framework works: role gives the model a writing persona, calibrating tone and vocabulary; output structure forces the model to organize answers by field, preventing rambling; constraints directly block common failure modes; examples anchor the quality baseline.

These four points aren't mysterious—they essentially make explicit the implicit requirements humans give when assigning tasks to subordinates. In everyday communication, we assume the other party knows the background and standards, but for LLMs, what isn't written doesn't exist.

Context Window and Instruction Following

The four mechanisms work only if the model has sufficient instruction-following ability and context window capacity. Five-part prompts typically run from hundreds to over a thousand tokens; modern context windows (ranging from tens of thousands to hundreds of thousands of tokens) can accommodate them, but in long conversations, earlier roles and constraints may be diluted by "lost in the middle" effects. Mitigation strategies include placing the most critical roles and constraints at the beginning and end of the prompt (leveraging primacy and recency effects), periodically restating constraints in multi-turn conversations, or putting fixed template parts into the system prompt. Understanding this helps explain why the same template performs consistently in single-turn tasks but requires extra maintenance in long sessions.

Tooling Attempts and Limitations

Tired of hand-writing scaffolding, the author built a tool called PromptOpt: paste a rough idea, get back a structured prompt in the above format, with a free tier of 10 optimizations.

Objectively, the value of such tools depends on the template's generality. The five-part framework suits content generation, marketing copy, and structured data extraction, but for multi-turn dialogue, complex reasoning chains, or scenarios requiring external tool calls, a fixed template may actually limit the model's potential. The original doesn't discuss these edge cases.

A more pragmatic approach is to treat the framework as a checklist: after writing a prompt, verify each of the five sections is present and fill in what's missing, rather than mechanically applying it. The author himself raises an open question at the end—what's your personal "must-write" section? This shows the framework is still evolving.

For developers using LLMs daily, the most direct action is: pick a prompt you recently wrote, add the five sections, rerun it on the same model, and compare outputs. The experiment costs little but usually gives an intuitive sense of how structured input changes results.

One-line Summary

The five-part prompt template—role, context, output schema, constraints, and examples—turns vague requests into deliverable output.

Paragraph Summary

The article introduces a prompt template consisting of five parts: role, context, output schema, constraints, and examples. The author argues that ordinary prompts fail because inputs lack structural constraints—each missing section corresponds to a predictable failure mode. By defining a writing persona, providing project background, specifying return format with JSON fields, listing banned words and other hard limits, and giving positive and negative examples, model output shifts from generic to specific and deliverable. In the case study, the same model returned complete JSON with quantified selling points and a clear CTA. The author identifies four working mechanisms and notes the framework suits content generation and structured extraction but requires caution in complex reasoning scenarios, recommending it as a checklist rather than a mechanical formula.

#prompt engineering#five-part prompt framework#LLM output quality#structured output#JSON schema#negative constraints
Share:

Related articles