@ckelsoe/prompt-architect 3.2.1 → 3.3.1
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 +116 -5
- package/MIGRATION.md +1 -1
- package/README.md +42 -45
- package/adapters/README.md +1 -1
- package/adapters/system-prompt.md +41 -11
- package/package.json +5 -4
- package/scripts/install.js +52 -22
- package/scripts/test.js +62 -40
- package/scripts/validate-skill.js +184 -56
- package/skills/prompt-architect/SKILL.md +49 -47
- package/skills/prompt-architect/assets/templates/chain-of-density_template.txt +60 -30
- package/skills/prompt-architect/assets/templates/iterative-compression_template.txt +59 -0
- package/skills/prompt-architect/references/frameworks/ape.md +2 -0
- package/skills/prompt-architect/references/frameworks/bab.md +2 -0
- package/skills/prompt-architect/references/frameworks/cai-critique-revise.md +1 -1
- package/skills/prompt-architect/references/frameworks/chain-of-density.md +95 -423
- package/skills/prompt-architect/references/frameworks/chain-of-thought.md +17 -12
- package/skills/prompt-architect/references/frameworks/co-star.md +2 -0
- package/skills/prompt-architect/references/frameworks/ctf.md +3 -1
- package/skills/prompt-architect/references/frameworks/iterative-compression.md +481 -0
- package/skills/prompt-architect/references/frameworks/pre-mortem.md +6 -6
- package/skills/prompt-architect/references/frameworks/race.md +2 -0
- package/skills/prompt-architect/references/frameworks/react.md +1 -1
- package/skills/prompt-architect/references/frameworks/reverse-role.md +1 -1
- package/skills/prompt-architect/references/frameworks/rise.md +27 -8
- package/skills/prompt-architect/references/frameworks/risen.md +2 -0
- package/skills/prompt-architect/references/frameworks/rtf.md +2 -0
- package/skills/prompt-architect/references/frameworks/skeleton-of-thought.md +1 -1
- package/skills/prompt-architect/references/frameworks/step-back.md +1 -1
- package/skills/prompt-architect/references/frameworks/tidd-ec.md +19 -6
- package/skills/prompt-architect/scripts/framework_analyzer.py +0 -807
- package/skills/prompt-architect/scripts/prompt_evaluator.py +0 -336
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: prompt-architect
|
|
3
|
-
description: Analyzes and improves prompts using
|
|
3
|
+
description: Analyzes and improves prompts using 29 frameworks across 7 intent categories. Use when a user wants to improve, rewrite, structure, or engineer a prompt — including requests like "help me write a better prompt", "improve this prompt", "what framework should I use", "make this prompt more effective", or any prompt engineering task. Recommends the right framework based on intent (create, transform, reason, critique, recover, clarify, agentic), asks targeted questions, and delivers a structured, high-quality result.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Requires no external dependencies. Works with any Agent Skills compatible tool.
|
|
6
6
|
metadata:
|
|
7
7
|
author: ckelsoe
|
|
8
|
-
version: "3.
|
|
8
|
+
version: "3.3.1"
|
|
9
9
|
homepage: https://github.com/ckelsoe/prompt-architect
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -17,16 +17,30 @@ You are an expert in prompt engineering and systematic application of prompting
|
|
|
17
17
|
|
|
18
18
|
### 1. Initial Assessment
|
|
19
19
|
|
|
20
|
-
When a user provides a prompt to improve,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
When a user provides a prompt to improve, **score it 1-10 on each of these five dimensions** and report an overall score (the mean, to one decimal place). Always show the scores — they justify the changes you are about to make and give the user a before/after they can feel.
|
|
21
|
+
|
|
22
|
+
| Dimension | What you are scoring |
|
|
23
|
+
|---|---|
|
|
24
|
+
| **Clarity** | Is the goal unambiguous? Penalize vague terms ("thing", "stuff", "something", "maybe"), unresolved pronouns, and an implied-but-unstated objective. |
|
|
25
|
+
| **Specificity** | Are requirements concrete? Reward named entities, quantities, and explicit format/length/style specifications. Penalize prompts so short they cannot carry the detail. |
|
|
26
|
+
| **Context** | Is the necessary background present? Reward stated situation, audience, and rationale ("because", "in order to"). Penalize a bare instruction with no setting. |
|
|
27
|
+
| **Completeness** | Are *what*, *why*, *how*, and *output format* all present? Each missing element costs. |
|
|
28
|
+
| **Structure** | Is it organized for its length? Reward sections, lists, and logical ordering. Penalize run-on sentences and long unbroken prose. |
|
|
29
|
+
|
|
30
|
+
**Rubric anchors** — apply per dimension so scores mean the same thing every time:
|
|
31
|
+
|
|
32
|
+
| Band | Meaning |
|
|
33
|
+
|---|---|
|
|
34
|
+
| **1-3** | Absent or actively harmful. The model would have to guess this dimension entirely. |
|
|
35
|
+
| **4-6** | Present but underspecified. The model can proceed, but will fill gaps with assumptions the user did not choose. |
|
|
36
|
+
| **7-8** | Solid. Enough to produce a good result; refinement would be marginal. |
|
|
37
|
+
| **9-10** | Complete and unambiguous. A competent model has nothing left to infer on this dimension. |
|
|
38
|
+
|
|
39
|
+
Score the prompt *as written*, not as you charitably interpret it — the gap between those two is precisely what the framework will fix. A prompt scoring 7+ across the board often needs no framework at all (see **When NOT to Use Frameworks**).
|
|
26
40
|
|
|
27
41
|
### 2. Intent-Based Framework Selection
|
|
28
42
|
|
|
29
|
-
With
|
|
43
|
+
With 29 frameworks, identify the user's **primary intent** first, then use the discriminating questions within that category.
|
|
30
44
|
|
|
31
45
|
---
|
|
32
46
|
|
|
@@ -68,7 +82,8 @@ With 27 frameworks, identify the user's **primary intent** first, then use the d
|
|
|
68
82
|
|--------|-----------|
|
|
69
83
|
| Rewrite, refactor, convert | **BAB** |
|
|
70
84
|
| Iterative quality improvement | **Self-Refine** |
|
|
71
|
-
|
|
|
85
|
+
| Summarize at fixed length, maximize information | **Chain of Density** |
|
|
86
|
+
| Shorten text toward a target length | **Iterative Compression** |
|
|
72
87
|
| Outline-first then expand sections | **Skeleton of Thought** |
|
|
73
88
|
|
|
74
89
|
---
|
|
@@ -106,6 +121,20 @@ With 27 frameworks, identify the user's **primary intent** first, then use the d
|
|
|
106
121
|
|
|
107
122
|
---
|
|
108
123
|
|
|
124
|
+
#### Combining Frameworks
|
|
125
|
+
|
|
126
|
+
Most prompts need exactly one framework. Combine only when the task genuinely has **two separable phases** — one framework structures the request, a second governs how the output is checked or refined. If you cannot name the two phases, do not combine.
|
|
127
|
+
|
|
128
|
+
| When | Combination | Why |
|
|
129
|
+
|---|---|---|
|
|
130
|
+
| High-stakes content that must survive review | **CO-STAR + Self-Refine** | CO-STAR fixes audience/tone/format; Self-Refine adds a critique-and-revise loop before delivery |
|
|
131
|
+
| Multi-step procedure executed with tools | **RISEN + ReAct** | RISEN specifies the steps and success criteria; ReAct governs the tool-use cycle within each step |
|
|
132
|
+
| Business deliverable with a hostile audience | **BROKE + Devil's Advocate** | BROKE sets objective and key results; Devil's Advocate stress-tests them before they reach a stakeholder |
|
|
133
|
+
|
|
134
|
+
When you combine, load `assets/templates/hybrid_template.txt` and state plainly in your analysis which framework owns which phase. Never stack more than two — a third adds structure the model spends attention parsing rather than following.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
109
138
|
### 3. Framework Quick Reference
|
|
110
139
|
|
|
111
140
|
One-line per framework (load `references/frameworks/` for full detail):
|
|
@@ -115,7 +144,7 @@ One-line per framework (load `references/frameworks/` for full detail):
|
|
|
115
144
|
**Comprehensive:** CO-STAR | RISEN | TIDD-EC
|
|
116
145
|
**Data:** RISE-IE | RISE-IX
|
|
117
146
|
**Reasoning:** Plan-and-Solve | Chain of Thought | Least-to-Most | Step-Back | Tree of Thought | RCoT
|
|
118
|
-
**Structure/Iteration:** Skeleton of Thought | Chain of Density
|
|
147
|
+
**Structure/Iteration:** Skeleton of Thought | Chain of Density | Iterative Compression
|
|
119
148
|
**Critique/Quality:** Self-Refine | CAI Critique-Revise | Devil's Advocate | Pre-Mortem
|
|
120
149
|
**Meta/Reverse:** RPEF | Reverse Role Prompting
|
|
121
150
|
**Agentic:** ReAct
|
|
@@ -144,7 +173,8 @@ Ask targeted questions (3-5 at a time) based on identified gaps:
|
|
|
144
173
|
**For Least-to-Most**: Full problem, decomposed subproblems in dependency order?
|
|
145
174
|
**For Plan-and-Solve**: Problem with all relevant numbers/variables?
|
|
146
175
|
**For Chain of Thought**: Problem, reasoning steps, verification?
|
|
147
|
-
**For Chain of Density**:
|
|
176
|
+
**For Chain of Density**: Source document to summarize, fixed target length, number of iterations?
|
|
177
|
+
**For Iterative Compression**: Content to compress, target length, optimization goal, stopping criterion?
|
|
148
178
|
**For Self-Refine**: Output to improve, feedback dimensions, stop condition?
|
|
149
179
|
**For CAI Critique-Revise**: The principle to enforce, output to critique?
|
|
150
180
|
**For Devil's Advocate**: Position to attack, attack dimensions, severity ranking needed?
|
|
@@ -153,7 +183,7 @@ Ask targeted questions (3-5 at a time) based on identified gaps:
|
|
|
153
183
|
**For RPEF**: Output sample to reverse-engineer, input data if available?
|
|
154
184
|
**For Reverse Role**: Intent statement, domain of expertise, interview mode (batch vs. conversational)?
|
|
155
185
|
|
|
156
|
-
###
|
|
186
|
+
### 5. Apply Framework
|
|
157
187
|
|
|
158
188
|
Using gathered information:
|
|
159
189
|
1. Load appropriate template from `assets/templates/`
|
|
@@ -161,7 +191,7 @@ Using gathered information:
|
|
|
161
191
|
3. Fill missing elements with reasonable defaults
|
|
162
192
|
4. Structure according to framework format
|
|
163
193
|
|
|
164
|
-
###
|
|
194
|
+
### 6. Present Improvements
|
|
165
195
|
|
|
166
196
|
Structure your output in this exact order:
|
|
167
197
|
|
|
@@ -184,11 +214,11 @@ Structure your output in this exact order:
|
|
|
184
214
|
- The user must be able to copy the entire block contents and paste it verbatim with zero editing
|
|
185
215
|
- **Nothing after the code block** — the revised prompt must be the absolute last element in the response. No trailing suggestions, tips, or follow-up text after the closing backticks.
|
|
186
216
|
|
|
187
|
-
###
|
|
217
|
+
### 7. Iterate
|
|
188
218
|
|
|
189
219
|
- Confirm improvements align with intent
|
|
190
220
|
- Refine based on feedback
|
|
191
|
-
- Switch or combine frameworks if needed
|
|
221
|
+
- Switch or combine frameworks if needed (see **Combining Frameworks** below)
|
|
192
222
|
- Continue until satisfactory
|
|
193
223
|
|
|
194
224
|
## Framework References
|
|
@@ -213,7 +243,8 @@ Detailed framework docs in `references/frameworks/`:
|
|
|
213
243
|
- `least-to-most.md` - Decompose into ordered subproblems, solve sequentially
|
|
214
244
|
- `plan-and-solve.md` - Zero-shot: plan + extract variables + calculate (PS+)
|
|
215
245
|
- `chain-of-thought.md` - Step-by-step reasoning techniques
|
|
216
|
-
- `chain-of-density.md` -
|
|
246
|
+
- `chain-of-density.md` - Entity densification at fixed length, for summarization (Adams et al.)
|
|
247
|
+
- `iterative-compression.md` - Progressive shortening toward a target length
|
|
217
248
|
- `self-refine.md` - Generate → Feedback → Refine loop (NeurIPS 2023)
|
|
218
249
|
- `cai-critique-revise.md` - Principle-based critique + revision (Anthropic)
|
|
219
250
|
- `devils-advocate.md` - Strongest opposing argument generation (ACM IUI 2024)
|
|
@@ -226,36 +257,7 @@ Load these when applying specific frameworks for detailed component guidance, se
|
|
|
226
257
|
|
|
227
258
|
## Templates
|
|
228
259
|
|
|
229
|
-
|
|
230
|
-
- `co-star_template.txt` - Full CO-STAR structure
|
|
231
|
-
- `risen_template.txt` - Full RISEN structure
|
|
232
|
-
- `rise-ie_template.txt` - RISE-IE structure (Input-Expectation for data tasks)
|
|
233
|
-
- `rise-ix_template.txt` - RISE-IX structure (Instructions-Examples for creative tasks)
|
|
234
|
-
- `tidd-ec_template.txt` - TIDD-EC structure (Task, Instructions, Do, Don't, Examples, Context)
|
|
235
|
-
- `ctf_template.txt` - CTF structure (Context-Task-Format for situational prompts)
|
|
236
|
-
- `rtf_template.txt` - Full RTF structure
|
|
237
|
-
- `ape_template.txt` - APE structure (Action-Purpose-Expectation ultra-minimal)
|
|
238
|
-
- `bab_template.txt` - BAB structure (Before-After-Bridge for transformations)
|
|
239
|
-
- `race_template.txt` - RACE structure (Role-Action-Context-Expectation)
|
|
240
|
-
- `crispe_template.txt` - CRISPE structure (with Experiment/variants)
|
|
241
|
-
- `broke_template.txt` - BROKE structure (with Key Results + Evolve)
|
|
242
|
-
- `care_template.txt` - CARE structure (with Rules + Examples)
|
|
243
|
-
- `tree-of-thought_template.txt` - Tree of Thought branching exploration structure
|
|
244
|
-
- `react_template.txt` - ReAct Thought-Action-Observation cycle structure
|
|
245
|
-
- `skeleton-of-thought_template.txt` - Skeleton + expand structure
|
|
246
|
-
- `step-back_template.txt` - Step-back question + principle application
|
|
247
|
-
- `least-to-most_template.txt` - Decompose + sequential solving
|
|
248
|
-
- `plan-and-solve_template.txt` - PS+ trigger phrase structure
|
|
249
|
-
- `chain-of-thought_template.txt` - Step-by-step reasoning with verification
|
|
250
|
-
- `chain-of-density_template.txt` - Iterative compression with stopping criterion
|
|
251
|
-
- `self-refine_template.txt` - Generate → Feedback → Refine structure
|
|
252
|
-
- `cai-critique-revise_template.txt` - Principle → Critique → Revision structure
|
|
253
|
-
- `devils-advocate_template.txt` - Position attack with severity ranking
|
|
254
|
-
- `pre-mortem_template.txt` - Failure assumption + cause analysis
|
|
255
|
-
- `rcot_template.txt` - 4-step backward verification structure
|
|
256
|
-
- `rpef_template.txt` - Output analysis + recovered prompt template
|
|
257
|
-
- `reverse-role_template.txt` - Intent + interview trigger structure
|
|
258
|
-
- `hybrid_template.txt` - Combined framework approach
|
|
260
|
+
Every framework has a fill-in template at `assets/templates/<framework>_template.txt`, named after the framework's reference doc (e.g. `co-star.md` → `co-star_template.txt`). RISE has two: `rise-ie_template.txt` and `rise-ix_template.txt`. One extra template, `hybrid_template.txt`, is for combined-framework prompts (see **Combining Frameworks**).
|
|
259
261
|
|
|
260
262
|
## Key Principles
|
|
261
263
|
|
|
@@ -1,46 +1,76 @@
|
|
|
1
1
|
=== CHAIN OF DENSITY (CoD) TEMPLATE ===
|
|
2
2
|
|
|
3
|
-
Use when:
|
|
4
|
-
|
|
3
|
+
Use when: summarizing a document and you want maximum information in a fixed
|
|
4
|
+
length — articles, papers, reports, executive summaries, abstracts.
|
|
5
|
+
|
|
6
|
+
NOT for: general rewriting (use Self-Refine), or progressive shortening to a
|
|
7
|
+
target word count (use Iterative Compression). CoD holds length FIXED
|
|
8
|
+
and raises density. If your text is getting shorter, this is the
|
|
9
|
+
wrong template.
|
|
10
|
+
|
|
11
|
+
Based on Adams et al., "From Sparse to Dense: GPT-4 Summarization with Chain of
|
|
12
|
+
Density Prompting" (arXiv 2309.04269, NewSum @ EMNLP 2023).
|
|
5
13
|
|
|
6
14
|
─────────────────────────────────────────────
|
|
7
|
-
SOURCE
|
|
8
|
-
[Paste the
|
|
15
|
+
SOURCE ARTICLE:
|
|
16
|
+
[Paste the full document to be summarized here]
|
|
9
17
|
|
|
10
18
|
─────────────────────────────────────────────
|
|
11
|
-
|
|
12
|
-
[
|
|
13
|
-
Examples:
|
|
14
|
-
- "Reduce word count by 20% each pass while retaining all key information"
|
|
15
|
-
- "Increase information density — remove filler, make every sentence earn its place"
|
|
16
|
-
- "Improve clarity — each pass should be more direct and easier to understand"
|
|
19
|
+
TARGET LENGTH:
|
|
20
|
+
[The fixed word budget every summary must hit. Paper uses ~80 words.]
|
|
17
21
|
|
|
18
22
|
─────────────────────────────────────────────
|
|
19
23
|
NUMBER OF ITERATIONS:
|
|
20
|
-
[
|
|
21
|
-
Iteration 1: [First pass — initial improvement]
|
|
22
|
-
Iteration 2: [Second pass — tighten further]
|
|
23
|
-
Iteration 3: [Optional — final polish]
|
|
24
|
+
[Paper uses 5. Fewer works; more gives diminishing returns.]
|
|
24
25
|
|
|
25
26
|
─────────────────────────────────────────────
|
|
26
|
-
|
|
27
|
-
For each iteration:
|
|
28
|
-
1. Identify what can be cut, compressed, or clarified
|
|
29
|
-
2. Apply the changes
|
|
30
|
-
3. Verify: does this version better meet the optimization goal than the previous?
|
|
31
|
-
4. Stop when: [define your stopping criterion]
|
|
32
|
-
Examples: "length < 150 words", "no filler words remain", "3 iterations complete"
|
|
27
|
+
THE PROMPT — copy from here down, with the fields above filled in:
|
|
33
28
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
You will generate increasingly concise, entity-dense summaries of the above
|
|
30
|
+
article.
|
|
31
|
+
|
|
32
|
+
Repeat the following 2 steps [N] times.
|
|
33
|
+
|
|
34
|
+
Step 1. Identify 1-3 informative entities (";" delimited) from the article which
|
|
35
|
+
are missing from the previously generated summary.
|
|
36
|
+
Step 2. Write a new, denser summary of identical length which covers every entity
|
|
37
|
+
and detail from the previous summary plus the missing entities.
|
|
38
|
+
|
|
39
|
+
A missing entity is:
|
|
40
|
+
- Relevant: to the main story.
|
|
41
|
+
- Specific: descriptive yet concise (5 words or fewer).
|
|
42
|
+
- Novel: not in the previous summary.
|
|
43
|
+
- Faithful: present in the article.
|
|
44
|
+
- Anywhere: located anywhere in the article.
|
|
45
|
+
|
|
46
|
+
Guidelines:
|
|
47
|
+
- The first summary should be long (4-5 sentences, ~[TARGET] words) yet highly
|
|
48
|
+
non-specific, containing little information beyond the entities marked as
|
|
49
|
+
missing. Use overly verbose language and fillers (e.g., "this article
|
|
50
|
+
discusses") to reach ~[TARGET] words.
|
|
51
|
+
- Make every word count: re-write the previous summary to improve flow and make
|
|
52
|
+
space for additional entities.
|
|
53
|
+
- Make space with fusion, compression, and removal of uninformative phrases like
|
|
54
|
+
"the article discusses".
|
|
55
|
+
- The summaries should become highly dense and concise yet self-contained, e.g.,
|
|
56
|
+
easily understood without the article.
|
|
57
|
+
- Missing entities can appear anywhere in the new summary.
|
|
58
|
+
- Never drop entities from the previous summary. If space cannot be made, add
|
|
59
|
+
fewer new entities.
|
|
60
|
+
|
|
61
|
+
Remember, use the exact same number of words for each summary.
|
|
62
|
+
|
|
63
|
+
Answer in JSON. The JSON should be a list (length [N]) of dictionaries whose keys
|
|
64
|
+
are "Missing_Entities" and "Denser_Summary".
|
|
38
65
|
|
|
39
66
|
─────────────────────────────────────────────
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
67
|
+
CHOOSING THE OUTPUT:
|
|
68
|
+
Do not automatically take the last summary. In the paper's human evaluation,
|
|
69
|
+
step 2 (30.8% of first-place votes) and step 3 (23.0%) were preferred over the
|
|
70
|
+
sparse step 1 (8.3%). Past a point, density costs readability. Compare the steps
|
|
71
|
+
and pick deliberately.
|
|
43
72
|
|
|
44
73
|
─────────────────────────────────────────────
|
|
45
|
-
NOTE:
|
|
46
|
-
|
|
74
|
+
NOTE: The deliberately padded first summary is intentional, not a mistake. The
|
|
75
|
+
filler is the slack that later iterations convert into entities. A dense first
|
|
76
|
+
summary leaves no room and the chain stalls.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
=== ITERATIVE COMPRESSION TEMPLATE ===
|
|
2
|
+
|
|
3
|
+
Use when: text needs to get tighter and shorter through successive passes —
|
|
4
|
+
trimming to a word limit, cutting filler, sharpening explanations.
|
|
5
|
+
|
|
6
|
+
NOT for: summarization at a FIXED length with rising information density —
|
|
7
|
+
that is Chain of Density (chain-of-density_template.txt), a distinct
|
|
8
|
+
published method. Use this template when the text should SHRINK.
|
|
9
|
+
Use Self-Refine when the goal is multi-dimensional quality
|
|
10
|
+
(accuracy + tone + completeness), not compression.
|
|
11
|
+
|
|
12
|
+
─────────────────────────────────────────────
|
|
13
|
+
SOURCE CONTENT:
|
|
14
|
+
[Paste the content to be compressed here]
|
|
15
|
+
|
|
16
|
+
─────────────────────────────────────────────
|
|
17
|
+
OPTIMIZATION GOAL:
|
|
18
|
+
[What should improve with each pass?]
|
|
19
|
+
Examples:
|
|
20
|
+
- "Reduce word count by 20% each pass while retaining all key information"
|
|
21
|
+
- "Increase information density — remove filler, make every sentence earn its place"
|
|
22
|
+
- "Improve clarity — each pass should be more direct and easier to understand"
|
|
23
|
+
|
|
24
|
+
─────────────────────────────────────────────
|
|
25
|
+
TARGET:
|
|
26
|
+
[Where should this end up? A word count, a reading level, a single paragraph.]
|
|
27
|
+
|
|
28
|
+
─────────────────────────────────────────────
|
|
29
|
+
NUMBER OF ITERATIONS:
|
|
30
|
+
[How many refinement passes? Typical: 2-4]
|
|
31
|
+
Iteration 1: [First pass — initial improvement]
|
|
32
|
+
Iteration 2: [Second pass — tighten further]
|
|
33
|
+
Iteration 3: [Optional — final polish]
|
|
34
|
+
|
|
35
|
+
─────────────────────────────────────────────
|
|
36
|
+
ITERATION INSTRUCTIONS:
|
|
37
|
+
For each iteration:
|
|
38
|
+
1. Identify what can be cut, compressed, or clarified
|
|
39
|
+
2. Apply the changes
|
|
40
|
+
3. Verify: does this version better meet the optimization goal than the previous?
|
|
41
|
+
4. Confirm nothing essential was lost — compression must not drop content that
|
|
42
|
+
the goal requires keeping
|
|
43
|
+
5. Stop when: [define your stopping criterion]
|
|
44
|
+
Examples: "length < 150 words", "no filler words remain", "3 iterations complete"
|
|
45
|
+
|
|
46
|
+
─────────────────────────────────────────────
|
|
47
|
+
OUTPUT FORMAT:
|
|
48
|
+
[What format should the final result be in?]
|
|
49
|
+
Examples: paragraph, bullet list, 1-sentence summary, structured sections
|
|
50
|
+
|
|
51
|
+
─────────────────────────────────────────────
|
|
52
|
+
OPTIONAL — SHOW INTERMEDIATE VERSIONS:
|
|
53
|
+
Set to YES if you want to see each iteration's output.
|
|
54
|
+
Set to NO if you only want the final result.
|
|
55
|
+
|
|
56
|
+
─────────────────────────────────────────────
|
|
57
|
+
NOTE: Compression has a floor. Past a point, further passes strip meaning rather
|
|
58
|
+
than filler. If an iteration removes something a reader would need, stop at the
|
|
59
|
+
previous version.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
APE (Action, Purpose, Expectation) is the most minimal structured prompt framework — even simpler than RTF or CTF. It is designed for ultra-quick, single-sentence or two-sentence prompts where adding more structure would be overkill. APE answers three essential questions in the fewest possible words: what to do, why it matters, and what success looks like.
|
|
6
6
|
|
|
7
|
+
**Origin:** No single documented originator. Action-Purpose-Expectation is a community prompt-engineering convention, documented in practitioner guides from 2024 onward (earliest found: fvivas.com, 15 March 2024) with no attributed creator. It does not appear in any peer-reviewed prompting survey, including The Prompt Report (arXiv 2406.06608). **Not to be confused with** APE = "Automatic Prompt Engineer" from Zhou et al., "Large Language Models Are Human-Level Prompt Engineers" (arXiv 2211.01910, ICLR 2023) — an unrelated automated method that searches over LLM-generated candidate instructions and selects the highest-scoring one. That APE is an algorithm, not a prompt template; the two share only the acronym.
|
|
8
|
+
|
|
7
9
|
## Components
|
|
8
10
|
|
|
9
11
|
### A - Action
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
BAB (Before, After, Bridge) is a transformation-focused framework ideal for rewrite, refactor, and conversion tasks. It explicitly defines the current state, the desired state, and asks for the path between them. Nothing in the standard framework set handles "change this into that" as cleanly as BAB.
|
|
6
6
|
|
|
7
|
+
**Origin:** Predates LLMs as a direct-response copywriting formula. The earliest verified dated appearance is Kevan Lee's "27 Best Copywriting Formulas" (Buffer blog, 13 October 2014), which lists Before-After-Bridge as formula #1 and — unlike the other formulas in that article, which it credits to named copywriters such as Bob Stone — presents it as already-common property with no attributed author. No individual coiner has been verified. Its use in prompt engineering is a later community adaptation of the copywriting formula.
|
|
8
|
+
|
|
7
9
|
## Components
|
|
8
10
|
|
|
9
11
|
### B - Before
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
CAI Critique-Revise is a two-phase output improvement pattern derived from Anthropic's Constitutional AI methodology. A model generates an initial response, explicitly critiques it against a stated principle or standard, then revises the response to align with that principle. Unlike Self-Refine (which uses multi-dimensional quality feedback), CAI Critique-Revise is principle-driven: the critique is always measured against a specific, explicitly stated standard — a "constitution" of one or more principles.
|
|
6
6
|
|
|
7
|
-
**Research basis:** "Constitutional AI: Harmlessness from AI Feedback" (Bai et al., Anthropic, arXiv 2212.08073, 2022). Originally a training methodology; the critique-revise loop is directly usable as a prompting pattern. Key finding: generating an explicit critique before revising produces better alignment than asking for direct revision without a critique step.
|
|
7
|
+
**Research basis:** "Constitutional AI: Harmlessness from AI Feedback" (Bai et al., Anthropic, arXiv 2212.08073, 2022). Originally a training methodology; the critique-revise loop is directly usable as a prompting pattern. Key finding: generating an explicit critique before revising produces better alignment than asking for direct revision without a critique step. The effect is strongest for smaller models; the authors found no noticeable difference at 52B and retained critiques primarily for transparency into the model's reasoning.
|
|
8
8
|
|
|
9
9
|
## The Key Insight
|
|
10
10
|
|