@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.
Files changed (70) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/CHANGELOG.md +135 -5
  4. package/MIGRATION.md +1 -1
  5. package/README.md +32 -47
  6. package/adapters/README.md +1 -1
  7. package/adapters/system-prompt.md +115 -59
  8. package/package.json +5 -4
  9. package/scripts/install.js +52 -22
  10. package/scripts/test.js +88 -40
  11. package/scripts/validate-skill.js +184 -56
  12. package/skills/prompt-architect/SKILL.md +94 -79
  13. package/skills/prompt-architect/assets/templates/ape_template.txt +14 -3
  14. package/skills/prompt-architect/assets/templates/bab_template.txt +23 -10
  15. package/skills/prompt-architect/assets/templates/broke_template.txt +31 -6
  16. package/skills/prompt-architect/assets/templates/cai-critique-revise_template.txt +16 -8
  17. package/skills/prompt-architect/assets/templates/care_template.txt +4 -0
  18. package/skills/prompt-architect/assets/templates/chain-of-density_template.txt +64 -35
  19. package/skills/prompt-architect/assets/templates/chain-of-thought_template.txt +8 -0
  20. package/skills/prompt-architect/assets/templates/co-star_template.txt +8 -0
  21. package/skills/prompt-architect/assets/templates/crispe_template.txt +6 -0
  22. package/skills/prompt-architect/assets/templates/ctf_template.txt +8 -0
  23. package/skills/prompt-architect/assets/templates/devils-advocate_template.txt +7 -0
  24. package/skills/prompt-architect/assets/templates/hybrid_template.txt +44 -24
  25. package/skills/prompt-architect/assets/templates/iterative-compression_template.txt +74 -0
  26. package/skills/prompt-architect/assets/templates/least-to-most_template.txt +4 -0
  27. package/skills/prompt-architect/assets/templates/plan-and-solve_template.txt +4 -0
  28. package/skills/prompt-architect/assets/templates/pre-mortem_template.txt +24 -14
  29. package/skills/prompt-architect/assets/templates/race_template.txt +9 -0
  30. package/skills/prompt-architect/assets/templates/rcot_template.txt +8 -0
  31. package/skills/prompt-architect/assets/templates/react_template.txt +38 -16
  32. package/skills/prompt-architect/assets/templates/rise-ie_template.txt +4 -0
  33. package/skills/prompt-architect/assets/templates/rise-ix_template.txt +3 -3
  34. package/skills/prompt-architect/assets/templates/risen_template.txt +7 -0
  35. package/skills/prompt-architect/assets/templates/rpef_template.txt +16 -11
  36. package/skills/prompt-architect/assets/templates/rtf_template.txt +9 -0
  37. package/skills/prompt-architect/assets/templates/skeleton-of-thought_template.txt +18 -10
  38. package/skills/prompt-architect/assets/templates/step-back_template.txt +4 -0
  39. package/skills/prompt-architect/assets/templates/tidd-ec_template.txt +54 -31
  40. package/skills/prompt-architect/assets/templates/tree-of-thought_template.txt +37 -21
  41. package/skills/prompt-architect/references/frameworks/ape.md +145 -57
  42. package/skills/prompt-architect/references/frameworks/bab.md +139 -58
  43. package/skills/prompt-architect/references/frameworks/broke.md +157 -57
  44. package/skills/prompt-architect/references/frameworks/cai-critique-revise.md +184 -76
  45. package/skills/prompt-architect/references/frameworks/care.md +67 -36
  46. package/skills/prompt-architect/references/frameworks/chain-of-density.md +111 -417
  47. package/skills/prompt-architect/references/frameworks/chain-of-thought.md +45 -19
  48. package/skills/prompt-architect/references/frameworks/co-star.md +102 -44
  49. package/skills/prompt-architect/references/frameworks/crispe.md +7 -5
  50. package/skills/prompt-architect/references/frameworks/ctf.md +75 -37
  51. package/skills/prompt-architect/references/frameworks/devils-advocate.md +105 -58
  52. package/skills/prompt-architect/references/frameworks/iterative-compression.md +448 -0
  53. package/skills/prompt-architect/references/frameworks/least-to-most.md +35 -13
  54. package/skills/prompt-architect/references/frameworks/plan-and-solve.md +38 -9
  55. package/skills/prompt-architect/references/frameworks/pre-mortem.md +182 -72
  56. package/skills/prompt-architect/references/frameworks/race.md +93 -38
  57. package/skills/prompt-architect/references/frameworks/rcot.md +1 -1
  58. package/skills/prompt-architect/references/frameworks/react.md +230 -97
  59. package/skills/prompt-architect/references/frameworks/reverse-role.md +23 -16
  60. package/skills/prompt-architect/references/frameworks/rise.md +120 -77
  61. package/skills/prompt-architect/references/frameworks/risen.md +82 -28
  62. package/skills/prompt-architect/references/frameworks/rpef.md +227 -58
  63. package/skills/prompt-architect/references/frameworks/rtf.md +4 -2
  64. package/skills/prompt-architect/references/frameworks/self-refine.md +4 -2
  65. package/skills/prompt-architect/references/frameworks/skeleton-of-thought.md +68 -22
  66. package/skills/prompt-architect/references/frameworks/step-back.md +48 -16
  67. package/skills/prompt-architect/references/frameworks/tidd-ec.md +129 -51
  68. package/skills/prompt-architect/references/frameworks/tree-of-thought.md +112 -37
  69. package/skills/prompt-architect/scripts/framework_analyzer.py +0 -807
  70. package/skills/prompt-architect/scripts/prompt_evaluator.py +0 -336
