@ckelsoe/prompt-architect 3.2.2 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +135 -5
- package/MIGRATION.md +1 -1
- package/README.md +32 -47
- package/adapters/README.md +1 -1
- package/adapters/system-prompt.md +115 -59
- package/package.json +5 -4
- package/scripts/install.js +52 -22
- package/scripts/test.js +88 -40
- package/scripts/validate-skill.js +184 -56
- package/skills/prompt-architect/SKILL.md +94 -79
- package/skills/prompt-architect/assets/templates/ape_template.txt +14 -3
- package/skills/prompt-architect/assets/templates/bab_template.txt +23 -10
- package/skills/prompt-architect/assets/templates/broke_template.txt +31 -6
- package/skills/prompt-architect/assets/templates/cai-critique-revise_template.txt +16 -8
- package/skills/prompt-architect/assets/templates/care_template.txt +4 -0
- package/skills/prompt-architect/assets/templates/chain-of-density_template.txt +64 -35
- package/skills/prompt-architect/assets/templates/chain-of-thought_template.txt +8 -0
- package/skills/prompt-architect/assets/templates/co-star_template.txt +8 -0
- package/skills/prompt-architect/assets/templates/crispe_template.txt +6 -0
- package/skills/prompt-architect/assets/templates/ctf_template.txt +8 -0
- package/skills/prompt-architect/assets/templates/devils-advocate_template.txt +7 -0
- package/skills/prompt-architect/assets/templates/hybrid_template.txt +44 -24
- package/skills/prompt-architect/assets/templates/iterative-compression_template.txt +74 -0
- package/skills/prompt-architect/assets/templates/least-to-most_template.txt +4 -0
- package/skills/prompt-architect/assets/templates/plan-and-solve_template.txt +4 -0
- package/skills/prompt-architect/assets/templates/pre-mortem_template.txt +24 -14
- package/skills/prompt-architect/assets/templates/race_template.txt +9 -0
- package/skills/prompt-architect/assets/templates/rcot_template.txt +8 -0
- package/skills/prompt-architect/assets/templates/react_template.txt +38 -16
- package/skills/prompt-architect/assets/templates/rise-ie_template.txt +4 -0
- package/skills/prompt-architect/assets/templates/rise-ix_template.txt +3 -3
- package/skills/prompt-architect/assets/templates/risen_template.txt +7 -0
- package/skills/prompt-architect/assets/templates/rpef_template.txt +16 -11
- package/skills/prompt-architect/assets/templates/rtf_template.txt +9 -0
- package/skills/prompt-architect/assets/templates/skeleton-of-thought_template.txt +18 -10
- package/skills/prompt-architect/assets/templates/step-back_template.txt +4 -0
- package/skills/prompt-architect/assets/templates/tidd-ec_template.txt +54 -31
- package/skills/prompt-architect/assets/templates/tree-of-thought_template.txt +37 -21
- package/skills/prompt-architect/references/frameworks/ape.md +145 -57
- package/skills/prompt-architect/references/frameworks/bab.md +139 -58
- package/skills/prompt-architect/references/frameworks/broke.md +157 -57
- package/skills/prompt-architect/references/frameworks/cai-critique-revise.md +184 -76
- package/skills/prompt-architect/references/frameworks/care.md +67 -36
- package/skills/prompt-architect/references/frameworks/chain-of-density.md +111 -417
- package/skills/prompt-architect/references/frameworks/chain-of-thought.md +45 -19
- package/skills/prompt-architect/references/frameworks/co-star.md +102 -44
- package/skills/prompt-architect/references/frameworks/crispe.md +7 -5
- package/skills/prompt-architect/references/frameworks/ctf.md +75 -37
- package/skills/prompt-architect/references/frameworks/devils-advocate.md +105 -58
- package/skills/prompt-architect/references/frameworks/iterative-compression.md +448 -0
- package/skills/prompt-architect/references/frameworks/least-to-most.md +35 -13
- package/skills/prompt-architect/references/frameworks/plan-and-solve.md +38 -9
- package/skills/prompt-architect/references/frameworks/pre-mortem.md +182 -72
- package/skills/prompt-architect/references/frameworks/race.md +93 -38
- package/skills/prompt-architect/references/frameworks/rcot.md +1 -1
- package/skills/prompt-architect/references/frameworks/react.md +230 -97
- package/skills/prompt-architect/references/frameworks/reverse-role.md +23 -16
- package/skills/prompt-architect/references/frameworks/rise.md +120 -77
- package/skills/prompt-architect/references/frameworks/risen.md +82 -28
- package/skills/prompt-architect/references/frameworks/rpef.md +227 -58
- package/skills/prompt-architect/references/frameworks/rtf.md +4 -2
- package/skills/prompt-architect/references/frameworks/self-refine.md +4 -2
- package/skills/prompt-architect/references/frameworks/skeleton-of-thought.md +68 -22
- package/skills/prompt-architect/references/frameworks/step-back.md +48 -16
- package/skills/prompt-architect/references/frameworks/tidd-ec.md +129 -51
- package/skills/prompt-architect/references/frameworks/tree-of-thought.md +112 -37
- package/skills/prompt-architect/scripts/framework_analyzer.py +0 -807
- package/skills/prompt-architect/scripts/prompt_evaluator.py +0 -336
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
Chain of Thought is a prompting technique that encourages step-by-step reasoning and makes the thinking process explicit. Instead of jumping to answers, it guides Claude to break down complex problems, show intermediate steps, and verify logic along the way.
|
|
6
6
|
|
|
7
|
+
When prompt-architect emits a Chain-of-Thought prompt, its framework section headers — `PROBLEM / QUESTION`, `SOURCE MATERIAL`, `REASONING INSTRUCTION` — are stripped and the model receives a flat block. The reasoning instruction is written as a complete sentence so it survives on its own, while the numbered step labels the prompt requests (`Step 1:`, `STEP 1 - REQUIREMENTS:`) are literal labels inside the reasoning protocol and stay in place. An optional `SOURCE MATERIAL` block holds the code, data, or document being reasoned over and is deleted when the problem is self-contained.
|
|
8
|
+
|
|
9
|
+
**Research basis:** "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models" (Wei et al., Google Research, arXiv 2201.11903, NeurIPS 2022). Prompting PaLM 540B with eight chain-of-thought exemplars raised GSM8K accuracy from 17.9% with standard prompting to 56.9%, beating the prior fine-tuned state of the art of 55% (GPT-3 plus a verifier, Cobbe et al. 2021).
|
|
10
|
+
|
|
7
11
|
## Core Concept
|
|
8
12
|
|
|
9
13
|
CoT works by:
|
|
@@ -166,6 +170,16 @@ Poor:
|
|
|
166
170
|
|
|
167
171
|
## Complete Examples
|
|
168
172
|
|
|
173
|
+
Every example below is shown in emitted form. Two kinds of label appear, and they behave
|
|
174
|
+
differently at emission. The framework's own section headers — `SOURCE MATERIAL:`,
|
|
175
|
+
`PROBLEM / QUESTION:`, `REASONING INSTRUCTION:` — are scaffolding and are stripped, so each
|
|
176
|
+
is written so its instruction still reads once the header is gone. The numbered
|
|
177
|
+
reasoning-step labels the prompt asks for (`Step 1:`, `STEP 1 - REQUIREMENTS:`) are literal
|
|
178
|
+
labels inside the reasoning protocol, not section headers, and they survive into the emitted
|
|
179
|
+
prompt exactly as written — they are what the model is being told to produce. Where the
|
|
180
|
+
reasoning runs over an existing artifact, the `SOURCE MATERIAL` block carries it; where the
|
|
181
|
+
task starts from a blank page, that block is deleted.
|
|
182
|
+
|
|
169
183
|
### Example 1: Debugging
|
|
170
184
|
|
|
171
185
|
**Without CoT:**
|
|
@@ -174,14 +188,19 @@ Why isn't this code working?
|
|
|
174
188
|
[code snippet]
|
|
175
189
|
```
|
|
176
190
|
|
|
177
|
-
**With CoT
|
|
191
|
+
**With CoT** (source material supplied):
|
|
178
192
|
```
|
|
179
|
-
|
|
193
|
+
SOURCE MATERIAL:
|
|
194
|
+
[Paste the code you want debugged here]
|
|
195
|
+
The reasoning that follows must work from the material above, not from
|
|
196
|
+
assumptions about it.
|
|
180
197
|
|
|
181
|
-
|
|
198
|
+
PROBLEM / QUESTION:
|
|
199
|
+
Debug the code above by thinking through it step-by-step.
|
|
182
200
|
|
|
201
|
+
REASONING INSTRUCTION:
|
|
183
202
|
Use this process:
|
|
184
|
-
1. Read the code and state what it
|
|
203
|
+
1. Read the code and state what it is supposed to do
|
|
185
204
|
2. Identify the input and expected output
|
|
186
205
|
3. Trace through execution line by line
|
|
187
206
|
4. Note any suspicious patterns or red flags
|
|
@@ -199,7 +218,9 @@ Use this process:
|
|
|
199
218
|
Design a URL shortener.
|
|
200
219
|
```
|
|
201
220
|
|
|
202
|
-
**With CoT
|
|
221
|
+
**With CoT** (no source material — the design is worked out from scratch, so no
|
|
222
|
+
`SOURCE MATERIAL` block is needed; the `STEP N -` labels are literal protocol labels and
|
|
223
|
+
survive header stripping):
|
|
203
224
|
```
|
|
204
225
|
Design a URL shortener by working through these steps:
|
|
205
226
|
|
|
@@ -242,7 +263,9 @@ For each step, explain your reasoning.
|
|
|
242
263
|
Should we use MongoDB or PostgreSQL?
|
|
243
264
|
```
|
|
244
265
|
|
|
245
|
-
**With CoT
|
|
266
|
+
**With CoT** (no source material — the decision is reasoned out from scratch, so no
|
|
267
|
+
`SOURCE MATERIAL` block is needed; the `STEP N -` labels are literal protocol labels and
|
|
268
|
+
survive header stripping):
|
|
246
269
|
```
|
|
247
270
|
Decide between MongoDB and PostgreSQL by reasoning through:
|
|
248
271
|
|
|
@@ -304,7 +327,7 @@ STEPS:
|
|
|
304
327
|
...
|
|
305
328
|
```
|
|
306
329
|
|
|
307
|
-
### CoT + RISE
|
|
330
|
+
### CoT + RISE-IE
|
|
308
331
|
```
|
|
309
332
|
ROLE: [Analyst]
|
|
310
333
|
INPUT: [Data]
|
|
@@ -319,24 +342,27 @@ STEPS:
|
|
|
319
342
|
### Self-Consistency
|
|
320
343
|
Generate multiple reasoning paths and choose the most common answer:
|
|
321
344
|
|
|
345
|
+
**Research basis:** "Self-Consistency Improves Chain of Thought Reasoning in Language Models" (Wang et al., arXiv 2203.11171, ICLR 2023). Sample a diverse set of reasoning paths rather than greedy-decoding one, then "marginalize out the reasoning paths and aggregate by choosing the most consistent answer in the final answer set." On PaLM 540B / GSM8K, a majority vote over 40 sampled paths reached 74.4% versus 56.5% for greedy CoT decoding (+17.9 points); an unweighted majority vote matched or beat every weighted aggregation the authors tested.
|
|
346
|
+
|
|
347
|
+
The mechanism is **sampling the same prompt repeatedly and taking a majority vote** — not asking the model to try different methods and then judge which it likes best. Self-assessment is a different (and weaker) technique; the model is not a reliable judge of its own reasoning.
|
|
348
|
+
|
|
322
349
|
```
|
|
323
|
-
Solve this problem
|
|
350
|
+
Solve this problem. Show your step-by-step reasoning, then state your final
|
|
351
|
+
answer on its own line as:
|
|
324
352
|
|
|
325
|
-
|
|
326
|
-
[Method 1 with step-by-step reasoning]
|
|
353
|
+
FINAL ANSWER: [answer]
|
|
327
354
|
|
|
328
|
-
|
|
329
|
-
|
|
355
|
+
[Problem]
|
|
356
|
+
```
|
|
330
357
|
|
|
331
|
-
|
|
332
|
-
[Method 3 with step-by-step reasoning]
|
|
358
|
+
Run this **same prompt N times at non-zero temperature** (the paper samples 40; 5-10 is usually enough in practice, and temperature ~0.7 is a reasonable default). Then aggregate outside the model:
|
|
333
359
|
|
|
334
|
-
|
|
335
|
-
|
|
360
|
+
1. Extract the `FINAL ANSWER:` value from each of the N samples
|
|
361
|
+
2. Count how often each distinct answer appears
|
|
362
|
+
3. Return the most frequent answer — a plain, unweighted majority vote
|
|
363
|
+
4. Treat a near-tie as a signal of genuine uncertainty, not as a reason to ask the model to break the tie
|
|
336
364
|
|
|
337
|
-
|
|
338
|
-
Based on the most consistent result.
|
|
339
|
-
```
|
|
365
|
+
Do **not** ask the model to compare its own paths and pick the best one. The diversity of independently sampled reasoning is what produces the gain; collapsing it into a single self-judgment discards exactly the signal the method depends on.
|
|
340
366
|
|
|
341
367
|
### Uncertainty Quantification
|
|
342
368
|
```
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
CO-STAR is a comprehensive prompting framework that emphasizes context, audience, and communication style. It's particularly effective for content creation, writing tasks, and scenarios where tone and audience considerations significantly impact output quality.
|
|
5
|
+
CO-STAR is a comprehensive prompting framework that emphasizes context, audience, and communication style. It's particularly effective for content creation, writing tasks, and scenarios where tone and audience considerations significantly impact output quality. Section headers are stripped at emission, so a CO-STAR prompt lands as a flat block of prose — a paragraph of context, a stated objective, and self-standing sentences for style, tone, audience, and response format — preceded by an optional source-material block whenever the content is built from an artifact the user already has. Because the `STYLE`, `TONE`, and `AUDIENCE` labels do not survive, those slots have to be written as complete sentences rather than the bare descriptors ("professional yet friendly," "senior executives") they would otherwise collapse to.
|
|
6
|
+
|
|
7
|
+
**Origin:** Developed by the Data Science & AI team at GovTech (Government Technology Agency of Singapore), and popularized by Sheila Teo, who won GovTech's "Prompt Royale" — Singapore's first GPT-4 prompt engineering competition, 400+ participants, finale 8 November 2023. Teo credits the framework to GovTech rather than to herself: "The CO-STAR framework, a brainchild of GovTech Singapore's Data Science & AI team, is a handy template for structuring prompts." Practitioner framework — no controlled evaluation of CO-STAR has been published.
|
|
6
8
|
|
|
7
9
|
## Components
|
|
8
10
|
|
|
9
11
|
### C - Context
|
|
10
|
-
**Purpose:** Provide background information, situational details, and constraints.
|
|
12
|
+
**Purpose:** Provide background information, situational details, and constraints. It fills as a self-contained paragraph and survives header stripping on its own, so long as it reads as description of a situation rather than a bare label.
|
|
11
13
|
|
|
12
14
|
**Questions to Ask:**
|
|
13
15
|
- What's the background situation?
|
|
@@ -17,12 +19,12 @@ CO-STAR is a comprehensive prompting framework that emphasizes context, audience
|
|
|
17
19
|
- Are there any limitations or restrictions?
|
|
18
20
|
|
|
19
21
|
**Examples:**
|
|
20
|
-
- "You're working with a startup that has limited resources
|
|
21
|
-
- "This is for a formal government report
|
|
22
|
-
- "The user base is primarily non-technical
|
|
22
|
+
- "You're working with a startup that has limited resources."
|
|
23
|
+
- "This is for a formal government report."
|
|
24
|
+
- "The user base is primarily non-technical."
|
|
23
25
|
|
|
24
26
|
### O - Objective
|
|
25
|
-
**Purpose:** Define the clear, specific goal to be achieved.
|
|
27
|
+
**Purpose:** Define the clear, specific goal to be achieved, as one complete imperative sentence. Nothing else in the prompt states the task, so once the `OBJECTIVE` header is gone a bare goal fragment leaves the emitted prompt without an instruction.
|
|
26
28
|
|
|
27
29
|
**Questions to Ask:**
|
|
28
30
|
- What exactly do you want accomplished?
|
|
@@ -31,12 +33,12 @@ CO-STAR is a comprehensive prompting framework that emphasizes context, audience
|
|
|
31
33
|
- Are there secondary goals?
|
|
32
34
|
|
|
33
35
|
**Examples:**
|
|
34
|
-
- "Create a comprehensive product comparison
|
|
35
|
-
- "Generate ideas for reducing customer churn
|
|
36
|
-
- "Explain the concept in simple terms
|
|
36
|
+
- "Create a comprehensive product comparison of the three tools above."
|
|
37
|
+
- "Generate ideas for reducing customer churn."
|
|
38
|
+
- "Explain the concept in simple terms."
|
|
37
39
|
|
|
38
40
|
### S - Style
|
|
39
|
-
**Purpose:** Specify the writing style, format, and structural preferences.
|
|
41
|
+
**Purpose:** Specify the writing style, format, and structural preferences. Phrase it as an instruction ("Write in…", "Follow…"), not a bare descriptor, because the `STYLE` header is stripped and a fragment like "journalistic, short paragraphs" no longer reads as a directive on its own.
|
|
40
42
|
|
|
41
43
|
**Questions to Ask:**
|
|
42
44
|
- What writing style is appropriate?
|
|
@@ -46,12 +48,12 @@ CO-STAR is a comprehensive prompting framework that emphasizes context, audience
|
|
|
46
48
|
- Any style guides to follow?
|
|
47
49
|
|
|
48
50
|
**Examples:**
|
|
49
|
-
- "Use a journalistic style with short paragraphs
|
|
50
|
-
- "Follow AP style guidelines
|
|
51
|
-
- "Write in a conversational, blog-post style
|
|
51
|
+
- "Use a journalistic style with short paragraphs."
|
|
52
|
+
- "Follow AP style guidelines."
|
|
53
|
+
- "Write in a conversational, blog-post style."
|
|
52
54
|
|
|
53
55
|
### T - Tone
|
|
54
|
-
**Purpose:** Set the emotional quality and attitude of the response.
|
|
56
|
+
**Purpose:** Set the emotional quality and attitude of the response. Because the `TONE` header does not survive emission, write the slot as a complete sentence ("Keep the tone…", "Sound…") — a bare adjective phrase like "professional yet friendly" dangles once the label is deleted.
|
|
55
57
|
|
|
56
58
|
**Questions to Ask:**
|
|
57
59
|
- What emotional quality should it have?
|
|
@@ -60,13 +62,13 @@ CO-STAR is a comprehensive prompting framework that emphasizes context, audience
|
|
|
60
62
|
- Urgent or measured?
|
|
61
63
|
|
|
62
64
|
**Examples:**
|
|
63
|
-
- "
|
|
64
|
-
- "
|
|
65
|
-
- "
|
|
66
|
-
- "
|
|
65
|
+
- "Keep the tone professional yet friendly."
|
|
66
|
+
- "Make it urgent and action-oriented."
|
|
67
|
+
- "Keep it empathetic and supportive."
|
|
68
|
+
- "Sound confident and authoritative."
|
|
67
69
|
|
|
68
70
|
### A - Audience
|
|
69
|
-
**Purpose:** Identify who will consume the output and their characteristics.
|
|
71
|
+
**Purpose:** Identify who will consume the output and their characteristics. Name the audience in a complete sentence ("The audience is…"), because the `AUDIENCE` header is stripped and a bare noun phrase like "senior executives" would otherwise sit in the flat block with nothing marking it as the reader.
|
|
70
72
|
|
|
71
73
|
**Questions to Ask:**
|
|
72
74
|
- Who is the target audience?
|
|
@@ -76,12 +78,12 @@ CO-STAR is a comprehensive prompting framework that emphasizes context, audience
|
|
|
76
78
|
- What's their context?
|
|
77
79
|
|
|
78
80
|
**Examples:**
|
|
79
|
-
- "
|
|
80
|
-
- "
|
|
81
|
-
- "
|
|
81
|
+
- "The audience is senior executives with limited technical knowledge."
|
|
82
|
+
- "The audience is junior developers learning the framework."
|
|
83
|
+
- "The audience is parents of elementary school children."
|
|
82
84
|
|
|
83
85
|
### R - Response
|
|
84
|
-
**Purpose:** Define the expected output format and structure.
|
|
86
|
+
**Purpose:** Define the expected output format and structure. Phrase it as an instruction about the output ("Provide…", "Format the result as…") so it still reads as a directive once the `RESPONSE FORMAT` header is removed.
|
|
85
87
|
|
|
86
88
|
**Questions to Ask:**
|
|
87
89
|
- What format should the output take?
|
|
@@ -91,61 +93,117 @@ CO-STAR is a comprehensive prompting framework that emphasizes context, audience
|
|
|
91
93
|
- What level of detail is needed?
|
|
92
94
|
|
|
93
95
|
**Examples:**
|
|
94
|
-
- "Provide a 500-word article with 3 main sections
|
|
95
|
-
- "
|
|
96
|
-
- "Generate a table comparing features
|
|
96
|
+
- "Provide a 500-word article with 3 main sections."
|
|
97
|
+
- "Format the result as a bulleted list of 10 items."
|
|
98
|
+
- "Generate a table comparing features."
|
|
97
99
|
|
|
98
100
|
## Template Structure
|
|
99
101
|
|
|
102
|
+
Section headers are stripped at emission, so every slot's meaning is carried by the prose
|
|
103
|
+
around and inside it rather than by the header above it. Context is a self-contained
|
|
104
|
+
paragraph and survives on its own; Objective must be a complete imperative sentence; and
|
|
105
|
+
Style, Tone, Audience, and Response Format each have to be phrased as a full sentence,
|
|
106
|
+
because the labels that would otherwise mark them as style, tone, audience, or format are
|
|
107
|
+
the first thing deleted.
|
|
108
|
+
|
|
100
109
|
```
|
|
110
|
+
SOURCE MATERIAL:
|
|
111
|
+
[OPTIONAL — include only if the content is built from material the user already has.
|
|
112
|
+
If so, emit a literal paste instruction naming the specific artifact, e.g. "[Paste the Q3 revenue report here]"
|
|
113
|
+
or "[Paste the blog post whose voice should be matched here]" — never a generic word like "content" —
|
|
114
|
+
then one line of prose tying it to what follows, e.g. "Use the material above as the factual and stylistic
|
|
115
|
+
basis for what you produce; do not invent details it does not support."
|
|
116
|
+
If the content is written entirely from scratch, omit this section — do not emit an empty placeholder.]
|
|
117
|
+
|
|
101
118
|
CONTEXT:
|
|
102
|
-
[
|
|
119
|
+
[Provide background information, situation, and any relevant constraints. What's the setting? What's happened before? What limitations exist?]
|
|
103
120
|
|
|
104
121
|
OBJECTIVE:
|
|
105
|
-
[
|
|
122
|
+
[State the clear, specific goal you want to achieve. What exactly do you want accomplished? What does success look like?]
|
|
106
123
|
|
|
107
124
|
STYLE:
|
|
108
|
-
[
|
|
125
|
+
[Specify the writing style, format preferences, and structural approach. Should it follow a particular style guide? What format is needed?]
|
|
109
126
|
|
|
110
127
|
TONE:
|
|
111
|
-
[
|
|
128
|
+
[Define the emotional quality and attitude. Should it be professional, casual, urgent, friendly, authoritative, empathetic, etc.?]
|
|
112
129
|
|
|
113
130
|
AUDIENCE:
|
|
114
|
-
[
|
|
131
|
+
[Identify who will consume this output. What's their expertise level? What do they care about? What are their characteristics?]
|
|
115
132
|
|
|
116
133
|
RESPONSE FORMAT:
|
|
117
|
-
[
|
|
134
|
+
[Specify the expected output structure. How long? What sections? What level of detail? Any specific format requirements?]
|
|
118
135
|
```
|
|
119
136
|
|
|
120
|
-
|
|
137
|
+
`SOURCE MATERIAL` is a seventh block in a six-letter acronym, and it carries no letter
|
|
138
|
+
because it is optional. Much CO-STAR work rewrites, repurposes, or matches the voice of
|
|
139
|
+
something that already exists — a report to summarize, a press release to adapt, a post
|
|
140
|
+
whose style should be echoed — and that artifact is pasted here, named concretely (never
|
|
141
|
+
the generic word "content"), and referred to as "the … above" from inside the Objective.
|
|
142
|
+
Delete the block whenever the content is written entirely from scratch; do not leave an
|
|
143
|
+
empty placeholder.
|
|
144
|
+
|
|
145
|
+
## Complete Examples
|
|
146
|
+
|
|
147
|
+
Every example below is shown in emitted form: each slot carries its own role in prose.
|
|
148
|
+
Read the headers as scaffolding that will be deleted — the examples are written so that
|
|
149
|
+
nothing is lost when it is, which is why Style, Tone, Audience, and Response Format each
|
|
150
|
+
read as a complete sentence.
|
|
151
|
+
|
|
152
|
+
### Example 1: Health Blog Article
|
|
121
153
|
|
|
122
|
-
|
|
154
|
+
**Before CO-STAR:**
|
|
123
155
|
"Write about the benefits of exercise."
|
|
124
156
|
|
|
125
|
-
|
|
157
|
+
**After CO-STAR** (no source material — the article is written from scratch, so the
|
|
158
|
+
`SOURCE MATERIAL` block is omitted):
|
|
126
159
|
```
|
|
127
160
|
CONTEXT:
|
|
128
161
|
I'm creating content for a health blog aimed at busy professionals who struggle to find time for fitness. Previous articles have focused on nutrition, and this is part of a series on lifestyle improvements.
|
|
129
162
|
|
|
130
163
|
OBJECTIVE:
|
|
131
|
-
|
|
164
|
+
Write an engaging article that convinces time-pressed professionals that exercise is worth prioritizing, focusing on benefits beyond just physical health.
|
|
132
165
|
|
|
133
166
|
STYLE:
|
|
134
167
|
Use a conversational blog style with short paragraphs (2-3 sentences), subheadings every 150-200 words, and occasional bullet points for key takeaways. Include specific examples and avoid medical jargon.
|
|
135
168
|
|
|
136
169
|
TONE:
|
|
137
|
-
|
|
170
|
+
Keep the tone encouraging and motivating without being preachy. Acknowledge their time constraints and show empathy for their challenges, and stay practical and realistic rather than idealistic.
|
|
171
|
+
|
|
172
|
+
AUDIENCE:
|
|
173
|
+
The audience is professionals aged 30-50 who work 50+ hour weeks, have limited free time, may have families, and currently don't exercise regularly. They're skeptical of fitness advice that seems unrealistic for their lifestyle.
|
|
174
|
+
|
|
175
|
+
RESPONSE FORMAT:
|
|
176
|
+
Produce an 800-word article with an engaging headline, a brief 2-3 sentence introduction, 4-5 main sections with subheadings, bullet points highlighting key benefits, and a practical conclusion with next steps.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Example 2: Executive Summary from a Report
|
|
180
|
+
|
|
181
|
+
**Before CO-STAR:**
|
|
182
|
+
"Summarize this report for the board."
|
|
183
|
+
|
|
184
|
+
**After CO-STAR** (source material supplied):
|
|
185
|
+
```
|
|
186
|
+
SOURCE MATERIAL:
|
|
187
|
+
[Paste the Q3 revenue report here]
|
|
188
|
+
Use the material above as the factual and stylistic basis for what you produce; do not invent details it does not support.
|
|
189
|
+
|
|
190
|
+
CONTEXT:
|
|
191
|
+
I'm the head of finance at a mid-size SaaS company, preparing a summary of our Q3 performance for the board's quarterly meeting. The full report above is 20 pages of financial detail, and the board sees dozens of documents per meeting.
|
|
192
|
+
|
|
193
|
+
OBJECTIVE:
|
|
194
|
+
Distill the Q3 revenue report above into a one-page summary the board can absorb in two minutes, surfacing the numbers and trends that bear on strategic decisions.
|
|
195
|
+
|
|
196
|
+
STYLE:
|
|
197
|
+
Write in a crisp executive-brief style: lead with the conclusion, use short declarative sentences, and support each claim with a figure drawn from the report above rather than a general statement.
|
|
198
|
+
|
|
199
|
+
TONE:
|
|
200
|
+
Keep the tone measured and factual — neither alarmist about the misses nor promotional about the wins.
|
|
138
201
|
|
|
139
202
|
AUDIENCE:
|
|
140
|
-
|
|
203
|
+
The audience is board members who are financially literate but not close to day-to-day operations; they care about growth, runway, and risk, not implementation detail.
|
|
141
204
|
|
|
142
205
|
RESPONSE FORMAT:
|
|
143
|
-
|
|
144
|
-
- Engaging headline
|
|
145
|
-
- Brief introduction (2-3 sentences)
|
|
146
|
-
- 4-5 main sections with subheadings
|
|
147
|
-
- Bullet points highlighting key benefits
|
|
148
|
-
- Practical conclusion with next steps
|
|
206
|
+
Produce a single page: three sentences of headline takeaways, then a short table of the key metrics with quarter-over-quarter change, then a four-item bulleted list of the decisions or risks that need the board's attention.
|
|
149
207
|
```
|
|
150
208
|
|
|
151
209
|
## Best Use Cases
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
CRISPE is a comprehensive general-purpose prompting framework covering six dimensions: Capacity and Role, Insight, Instructions, Personality, and Experiment. Its defining feature — the **Experiment** component — sets it apart from similar frameworks by explicitly asking the AI to produce multiple variants, approaches, or versions, enabling the user to compare and choose the best output rather than accepting a single answer.
|
|
6
6
|
|
|
7
|
-
**Origin:**
|
|
7
|
+
**Origin:** Community framework, commonly attributed to Matt Nigh (2022). No primary source for that attribution has been verified for this package. Practitioner framework — no controlled evaluation of CRISPE has been published.
|
|
8
|
+
|
|
9
|
+
*Correction:* an earlier version of this file stated that CRISPE was "cited in PMC peer-reviewed medical AI studies, 2024-2025" and in "educational technology research (Springer, 2025)." Those claims named no title, author, DOI, or PMCID and were not checkable as written, so they have been removed. Being *mentioned* in a paper would not constitute evaluation of the framework in any case.
|
|
8
10
|
|
|
9
11
|
## Components
|
|
10
12
|
|
|
11
|
-
### C — Capacity and Role
|
|
13
|
+
### C, R — Capacity and Role
|
|
12
14
|
**Purpose:** Define the expertise level and professional role the AI should embody. More specific than a simple "you are a..." — it combines the *type* of expertise with the *level* of sophistication expected.
|
|
13
15
|
|
|
14
16
|
**Questions to Ask:**
|
|
@@ -21,7 +23,7 @@ CRISPE is a comprehensive general-purpose prompting framework covering six dimen
|
|
|
21
23
|
- "You are a senior software architect specializing in distributed systems..."
|
|
22
24
|
- "Act as a world-class UX researcher who has run hundreds of user interviews..."
|
|
23
25
|
|
|
24
|
-
###
|
|
26
|
+
### I — Insight
|
|
25
27
|
**Purpose:** Provide the background context, data, or knowledge the AI needs to perform the task effectively. This is the "briefing" — what you'd tell a new consultant before they start work.
|
|
26
28
|
|
|
27
29
|
**Questions to Ask:**
|
|
@@ -34,7 +36,7 @@ CRISPE is a comprehensive general-purpose prompting framework covering six dimen
|
|
|
34
36
|
- "Context: our team uses Python exclusively, we have a 3-month deadline, and our infrastructure is AWS..."
|
|
35
37
|
- "Background: this is for a Series A startup pitching to enterprise buyers for the first time..."
|
|
36
38
|
|
|
37
|
-
###
|
|
39
|
+
### S — Instructions
|
|
38
40
|
**Purpose:** State clearly and specifically what the AI should do. The task itself, with enough detail to remove ambiguity.
|
|
39
41
|
|
|
40
42
|
**Questions to Ask:**
|
|
@@ -47,7 +49,7 @@ CRISPE is a comprehensive general-purpose prompting framework covering six dimen
|
|
|
47
49
|
- "Create a technical design document for this feature..."
|
|
48
50
|
- "Analyze this data and identify the top 3 risk factors..."
|
|
49
51
|
|
|
50
|
-
###
|
|
52
|
+
### P — Personality (Style)
|
|
51
53
|
**Purpose:** Define the tone, voice, and communication style of the response. Sets how the output should *feel* — the personality it should embody.
|
|
52
54
|
|
|
53
55
|
**Questions to Ask:**
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
CTF is a simple 3-component framework focused on situational context, task clarity, and output format. It is ideal for tasks where background/situation is more important than AI persona framing, and the primary concern is getting a clearly defined output from a well-understood context.
|
|
5
|
+
CTF is a simple 3-component framework focused on situational context, task clarity, and output format. It is ideal for tasks where background/situation is more important than AI persona framing, and the primary concern is getting a clearly defined output from a well-understood context. Section headers are stripped when the prompt is emitted, so a CTF prompt lands as a short flat block — a paragraph of situation, a sentence naming the task, and a format specification — preceded by an optional source-material block whenever the task operates on an artifact that already exists.
|
|
6
|
+
|
|
7
|
+
**Origin:** No single documented originator. CTF appears in the community framework literature as a variant of RTF, with Context substituted for Role, documented alongside it in unattributed practitioner listings from 2024 onward (e.g. fvivas.com, 15 March 2024). No academic treatment; absent from The Prompt Report (arXiv 2406.06608).
|
|
6
8
|
|
|
7
9
|
## Components
|
|
8
10
|
|
|
9
11
|
### C - Context
|
|
10
|
-
**Purpose:** Describe the situation, background, or circumstances surrounding the task.
|
|
12
|
+
**Purpose:** Describe the situation, background, or circumstances surrounding the task. It fills naturally as a self-contained paragraph of situational prose, so it survives header stripping on its own — but keep it descriptive narrative, not a bare label like "legacy code," so the paragraph still reads as a situation once the `CONTEXT` header is gone.
|
|
11
13
|
|
|
12
14
|
**Questions to Ask:**
|
|
13
15
|
- What is the current situation?
|
|
@@ -17,12 +19,12 @@ CTF is a simple 3-component framework focused on situational context, task clari
|
|
|
17
19
|
- What constraints or circumstances apply?
|
|
18
20
|
|
|
19
21
|
**Examples:**
|
|
20
|
-
- "We are mid-sprint and the client has
|
|
21
|
-
- "I
|
|
22
|
-
- "Our team writes internal status reports weekly and we
|
|
22
|
+
- "We are mid-sprint and the client has revised the acceptance criteria in the requirements doc above; the dev team has not been told yet."
|
|
23
|
+
- "I am a junior developer onboarding to the legacy Python module above, which nobody has documented."
|
|
24
|
+
- "Our team writes internal status reports weekly and the format drifts every time, so we want one reusable structure."
|
|
23
25
|
|
|
24
26
|
### T - Task
|
|
25
|
-
**Purpose:** State exactly what needs to be done.
|
|
27
|
+
**Purpose:** State exactly what needs to be done, as one complete imperative sentence. Nothing else in a CTF prompt states the task, so once the `TASK` header is stripped a bare noun phrase ("a summary") leaves the emitted prompt with no instruction in it.
|
|
26
28
|
|
|
27
29
|
**Questions to Ask:**
|
|
28
30
|
- What exactly needs to be done?
|
|
@@ -30,12 +32,12 @@ CTF is a simple 3-component framework focused on situational context, task clari
|
|
|
30
32
|
- What's the core action?
|
|
31
33
|
|
|
32
34
|
**Examples:**
|
|
33
|
-
- "
|
|
34
|
-
- "Explain what
|
|
35
|
-
- "Create a template
|
|
35
|
+
- "Summarize the changed requirements in the doc above for the development team."
|
|
36
|
+
- "Explain in plain language what the function above does."
|
|
37
|
+
- "Create a reusable weekly status report template the team can fill out in under 10 minutes."
|
|
36
38
|
|
|
37
39
|
### F - Format
|
|
38
|
-
**Purpose:** Specify how the output should be structured.
|
|
40
|
+
**Purpose:** Specify how the output should be structured. Phrase it as an instruction about the output rather than a bare descriptor — a fragment like "markdown table" dangles once the `FORMAT` header is deleted, whereas "Provide the output as a markdown table" still reads as a directive.
|
|
39
41
|
|
|
40
42
|
**Questions to Ask:**
|
|
41
43
|
- What format should the output take?
|
|
@@ -44,46 +46,80 @@ CTF is a simple 3-component framework focused on situational context, task clari
|
|
|
44
46
|
- Any specific formatting requirements?
|
|
45
47
|
|
|
46
48
|
**Examples:**
|
|
47
|
-
- "Provide as a markdown table
|
|
48
|
-
- "Format as a bulleted list under three headings
|
|
49
|
-
- "Write as a
|
|
49
|
+
- "Provide the output as a markdown table."
|
|
50
|
+
- "Format the answer as a bulleted list under three headings."
|
|
51
|
+
- "Write the answer as a single paragraph of 100 words or fewer."
|
|
50
52
|
|
|
51
53
|
## Template Structure
|
|
52
54
|
|
|
55
|
+
Section headers are stripped at emission, so every slot's meaning is carried by the prose
|
|
56
|
+
around and inside it rather than by the header above it. Context is a self-contained
|
|
57
|
+
paragraph and survives on its own; Task must be a complete imperative sentence, and Format
|
|
58
|
+
must be phrased as an instruction about the output, because neither has a header to lean on
|
|
59
|
+
once emitted.
|
|
60
|
+
|
|
53
61
|
```
|
|
62
|
+
SOURCE MATERIAL:
|
|
63
|
+
[Optional — include only if this task operates on material you already have. Paste the
|
|
64
|
+
specific artifact here and name it in this line, e.g. "Paste the legacy authentication
|
|
65
|
+
function here", "Paste the revised requirements doc here" — the artifact itself, not a
|
|
66
|
+
description of it. If this task generates from scratch, delete this bracketed block along
|
|
67
|
+
with the sentence directly below it.]
|
|
68
|
+
Use the material above as the basis for the task described below.
|
|
69
|
+
|
|
54
70
|
CONTEXT:
|
|
55
|
-
[
|
|
71
|
+
[Describe the situation, background, or circumstances surrounding this task.
|
|
72
|
+
Include relevant details like: current state, constraints, what's already been done,
|
|
73
|
+
why this is needed, and any important background the AI should know.]
|
|
56
74
|
|
|
57
75
|
TASK:
|
|
58
|
-
[
|
|
76
|
+
[State clearly and specifically what needs to be done. Be explicit about the deliverable.]
|
|
59
77
|
|
|
60
78
|
FORMAT:
|
|
61
|
-
[
|
|
79
|
+
[Specify exactly how the output should be structured:
|
|
80
|
+
- Overall format (document, code, list, table, etc.)
|
|
81
|
+
- Required sections or components
|
|
82
|
+
- Length constraints
|
|
83
|
+
- Style requirements
|
|
84
|
+
- Any specific formatting rules]
|
|
62
85
|
```
|
|
63
86
|
|
|
87
|
+
`SOURCE MATERIAL` is a fourth block in a three-letter acronym, and it carries no letter
|
|
88
|
+
because it is optional. CTF is often pointed at something that already exists — a legacy
|
|
89
|
+
function, a revised requirements doc, a draft — and that artifact is pasted here and
|
|
90
|
+
referred to as "the … above" from inside the Task. Delete the block and the sentence
|
|
91
|
+
beneath it whenever the task generates something from scratch.
|
|
92
|
+
|
|
64
93
|
## Complete Examples
|
|
65
94
|
|
|
95
|
+
Every example below is shown in emitted form: each slot carries its own role in prose.
|
|
96
|
+
Read the headers as scaffolding that will be deleted — the examples are written so that
|
|
97
|
+
nothing is lost when it is.
|
|
98
|
+
|
|
66
99
|
### Example 1: Requirement Change Summary
|
|
67
100
|
|
|
68
101
|
**Before CTF:**
|
|
69
102
|
"Summarize the new requirements."
|
|
70
103
|
|
|
71
|
-
**After CTF
|
|
104
|
+
**After CTF** (source material supplied):
|
|
72
105
|
```
|
|
106
|
+
SOURCE MATERIAL:
|
|
107
|
+
[Paste the client's revised login-flow requirements here]
|
|
108
|
+
Use the material above as the basis for the task described below.
|
|
109
|
+
|
|
73
110
|
CONTEXT:
|
|
74
111
|
We are in sprint 3 of a 6-sprint project. The client just revised the login flow
|
|
75
|
-
requirements: they now want SSO via Google instead of
|
|
76
|
-
hasn't been told yet and we need to communicate this
|
|
112
|
+
requirements in the document above: they now want SSO via Google instead of
|
|
113
|
+
email/password. The dev team hasn't been told yet and we need to communicate this
|
|
114
|
+
clearly without causing panic.
|
|
77
115
|
|
|
78
116
|
TASK:
|
|
79
|
-
Write a brief summary of the requirement change to share with the development team
|
|
117
|
+
Write a brief summary of the requirement change above to share with the development team
|
|
80
118
|
in Slack.
|
|
81
119
|
|
|
82
120
|
FORMAT:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- End with a single action item
|
|
86
|
-
- Keep total under 150 words
|
|
121
|
+
Format the summary as 3-5 bullet points in plain language with no jargon, ending with a
|
|
122
|
+
single action item, and keep the total under 150 words.
|
|
87
123
|
```
|
|
88
124
|
|
|
89
125
|
### Example 2: Code Explanation
|
|
@@ -91,21 +127,24 @@ FORMAT:
|
|
|
91
127
|
**Before CTF:**
|
|
92
128
|
"Explain this code."
|
|
93
129
|
|
|
94
|
-
**After CTF
|
|
130
|
+
**After CTF** (source material supplied):
|
|
95
131
|
```
|
|
132
|
+
SOURCE MATERIAL:
|
|
133
|
+
[Paste the undocumented legacy authentication function here]
|
|
134
|
+
Use the material above as the basis for the task described below.
|
|
135
|
+
|
|
96
136
|
CONTEXT:
|
|
97
|
-
I'm a junior developer new to this codebase. The function
|
|
137
|
+
I'm a junior developer new to this codebase. The function above is from a legacy
|
|
98
138
|
authentication module that nobody has documented. I need to understand it before
|
|
99
139
|
refactoring it next week.
|
|
100
140
|
|
|
101
141
|
TASK:
|
|
102
|
-
Explain what
|
|
142
|
+
Explain what the function above does, why each section exists, and flag any potential
|
|
103
143
|
issues I should know before touching it.
|
|
104
144
|
|
|
105
145
|
FORMAT:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- Potential issues section at the end (bullet points)
|
|
146
|
+
Open with a short plain-language summary of 2-3 sentences, then give a line-by-line
|
|
147
|
+
breakdown as a numbered list, and end with a bulleted "Potential issues" section.
|
|
109
148
|
```
|
|
110
149
|
|
|
111
150
|
### Example 3: Template Creation
|
|
@@ -113,7 +152,8 @@ FORMAT:
|
|
|
113
152
|
**Before CTF:**
|
|
114
153
|
"Create a status report template."
|
|
115
154
|
|
|
116
|
-
**After CTF
|
|
155
|
+
**After CTF** (no source material — the template is designed from scratch, so the
|
|
156
|
+
`SOURCE MATERIAL` block and the sentence below it are both deleted):
|
|
117
157
|
```
|
|
118
158
|
CONTEXT:
|
|
119
159
|
Our team of 6 engineers sends weekly status reports to a non-technical product
|
|
@@ -124,11 +164,9 @@ TASK:
|
|
|
124
164
|
Create a weekly status report template that balances completeness with brevity.
|
|
125
165
|
|
|
126
166
|
FORMAT:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
- Total estimated fill-in time: under 10 minutes
|
|
131
|
-
- Length when filled: 200-300 words
|
|
167
|
+
Produce a markdown template with section headers, a fill-in placeholder under each header,
|
|
168
|
+
and a brief instruction comment beneath it. Aim for under 10 minutes of fill-in time and a
|
|
169
|
+
filled length of 200-300 words.
|
|
132
170
|
```
|
|
133
171
|
|
|
134
172
|
## Best Use Cases
|
|
@@ -168,7 +206,7 @@ Markdown template with:
|
|
|
168
206
|
- ❌ Audience and tone are critical (use CO-STAR)
|
|
169
207
|
- ❌ Multi-step process with methodology needed (use RISEN)
|
|
170
208
|
- ❌ Explicit dos/don'ts required (use TIDD-EC)
|
|
171
|
-
- ❌ Input→output transformation (use RISE-IE)
|
|
209
|
+
- ❌ Input→output transformation (use RISE-IE — the Role/Input/Steps/Expectation form)
|
|
172
210
|
|
|
173
211
|
## CTF vs RTF
|
|
174
212
|
|