跪拜 Guibai
← All articles
Backend

A Prompt Engineering Cheatsheet That Boils Down to Four Questions

By XW ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Consistent, diffable prompt structures turn prompting into a team practice. The manual's core claim is that only four fields truly determine output quality: audience, constraints, examples, and output format. That simplifies prompt debugging and makes prompt templates reusable across models and language versions.

Summary

Prompt engineering has moved from a single-prompt art to a maintainable engineering discipline. The manual breaks down the entire landscape into four questions every framework answers: who is speaking (Role), what is the task, what constraints apply, and how the output should be delivered. All 13 frameworks are variations on those slots. Beyond the frameworks, it adds four reasoning techniques (CoT, ToT, ReAct, Self-Consistency) and five content-building techniques (few-shot, persona, constraints, delimiters, output formatting), with combination recipes that multiply these tools together.

The core advice is structural: use `# Role:` style headings instead of natural-language prose. The manual argues these explicit Markdown headings give models clear field boundaries, reduce slot confusion, enable Git-diffable team maintenance, and allow programmatic assembly. It also includes a decision tree for selecting the right framework, a full comparison table, and a list of common mistakes. The most portable piece is a universal `# Output Rules:` suffix that tells the model to ask when information is missing, reason step-by-step, and state conclusions first.

Takeaways
— 13 frameworks, 4 reasoning techniques, and 5 content-building techniques are covered, all using a `# Role:` structured heading convention.
— Every framework answers four questions: role, task, constraints, and format.
— Only four fields actually matter for quality: audience, constraints, examples, and output format.
— The CO-STAR framework is the only one with a dedicated `# Audience:` field, which is why it's strongest for audience-specific content.
— Few-shot examples outperform thousands of words of adjectives; quality matters more than quantity.
— Use English labels for structure and Chinese for content: the manual recommends English headings because they dominate training data, but warns against mixing languages in the same hierarchy.
— A universal `# Output Rules:` suffix can be appended to any prompt: ask when info is missing, reason step-by-step, conclude first, respond in Simplified Chinese.
— The decision tree suggests RTF for simple tasks, ICIO for material processing, CO-STAR for audience-specific content, RISEN for bounded planning, BROKE for iterative long documents, and CRISPE+ToT+Self-Consistency for high-stakes decisions.
— Material should be wrapped in delimiters (triple quotes or XML tags) to prevent prompt injection and confusion.
Conclusions

The manual's emphasis on structured headings over natural language reflects the training distribution of mainstream models; English `# Role:` patterns are denser in pretraining data, so they anchor better in long contexts.

By claiming that only four fields matter, the manual simplifies the whole framework zoo: the rest is just arrangement and naming.

The recommendation to put instructions first and materials last exploits the model's sensitivity to beginning and end of context, a practical detail that frames often miss.

The decision tree's 'uncertain? use RTF + CoT' default is a pragmatic fallback that covers 90% of cases, acknowledging that most tasks don't need a 6-field framework.

The manual treats prompt engineering as a collaborative engineering task, notable for advocating Git-diffable prompts and team maintainability, not just individual output quality.

Concepts & terms
Chain of Thought (CoT)
A reasoning technique that forces the model to write out intermediate steps before concluding, reducing errors in math and logic.
Few-shot
Providing 2-3 input-output examples so the model matches the pattern; often more effective than descriptive adjectives.
CO-STAR
A 6-field framework (Context, Objective, Style, Tone, Audience, Response) popularized by a Singapore GovTech champion, the only framework with a dedicated audience field.
Self-Consistency
Running the same question from multiple independent angles and cross-checking; triple token cost, reserved for high-stakes decisions.
Structured headings
Using `# Role:` style headings instead of natural language to give models clear field boundaries and enable programmatic assembly.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