@@ -49,35 +49,49 @@ const SKILL_DIR = path.join(__dirname, '..', 'skills', 'prompt-architect');
49
49
  const SKILL_FILE = path.join(SKILL_DIR, 'SKILL.md');
50
50
 
51
51
  const REQUIRED_DIRS = [
52
- 'scripts',
53
52
  'references/frameworks',
54
53
  'assets/templates',
55
54
  ];
56
55
 
57
- const REQUIRED_FRAMEWORKS = [
58
- 'co-star.md',
59
- 'risen.md',
60
- 'rise.md',
61
- 'tidd-ec.md',
62
- 'rtf.md',
63
- 'chain-of-thought.md',
64
- 'chain-of-density.md',
65
- ];
56
+ const FRAMEWORKS_DIR = path.join(SKILL_DIR, 'references', 'frameworks');
57
+ const TEMPLATES_DIR = path.join(SKILL_DIR, 'assets', 'templates');
66
58
 
67
- const REQUIRED_TEMPLATES = [
68
- 'co-star_template.txt',
69
- 'risen_template.txt',
70
- 'rise-ie_template.txt',
71
- 'rise-ix_template.txt',
72
- 'tidd-ec_template.txt',
73
- 'rtf_template.txt',
74
- 'hybrid_template.txt',
75
- ];
59
+ // Templates that are not named after a single framework.
60
+ const NON_FRAMEWORK_TEMPLATES = ['hybrid_template.txt'];
76
61
 
77
- const REQUIRED_SCRIPTS = [
78
- 'framework_analyzer.py',
79
- 'prompt_evaluator.py',
80
- ];
62
+ // Reference docs that define more than one independently-selectable framework.
63
+ // rise.md documents RISE-IE and RISE-IX, each with its own template and routing row.
64
+ const MULTI_FRAMEWORK_DOCS = { 'rise.md': ['rise-ie', 'rise-ix'] };
65
+
66
+ // Read the filesystem rather than hardcoding lists — a hardcoded subset is why
67
+ // count drift and a deleted reference doc could both pass CI silently.
68
+ function listFrameworkDocs() {
69
+ return fs.readdirSync(FRAMEWORKS_DIR).filter(f => f.endsWith('.md')).sort();
70
+ }
71
+
72
+ function listTemplates() {
73
+ return fs.readdirSync(TEMPLATES_DIR).filter(f => f.endsWith('.txt')).sort();
74
+ }
75
+
76
+ // The advertised framework count: one per reference doc, except docs that
77
+ // define several.
78
+ function expectedFrameworkCount() {
79
+ return listFrameworkDocs().reduce(
80
+ (n, doc) => n + (MULTI_FRAMEWORK_DOCS[doc] ? MULTI_FRAMEWORK_DOCS[doc].length : 1),
81
+ 0
82
+ );
83
+ }
84
+
85
+ // Every template slug a framework doc implies.
86
+ function expectedTemplateSlugs() {
87
+ const slugs = [];
88
+ for (const doc of listFrameworkDocs()) {
89
+ const base = doc.replace(/\.md$/, '');
90
+ if (MULTI_FRAMEWORK_DOCS[doc]) slugs.push(...MULTI_FRAMEWORK_DOCS[doc]);
91
+ else slugs.push(base);
92
+ }
93
+ return slugs;
94
+ }
81
95
 
82
96
  let errorCount = 0;
83
97
  let warningCount = 0;
@@ -115,47 +129,59 @@ function validateSkill() {
115
129
 
116
130
  // Check framework files
117
131
  info('\nValidating framework files...');
118
- REQUIRED_FRAMEWORKS.forEach(framework => {
119
- const frameworkPath = path.join(SKILL_DIR, 'references', 'frameworks', framework);
120
- if (!fs.existsSync(frameworkPath)) {
121
- error(`Framework file missing: ${framework}`);
122
- errorCount++;
123
- } else {
124
- const stats = fs.statSync(frameworkPath);
125
- const sizeKB = (stats.size / 1024).toFixed(2);
126
- success(`Framework found: ${framework} (${sizeKB} KB)`);
127
-
128
- // Warn if framework file is too small
129
- if (stats.size < 5000) {
130
- warning(`Framework ${framework} seems small (< 5 KB)`);
131
- warningCount++;
132
- }
132
+ const frameworkDocs = listFrameworkDocs();
133
+ if (frameworkDocs.length === 0) {
134
+ error('No framework reference docs found');
135
+ errorCount++;
136
+ }
137
+ frameworkDocs.forEach(framework => {
138
+ const stats = fs.statSync(path.join(FRAMEWORKS_DIR, framework));
139
+ if (stats.size < 5000) {
140
+ warning(`Framework ${framework} seems small (< 5 KB)`);
141
+ warningCount++;
133
142
  }
134
143
  });
144
+ success(`${frameworkDocs.length} framework reference docs found`);
135
145
 
136
- // Check template files
146
+ // Check every framework has its template, and no template is orphaned
137
147
  info('\nValidating template files...');
138
- REQUIRED_TEMPLATES.forEach(template => {
139
- const templatePath = path.join(SKILL_DIR, 'assets', 'templates', template);
140
- if (!fs.existsSync(templatePath)) {
141
- error(`Template file missing: ${template}`);
148
+ const templates = listTemplates();
149
+ const templateSet = new Set(templates);
150
+ let templateErrors = 0;
151
+
152
+ for (const slug of expectedTemplateSlugs()) {
153
+ const expected = `${slug}_template.txt`;
154
+ if (!templateSet.has(expected)) {
155
+ error(`Template missing for framework "${slug}": ${expected}`);
142
156
  errorCount++;
143
- } else {
144
- success(`Template found: ${template}`);
157
+ templateErrors++;
145
158
  }
146
- });
159
+ }
147
160
 
148
- // Check script files
149
- info('\nValidating script files...');
150
- REQUIRED_SCRIPTS.forEach(script => {
151
- const scriptPath = path.join(SKILL_DIR, 'scripts', script);
152
- if (!fs.existsSync(scriptPath)) {
153
- error(`Script file missing: ${script}`);
161
+ const expectedSet = new Set([
162
+ ...expectedTemplateSlugs().map(s => `${s}_template.txt`),
163
+ ...NON_FRAMEWORK_TEMPLATES,
164
+ ]);
165
+ for (const template of templates) {
166
+ if (!expectedSet.has(template)) {
167
+ error(`Orphaned template with no corresponding framework doc: ${template}`);
154
168
  errorCount++;
155
- } else {
156
- success(`Script found: ${script}`);
169
+ templateErrors++;
157
170
  }
158
- });
171
+ }
172
+ for (const template of NON_FRAMEWORK_TEMPLATES) {
173
+ if (!templateSet.has(template)) {
174
+ error(`Required non-framework template missing: ${template}`);
175
+ errorCount++;
176
+ templateErrors++;
177
+ }
178
+ }
179
+ if (templateErrors === 0) {
180
+ success(`${templates.length} templates found, all matched to frameworks`);
181
+ }
182
+
183
+ // Cross-check the advertised count against what is actually on disk
184
+ validateFrameworkCount();
159
185
 
160
186
  // Check package structure
161
187
  info('\nValidating package structure...');
@@ -170,6 +196,107 @@ function validateSkill() {
170
196
 
171
197
  }
172
198
 
199
+ // Assert the advertised framework count matches the filesystem, everywhere it
200
+ // is stated. This is the check whose absence let "27" survive to v3.2.2 while
201
+ // 28 frameworks shipped.
202
+ function validateFrameworkCount() {
203
+ info('\nValidating advertised framework count...');
204
+ const actual = expectedFrameworkCount();
205
+ const root = path.join(__dirname, '..');
206
+ const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
207
+
208
+ const declared = (pkg.claudeCode && pkg.claudeCode.frameworks) || [];
209
+ if (declared.length !== actual) {
210
+ error(`package.json claudeCode.frameworks lists ${declared.length} frameworks, but ${actual} exist on disk`);
211
+ errorCount++;
212
+ } else {
213
+ success(`claudeCode.frameworks matches disk (${actual})`);
214
+ }
215
+
216
+ // Any prose that says "<N> ... framework" or "<N>-framework" must say N = actual.
217
+ const proseSites = [
218
+ 'package.json',
219
+ '.claude-plugin/plugin.json',
220
+ '.claude-plugin/marketplace.json',
221
+ 'README.md',
222
+ 'adapters/system-prompt.md',
223
+ path.join('skills', 'prompt-architect', 'SKILL.md'),
224
+ ];
225
+ const countPattern = /(\d+)[\s-]+(?:research-backed\s+)?frameworks?\b/gi;
226
+ let mismatches = 0;
227
+
228
+ for (const rel of proseSites) {
229
+ const full = path.join(root, rel);
230
+ if (!fs.existsSync(full)) continue;
231
+ const lines = fs.readFileSync(full, 'utf8').split('\n');
232
+ lines.forEach((line, i) => {
233
+ let m;
234
+ countPattern.lastIndex = 0;
235
+ while ((m = countPattern.exec(line)) !== null) {
236
+ const n = parseInt(m[1], 10);
237
+ // Ignore small numbers — those are phrases like "two frameworks", or
238
+ // "2 frameworks" inside an explanatory sentence, not the headline count.
239
+ if (n >= 10 && n !== actual) {
240
+ error(`${rel}:${i + 1} advertises ${n} frameworks, but ${actual} exist — "${m[0]}"`);
241
+ errorCount++;
242
+ mismatches++;
243
+ }
244
+ }
245
+ });
246
+ }
247
+ if (mismatches === 0) {
248
+ success(`All advertised framework counts agree (${actual})`);
249
+ }
250
+ }
251
+
252
+ // CLAUDE.md claims CI validates the SKILL.md version. It did not. It does now,
253
+ // along with every other site that carries the version.
254
+ function validateVersionSites() {
255
+ info('\nValidating version consistency across all sites...');
256
+ const root = path.join(__dirname, '..');
257
+ const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
258
+ const expected = pkg.version;
259
+
260
+ const sites = [];
261
+
262
+ sites.push({ name: 'package.json claudeCode.version', value: pkg.claudeCode && pkg.claudeCode.version });
263
+
264
+ const pluginPath = path.join(root, '.claude-plugin', 'plugin.json');
265
+ if (fs.existsSync(pluginPath)) {
266
+ sites.push({ name: 'plugin.json version', value: JSON.parse(fs.readFileSync(pluginPath, 'utf8')).version });
267
+ }
268
+
269
+ const marketPath = path.join(root, '.claude-plugin', 'marketplace.json');
270
+ if (fs.existsSync(marketPath)) {
271
+ const market = JSON.parse(fs.readFileSync(marketPath, 'utf8'));
272
+ (market.plugins || []).forEach((p, i) => {
273
+ sites.push({ name: `marketplace.json plugins[${i}].version`, value: p.version });
274
+ });
275
+ }
276
+
277
+ if (fs.existsSync(SKILL_FILE)) {
278
+ const fm = fs.readFileSync(SKILL_FILE, 'utf8').match(/^---\r?\n([\s\S]*?)\r?\n---/);
279
+ const m = fm && fm[1].match(/^\s*version:\s*["']?([^"'\r\n]+)["']?\s*$/m);
280
+ sites.push({ name: 'SKILL.md metadata.version', value: m ? m[1].trim() : undefined });
281
+ }
282
+
283
+ let bad = 0;
284
+ for (const site of sites) {
285
+ if (site.value === undefined) {
286
+ error(`${site.name} is missing — cannot verify it matches package.json (${expected})`);
287
+ errorCount++;
288
+ bad++;
289
+ } else if (site.value !== expected) {
290
+ error(`${site.name} is ${site.value}, expected ${expected}`);
291
+ errorCount++;
292
+ bad++;
293
+ }
294
+ }
295
+ if (bad === 0) {
296
+ success(`All ${sites.length + 1} version sites agree (${expected})`);
297
+ }
298
+ }
299
+
173
300
  function validateSkillFile() {
174
301
  const content = fs.readFileSync(SKILL_FILE, 'utf8');
175
302
 
@@ -185,7 +312,7 @@ function validateSkillFile() {
185
312
  const frontmatter = frontmatterMatch[1];
186
313
 
187
314
  // Check required fields
188
- const requiredFields = ['name', 'description'];
315
+ const requiredFields = ['name', 'description', 'version'];
189
316
  requiredFields.forEach(field => {
190
317
  if (!frontmatter.includes(`${field}:`)) {
191
318
  error(`SKILL.md missing required field: ${field}`);
@@ -330,6 +457,7 @@ function validatePluginManifest() {
330
457
  try {
331
458
  validateSkill();
332
459
  validatePluginManifest();
460
+ validateVersionSites();
333
461
 
334
462
  // Final summary
335
463
  log('\n' + '='.repeat(50), 'blue');
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: prompt-architect
3
- description: Analyzes and improves prompts using 27 research-backed 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.
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.2.2"
8
+ version: "3.4.0"
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, analyze across dimensions:
21
- - **Clarity**: Is the goal clear and unambiguous?
22
- - **Specificity**: Are requirements detailed enough?
23
- - **Context**: Is necessary background provided?
24
- - **Constraints**: Are limitations specified?
25
- - **Output Format**: Is desired format clear?
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 27 frameworks, identify the user's **primary intent** first, then use the discriminating questions within that category.
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
- | Compress or densify | **Chain of Density** |
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 — beyond that the frameworks' instructions start to overlap and contradict, and no single framework clearly owns any phase.
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
@@ -124,44 +153,56 @@ One-line per framework (load `references/frameworks/` for full detail):
124
153
 
125
154
  Ask targeted questions (3-5 at a time) based on identified gaps:
126
155
 
127
- **For CO-STAR**: Context, audience, tone, style, objective, format?
128
- **For RISEN**: Role, principles, steps, success criteria, constraints?
129
- **For RISE-IE**: Role, input format/characteristics, processing steps, output expectations?
130
- **For RISE-IX**: Role, task instructions, workflow steps, reference examples?
131
- **For TIDD-EC**: Task type, exact steps, what to include (dos), what to avoid (don'ts), examples, context?
132
- **For CTF**: What is the situation/background, exact task, output format?
133
- **For RTF**: Expertise needed, exact task, output format?
134
- **For APE**: Core action, why it's needed, what success looks like?
135
- **For BAB**: What is the current state/problem, what should it become, transformation rules?
136
- **For RACE**: Role/expertise, action, situational context, explicit expectation?
137
- **For CRISPE**: Capacity/role, background insight, instructions, personality/style, how many variants?
138
- **For BROKE**: Background situation, role, objective, measurable key results, evolve instructions?
139
- **For CARE**: Context/situation, specific ask, explicit rules and constraints, examples of good output?
140
- **For Tree of Thought**: Problem, distinct solution branches to explore, evaluation criteria?
141
- **For ReAct**: Goal, available tools, constraints and stop condition?
142
- **For Skeleton of Thought**: Topic/question, number of skeleton points, expansion depth per point?
143
- **For Step-Back**: Original question, what higher-level principle governs it?
144
- **For Least-to-Most**: Full problem, decomposed subproblems in dependency order?
145
- **For Plan-and-Solve**: Problem with all relevant numbers/variables?
146
- **For Chain of Thought**: Problem, reasoning steps, verification?
147
- **For Chain of Density**: Content to improve, iterations, optimization goals?
148
- **For Self-Refine**: Output to improve, feedback dimensions, stop condition?
149
- **For CAI Critique-Revise**: The principle to enforce, output to critique?
150
- **For Devil's Advocate**: Position to attack, attack dimensions, severity ranking needed?
151
- **For Pre-Mortem**: Project/decision, time horizon, domains to analyze?
152
- **For RCoT**: Question with all conditions, initial answer to verify?
153
- **For RPEF**: Output sample to reverse-engineer, input data if available?
154
- **For Reverse Role**: Intent statement, domain of expertise, interview mode (batch vs. conversational)?
155
-
156
- ### 4. Apply Framework
156
+ **For CO-STAR**: Paste the material this is built from if any, the situation and constraints behind it, who the audience is and what you want them to do, the tone and style to write in, the output format and length?
157
+ **For RISEN**: Paste the material the procedure runs on if any, the expertise and methodology to adopt, the steps in order, what must be true when it is done, what is out of scope or must not happen?
158
+ **For RISE-IE**: Paste the actual data to be processed (not a description of it), its format and any quirks to expect, the expertise needed, the processing steps in order, what the output must look like?
159
+ **For RISE-IX**: The expertise to embody, what to create and its core requirements, the workflow steps, paste 2-3 actual samples whose style and format the output should match?
160
+ **For TIDD-EC**: Paste the material this task operates on (the message, document, or dataset itself, not a description of it), what kind of task this is and the background that shapes it, the exact steps in order, what must always be included and what must never happen (state each as a prohibition, not a topic), examples of a good result?
161
+ **For CTF**: Paste the artifact this operates on if you have one, the situation and background around it, the exact task and deliverable, the output format?
162
+ **For RTF**: Paste the material the task applies to if any, the expertise needed, the exact task and deliverable, the output format and length?
163
+ **For APE**: Paste the material the action applies to if any, the one action to perform, why it is needed and who uses the result, what a good result looks like?
164
+ **For BAB**: Paste the actual artifact being transformed, what is wrong with it now, what it should become, what rules govern the transformation?
165
+ **For RACE**: Paste the material the task applies to if any, the role and expertise needed, the action to perform, the situational context and audience, what a successful output looks like?
166
+ **For CRISPE**: The expertise and role to embody, paste the data or style sample it should work from, the background it needs, the exact task and deliverable, the tone and how many variants?
167
+ **For BROKE**: Paste the supporting material or performance data if you have it, the current situation and why this task exists, the role to embody, the specific deliverable and the structure and length the response should have, the measurable business outcome it should move?
168
+ **For CARE**: Paste the source document or draft this works from if any, your situation and why this task exists, the specific ask and deliverable, what must be included and what would make this output wrong or unusable, an example of what good looks like?
169
+ **For Tree of Thought**: The decision or problem and its constraints, paste the evidence the branches must be judged against, the 2-5 distinct approaches to compare, the criteria that decide between them?
170
+ **For ReAct**: Does the environment this runs in actually have callable tools — if not, stop and use Chain of Thought instead, which tools are available and how each is invoked, what end state counts as success, what limits apply and when to stop?
171
+ **For Skeleton of Thought**: The topic or question to outline, paste the document, data, or notes the answer must be drawn from if you have any, who the answer is for and what scope it should cover, how far each point should be expanded (a few sentences, a paragraph, full detail)?
172
+ **For Step-Back**: The specific question you want answered, paste the code, document, or design it is about if any, what higher-level principle or concept governs it?
173
+ **For Least-to-Most**: The full problem in one statement, paste the material the subproblems must reason over, what is the simplest thing that must be answered first, what does the final answer depend on?
174
+ **For Plan-and-Solve**: The problem with every number, unit, and constraint written out, paste the dataset or figures the calculation runs on if any, which values are given and which must be derived?
175
+ **For Chain of Thought**: The problem with all its conditions stated, paste the code, data, or document to reason over if any, what the reasoning steps should be?
176
+ **For Chain of Density**: Paste the full document to summarize, the fixed word budget every summary must hit, how many densification passes (the paper uses 5)?
177
+ **For Iterative Compression**: Paste the content to compress, where it should end up (word count, reading level, single paragraph), what should improve on each pass, how many passes and when to stop?
178
+ **For Self-Refine**: Paste the actual draft to improve, which dimensions the critique should cover (clarity, completeness, tone), what would make this output wrong or unusable?
179
+ **For CAI Critique-Revise**: Paste the actual output to be critiqued, the specific standard it must satisfy stated precisely enough to be checkable, what would make this output wrong or unusable?
180
+ **For Devil's Advocate**: The position, plan, or decision to attack, paste the proposal or memo that sets it out if you have one, which dimensions the attack should cover?
181
+ **For Pre-Mortem**: The project or decision being analyzed with its team, timeline, and goals, paste the plan or proposal document if you have one, how far in the future the imagined failure should be dated?
182
+ **For RCoT**: The question with every condition and constraint written out, paste the document those conditions come from if any, any implicit requirement not yet written into the question (units, deadlines, exclusions, edge cases) that a correct answer must still satisfy?
183
+ **For RPEF**: Paste the actual output sample to reverse-engineer, paste the input that produced it or confirm it is output-only, which details are one-off specifics that should become [PLACEHOLDER] variables?
184
+ **For Reverse Role**: What you want to achieve in one or two sentences, the domain of expertise to consult, questions one at a time or all at once, should it then do the task or synthesize a structured prompt for you to approve?
185
+
186
+ Every set above asks for the user's own material, because a framework that operates on an
187
+ artifact and never asks for it will invent one. Three frameworks are deliberately exempt:
188
+ **ReAct** (its material arrives as live tool output, not pasted text), **Reverse Role** (it
189
+ elicits everything through the interview and its template has no material slot), and
190
+ **RISE-IX** (its samples land in the EXAMPLES slot, which its own question already covers).
191
+ Do not add a material question to those three.
192
+
193
+ ### 5. Apply Framework
157
194
 
158
195
  Using gathered information:
159
196
  1. Load appropriate template from `assets/templates/`
160
197
  2. Map user's information to framework components
161
- 3. Fill missing elements with reasonable defaults
198
+ 3. Fill missing elements with reasonable defaults — **with two exceptions, below**
162
199
  4. Structure according to framework format
163
200
 
164
- ### 5. Present Improvements
201
+ **Never default a fact about the user's world.** Their business, metrics, history, policies, staff, customers, data, or constraints are things only they know. A plausible-sounding default here is a fabrication the user may not notice before sending — asserting "our first price increase in three years" in an email to paying customers, or inventing a phone number in a published review reply. Where such a slot is unanswered, emit a visible `[you fill this in: <what is needed>]` placeholder and list every placeholder in your analysis section.
202
+
203
+ **Never soften or drop a prohibition.** If the user said something must not happen, it must survive into the emitted prompt as an explicit "Do not…" or "Never…" instruction. It cannot rely on a section header to carry the negation, because headers are stripped at emission (see step 6).
204
+
205
+ ### 6. Present Improvements
165
206
 
166
207
  Structure your output in this exact order:
167
208
 
@@ -181,14 +222,14 @@ Structure your output in this exact order:
181
222
  - **No framework section headers** (no "BEFORE:", "BRIDGE:", "CONTEXT:", etc.) — these are scaffolding, not part of the deliverable
182
223
  - **No indentation** beyond what the prompt itself genuinely requires
183
224
  - **No markdown formatting** inside the block unless the prompt explicitly needs it (e.g., it asks for tables)
184
- - The user must be able to copy the entire block contents and paste it verbatim with zero editing
225
+ - The user must be able to copy the entire block contents and paste it verbatim with zero editing — the one exception is `[...]` placeholders for material or facts only the user can supply (see step 5). Keep these to a minimum, make each self-explanatory, and name them in the analysis section so the user knows exactly what to fill in before sending.
185
226
  - **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
227
 
187
- ### 6. Iterate
228
+ ### 7. Iterate
188
229
 
189
230
  - Confirm improvements align with intent
190
231
  - Refine based on feedback
191
- - Switch or combine frameworks if needed
232
+ - Switch or combine frameworks if needed (see **Combining Frameworks** above)
192
233
  - Continue until satisfactory
193
234
 
194
235
  ## Framework References
@@ -213,7 +254,8 @@ Detailed framework docs in `references/frameworks/`:
213
254
  - `least-to-most.md` - Decompose into ordered subproblems, solve sequentially
214
255
  - `plan-and-solve.md` - Zero-shot: plan + extract variables + calculate (PS+)
215
256
  - `chain-of-thought.md` - Step-by-step reasoning techniques
216
- - `chain-of-density.md` - Iterative refinement through compression
257
+ - `chain-of-density.md` - Entity densification at fixed length, for summarization (Adams et al.)
258
+ - `iterative-compression.md` - Progressive shortening toward a target length
217
259
  - `self-refine.md` - Generate → Feedback → Refine loop (NeurIPS 2023)
218
260
  - `cai-critique-revise.md` - Principle-based critique + revision (Anthropic)
219
261
  - `devils-advocate.md` - Strongest opposing argument generation (ACM IUI 2024)
@@ -226,36 +268,7 @@ Load these when applying specific frameworks for detailed component guidance, se
226
268
 
227
269
  ## Templates
228
270
 
229
- Framework templates in `assets/templates/` provide structure:
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
271
+ 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
272
 
260
273
  ## Key Principles
261
274
 
@@ -314,10 +327,10 @@ This example shows the full intent-based flow — detecting intent, using the di
314
327
  > - **Same chat**: Tell the assistant: *"Use the revised prompt you just provided as a new instruction and execute it."*
315
328
 
316
329
  ```
317
- Rewrite the following job posting. The current version suffers from corporate-speak, passive voice, overly formal tone, and generic language that doesn't reflect actual team culture.
318
-
319
330
  [Paste the current job posting here]
320
331
 
332
+ The job posting above suffers from corporate-speak, passive voice, overly formal tone, and generic language that doesn't reflect actual team culture.
333
+
321
334
  The rewritten version should sound like it was written by engineers, for engineers. Early-career developers should read it and think "I want to work there." It should feel honest, direct, and human — not like legal boilerplate.
322
335
 
323
336
  Follow these rules:
@@ -327,6 +340,8 @@ Follow these rules:
327
340
  - Keep all technical requirements and must-haves verbatim — do not change these.
328
341
  - Target reading level: conversational, not academic.
329
342
  - Length: same or shorter than the original. Cut fluff, don't add it.
343
+
344
+ Now rewrite the job posting above.
330
345
  ```
331
346
 
332
347
  ---
@@ -1,5 +1,16 @@
1
- ACTION: [What to do — one clear verb-driven instruction]
1
+ SOURCE MATERIAL:
2
+ [Optional — paste the artifact the task operates on here, named concretely (the meeting
3
+ transcript, the function). If the task creates something from scratch, delete this
4
+ bracketed block along with the sentence directly below it.]
5
+ Use the material above as the input for the task described below.
2
6
 
3
- PURPOSE: [Why it's needed — one sentence on how it will be used or who needs it]
7
+ ACTION:
8
+ [One complete imperative sentence naming what to produce, e.g. "Summarize the decisions in
9
+ the transcript above." Never a bare noun phrase like "meeting summary" — nothing else here
10
+ states the task. The two fields below may be fragments.]
4
11
 
5
- EXPECTATION: [What a good result looks like — format, length, quality bar, or tone]
12
+ PURPOSE:
13
+ Calibrate the result to this purpose: [who needs it and what they will do with it].
14
+
15
+ EXPECTATION:
16
+ A good result meets this standard: [the success bar — length, format, tone, or quality].
@@ -1,15 +1,28 @@
1
+ SOURCE MATERIAL:
2
+ [Paste the artifact to be transformed here — the artifact itself, never a description of it.
3
+ Name it concretely and keep it bracketed for the user to fill in, e.g. "[Paste the current
4
+ job posting here]".]
5
+ Use the material above as the material to be transformed for the work described below.
6
+
1
7
  BEFORE:
2
- [Describe the current state what exists now, what's wrong with it, what needs to change.
3
- Be specific: quote actual content, describe current problems, name limitations.]
8
+ This is the state that material is in now, and why it must change:
9
+ [Describe the current state in complete sentences, not a bare noun phrase. Say what exists
10
+ now, what is wrong with it, and what needs to change. Quote the material above wherever a
11
+ specific flaw is visible in it.]
4
12
 
5
13
  AFTER:
6
- [Describe the desired end state what it should look like once transformed.
7
- Include: qualities it should have, audience/consumer of the result, success criteria.]
14
+ This is what it must become once the transformation is complete:
15
+ [Describe the desired end state in complete sentences. Cover the qualities the result must
16
+ have and the criteria that make it successful. Name the audience only if the user identified
17
+ one; otherwise leave "[you fill this in: who will read the result]".]
8
18
 
9
19
  BRIDGE:
10
- [Define the transformation rules how to get from Before to After.
11
- Include:
12
- - What must be preserved (do not change)
13
- - What should change
14
- - Any constraints on approach or style
15
- - Tone, length, or format requirements for the result]
20
+ Follow these rules when carrying out the transformation:
21
+ [State each rule as a self-contained imperative carrying its own verb — "Preserve every salary
22
+ and benefits detail exactly as written", not "salary details". Write prohibitions as
23
+ "Do not…" or "Never…". Cover:
24
+ - What must be preserved unchanged, and what should change
25
+ - Any constraint on approach, style, tone, length, or format]
26
+
27
+ Now [state the transformation as an imperative naming the material, e.g. "rewrite the job
28
+ posting above"].